<!-- 
  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 Wed, Apr 19, 2017 07:44+1000 for FHIR v3.0.1 
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://hl7.org/fhir" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" targetNamespace="http://hl7.org/fhir" elementFormDefault="qualified" version="3.0.1">
  <!-- Note: When using this schema with some tools, it may also be necessary to declare xmlns:xml="http://www.w3.org/XML/1998/namespace", however this causes performance issues with other tools and thus is not in the base schemas. -->
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd" />
  <xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="fhir-xhtml.xsd" />
  <xs:simpleType name="date-primitive">
    <xs:restriction>
      <xs:simpleType>
        <xs:union memberTypes="xs:gYear xs:gYearMonth xs:date" />
      </xs:simpleType>
      <xs:pattern value="-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1]))?)?" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="date">
    <xs:annotation>
      <xs:documentation xml:lang="en">A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.</xs:documentation>
      <xs:documentation 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="date-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="dateTime-primitive">
    <xs:restriction>
      <xs:simpleType>
        <xs:union memberTypes="xs:gYear xs:gYearMonth xs:date xs:dateTime" />
      </xs:simpleType>
      <xs:pattern value="-?[0-9]{4}(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)?)?)?" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="dateTime">
    <xs:annotation>
      <xs:documentation xml:lang="en">A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored.                 Dates SHALL be valid dates.</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="dateTime-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="code-primitive">
    <xs:restriction base="xs:token">
      <xs:minLength value="1" />
      <xs:pattern value="[^\s]+([\s]?[^\s]+)*" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="code">
    <xs:annotation>
      <xs:documentation xml:lang="en">A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="code-primitive" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="string-primitive">
    <xs:restriction base="xs:string">
      <xs:minLength value="1" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="string">
    <xs:annotation>
      <xs:documentation xml:lang="en">A sequence of Unicode characters</xs:documentation>
      <xs:documentation xml:lang="en">Note that FHIR strings may not exceed 1MB in size</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="string-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="integer-primitive">
    <xs:restriction base="xs:int">
      <xs:pattern value="-?([0]|([1-9][0-9]*))" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="integer">
    <xs:annotation>
      <xs:documentation xml:lang="en">A whole number</xs:documentation>
      <xs:documentation xml:lang="en">32 bit number; for values larger than this, use decimal</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="integer-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="oid-primitive">
    <xs:restriction base="xs:anyURI">
      <xs:pattern value="urn:oid:(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*" />
      <xs:minLength value="1" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="oid">
    <xs:annotation>
      <xs:documentation xml:lang="en">An OID represented as a URI</xs:documentation>
      <xs:documentation xml:lang="en">RFC 3001. See also ISO/IEC 8824:1990 €</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="oid-primitive" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="uri-primitive">
    <xs:restriction base="xs:anyURI" />
  </xs:simpleType>
  <xs:complexType name="uri">
    <xs:annotation>
      <xs:documentation xml:lang="en">String of characters used to identify a name or a resource</xs:documentation>
      <xs:documentation xml:lang="en">see http://en.wikipedia.org/wiki/Uniform_resource_identifier</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="uri-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="uuid-primitive">
    <xs:restriction base="xs:anyURI">
      <xs:pattern value="urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" />
      <xs:minLength value="1" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="uuid">
    <xs:annotation>
      <xs:documentation xml:lang="en">A UUID, represented as a URI</xs:documentation>
      <xs:documentation xml:lang="en">See The Open Group, CDE 1.1 Remote Procedure Call specification, Appendix A.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="uuid-primitive" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="instant-primitive">
    <xs:restriction base="xs:dateTime" />
  </xs:simpleType>
  <xs:complexType name="instant">
    <xs:annotation>
      <xs:documentation xml:lang="en">An instant in time - known at least to the second</xs:documentation>
      <xs:documentation xml:lang="en">Note: This is intended for precisely observed times, typically system logs etc., and not human-reported times - for them, see date and dateTime below. Time zone is always required</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="instant-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="boolean-primitive">
    <xs:restriction base="xs:boolean" />
  </xs:simpleType>
  <xs:complexType name="boolean">
    <xs:annotation>
      <xs:documentation xml:lang="en">Value of "true" or "false"</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="boolean-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="base64Binary-primitive">
    <xs:restriction base="xs:base64Binary" />
  </xs:simpleType>
  <xs:complexType name="base64Binary">
    <xs:annotation>
      <xs:documentation xml:lang="en">A stream of bytes</xs:documentation>
      <xs:documentation xml:lang="en">A stream of bytes, base64 encoded</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="base64Binary-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="unsignedInt-primitive">
    <xs:restriction base="xs:nonNegativeInteger">
      <xs:pattern value="[0]|([1-9][0-9]*)" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="unsignedInt">
    <xs:annotation>
      <xs:documentation xml:lang="en">An integer with a value that is not negative (e.g. &gt;= 0)</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="unsignedInt-primitive" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="markdown-primitive">
    <xs:restriction base="xs:string">
      <xs:minLength value="1" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="markdown">
    <xs:annotation>
      <xs:documentation xml:lang="en">A string that may contain markdown syntax for optional processing by a mark down presentation engine</xs:documentation>
      <xs:documentation xml:lang="en">Systems are not required to have markdown support, and there is considerable variation in markdown syntax, so the text should be readable without markdown processing. The preferred markdown syntax is described here: http://daringfireball.net/projects/markdown/syntax (and tests here: http://daringfireball.net/projects/downloads/MarkdownTest_1.0.zip)</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="markdown-primitive" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="time-primitive">
    <xs:restriction base="xs:time">
      <xs:pattern value="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="time">
    <xs:annotation>
      <xs:documentation xml:lang="en">A time during the day, with no date specified</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="time-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="id-primitive">
    <xs:restriction base="xs:string">
      <xs:pattern value="[A-Za-z0-9\-\.]{1,64}" />
      <xs:minLength value="1" />
      <xs:maxLength value="64" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="id">
    <xs:annotation>
      <xs:documentation xml:lang="en">Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters.  (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.)  Ids are case-insensitive.</xs:documentation>
      <xs:documentation xml:lang="en">RFC 4122</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="id-primitive" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="positiveInt-primitive">
    <xs:restriction base="xs:positiveInteger">
      <xs:pattern value="[1-9][0-9]*" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="positiveInt">
    <xs:annotation>
      <xs:documentation xml:lang="en">An integer with a value that is positive (e.g. &gt;0)</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="positiveInt-primitive" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="decimal-primitive">
    <xs:restriction base="xs:decimal">
      <xs:pattern value="-?([0]|([1-9][0-9]*))(\.[0-9]+)?" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="decimal">
    <xs:annotation>
      <xs:documentation xml:lang="en">A rational number with implicit precision</xs:documentation>
      <xs:documentation xml:lang="en">Do not use a IEEE type floating point type, instead use something that works like a true decimal, with inbuilt precision (e.g. Java BigInteger)</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="decimal-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ResourceContainer">
    <xs:choice>
      <xs:element ref="Account" />
      <xs:element ref="ActivityDefinition" />
      <xs:element ref="AdverseEvent" />
      <xs:element ref="AllergyIntolerance" />
      <xs:element ref="Appointment" />
      <xs:element ref="AppointmentResponse" />
      <xs:element ref="AuditEvent" />
      <xs:element ref="Basic" />
      <xs:element ref="Binary" />
      <xs:element ref="BodySite" />
      <xs:element ref="Bundle" />
      <xs:element ref="CapabilityStatement" />
      <xs:element ref="CarePlan" />
      <xs:element ref="CareTeam" />
      <xs:element ref="ChargeItem" />
      <xs:element ref="Claim" />
      <xs:element ref="ClaimResponse" />
      <xs:element ref="ClinicalImpression" />
      <xs:element ref="CodeSystem" />
      <xs:element ref="Communication" />
      <xs:element ref="CommunicationRequest" />
      <xs:element ref="CompartmentDefinition" />
      <xs:element ref="Composition" />
      <xs:element ref="ConceptMap" />
      <xs:element ref="Condition" />
      <xs:element ref="Consent" />
      <xs:element ref="Contract" />
      <xs:element ref="Coverage" />
      <xs:element ref="DataElement" />
      <xs:element ref="DetectedIssue" />
      <xs:element ref="Device" />
      <xs:element ref="DeviceComponent" />
      <xs:element ref="DeviceMetric" />
      <xs:element ref="DeviceRequest" />
      <xs:element ref="DeviceUseStatement" />
      <xs:element ref="DiagnosticReport" />
      <xs:element ref="DocumentManifest" />
      <xs:element ref="DocumentReference" />
      <xs:element ref="EligibilityRequest" />
      <xs:element ref="EligibilityResponse" />
      <xs:element ref="Encounter" />
      <xs:element ref="Endpoint" />
      <xs:element ref="EnrollmentRequest" />
      <xs:element ref="EnrollmentResponse" />
      <xs:element ref="EpisodeOfCare" />
      <xs:element ref="ExpansionProfile" />
      <xs:element ref="ExplanationOfBenefit" />
      <xs:element ref="FamilyMemberHistory" />
      <xs:element ref="Flag" />
      <xs:element ref="Goal" />
      <xs:element ref="GraphDefinition" />
      <xs:element ref="Group" />
      <xs:element ref="GuidanceResponse" />
      <xs:element ref="HealthcareService" />
      <xs:element ref="ImagingManifest" />
      <xs:element ref="ImagingStudy" />
      <xs:element ref="Immunization" />
      <xs:element ref="ImmunizationRecommendation" />
      <xs:element ref="ImplementationGuide" />
      <xs:element ref="Library" />
      <xs:element ref="Linkage" />
      <xs:element ref="List" />
      <xs:element ref="Location" />
      <xs:element ref="Measure" />
      <xs:element ref="MeasureReport" />
      <xs:element ref="Media" />
      <xs:element ref="Medication" />
      <xs:element ref="MedicationAdministration" />
      <xs:element ref="MedicationDispense" />
      <xs:element ref="MedicationRequest" />
      <xs:element ref="MedicationStatement" />
      <xs:element ref="MessageDefinition" />
      <xs:element ref="MessageHeader" />
      <xs:element ref="NamingSystem" />
      <xs:element ref="NutritionOrder" />
      <xs:element ref="Observation" />
      <xs:element ref="OperationDefinition" />
      <xs:element ref="OperationOutcome" />
      <xs:element ref="Organization" />
      <xs:element ref="Patient" />
      <xs:element ref="PaymentNotice" />
      <xs:element ref="PaymentReconciliation" />
      <xs:element ref="Person" />
      <xs:element ref="PlanDefinition" />
      <xs:element ref="Practitioner" />
      <xs:element ref="PractitionerRole" />
      <xs:element ref="Procedure" />
      <xs:element ref="ProcedureRequest" />
      <xs:element ref="ProcessRequest" />
      <xs:element ref="ProcessResponse" />
      <xs:element ref="Provenance" />
      <xs:element ref="Questionnaire" />
      <xs:element ref="QuestionnaireResponse" />
      <xs:element ref="ReferralRequest" />
      <xs:element ref="RelatedPerson" />
      <xs:element ref="RequestGroup" />
      <xs:element ref="ResearchStudy" />
      <xs:element ref="ResearchSubject" />
      <xs:element ref="RiskAssessment" />
      <xs:element ref="Schedule" />
      <xs:element ref="SearchParameter" />
      <xs:element ref="Sequence" />
      <xs:element ref="ServiceDefinition" />
      <xs:element ref="Slot" />
      <xs:element ref="Specimen" />
      <xs:element ref="StructureDefinition" />
      <xs:element ref="StructureMap" />
      <xs:element ref="Subscription" />
      <xs:element ref="Substance" />
      <xs:element ref="SupplyDelivery" />
      <xs:element ref="SupplyRequest" />
      <xs:element ref="Task" />
      <xs:element ref="TestReport" />
      <xs:element ref="TestScript" />
      <xs:element ref="ValueSet" />
      <xs:element ref="VisionPrescription" />
      <xs:element ref="Parameters" />
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="Extension">
    <xs:annotation>
      <xs:documentation xml:lang="en">Optional Extension Element - found in all resources.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).</xs:documentation>
            </xs:annotation>
            <xs:element name="valueBase64Binary" type="base64Binary" />
            <xs:element name="valueBoolean" type="boolean" />
            <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="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="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="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="valueReference" type="Reference" />
            <xs:element name="valueSampledData" type="SampledData" />
            <xs:element name="valueSignature" type="Signature" />
            <xs:element name="valueTiming" type="Timing" />
            <xs:element name="valueMeta" type="Meta" />
          </xs:choice>
        </xs:sequence>
        <xs:attribute name="url" type="uri-primitive" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="BackboneElement">
    <xs:annotation>
      <xs:documentation xml:lang="en">Base definition for all elements that are defined inside a resource - but not those in a data type.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="modifierExtension" type="Extension" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Narrative">
    <xs:annotation>
      <xs:documentation xml:lang="en">A human-readable formatted text, including images.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="status" type="NarrativeStatus" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element ref="xhtml:div" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual narrative content, a stripped down version of XHTML.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NarrativeStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="generated">
        <xs:annotation>
          <xs:documentation xml:lang="en">Generated</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="extensions">
        <xs:annotation>
          <xs:documentation xml:lang="en">Extensions</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="additional">
        <xs:annotation>
          <xs:documentation xml:lang="en">Additional</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="empty">
        <xs:annotation>
          <xs:documentation xml:lang="en">Empty</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NarrativeStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The status of a resource narrative</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="NarrativeStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Element">
    <xs:annotation>
      <xs:documentation xml:lang="en">Base definition for all elements in a resource.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="extension" type="Extension" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation xml:lang="en">May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" type="string-primitive" use="optional" />
  </xs:complexType>
  <xs:complexType name="Reference">
    <xs:annotation>
      <xs:documentation xml:lang="en">A reference from one resource to another.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="reference" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" type="Identifier" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Plain text narrative that identifies the resource in addition to the resource reference.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Quantity">
    <xs:annotation>
      <xs:documentation xml:lang="en">A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="value" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the measured amount. The value includes an implicit precision in the presentation of the value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comparator" type="QuantityComparator" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "&lt;" , then the real value is &lt; stated value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="unit" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A human-readable form of the unit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identification of the system that provides the coded form of the unit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A computer processable form of the unit in some unit representation system.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="QuantityComparator-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="&lt;">
        <xs:annotation>
          <xs:documentation xml:lang="en">Less than</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="&lt;=">
        <xs:annotation>
          <xs:documentation xml:lang="en">Less or Equal to</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="&gt;=">
        <xs:annotation>
          <xs:documentation xml:lang="en">Greater or Equal to</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="&gt;">
        <xs:annotation>
          <xs:documentation xml:lang="en">Greater than</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="QuantityComparator">
    <xs:annotation>
      <xs:documentation xml:lang="en">How the Quantity should be understood and represented.</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="QuantityComparator-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Period">
    <xs:annotation>
      <xs:documentation xml:lang="en">A time period defined by a start and end date and optionally time.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="start" type="dateTime" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The start of the period. The boundary is inclusive.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="end" type="dateTime" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Attachment">
    <xs:annotation>
      <xs:documentation xml:lang="en">For referring to data content defined in other formats.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="contentType" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="language" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The human language of the content. The value can be any valid value according to BCP 47.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="data" type="base64Binary" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual data of the attachment - a sequence of bytes. In XML, represented using base64.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="url" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An alternative location where the data can be accessed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="size" type="unsignedInt" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The number of bytes of data that make up this attachment (before base64 encoding, if that is done).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="hash" type="base64Binary" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The calculated hash of the data using SHA-1. Represented using base64.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A label or set of text to display in place of the data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="creation" type="dateTime" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date that the attachment was first created.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Duration">
    <xs:annotation>
      <xs:documentation xml:lang="en">A length of time.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Quantity">
        <xs:sequence></xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Count">
    <xs:annotation>
      <xs:documentation xml:lang="en">A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Quantity">
        <xs:sequence></xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Range">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of ordered Quantities defined by a low and high limit.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="low" type="Quantity" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The low limit. The boundary is inclusive.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="high" type="Quantity" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The high limit. The boundary is inclusive.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Annotation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A  text note which also  contains information about who made the statement and when.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual responsible for making the annotation.</xs:documentation>
            </xs:annotation>
            <xs:element name="authorReference" type="Reference" maxOccurs="1" />
            <xs:element name="authorString" type="string" maxOccurs="1" />
          </xs:choice>
          <xs:element name="time" type="dateTime" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates when this particular annotation was made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The text of the annotation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Money">
    <xs:annotation>
      <xs:documentation xml:lang="en">An amount of economic utility in some recognized currency.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Quantity">
        <xs:sequence></xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Identifier">
    <xs:annotation>
      <xs:documentation xml:lang="en">A technical identifier - identifies some entity uniquely and unambiguously.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="use" type="IdentifierUse" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The purpose of this identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" type="CodeableConcept" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Establishes the namespace for the value - that is, a URL that describes a set values that are unique.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The portion of the identifier typically relevant to the user and which is unique within the context of the system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="Period" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Time period during which identifier is/was valid for use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assigner" type="Reference" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Organization that issued/manages the identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="IdentifierUse-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="usual">
        <xs:annotation>
          <xs:documentation xml:lang="en">Usual</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="official">
        <xs:annotation>
          <xs:documentation xml:lang="en">Official</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="temp">
        <xs:annotation>
          <xs:documentation xml:lang="en">Temp</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="secondary">
        <xs:annotation>
          <xs:documentation xml:lang="en">Secondary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="IdentifierUse">
    <xs:annotation>
      <xs:documentation xml:lang="en">Identifies the purpose for this identifier, if known .</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="IdentifierUse-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Coding">
    <xs:annotation>
      <xs:documentation xml:lang="en">A reference to a code defined by a terminology system.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="system" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identification of the code system that defines the meaning of the symbol in the code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A representation of the meaning of the code in the system, following the rules of the system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="userSelected" type="boolean" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Signature">
    <xs:annotation>
      <xs:documentation xml:lang="en">A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different signature approaches have different utilities.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="type" type="Coding" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="when" type="instant" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the digital signature was signed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to an application-usable description of the identity that signed  (e.g. the signature used their private key).</xs:documentation>
            </xs:annotation>
            <xs:element name="whoUri" type="uri" maxOccurs="1" />
            <xs:element name="whoReference" type="Reference" maxOccurs="1" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to an application-usable description of the identity that is represented by the signature.</xs:documentation>
            </xs:annotation>
            <xs:element name="onBehalfOfUri" type="uri" maxOccurs="1" />
            <xs:element name="onBehalfOfReference" type="Reference" maxOccurs="1" />
          </xs:choice>
          <xs:element name="contentType" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="blob" type="base64Binary" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SampledData">
    <xs:annotation>
      <xs:documentation xml:lang="en">A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="origin" type="Quantity" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="decimal" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The length of time between sampling times, measured in milliseconds.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="factor" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A correction factor that is applied to the sampled data points before they are added to the origin.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lowerLimit" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="upperLimit" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dimensions" type="positiveInt" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="data" type="SampledDataDataType" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SampledDataDataType-primitive">
    <xs:restriction base="xs:string">
      <xs:pattern value="((-{0,1}\d*\.{0,1}\d+)|[EUL])( ((-{0,1}\d*\.{0,1}\d+)|[EUL]))*" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SampledDataDataType">
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="SampledDataDataType-primitive" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Ratio">
    <xs:annotation>
      <xs:documentation xml:lang="en">A relationship of two Quantity values - expressed as a numerator and a denominator.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="numerator" type="Quantity" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the numerator.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="denominator" type="Quantity" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the denominator.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Distance">
    <xs:annotation>
      <xs:documentation xml:lang="en">A length - a value with a unit that is a physical distance.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Quantity">
        <xs:sequence></xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Age">
    <xs:annotation>
      <xs:documentation xml:lang="en">A duration of time during which an organism (or a process) has existed.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Quantity">
        <xs:sequence></xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CodeableConcept">
    <xs:annotation>
      <xs:documentation xml:lang="en">A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="coding" type="Coding" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a code defined by a terminology system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Meta">
    <xs:annotation>
      <xs:documentation xml:lang="en">The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="versionId" type="id" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastUpdated" type="instant" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the resource last changed - e.g. when the version changed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" type="uri" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="security" type="Coding" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="tag" type="Coding" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Address">
    <xs:annotation>
      <xs:documentation xml:lang="en">An address expressed using postal conventions (as opposed to GPS or other location definition formats).  This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery.  There are a variety of postal address formats defined around the world.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="use" type="AddressUse" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The purpose of this address.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" type="AddressType" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A full text representation of the address.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="line" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">This component contains the house number, apartment number, street name, street direction,  P.O. Box number, delivery hints, and similar address information.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="city" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the city, town, village or other community or delivery center.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="district" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the administrative area (county).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="state" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="postalCode" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A postal code designating a region defined by the postal service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="country" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Country - a nation as commonly understood or generally accepted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="Period" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Time period when address was/is in use.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AddressUse-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="home">
        <xs:annotation>
          <xs:documentation xml:lang="en">Home</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="work">
        <xs:annotation>
          <xs:documentation xml:lang="en">Work</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="temp">
        <xs:annotation>
          <xs:documentation xml:lang="en">Temporary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="old">
        <xs:annotation>
          <xs:documentation xml:lang="en">Old / Incorrect</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AddressUse">
    <xs:annotation>
      <xs:documentation xml:lang="en">The use of an address</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="AddressUse-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AddressType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="postal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Postal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="physical">
        <xs:annotation>
          <xs:documentation xml:lang="en">Physical</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="both">
        <xs:annotation>
          <xs:documentation xml:lang="en">Postal &amp; Physical</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AddressType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of an address (physical / postal)</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="AddressType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TriggerDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A description of a triggering event.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="type" type="TriggerType" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of triggering event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="eventName" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the event (if this is a named-event trigger).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The timing of the event (if this is a period trigger).</xs:documentation>
            </xs:annotation>
            <xs:element name="eventTimingTiming" type="Timing" maxOccurs="1" />
            <xs:element name="eventTimingReference" type="Reference" maxOccurs="1" />
            <xs:element name="eventTimingDate" type="date" maxOccurs="1" />
            <xs:element name="eventTimingDateTime" type="dateTime" maxOccurs="1" />
          </xs:choice>
          <xs:element name="eventData" type="DataRequirement" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The triggering data of the event (if this is a data trigger).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TriggerType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="named-event">
        <xs:annotation>
          <xs:documentation xml:lang="en">Named Event</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="periodic">
        <xs:annotation>
          <xs:documentation xml:lang="en">Periodic</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="data-added">
        <xs:annotation>
          <xs:documentation xml:lang="en">Data Added</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="data-modified">
        <xs:annotation>
          <xs:documentation xml:lang="en">Data Modified</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="data-removed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Data Removed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="data-accessed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Data Accessed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="data-access-ended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Data Access Ended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TriggerType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of trigger</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="TriggerType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contributor">
    <xs:annotation>
      <xs:documentation xml:lang="en">A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="type" type="ContributorType" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of contributor.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization responsible for the contribution.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" type="ContactDetail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the contributor.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ContributorType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="author">
        <xs:annotation>
          <xs:documentation xml:lang="en">Author</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="editor">
        <xs:annotation>
          <xs:documentation xml:lang="en">Editor</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="reviewer">
        <xs:annotation>
          <xs:documentation xml:lang="en">Reviewer</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="endorser">
        <xs:annotation>
          <xs:documentation xml:lang="en">Endorser</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ContributorType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of contributor</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="ContributorType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DataRequirement">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="type" type="code" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" type="uri" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The profile of the required data, specified as the uri of the profile definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mustSupport" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available. Note that the value for this element can be a path to allow references to nested elements. In that case, all the elements along the path must be supported.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="codeFilter" type="DataRequirement.CodeFilter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dateFilter" type="DataRequirement.DateFilter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date filters specify additional constraints on the data in terms of the applicable date range for specific elements.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DataRequirement.CodeFilter">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="path" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueSetString" type="string" maxOccurs="1" />
            <xs:element name="valueSetReference" type="Reference" maxOccurs="1" />
          </xs:choice>
          <xs:element name="valueCode" type="code" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The codes for the code filter. Only one of valueSet, valueCode, valueCoding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="valueCoding" type="Coding" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="valueCodeableConcept" type="CodeableConcept" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DataRequirement.DateFilter">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="path" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime. If a Duration is specified, the filter will return only those data items that fall within Duration from now.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueDateTime" type="dateTime" maxOccurs="1" />
            <xs:element name="valuePeriod" type="Period" maxOccurs="1" />
            <xs:element name="valueDuration" type="Duration" maxOccurs="1" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Dosage">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates how the medication is/was taken or should be taken by the patient.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="sequence" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the order in which the dosage instructions should be applied or interpreted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Free text dosage instructions e.g. SIG.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="additionalInstruction" type="CodeableConcept" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Supplemental instruction - e.g. "with meals".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patientInstruction" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Instructions in terms that are understood by the patient or consumer.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="timing" type="Timing" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">When medication should be administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).</xs:documentation>
            </xs:annotation>
            <xs:element name="asNeededBoolean" type="boolean" maxOccurs="1" />
            <xs:element name="asNeededCodeableConcept" type="CodeableConcept" maxOccurs="1" />
          </xs:choice>
          <xs:element name="site" type="CodeableConcept" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Body site to administer to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="route" type="CodeableConcept" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">How drug should enter body.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="method" type="CodeableConcept" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Technique for administering medication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Amount of medication per dose.</xs:documentation>
            </xs:annotation>
            <xs:element name="doseRange" type="Range" maxOccurs="1" />
            <xs:element name="doseQuantity" type="Quantity" maxOccurs="1" />
          </xs:choice>
          <xs:element name="maxDosePerPeriod" type="Ratio" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Upper limit on medication per unit of time.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="maxDosePerAdministration" type="Quantity" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Upper limit on medication per administration.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="maxDosePerLifetime" type="Quantity" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Upper limit on medication per lifetime of the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Amount of medication per unit of time.</xs:documentation>
            </xs:annotation>
            <xs:element name="rateRatio" type="Ratio" maxOccurs="1" />
            <xs:element name="rateRange" type="Range" maxOccurs="1" />
            <xs:element name="rateQuantity" type="Quantity" maxOccurs="1" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RelatedArtifact">
    <xs:annotation>
      <xs:documentation xml:lang="en">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="type" type="RelatedArtifactType" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of relationship to the related artifact.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="citation" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="url" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A url for the artifact that can be followed to access the actual content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="document" type="Attachment" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The document being referenced, represented as an attachment. This is exclusive with the resource element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" type="Reference" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The related resource, such as a library, value set, profile, or other knowledge resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="RelatedArtifactType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="documentation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Documentation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="justification">
        <xs:annotation>
          <xs:documentation xml:lang="en">Justification</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="citation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Citation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="predecessor">
        <xs:annotation>
          <xs:documentation xml:lang="en">Predecessor</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="successor">
        <xs:annotation>
          <xs:documentation xml:lang="en">Successor</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="derived-from">
        <xs:annotation>
          <xs:documentation xml:lang="en">Derived From</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="depends-on">
        <xs:annotation>
          <xs:documentation xml:lang="en">Depends On</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="composed-of">
        <xs:annotation>
          <xs:documentation xml:lang="en">Composed Of</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="RelatedArtifactType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of relationship to the related artifact</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="RelatedArtifactType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ContactDetail">
    <xs:annotation>
      <xs:documentation xml:lang="en">Specifies contact information for a person or organization.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="name" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of an individual to contact.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" type="ContactPoint" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The contact details for the individual (if a name was provided) or the organization.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="HumanName">
    <xs:annotation>
      <xs:documentation xml:lang="en">A human's name with the ability to identify parts and usage.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="use" type="NameUse" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the purpose for this name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A full text representation of the name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="family" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="given" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Given name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prefix" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="suffix" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="Period" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the period of time when this name was valid for the named person.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NameUse-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="usual">
        <xs:annotation>
          <xs:documentation xml:lang="en">Usual</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="official">
        <xs:annotation>
          <xs:documentation xml:lang="en">Official</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="temp">
        <xs:annotation>
          <xs:documentation xml:lang="en">Temp</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="nickname">
        <xs:annotation>
          <xs:documentation xml:lang="en">Nickname</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="anonymous">
        <xs:annotation>
          <xs:documentation xml:lang="en">Anonymous</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="old">
        <xs:annotation>
          <xs:documentation xml:lang="en">Old</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="maiden">
        <xs:annotation>
          <xs:documentation xml:lang="en">Name changed for Marriage</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NameUse">
    <xs:annotation>
      <xs:documentation xml:lang="en">The use of a human name</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="NameUse-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ContactPoint">
    <xs:annotation>
      <xs:documentation xml:lang="en">Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="system" type="ContactPointSystem" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Telecommunications form for contact point - what communications system is required to make use of the contact.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="use" type="ContactPointUse" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the purpose for the contact point.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rank" type="positiveInt" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="Period" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Time period when the contact point was/is in use.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ContactPointSystem-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="phone">
        <xs:annotation>
          <xs:documentation xml:lang="en">Phone</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fax">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fax</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="email">
        <xs:annotation>
          <xs:documentation xml:lang="en">Email</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="pager">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pager</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="url">
        <xs:annotation>
          <xs:documentation xml:lang="en">URL</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sms">
        <xs:annotation>
          <xs:documentation xml:lang="en">SMS</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation xml:lang="en">Other</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ContactPointSystem">
    <xs:annotation>
      <xs:documentation xml:lang="en">Telecommunications form for contact point</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="ContactPointSystem-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ContactPointUse-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="home">
        <xs:annotation>
          <xs:documentation xml:lang="en">Home</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="work">
        <xs:annotation>
          <xs:documentation xml:lang="en">Work</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="temp">
        <xs:annotation>
          <xs:documentation xml:lang="en">Temp</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="old">
        <xs:annotation>
          <xs:documentation xml:lang="en">Old</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="mobile">
        <xs:annotation>
          <xs:documentation xml:lang="en">Mobile</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ContactPointUse">
    <xs:annotation>
      <xs:documentation xml:lang="en">Use of contact point</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="ContactPointUse-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="UsageContext">
    <xs:annotation>
      <xs:documentation xml:lang="en">Specifies clinical/business/etc metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care).</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="code" type="Coding" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that identifies the type of context being specified by this usage context.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A value that defines the context specified in this context of use. The interpretation of the value is defined by the code.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueCodeableConcept" type="CodeableConcept" maxOccurs="1" />
            <xs:element name="valueQuantity" type="Quantity" maxOccurs="1" />
            <xs:element name="valueRange" type="Range" maxOccurs="1" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Timing">
    <xs:annotation>
      <xs:documentation xml:lang="en">Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="event" type="dateTime" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies specific times when the event occurs.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="repeat" type="Timing.Repeat" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of rules that describe when the event is scheduled.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="CodeableConcept" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code for the timing schedule. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing, with the exception that .repeat.bounds still applies over the code (and is not contained in the code).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Timing.Repeat">
    <xs:annotation>
      <xs:documentation xml:lang="en">Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.</xs:documentation>
            </xs:annotation>
            <xs:element name="boundsDuration" type="Duration" maxOccurs="1" />
            <xs:element name="boundsRange" type="Range" maxOccurs="1" />
            <xs:element name="boundsPeriod" type="Period" maxOccurs="1" />
          </xs:choice>
          <xs:element name="count" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A total count of the desired number of repetitions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="countMax" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="duration" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">How long this thing happens for when it happens.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="durationMax" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The upper limit of how long this thing happens for when it happens.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="durationUnit" type="UnitsOfTime" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The units of time for the duration, in UCUM units.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="frequency" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="frequencyMax" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">If present, indicates that the frequency is a range - so to repeat between [frequency] and [frequencyMax] times within the period or period range.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="periodMax" type="decimal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="periodUnit" type="UnitsOfTime" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The units of time for the period in UCUM units.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dayOfWeek" type="code" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">If one or more days of week is provided, then the action happens only on the specified day(s).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="timeOfDay" type="time" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specified time of day for action to take place.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="when" type="EventTiming" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Real world events that the occurrence of the event should be tied to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="offset" type="unsignedInt" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="UnitsOfTime-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="s">
        <xs:annotation>
          <xs:documentation xml:lang="en">秒</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="min">
        <xs:annotation>
          <xs:documentation xml:lang="en">分钟</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="h">
        <xs:annotation>
          <xs:documentation xml:lang="en">小时</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="d">
        <xs:annotation>
          <xs:documentation xml:lang="en">天</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="wk">
        <xs:annotation>
          <xs:documentation xml:lang="en">星期</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="mo">
        <xs:annotation>
          <xs:documentation xml:lang="en">月</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="a">
        <xs:annotation>
          <xs:documentation xml:lang="en">年</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="UnitsOfTime">
    <xs:annotation>
      <xs:documentation xml:lang="en">A unit of time (units from UCUM).</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="UnitsOfTime-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EventTiming-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="MORN">
        <xs:annotation>
          <xs:documentation xml:lang="en">Morning</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AFT">
        <xs:annotation>
          <xs:documentation xml:lang="en">Afternoon</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EVE">
        <xs:annotation>
          <xs:documentation xml:lang="en">Evening</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NIGHT">
        <xs:annotation>
          <xs:documentation xml:lang="en">Night</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PHS">
        <xs:annotation>
          <xs:documentation xml:lang="en">After Sleep</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HS">
        <xs:annotation>
          <xs:documentation xml:lang="en">HS</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="WAKE">
        <xs:annotation>
          <xs:documentation xml:lang="en">WAKE</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="C">
        <xs:annotation>
          <xs:documentation xml:lang="en">C</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CM">
        <xs:annotation>
          <xs:documentation xml:lang="en">CM</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CD">
        <xs:annotation>
          <xs:documentation xml:lang="en">CD</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CV">
        <xs:annotation>
          <xs:documentation xml:lang="en">CV</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AC">
        <xs:annotation>
          <xs:documentation xml:lang="en">AC</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ACM">
        <xs:annotation>
          <xs:documentation xml:lang="en">ACM</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ACD">
        <xs:annotation>
          <xs:documentation xml:lang="en">ACD</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ACV">
        <xs:annotation>
          <xs:documentation xml:lang="en">ACV</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PC">
        <xs:annotation>
          <xs:documentation xml:lang="en">PC</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PCM">
        <xs:annotation>
          <xs:documentation xml:lang="en">PCM</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PCD">
        <xs:annotation>
          <xs:documentation xml:lang="en">PCD</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PCV">
        <xs:annotation>
          <xs:documentation xml:lang="en">PCV</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EventTiming">
    <xs:annotation>
      <xs:documentation xml:lang="en">Real world event relating to the schedule.</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="EventTiming-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="path" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="representation" type="PropertyRepresentation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Codes that define how this element is represented in instances, when the deviation varies from the normal case.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sliceName" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="label" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" type="Coding" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that has the same meaning as the element in a particular terminology.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="slicing" type="ElementDefinition.Slicing" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="short" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A concise description of what this element means (e.g. for use in autogenerated summaries).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" type="markdown" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" type="markdown" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requirements" type="markdown" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="alias" type="string" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies additional names by which this element might also be known.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="min" type="unsignedInt" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The minimum number of times this element SHALL appear in the instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="max" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The maximum number of times this element is permitted to appear in the instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="base" type="ElementDefinition.Base" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is provided when the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contentReference" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" type="ElementDefinition.Type" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The data type or resource that the value of this element is permitted to be.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').</xs:documentation>
            </xs:annotation>
            <xs:element name="defaultValueBase64Binary" type="base64Binary" />
            <xs:element name="defaultValueBoolean" type="boolean" />
            <xs:element name="defaultValueCode" type="code" />
            <xs:element name="defaultValueDate" type="date" />
            <xs:element name="defaultValueDateTime" type="dateTime" />
            <xs:element name="defaultValueDecimal" type="decimal" />
            <xs:element name="defaultValueId" type="id" />
            <xs:element name="defaultValueInstant" type="instant" />
            <xs:element name="defaultValueInteger" type="integer" />
            <xs:element name="defaultValueMarkdown" type="markdown" />
            <xs:element name="defaultValueOid" type="oid" />
            <xs:element name="defaultValuePositiveInt" type="positiveInt" />
            <xs:element name="defaultValueString" type="string" />
            <xs:element name="defaultValueTime" type="time" />
            <xs:element name="defaultValueUnsignedInt" type="unsignedInt" />
            <xs:element name="defaultValueUri" type="uri" />
            <xs:element name="defaultValueAddress" type="Address" />
            <xs:element name="defaultValueAge" type="Age" />
            <xs:element name="defaultValueAnnotation" type="Annotation" />
            <xs:element name="defaultValueAttachment" type="Attachment" />
            <xs:element name="defaultValueCodeableConcept" type="CodeableConcept" />
            <xs:element name="defaultValueCoding" type="Coding" />
            <xs:element name="defaultValueContactPoint" type="ContactPoint" />
            <xs:element name="defaultValueCount" type="Count" />
            <xs:element name="defaultValueDistance" type="Distance" />
            <xs:element name="defaultValueDuration" type="Duration" />
            <xs:element name="defaultValueHumanName" type="HumanName" />
            <xs:element name="defaultValueIdentifier" type="Identifier" />
            <xs:element name="defaultValueMoney" type="Money" />
            <xs:element name="defaultValuePeriod" type="Period" />
            <xs:element name="defaultValueQuantity" type="Quantity" />
            <xs:element name="defaultValueRange" type="Range" />
            <xs:element name="defaultValueRatio" type="Ratio" />
            <xs:element name="defaultValueReference" type="Reference" />
            <xs:element name="defaultValueSampledData" type="SampledData" />
            <xs:element name="defaultValueSignature" type="Signature" />
            <xs:element name="defaultValueTiming" type="Timing" />
            <xs:element name="defaultValueMeta" type="Meta" />
          </xs:choice>
          <xs:element name="meaningWhenMissing" type="markdown" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="orderMeaning" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.</xs:documentation>
            </xs:annotation>
            <xs:element name="fixedBase64Binary" type="base64Binary" />
            <xs:element name="fixedBoolean" type="boolean" />
            <xs:element name="fixedCode" type="code" />
            <xs:element name="fixedDate" type="date" />
            <xs:element name="fixedDateTime" type="dateTime" />
            <xs:element name="fixedDecimal" type="decimal" />
            <xs:element name="fixedId" type="id" />
            <xs:element name="fixedInstant" type="instant" />
            <xs:element name="fixedInteger" type="integer" />
            <xs:element name="fixedMarkdown" type="markdown" />
            <xs:element name="fixedOid" type="oid" />
            <xs:element name="fixedPositiveInt" type="positiveInt" />
            <xs:element name="fixedString" type="string" />
            <xs:element name="fixedTime" type="time" />
            <xs:element name="fixedUnsignedInt" type="unsignedInt" />
            <xs:element name="fixedUri" type="uri" />
            <xs:element name="fixedAddress" type="Address" />
            <xs:element name="fixedAge" type="Age" />
            <xs:element name="fixedAnnotation" type="Annotation" />
            <xs:element name="fixedAttachment" type="Attachment" />
            <xs:element name="fixedCodeableConcept" type="CodeableConcept" />
            <xs:element name="fixedCoding" type="Coding" />
            <xs:element name="fixedContactPoint" type="ContactPoint" />
            <xs:element name="fixedCount" type="Count" />
            <xs:element name="fixedDistance" type="Distance" />
            <xs:element name="fixedDuration" type="Duration" />
            <xs:element name="fixedHumanName" type="HumanName" />
            <xs:element name="fixedIdentifier" type="Identifier" />
            <xs:element name="fixedMoney" type="Money" />
            <xs:element name="fixedPeriod" type="Period" />
            <xs:element name="fixedQuantity" type="Quantity" />
            <xs:element name="fixedRange" type="Range" />
            <xs:element name="fixedRatio" type="Ratio" />
            <xs:element name="fixedReference" type="Reference" />
            <xs:element name="fixedSampledData" type="SampledData" />
            <xs:element name="fixedSignature" type="Signature" />
            <xs:element name="fixedTiming" type="Timing" />
            <xs:element name="fixedMeta" type="Meta" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).</xs:documentation>
            </xs:annotation>
            <xs:element name="patternBase64Binary" type="base64Binary" />
            <xs:element name="patternBoolean" type="boolean" />
            <xs:element name="patternCode" type="code" />
            <xs:element name="patternDate" type="date" />
            <xs:element name="patternDateTime" type="dateTime" />
            <xs:element name="patternDecimal" type="decimal" />
            <xs:element name="patternId" type="id" />
            <xs:element name="patternInstant" type="instant" />
            <xs:element name="patternInteger" type="integer" />
            <xs:element name="patternMarkdown" type="markdown" />
            <xs:element name="patternOid" type="oid" />
            <xs:element name="patternPositiveInt" type="positiveInt" />
            <xs:element name="patternString" type="string" />
            <xs:element name="patternTime" type="time" />
            <xs:element name="patternUnsignedInt" type="unsignedInt" />
            <xs:element name="patternUri" type="uri" />
            <xs:element name="patternAddress" type="Address" />
            <xs:element name="patternAge" type="Age" />
            <xs:element name="patternAnnotation" type="Annotation" />
            <xs:element name="patternAttachment" type="Attachment" />
            <xs:element name="patternCodeableConcept" type="CodeableConcept" />
            <xs:element name="patternCoding" type="Coding" />
            <xs:element name="patternContactPoint" type="ContactPoint" />
            <xs:element name="patternCount" type="Count" />
            <xs:element name="patternDistance" type="Distance" />
            <xs:element name="patternDuration" type="Duration" />
            <xs:element name="patternHumanName" type="HumanName" />
            <xs:element name="patternIdentifier" type="Identifier" />
            <xs:element name="patternMoney" type="Money" />
            <xs:element name="patternPeriod" type="Period" />
            <xs:element name="patternQuantity" type="Quantity" />
            <xs:element name="patternRange" type="Range" />
            <xs:element name="patternRatio" type="Ratio" />
            <xs:element name="patternReference" type="Reference" />
            <xs:element name="patternSampledData" type="SampledData" />
            <xs:element name="patternSignature" type="Signature" />
            <xs:element name="patternTiming" type="Timing" />
            <xs:element name="patternMeta" type="Meta" />
          </xs:choice>
          <xs:element name="example" type="ElementDefinition.Example" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A sample value for this element demonstrating the type of information that would typically be found in the element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.</xs:documentation>
            </xs:annotation>
            <xs:element name="minValueDate" type="date" maxOccurs="1" />
            <xs:element name="minValueDateTime" type="dateTime" maxOccurs="1" />
            <xs:element name="minValueInstant" type="instant" maxOccurs="1" />
            <xs:element name="minValueTime" type="time" maxOccurs="1" />
            <xs:element name="minValueDecimal" type="decimal" maxOccurs="1" />
            <xs:element name="minValueInteger" type="integer" maxOccurs="1" />
            <xs:element name="minValuePositiveInt" type="positiveInt" maxOccurs="1" />
            <xs:element name="minValueUnsignedInt" type="unsignedInt" maxOccurs="1" />
            <xs:element name="minValueQuantity" type="Quantity" maxOccurs="1" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.</xs:documentation>
            </xs:annotation>
            <xs:element name="maxValueDate" type="date" maxOccurs="1" />
            <xs:element name="maxValueDateTime" type="dateTime" maxOccurs="1" />
            <xs:element name="maxValueInstant" type="instant" maxOccurs="1" />
            <xs:element name="maxValueTime" type="time" maxOccurs="1" />
            <xs:element name="maxValueDecimal" type="decimal" maxOccurs="1" />
            <xs:element name="maxValueInteger" type="integer" maxOccurs="1" />
            <xs:element name="maxValuePositiveInt" type="positiveInt" maxOccurs="1" />
            <xs:element name="maxValueUnsignedInt" type="unsignedInt" maxOccurs="1" />
            <xs:element name="maxValueQuantity" type="Quantity" maxOccurs="1" />
          </xs:choice>
          <xs:element name="maxLength" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="condition" type="id" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to an invariant that may make additional statements about the cardinality or value in the instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="constraint" type="ElementDefinition.Constraint" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mustSupport" type="boolean" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way.  If false, the element may be ignored and not supported.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="isModifier" type="boolean" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="isSummary" type="boolean" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the element should be included if a client requests a search with the parameter _summary=true.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="binding" type="ElementDefinition.Binding" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mapping" type="ElementDefinition.Mapping" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a concept from an external specification that roughly corresponds to this element.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition.Constraint">
    <xs:annotation>
      <xs:documentation xml:lang="en">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="key" type="id" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requirements" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Description of why this constraint is necessary or appropriate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="severity" type="ConstraintSeverity" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the impact constraint violation has on the conformance of the instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="human" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Text that can be used to describe the constraint in messages identifying that the constraint has been violated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A [FHIRPath](http://hl7.org/fluentpath) expression of constraint that can be executed to see if this constraint is met.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="xpath" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An XPath expression of constraint that can be executed to see if this constraint is met.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="source" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the original source of the constraint, for traceability purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition.Mapping">
    <xs:annotation>
      <xs:documentation xml:lang="en">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="identity" type="id" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An internal reference to the definition of a mapping.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="language" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the computable language in which mapping.map is expressed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="map" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Expresses what part of the target specification corresponds to this element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments that provide information about the mapping or its use.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition.Base">
    <xs:annotation>
      <xs:documentation xml:lang="en">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="path" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="min" type="unsignedInt" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Minimum cardinality of the base element identified by the path.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="max" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Maximum cardinality of the base element identified by the path.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition.Type">
    <xs:annotation>
      <xs:documentation xml:lang="en">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="code" type="uri" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a profile structure or implementation Guide that SHALL hold for the datatype this element refers to. Can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="targetProfile" type="uri" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a profile structure or implementation Guide that SHALL hold for the target of the reference this element refers to. Can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="aggregation" type="AggregationMode" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="versioning" type="ReferenceVersionRules" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this reference needs to be version specific or version independent, or whether either can be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition.Example">
    <xs:annotation>
      <xs:documentation xml:lang="en">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="label" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the purpose of this example amoung the set of examples.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual value for the element, which must be one of the types allowed for this element.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueBase64Binary" type="base64Binary" />
            <xs:element name="valueBoolean" type="boolean" />
            <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="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="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="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="valueReference" type="Reference" />
            <xs:element name="valueSampledData" type="SampledData" />
            <xs:element name="valueSignature" type="Signature" />
            <xs:element name="valueTiming" type="Timing" />
            <xs:element name="valueMeta" type="Meta" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition.Slicing">
    <xs:annotation>
      <xs:documentation xml:lang="en">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="discriminator" type="ElementDefinition.Discriminator" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ordered" type="boolean" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the matching elements have to occur in the same order as defined in the profile.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rules" type="SlicingRules" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition.Binding">
    <xs:annotation>
      <xs:documentation xml:lang="en">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="strength" type="BindingStrength" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the intended use of this particular set of codes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a Reference(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueSetUri" type="uri" maxOccurs="1" />
            <xs:element name="valueSetReference" type="Reference" maxOccurs="1" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ElementDefinition.Discriminator">
    <xs:annotation>
      <xs:documentation xml:lang="en">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="type" type="DiscriminatorType" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the element value is interpreted when discrimination is evaluated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="path" type="string" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A FHIRPath expression, using a restricted subset of FHIRPath, that is used to identify the element on which discrimination is based.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="PropertyRepresentation-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="xmlAttr">
        <xs:annotation>
          <xs:documentation xml:lang="en">XML Attribute</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="xmlText">
        <xs:annotation>
          <xs:documentation xml:lang="en">XML Text</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="typeAttr">
        <xs:annotation>
          <xs:documentation xml:lang="en">Type Attribute</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cdaText">
        <xs:annotation>
          <xs:documentation xml:lang="en">CDA Text Format</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="xhtml">
        <xs:annotation>
          <xs:documentation xml:lang="en">XHTML</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="PropertyRepresentation">
    <xs:annotation>
      <xs:documentation xml:lang="en">How a property is represented when serialized.</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="PropertyRepresentation-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConstraintSeverity-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="warning">
        <xs:annotation>
          <xs:documentation xml:lang="en">Warning</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConstraintSeverity">
    <xs:annotation>
      <xs:documentation xml:lang="en">SHALL applications comply with this constraint?</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="ConstraintSeverity-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AggregationMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="contained">
        <xs:annotation>
          <xs:documentation xml:lang="en">Contained</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="referenced">
        <xs:annotation>
          <xs:documentation xml:lang="en">Referenced</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="bundled">
        <xs:annotation>
          <xs:documentation xml:lang="en">Bundled</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AggregationMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">How resource references can be aggregated.</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="AggregationMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ReferenceVersionRules-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="either">
        <xs:annotation>
          <xs:documentation xml:lang="en">Either Specific or independent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="independent">
        <xs:annotation>
          <xs:documentation xml:lang="en">Version independent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="specific">
        <xs:annotation>
          <xs:documentation xml:lang="en">Version Specific</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ReferenceVersionRules">
    <xs:annotation>
      <xs:documentation xml:lang="en">Whether a reference needs to be version specific or version independent, or whether either can be used</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="ReferenceVersionRules-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SlicingRules-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="closed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Closed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="open">
        <xs:annotation>
          <xs:documentation xml:lang="en">Open</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="openAtEnd">
        <xs:annotation>
          <xs:documentation xml:lang="en">Open at End</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SlicingRules">
    <xs:annotation>
      <xs:documentation xml:lang="en">How slices are interpreted when evaluating an instance.</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="SlicingRules-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="BindingStrength-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="required">
        <xs:annotation>
          <xs:documentation xml:lang="en">Required</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="extensible">
        <xs:annotation>
          <xs:documentation xml:lang="en">Extensible</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="preferred">
        <xs:annotation>
          <xs:documentation xml:lang="en">Preferred</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="example">
        <xs:annotation>
          <xs:documentation xml:lang="en">Example</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="BindingStrength">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indication of the degree of conformance expectations associated with a binding.</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="BindingStrength-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DiscriminatorType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="value">
        <xs:annotation>
          <xs:documentation xml:lang="en">Value</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="exists">
        <xs:annotation>
          <xs:documentation xml:lang="en">Exists</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="pattern">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pattern</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="type">
        <xs:annotation>
          <xs:documentation xml:lang="en">Type</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="profile">
        <xs:annotation>
          <xs:documentation xml:lang="en">Profile</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DiscriminatorType">
    <xs:annotation>
      <xs:documentation xml:lang="en">How an element value is interpreted when discrimination is evaluated</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="DiscriminatorType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ParameterDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:sequence>
          <xs:element name="name" type="code" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the parameter used to allow access to the value of the parameter in evaluation contexts.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="use" type="code" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the parameter is input or output for the module.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="min" type="integer" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The minimum number of times this parameter SHALL appear in the request or response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="max" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The maximum number of times this element is permitted to appear in the request or response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" type="string" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A brief discussion of what the parameter is for and how it is used by the module.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" type="code" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of the parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" type="Reference" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DomainResource">
    <xs:annotation>
      <xs:documentation xml:lang="en">A resource that includes narrative, extensions, and contained resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Resource">
        <xs:sequence>
          <xs:element name="text" type="Narrative" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contained" type="ResourceContainer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="extension" type="Extension" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="modifierExtension" type="Extension" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Resource">
    <xs:annotation>
      <xs:documentation xml:lang="en">This is the base resource type for everything.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="id" type="id" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation xml:lang="en">The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="meta" type="Meta" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation xml:lang="en">The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="implicitRules" type="uri" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation xml:lang="en">A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="language" type="code" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation xml:lang="en">The base language in which the resource is written.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="PublicationStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation xml:lang="en">Draft</xs:documentation>
          <xs:documentation xml:lang="ru">черновик</xs:documentation>
          <xs:documentation xml:lang="nl">ontwerp</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
          <xs:documentation xml:lang="ru">активный</xs:documentation>
          <xs:documentation xml:lang="nl">actief</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="retired">
        <xs:annotation>
          <xs:documentation xml:lang="en">Retired</xs:documentation>
          <xs:documentation xml:lang="ru">удалён</xs:documentation>
          <xs:documentation xml:lang="nl">verouderd</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="PublicationStatus">
    <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="PublicationStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SearchParamType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="number">
        <xs:annotation>
          <xs:documentation xml:lang="en">Number</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="date">
        <xs:annotation>
          <xs:documentation xml:lang="en">Date/DateTime</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="string">
        <xs:annotation>
          <xs:documentation xml:lang="en">String</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="token">
        <xs:annotation>
          <xs:documentation xml:lang="en">Token</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="reference">
        <xs:annotation>
          <xs:documentation xml:lang="en">Reference</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="composite">
        <xs:annotation>
          <xs:documentation xml:lang="en">Composite</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="quantity">
        <xs:annotation>
          <xs:documentation xml:lang="en">Quantity</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uri">
        <xs:annotation>
          <xs:documentation xml:lang="en">URI</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SearchParamType">
    <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="SearchParamType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AdministrativeGender-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="male">
        <xs:annotation>
          <xs:documentation xml:lang="en">Male</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="female">
        <xs:annotation>
          <xs:documentation xml:lang="en">Female</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation xml:lang="en">Other</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AdministrativeGender">
    <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="AdministrativeGender-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="RemittanceOutcome-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="complete">
        <xs:annotation>
          <xs:documentation xml:lang="en">Processing Complete</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="partial">
        <xs:annotation>
          <xs:documentation xml:lang="en">Partial Processing</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="RemittanceOutcome">
    <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="RemittanceOutcome-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NoteType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="display">
        <xs:annotation>
          <xs:documentation xml:lang="en">Display</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="print">
        <xs:annotation>
          <xs:documentation xml:lang="en">Print (Form)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="printoper">
        <xs:annotation>
          <xs:documentation xml:lang="en">Print (Operator)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NoteType">
    <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="NoteType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConceptMapEquivalence-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="relatedto">
        <xs:annotation>
          <xs:documentation xml:lang="en">Related To</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="equivalent">
        <xs:annotation>
          <xs:documentation xml:lang="en">Equivalent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="equal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Equal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="wider">
        <xs:annotation>
          <xs:documentation xml:lang="en">Wider</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="subsumes">
        <xs:annotation>
          <xs:documentation xml:lang="en">Subsumes</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="narrower">
        <xs:annotation>
          <xs:documentation xml:lang="en">Narrower</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="specializes">
        <xs:annotation>
          <xs:documentation xml:lang="en">Specializes</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inexact">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inexact</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unmatched">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unmatched</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="disjoint">
        <xs:annotation>
          <xs:documentation xml:lang="en">Disjoint</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConceptMapEquivalence">
    <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="ConceptMapEquivalence-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DocumentReferenceStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="current">
        <xs:annotation>
          <xs:documentation xml:lang="en">Current</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="superseded">
        <xs:annotation>
          <xs:documentation xml:lang="en">Superseded</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="DocumentReferenceStatus">
    <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="DocumentReferenceStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Account" type="Account">
    <xs:annotation>
      <xs:documentation xml:lang="en">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Account">
    <xs:annotation>
      <xs:documentation xml:lang="en">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</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">Unique identifier used to reference the account.  May or may not be intended for human use (e.g. credit card number).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="AccountStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the account is presently used/usable or not.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Categorizes the account for reporting and searching purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name used for the account when displaying it to humans in reports, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the patient, device, practitioner, location or other object the account is associated with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the period of time over which the account is allowed to have transactions posted to it.
This period may be different to the coveragePeriod which is the duration of time that services may occur.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="balance" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Represents the sum of all credits less all debits associated with the account.  Might be positive, zero or negative.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="coverage" type="Account.Coverage" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="owner" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the organization, department, etc. with responsibility for the account.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides additional information about what the account tracks and how it is used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="guarantor" type="Account.Guarantor" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Parties financially responsible for the account.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Account.Coverage">
    <xs:annotation>
      <xs:documentation xml:lang="en">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party(s) that are responsible for payment (or part of) of charges applied to this account (including self-pay).

A coverage may only be resposible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The priority of the coverage in the context of this account.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Account.Guarantor">
    <xs:annotation>
      <xs:documentation xml:lang="en">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="party" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The entity who is responsible.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onHold" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The timeframe during which the guarantor accepts responsibility for the account.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AccountStatus-list">
    <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="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</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="AccountStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates whether the account is available to be used.</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="AccountStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ActivityDefinition" type="ActivityDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ActivityDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this activity definition is (or will be) published. The URL SHOULD include the major version of the activity definition. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this activity definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the activity definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this activity definition. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the activity definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the activity definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the activity definition from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this activity definition is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="usage" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A detailed description of how the asset is used from a clinical perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="approvalDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastReviewDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="effectivePeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during which the activity definition content was or is planned to be in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate activity definition instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the activity definition is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="topic" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive topics related to the content of the activity. Topics provide a high-level categorization of the activity that can be useful for filtering and searching.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contributor" minOccurs="0" maxOccurs="unbounded" type="Contributor">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contributor to the content of the asset, including authors, editors, reviewers, and endorsers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relatedArtifact" minOccurs="0" maxOccurs="unbounded" type="RelatedArtifact">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="library" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a Library resource containing any formal logic used by the asset.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="kind" minOccurs="0" maxOccurs="1" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ProcedureRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period, timing or frequency upon which the described activity is to occur.</xs:documentation>
            </xs:annotation>
            <xs:element name="timingTiming" type="Timing" />
            <xs:element name="timingDateTime" type="dateTime" />
            <xs:element name="timingPeriod" type="Period" />
            <xs:element name="timingRange" type="Range" />
          </xs:choice>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="ActivityDefinition.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates who should participate in performing the action described.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the food, drug or other product being consumed or supplied in the activity.</xs:documentation>
            </xs:annotation>
            <xs:element name="productReference" type="Reference" />
            <xs:element name="productCodeableConcept" type="CodeableConcept" />
          </xs:choice>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dosage" minOccurs="0" maxOccurs="unbounded" type="Dosage">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="transform" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dynamicValue" type="ActivityDefinition.DynamicValue" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the intent resource that would contain the result.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ActivityDefinition.Participant">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="ActionParticipantType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of participant in the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The role the participant should play in performing the described action.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ActivityDefinition.DynamicValue">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A brief, natural language description of the intended semantics of the dynamic value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="path" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The media type of the language for the expression.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">An expression specifying the value of the customized element.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ActionParticipantType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="patient">
        <xs:annotation>
          <xs:documentation xml:lang="en">Patient</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="practitioner">
        <xs:annotation>
          <xs:documentation xml:lang="en">Practitioner</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="related-person">
        <xs:annotation>
          <xs:documentation xml:lang="en">Related Person</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ActionParticipantType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of participant in the activity</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="ActionParticipantType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResourceType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="Account">
        <xs:annotation>
          <xs:documentation xml:lang="en">Account</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ActivityDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">ActivityDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AdverseEvent">
        <xs:annotation>
          <xs:documentation xml:lang="en">AdverseEvent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AllergyIntolerance">
        <xs:annotation>
          <xs:documentation xml:lang="en">AllergyIntolerance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Appointment">
        <xs:annotation>
          <xs:documentation xml:lang="en">Appointment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AppointmentResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">AppointmentResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AuditEvent">
        <xs:annotation>
          <xs:documentation xml:lang="en">AuditEvent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Basic">
        <xs:annotation>
          <xs:documentation xml:lang="en">Basic</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Binary">
        <xs:annotation>
          <xs:documentation xml:lang="en">Binary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BodySite">
        <xs:annotation>
          <xs:documentation xml:lang="en">BodySite</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Bundle">
        <xs:annotation>
          <xs:documentation xml:lang="en">Bundle</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CapabilityStatement">
        <xs:annotation>
          <xs:documentation xml:lang="en">CapabilityStatement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CarePlan">
        <xs:annotation>
          <xs:documentation xml:lang="en">CarePlan</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CareTeam">
        <xs:annotation>
          <xs:documentation xml:lang="en">CareTeam</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ChargeItem">
        <xs:annotation>
          <xs:documentation xml:lang="en">ChargeItem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Claim">
        <xs:annotation>
          <xs:documentation xml:lang="en">Claim</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ClaimResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">ClaimResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ClinicalImpression">
        <xs:annotation>
          <xs:documentation xml:lang="en">ClinicalImpression</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CodeSystem">
        <xs:annotation>
          <xs:documentation xml:lang="en">CodeSystem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Communication">
        <xs:annotation>
          <xs:documentation xml:lang="en">Communication</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CommunicationRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">CommunicationRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CompartmentDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">CompartmentDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Composition">
        <xs:annotation>
          <xs:documentation xml:lang="en">Composition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ConceptMap">
        <xs:annotation>
          <xs:documentation xml:lang="en">ConceptMap</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Condition">
        <xs:annotation>
          <xs:documentation xml:lang="en">Condition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Consent">
        <xs:annotation>
          <xs:documentation xml:lang="en">Consent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Contract">
        <xs:annotation>
          <xs:documentation xml:lang="en">Contract</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Coverage">
        <xs:annotation>
          <xs:documentation xml:lang="en">Coverage</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DataElement">
        <xs:annotation>
          <xs:documentation xml:lang="en">DataElement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DetectedIssue">
        <xs:annotation>
          <xs:documentation xml:lang="en">DetectedIssue</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Device">
        <xs:annotation>
          <xs:documentation xml:lang="en">Device</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceComponent">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceComponent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceMetric">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceMetric</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceUseStatement">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceUseStatement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DiagnosticReport">
        <xs:annotation>
          <xs:documentation xml:lang="en">DiagnosticReport</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DocumentManifest">
        <xs:annotation>
          <xs:documentation xml:lang="en">DocumentManifest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DocumentReference">
        <xs:annotation>
          <xs:documentation xml:lang="en">DocumentReference</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DomainResource">
        <xs:annotation>
          <xs:documentation xml:lang="en">DomainResource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EligibilityRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">EligibilityRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EligibilityResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">EligibilityResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Encounter">
        <xs:annotation>
          <xs:documentation xml:lang="en">Encounter</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Endpoint">
        <xs:annotation>
          <xs:documentation xml:lang="en">Endpoint</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EnrollmentRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">EnrollmentRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EnrollmentResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">EnrollmentResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EpisodeOfCare">
        <xs:annotation>
          <xs:documentation xml:lang="en">EpisodeOfCare</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ExpansionProfile">
        <xs:annotation>
          <xs:documentation xml:lang="en">ExpansionProfile</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ExplanationOfBenefit">
        <xs:annotation>
          <xs:documentation xml:lang="en">ExplanationOfBenefit</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="FamilyMemberHistory">
        <xs:annotation>
          <xs:documentation xml:lang="en">FamilyMemberHistory</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Flag">
        <xs:annotation>
          <xs:documentation xml:lang="en">Flag</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Goal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Goal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="GraphDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">GraphDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Group">
        <xs:annotation>
          <xs:documentation xml:lang="en">Group</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="GuidanceResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">GuidanceResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HealthcareService">
        <xs:annotation>
          <xs:documentation xml:lang="en">HealthcareService</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImagingManifest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImagingManifest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImagingStudy">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImagingStudy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Immunization">
        <xs:annotation>
          <xs:documentation xml:lang="en">Immunization</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImmunizationRecommendation">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImmunizationRecommendation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImplementationGuide">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImplementationGuide</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Library">
        <xs:annotation>
          <xs:documentation xml:lang="en">Library</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Linkage">
        <xs:annotation>
          <xs:documentation xml:lang="en">Linkage</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="List">
        <xs:annotation>
          <xs:documentation xml:lang="en">List</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Location">
        <xs:annotation>
          <xs:documentation xml:lang="en">Location</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Measure">
        <xs:annotation>
          <xs:documentation xml:lang="en">Measure</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MeasureReport">
        <xs:annotation>
          <xs:documentation xml:lang="en">MeasureReport</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Media">
        <xs:annotation>
          <xs:documentation xml:lang="en">Media</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Medication">
        <xs:annotation>
          <xs:documentation xml:lang="en">Medication</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationAdministration">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationAdministration</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationDispense">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationDispense</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationStatement">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationStatement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MessageDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">MessageDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MessageHeader">
        <xs:annotation>
          <xs:documentation xml:lang="en">MessageHeader</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NamingSystem">
        <xs:annotation>
          <xs:documentation xml:lang="en">NamingSystem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NutritionOrder">
        <xs:annotation>
          <xs:documentation xml:lang="en">NutritionOrder</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Observation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Observation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OperationDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">OperationDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OperationOutcome">
        <xs:annotation>
          <xs:documentation xml:lang="en">OperationOutcome</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Organization">
        <xs:annotation>
          <xs:documentation xml:lang="en">Organization</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Parameters">
        <xs:annotation>
          <xs:documentation xml:lang="en">Parameters</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Patient">
        <xs:annotation>
          <xs:documentation xml:lang="en">Patient</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PaymentNotice">
        <xs:annotation>
          <xs:documentation xml:lang="en">PaymentNotice</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PaymentReconciliation">
        <xs:annotation>
          <xs:documentation xml:lang="en">PaymentReconciliation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Person">
        <xs:annotation>
          <xs:documentation xml:lang="en">Person</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PlanDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">PlanDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Practitioner">
        <xs:annotation>
          <xs:documentation xml:lang="en">Practitioner</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PractitionerRole">
        <xs:annotation>
          <xs:documentation xml:lang="en">PractitionerRole</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Procedure">
        <xs:annotation>
          <xs:documentation xml:lang="en">Procedure</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProcedureRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ProcedureRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProcessRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ProcessRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProcessResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">ProcessResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Provenance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Provenance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Questionnaire">
        <xs:annotation>
          <xs:documentation xml:lang="en">Questionnaire</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="QuestionnaireResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">QuestionnaireResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ReferralRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ReferralRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RelatedPerson">
        <xs:annotation>
          <xs:documentation xml:lang="en">RelatedPerson</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RequestGroup">
        <xs:annotation>
          <xs:documentation xml:lang="en">RequestGroup</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ResearchStudy">
        <xs:annotation>
          <xs:documentation xml:lang="en">ResearchStudy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ResearchSubject">
        <xs:annotation>
          <xs:documentation xml:lang="en">ResearchSubject</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Resource">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RiskAssessment">
        <xs:annotation>
          <xs:documentation xml:lang="en">RiskAssessment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Schedule">
        <xs:annotation>
          <xs:documentation xml:lang="en">Schedule</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SearchParameter">
        <xs:annotation>
          <xs:documentation xml:lang="en">SearchParameter</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Sequence">
        <xs:annotation>
          <xs:documentation xml:lang="en">Sequence</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ServiceDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">ServiceDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Slot">
        <xs:annotation>
          <xs:documentation xml:lang="en">Slot</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Specimen">
        <xs:annotation>
          <xs:documentation xml:lang="en">Specimen</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StructureDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">StructureDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StructureMap">
        <xs:annotation>
          <xs:documentation xml:lang="en">StructureMap</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Subscription">
        <xs:annotation>
          <xs:documentation xml:lang="en">Subscription</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Substance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Substance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SupplyDelivery">
        <xs:annotation>
          <xs:documentation xml:lang="en">SupplyDelivery</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SupplyRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">SupplyRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Task">
        <xs:annotation>
          <xs:documentation xml:lang="en">Task</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TestReport">
        <xs:annotation>
          <xs:documentation xml:lang="en">TestReport</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TestScript">
        <xs:annotation>
          <xs:documentation xml:lang="en">TestScript</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ValueSet">
        <xs:annotation>
          <xs:documentation xml:lang="en">ValueSet</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VisionPrescription">
        <xs:annotation>
          <xs:documentation xml:lang="en">VisionPrescription</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ResourceType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The kind of activity the definition is describing</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="ResourceType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="AdverseEvent" type="AdverseEvent">
    <xs:annotation>
      <xs:documentation xml:lang="en">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="AdverseEvent">
    <xs:annotation>
      <xs:documentation xml:lang="en">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier(s) of this adverse event that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itsefl is not appropriate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="AdverseEventCategory">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of event which is important to characterize what occurred and caused harm to the subject, or had the potential to cause harm to the subject.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This element defines the specific type of event that occurred or that was prevented from occurring.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">This subject or group impacted by the event.  With a prospective adverse event, there will be no subject as the adverse event was prevented.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date (and perhaps time) when the adverse event occurred.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reaction" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The information about where the adverse event occurred.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="seriousness" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the seriousness or severity of the adverse event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the type of outcome from the adverse event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recorder" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information on who recorded the adverse event.  May be the patient or a practitioner.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="eventParticipant" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Parties that may or should contribute or have contributed information to the Act. Such information includes information leading to the decision to perform the Act and how to perform the Act (e.g. consultant), information that the Act itself seeks to reveal (e.g. informant of clinical history), or information about what Act was performed (e.g. informant witness).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the adverse event in text.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="suspectEntity" type="AdverseEvent.SuspectEntity" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the entity that is suspected to have caused the adverse event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subjectMedicalHistory" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">AdverseEvent.subjectMedicalHistory.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referenceDocument" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">AdverseEvent.referenceDocument.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="study" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">AdverseEvent.study.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="AdverseEvent.SuspectEntity">
    <xs:annotation>
      <xs:documentation xml:lang="en">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="instance" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="causality" minOccurs="0" maxOccurs="1" type="AdverseEventCausality">
            <xs:annotation>
              <xs:documentation xml:lang="en">causality1 | causality2.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="causalityAssessment" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">assess1 | assess2.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="causalityProductRelatedness" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">AdverseEvent.suspectEntity.causalityProductRelatedness.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="causalityMethod" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">method1 | method2.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="causalityAuthor" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">AdverseEvent.suspectEntity.causalityAuthor.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="causalityResult" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">result1 | result2.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AdverseEventCausality-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="causality1">
        <xs:annotation>
          <xs:documentation xml:lang="en">causality1 placeholder</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="causality2">
        <xs:annotation>
          <xs:documentation xml:lang="en">causality2 placeholder</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AdverseEventCausality">
    <xs:annotation>
      <xs:documentation xml:lang="en">TODO</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="AdverseEventCausality-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AdverseEventCategory-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="AE">
        <xs:annotation>
          <xs:documentation xml:lang="en">Adverse Event</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PAE">
        <xs:annotation>
          <xs:documentation xml:lang="en">Potential Adverse Event</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AdverseEventCategory">
    <xs:annotation>
      <xs:documentation xml:lang="en">Overall categorization of the event, e.g. real or potential</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="AdverseEventCategory-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="AllergyIntolerance" type="AllergyIntolerance">
    <xs:annotation>
      <xs:documentation xml:lang="en">Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="AllergyIntolerance">
    <xs:annotation>
      <xs:documentation xml:lang="en">Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</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">This records identifiers associated with this allergy/intolerance concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="clinicalStatus" minOccurs="0" maxOccurs="1" type="AllergyIntoleranceClinicalStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The clinical status of the allergy or intolerance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="verificationStatus" minOccurs="1" maxOccurs="1" type="AllergyIntoleranceVerificationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="AllergyIntoleranceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identification of the underlying physiological mechanism for the reaction risk.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="AllergyIntoleranceCategory">
            <xs:annotation>
              <xs:documentation xml:lang="en">Category of the identified substance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="criticality" minOccurs="0" maxOccurs="1" type="AllergyIntoleranceCriticality">
            <xs:annotation>
              <xs:documentation xml:lang="en">Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., "Latex"), an allergy or intolerance condition (e.g., "Latex allergy"), or a negated/excluded code for a specific substance or class (e.g., "No latex allergy") or a general or categorical negated statement (e.g.,  "No known allergy", "No known drug allergies").</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient who has the allergy or intolerance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Estimated or actual date,  date-time, or age when allergy or intolerance was identified.</xs:documentation>
            </xs:annotation>
            <xs:element name="onsetDateTime" type="dateTime" />
            <xs:element name="onsetAge" type="Age" />
            <xs:element name="onsetPeriod" type="Period" />
            <xs:element name="onsetRange" type="Range" />
            <xs:element name="onsetString" type="string" />
          </xs:choice>
          <xs:element name="assertedDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the existance of the AllergyIntolerance was first asserted or acknowledged.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recorder" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Individual who recorded the record and takes responsibility for its content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="asserter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The source of the information about the allergy that is recorded.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastOccurrence" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Represents the date and/or time of the last known occurrence of a reaction event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reaction" type="AllergyIntolerance.Reaction" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details about each adverse reaction event linked to exposure to the identified substance.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="AllergyIntolerance.Reaction">
    <xs:annotation>
      <xs:documentation xml:lang="en">Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="substance" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="manifestation" minOccurs="1" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Text description about the reaction as a whole, including details of the manifestation if required.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onset" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Record of the date and/or time of the onset of the Reaction.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="severity" minOccurs="0" maxOccurs="1" type="AllergyIntoleranceSeverity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="exposureRoute" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identification of the route by which the subject was exposed to the substance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional text about the adverse reaction event not captured in other fields.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceCriticality-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="low">
        <xs:annotation>
          <xs:documentation xml:lang="en">Low Risk</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="high">
        <xs:annotation>
          <xs:documentation xml:lang="en">High Risk</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unable-to-assess">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unable to Assess Risk</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceCriticality">
    <xs:annotation>
      <xs:documentation xml:lang="en">Estimate of the potential clinical harm, or seriousness, of a reaction to an identified substance.</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="AllergyIntoleranceCriticality-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="allergy">
        <xs:annotation>
          <xs:documentation xml:lang="en">Allergy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="intolerance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Intolerance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Identification of the underlying physiological mechanism for a Reaction Risk.</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="AllergyIntoleranceType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceCategory-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="food">
        <xs:annotation>
          <xs:documentation xml:lang="en">Food</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="medication">
        <xs:annotation>
          <xs:documentation xml:lang="en">Medication</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="environment">
        <xs:annotation>
          <xs:documentation xml:lang="en">Environment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="biologic">
        <xs:annotation>
          <xs:documentation xml:lang="en">Biologic</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceCategory">
    <xs:annotation>
      <xs:documentation xml:lang="en">Category of an identified substance.</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="AllergyIntoleranceCategory-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceVerificationStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="unconfirmed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unconfirmed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="confirmed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Confirmed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refuted">
        <xs:annotation>
          <xs:documentation xml:lang="en">Refuted</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="AllergyIntoleranceVerificationStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Assertion about certainty associated with a propensity, or potential risk, of a reaction to the identified substance.</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="AllergyIntoleranceVerificationStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceSeverity-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="mild">
        <xs:annotation>
          <xs:documentation xml:lang="en">Mild</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="moderate">
        <xs:annotation>
          <xs:documentation xml:lang="en">Moderate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="severe">
        <xs:annotation>
          <xs:documentation xml:lang="en">Severe</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceSeverity">
    <xs:annotation>
      <xs:documentation xml:lang="en">Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations.</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="AllergyIntoleranceSeverity-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AllergyIntoleranceClinicalStatus-list">
    <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="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="resolved">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resolved</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AllergyIntoleranceClinicalStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The clinical status of the allergy or intolerance.</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="AllergyIntoleranceClinicalStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Appointment" type="Appointment">
    <xs:annotation>
      <xs:documentation xml:lang="en">A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Appointment">
    <xs:annotation>
      <xs:documentation xml:lang="en">A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).</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">This records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="AppointmentStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="serviceCategory" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A broad categorisation of the service that is to be performed during this appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="serviceType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specific service that is to be performed during this appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specialty" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specialty of a practitioner that would be required to perform the service requested in this appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="appointmentType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The style of appointment or patient that has been booked in the slot (not service type).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reason that this appointment is being scheduled. This is more clinical than administrative.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="indication" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingInformation" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information to support the appointment provided when making the appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="start" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date/Time that the appointment is to take place.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date/Time that the appointment is to conclude.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="minutesDuration" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="slot" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The slots from the participants' schedules that will be filled by the appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional comments about the appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="incomingReferral" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The referral request this appointment is allocated to assess (incoming referral).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="Appointment.Participant" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of participants involved in the appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestedPeriod" minOccurs="0" maxOccurs="unbounded" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within. When using these values, the minutes duration should be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Appointment.Participant">
    <xs:annotation>
      <xs:documentation xml:lang="en">A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Role of participant in the appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A Person, Location/HealthcareService or Device that is participating in the appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="required" minOccurs="0" maxOccurs="1" type="ParticipantRequired">
            <xs:annotation>
              <xs:documentation xml:lang="en">Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ParticipationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Participation status of the actor.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ParticipantRequired-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="required">
        <xs:annotation>
          <xs:documentation xml:lang="en">Required</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="optional">
        <xs:annotation>
          <xs:documentation xml:lang="en">Optional</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="information-only">
        <xs:annotation>
          <xs:documentation xml:lang="en">Information Only</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ParticipantRequired">
    <xs:annotation>
      <xs:documentation xml:lang="en">Is the Participant required to attend the appointment.</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="ParticipantRequired-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AppointmentStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Proposed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="pending">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pending</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="booked">
        <xs:annotation>
          <xs:documentation xml:lang="en">Booked</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="arrived">
        <xs:annotation>
          <xs:documentation xml:lang="en">Arrived</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fulfilled">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fulfilled</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="noshow">
        <xs:annotation>
          <xs:documentation xml:lang="en">No Show</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="AppointmentStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The free/busy status of an appointment.</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="AppointmentStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ParticipationStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation xml:lang="en">Accepted</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="declined">
        <xs:annotation>
          <xs:documentation xml:lang="en">Declined</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="tentative">
        <xs:annotation>
          <xs:documentation xml:lang="en">Tentative</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="needs-action">
        <xs:annotation>
          <xs:documentation xml:lang="en">Needs Action</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ParticipationStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Participation status of an appointment.</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="ParticipationStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="AppointmentResponse" type="AppointmentResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="AppointmentResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.</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">This records identifiers associated with this appointment response concern that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="appointment" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Appointment that this response is replying to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="start" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date/Time that the appointment is to take place, or requested new start time.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="participantType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Role of participant in the appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A Person, Location/HealthcareService or Device that is participating in the appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="participantStatus" minOccurs="1" maxOccurs="1" type="ParticipationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional comments about the appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="AuditEvent" type="AuditEvent">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="AuditEvent">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
      <xs:documentation 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="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subtype" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifier for the category of event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" minOccurs="0" maxOccurs="1" type="AuditEventAction">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicator for type of action performed during the event that generated the audit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recorded" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time when the event occurred on the source.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="AuditEventOutcome">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the event succeeded or failed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcomeDesc" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text description of the outcome of the event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purposeOfEvent" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The purposeOfUse (reason) that was used during the event being recorded.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="agent" type="AuditEvent.Agent" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An actor taking an active role in the event or activity that is logged.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="source" type="AuditEvent.Source" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The system that is reporting the event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="entity" type="AuditEvent.Entity" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specific instances of data or objects that have been accessed.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="AuditEvent.Agent">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Direct reference to a resource that identifies the agent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="userId" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique identifier for the user actively participating in the event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="altId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human-meaningful name for the agent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestor" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicator that the user is or is not the requestor, or initiator, for the event being audited.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the event occurred.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="policy" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="media" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of media involved. Used when the event is about exporting/importing onto media.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="network" type="AuditEvent.Network" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Logical network location for application activity, if the activity has a network location.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purposeOfUse" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reason (purpose of use), specific to this agent, that was used during the event being recorded.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="AuditEvent.Network">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="address" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier for the network access point of the user device for the audit event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="AuditEventAgentNetworkType">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier for the type of network access point that originated the audit event.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="AuditEvent.Source">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="site" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="1" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifier of the source where the event was detected.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code specifying the type of source where event originated.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="AuditEvent.Entity">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a specific instance of the entity. The reference should always be version specific.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a specific instance of the entity. The reference should be version specific.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of the object that was involved in this audit event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code representing the role the entity played in the event being audited.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lifecycle" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifier for the data life-cycle stage for the entity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="securityLabel" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Security labels for the identified entity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name of the entity in the audit event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Text that describes the entity in more detail.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="query" minOccurs="0" maxOccurs="1" type="base64Binary">
            <xs:annotation>
              <xs:documentation xml:lang="en">The query parameters for a query-type entities.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="AuditEvent.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Tagged value pairs for conveying additional information about the entity.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="AuditEvent.Detail">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of extra detail provided in the value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="base64Binary">
            <xs:annotation>
              <xs:documentation xml:lang="en">The details, base64 encoded. Used to carry bulk information.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AuditEventOutcome-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="0">
        <xs:annotation>
          <xs:documentation xml:lang="en">Success</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="4">
        <xs:annotation>
          <xs:documentation xml:lang="en">Minor failure</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="8">
        <xs:annotation>
          <xs:documentation xml:lang="en">Serious failure</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="12">
        <xs:annotation>
          <xs:documentation xml:lang="en">Major failure</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AuditEventOutcome">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates whether the event succeeded or failed</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="AuditEventOutcome-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AuditEventAction-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="C">
        <xs:annotation>
          <xs:documentation xml:lang="en">Create</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="R">
        <xs:annotation>
          <xs:documentation xml:lang="en">Read/View/Print</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="U">
        <xs:annotation>
          <xs:documentation xml:lang="en">Update</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="D">
        <xs:annotation>
          <xs:documentation xml:lang="en">Delete</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="E">
        <xs:annotation>
          <xs:documentation xml:lang="en">Execute</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AuditEventAction">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicator for type of action performed during the event that generated the event</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="AuditEventAction-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AuditEventAgentNetworkType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation xml:lang="en">Machine Name</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="2">
        <xs:annotation>
          <xs:documentation xml:lang="en">IP Address</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="3">
        <xs:annotation>
          <xs:documentation xml:lang="en">Telephone Number</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="4">
        <xs:annotation>
          <xs:documentation xml:lang="en">Email address</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="5">
        <xs:annotation>
          <xs:documentation xml:lang="en">URI</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AuditEventAgentNetworkType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of network access point of this agent in the audit event</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="AuditEventAgentNetworkType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Basic" type="Basic">
    <xs:annotation>
      <xs:documentation xml:lang="en">Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Basic">
    <xs:annotation>
      <xs:documentation xml:lang="en">Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.</xs:documentation>
      <xs:documentation 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">Identifier assigned to the resource for business purposes, outside the context of FHIR.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the 'type' of resource - equivalent to the resource name for other resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies when the resource was first created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates who was responsible for creating the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Binary" type="Binary">
    <xs:annotation>
      <xs:documentation xml:lang="en">A binary resource can contain any content, whether text, image, pdf, zip archive, etc.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Binary">
    <xs:annotation>
      <xs:documentation xml:lang="en">A binary resource can contain any content, whether text, image, pdf, zip archive, etc.</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="Resource">
        <xs:sequence>
          <xs:element name="contentType" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">MimeType of the binary content represented as a standard MimeType (BCP 13).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="securityContext" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Treat this binary as if it was this other resource for access control purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="1" maxOccurs="1" type="base64Binary">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual content, base64 encoded.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="BodySite" type="BodySite">
    <xs:annotation>
      <xs:documentation xml:lang="en">Record details about the anatomical location of a specimen or body part.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="BodySite">
    <xs:annotation>
      <xs:documentation xml:lang="en">Record details about the anatomical location of a specimen or body part.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</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">Identifier for this instance of the anatomical location.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this body site is in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Named anatomical location - ideally coded where possible.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="qualifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Qualifier to refine the anatomical location.  These include qualifiers for laterality, relative location, directionality, number, and plane.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A summary, charactarization or explanation of the anatomic location.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="image" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">Image or images used to identify a location.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person to which the body site belongs.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Bundle" type="Bundle">
    <xs:annotation>
      <xs:documentation xml:lang="en">A container for a collection of resources.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Bundle">
    <xs:annotation>
      <xs:documentation xml:lang="en">A container for a collection of resources.</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="Resource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A persistent identifier for the batch that won't change as a batch is copied from server to server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="BundleType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the purpose of this bundle - how it was intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="total" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="link" type="Bundle.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A series of links that provide context to this bundle.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="entry" type="Bundle.Entry" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="signature" minOccurs="0" maxOccurs="1" type="Signature">
            <xs:annotation>
              <xs:documentation xml:lang="en">Digital Signature - base64 encoded. XML-DSIg or a JWT.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Bundle.Link">
    <xs:annotation>
      <xs:documentation xml:lang="en">A container for a collection of resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="relation" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reference details for the link.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Bundle.Entry">
    <xs:annotation>
      <xs:documentation xml:lang="en">A container for a collection of resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="link" type="Bundle.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A series of links that provide context to this entry.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fullUrl" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Absolute URL for the resource.  The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: 
* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)
* Results from operations might involve resources that are not identified.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" minOccurs="0" maxOccurs="1" type="ResourceContainer">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Resources for the entry.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="search" type="Bundle.Search" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about the search process that lead to the creation of this entry.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" type="Bundle.Request" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information about how this entry should be processed as part of a transaction.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="response" type="Bundle.Response" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information about how this entry should be processed as part of a transaction.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Bundle.Search">
    <xs:annotation>
      <xs:documentation xml:lang="en">A container for a collection of resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="0" maxOccurs="1" type="SearchEntryMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">Why this entry is in the result set - whether it's included as a match or because of an _include requirement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="score" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">When searching, the server's search ranking score for the entry.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Bundle.Request">
    <xs:annotation>
      <xs:documentation xml:lang="en">A container for a collection of resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="method" minOccurs="1" maxOccurs="1" type="HTTPVerb">
            <xs:annotation>
              <xs:documentation xml:lang="en">The HTTP verb for this entry in either a change history, or a transaction/ transaction response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The URL for this entry, relative to the root (the address to which the request is posted).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ifNoneMatch" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ifModifiedSince" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ifMatch" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ifNoneExist" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Bundle.Response">
    <xs:annotation>
      <xs:documentation xml:lang="en">A container for a collection of resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The location header created by processing this operation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="etag" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The etag for the resource, it the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastModified" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date/time that the resource was modified on the server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="ResourceContainer">
            <xs:annotation>
              <xs:documentation xml:lang="en">An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="HTTPVerb-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="GET">
        <xs:annotation>
          <xs:documentation xml:lang="en">GET</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="POST">
        <xs:annotation>
          <xs:documentation xml:lang="en">POST</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PUT">
        <xs:annotation>
          <xs:documentation xml:lang="en">PUT</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DELETE">
        <xs:annotation>
          <xs:documentation xml:lang="en">DELETE</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="HTTPVerb">
    <xs:annotation>
      <xs:documentation xml:lang="en">HTTP verbs (in the HTTP command line).</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="HTTPVerb-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="BundleType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="document">
        <xs:annotation>
          <xs:documentation xml:lang="en">Document</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="message">
        <xs:annotation>
          <xs:documentation xml:lang="en">Message</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="transaction">
        <xs:annotation>
          <xs:documentation xml:lang="en">Transaction</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="transaction-response">
        <xs:annotation>
          <xs:documentation xml:lang="en">Transaction Response</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="batch">
        <xs:annotation>
          <xs:documentation xml:lang="en">Batch</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="batch-response">
        <xs:annotation>
          <xs:documentation xml:lang="en">Batch Response</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="history">
        <xs:annotation>
          <xs:documentation xml:lang="en">History List</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="searchset">
        <xs:annotation>
          <xs:documentation xml:lang="en">Search Results</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="collection">
        <xs:annotation>
          <xs:documentation xml:lang="en">Collection</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="BundleType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates the purpose of a bundle - how it was intended to be used.</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="BundleType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SearchEntryMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="match">
        <xs:annotation>
          <xs:documentation xml:lang="en">Match</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="include">
        <xs:annotation>
          <xs:documentation xml:lang="en">Include</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="outcome">
        <xs:annotation>
          <xs:documentation xml:lang="en">Outcome</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SearchEntryMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">Why an entry is in the result set - whether it's included as a match or because of an _include requirement.</xs:documentation>
      <xs:documentation 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="SearchEntryMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CapabilityStatement" type="CapabilityStatement">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CapabilityStatement">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the capability statement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this capability statement. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the capability statement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate capability statement instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the capability statement is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this capability statement is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="kind" minOccurs="1" maxOccurs="1" type="CapabilityStatementKind">
            <xs:annotation>
              <xs:documentation xml:lang="en">The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="instantiates" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="software" type="CapabilityStatement.Software" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="implementation" type="CapabilityStatement.Implementation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fhirVersion" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version of the FHIR specification on which this capability statement is based.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="acceptUnknown" minOccurs="1" maxOccurs="1" type="UnknownContentCode">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that indicates whether the application accepts unknown elements or extensions when reading resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="format" minOccurs="1" maxOccurs="unbounded" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of the formats supported by this implementation using their content types.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patchFormat" minOccurs="0" maxOccurs="unbounded" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of the patch formats supported by this implementation using their content types.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="implementationGuide" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of implementation guides that the server does (or should) support in their entirety.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rest" type="CapabilityStatement.Rest" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A definition of the restful capabilities of the solution, if any.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="messaging" type="CapabilityStatement.Messaging" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the messaging capabilities of the solution.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="document" type="CapabilityStatement.Document" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A document definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Software">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name software is known by.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version identifier for the software covered by this statement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="releaseDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date this version of the software was released.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Implementation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about the specific installation that this capability statement relates to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Rest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="RestfulCapabilityMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about the system's restful capabilities that apply across all applications, such as security.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="security" type="CapabilityStatement.Security" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about security implementation from an interface perspective - what a client needs to know.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" type="CapabilityStatement.Resource" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A specification of the restful capabilities of the solution for a specific resource type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="interaction" type="CapabilityStatement.Interaction1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A specification of restful operations supported by the system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="searchParam" type="CapabilityStatement.SearchParam" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="operation" type="CapabilityStatement.Operation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Definition of an operation or a named query together with its parameters and their meaning and type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="compartment" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Security">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="cors" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Server adds CORS headers when responding to requests - this enables javascript applications to use the server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Types of security services that are supported/required by the system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">General description of how security works.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="certificate" type="CapabilityStatement.Certificate" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Certificates associated with security profiles.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Certificate">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">Mime type for a certificate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="blob" minOccurs="0" maxOccurs="1" type="base64Binary">
            <xs:annotation>
              <xs:documentation xml:lang="en">Actual certificate.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Resource">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">A type of resource exposed via the restful interface.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information about the resource type used by the system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="interaction" type="CapabilityStatement.Interaction" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a restful operation supported by the solution.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="versioning" minOccurs="0" maxOccurs="1" type="ResourceVersionPolicy">
            <xs:annotation>
              <xs:documentation xml:lang="en">This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="readHistory" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A flag for whether the server is able to return past versions as part of the vRead operation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="updateCreate" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="conditionalCreate" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A flag that indicates that the server supports conditional create.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="conditionalRead" minOccurs="0" maxOccurs="1" type="ConditionalReadStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that indicates how the server supports conditional read.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="conditionalUpdate" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A flag that indicates that the server supports conditional update.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="conditionalDelete" minOccurs="0" maxOccurs="1" type="ConditionalDeleteStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that indicates how the server supports conditional delete.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referencePolicy" minOccurs="0" maxOccurs="unbounded" type="ReferenceHandlingPolicy">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of flags that defines how references are supported.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="searchInclude" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of _include values supported by the server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="searchRevInclude" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of _revinclude (reverse include) values supported by the server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="searchParam" type="CapabilityStatement.SearchParam" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Interaction">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="TypeRestfulInteraction">
            <xs:annotation>
              <xs:documentation xml:lang="en">Coded identifier of the operation, supported by the system resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.SearchParam">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the search parameter used in the interface.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="SearchParamType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of value a search parameter refers to, and how the content is interpreted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Interaction1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="SystemRestfulInteraction">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded identifier of the operation, supported by the system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Operation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the formal definition can be found.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Messaging">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="endpoint" type="CapabilityStatement.Endpoint" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An endpoint (network accessible address) to which messages and/or replies are to be sent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reliableCache" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportedMessage" type="CapabilityStatement.SupportedMessage" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">References to message definitions for messages this system can send or receive.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="event" type="CapabilityStatement.Event" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the solution's support for an event at this end-point.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Endpoint">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="protocol" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of the messaging transport protocol(s) identifiers, supported by this endpoint.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.SupportedMessage">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="EventCapabilityMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">The mode of this event declaration - whether application is sender or receiver.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Event">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded identifier of a supported messaging event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="MessageSignificanceCategory">
            <xs:annotation>
              <xs:documentation xml:lang="en">The impact of the content of the message.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="EventCapabilityMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">The mode of this event declaration - whether an application is a sender or receiver.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="focus" minOccurs="1" maxOccurs="1" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">A resource associated with the event.  This is the resource that defines the event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about the request for this event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about the response for this event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Guidance on how this event is handled, such as internal system trigger points, business rules, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CapabilityStatement.Document">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="DocumentMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">Mode of this document declaration - whether an application is a producer or consumer.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A constraint on a resource used in the document.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CapabilityStatementKind-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="instance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Instance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="capability">
        <xs:annotation>
          <xs:documentation xml:lang="en">Capability</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="requirements">
        <xs:annotation>
          <xs:documentation xml:lang="en">Requirements</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CapabilityStatementKind">
    <xs:annotation>
      <xs:documentation xml:lang="en">How a capability statement is intended to be used.</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="CapabilityStatementKind-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EventCapabilityMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="sender">
        <xs:annotation>
          <xs:documentation xml:lang="en">Sender</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="receiver">
        <xs:annotation>
          <xs:documentation xml:lang="en">Receiver</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EventCapabilityMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">The mode of a message capability statement.</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="EventCapabilityMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResourceVersionPolicy-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="no-version">
        <xs:annotation>
          <xs:documentation xml:lang="en">No VersionId Support</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="versioned">
        <xs:annotation>
          <xs:documentation xml:lang="en">Versioned</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="versioned-update">
        <xs:annotation>
          <xs:documentation xml:lang="en">VersionId tracked fully</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ResourceVersionPolicy">
    <xs:annotation>
      <xs:documentation xml:lang="en">How the system supports versioning for a resource.</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="ResourceVersionPolicy-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MessageSignificanceCategory-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="Consequence">
        <xs:annotation>
          <xs:documentation xml:lang="en">Consequence</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Currency">
        <xs:annotation>
          <xs:documentation xml:lang="en">Currency</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Notification">
        <xs:annotation>
          <xs:documentation xml:lang="en">Notification</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MessageSignificanceCategory">
    <xs:annotation>
      <xs:documentation xml:lang="en">The impact of the content of a message.</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="MessageSignificanceCategory-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DocumentMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="producer">
        <xs:annotation>
          <xs:documentation xml:lang="en">Producer</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="consumer">
        <xs:annotation>
          <xs:documentation xml:lang="en">Consumer</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DocumentMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">Whether the application produces or consumes documents.</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="DocumentMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="RestfulCapabilityMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="client">
        <xs:annotation>
          <xs:documentation xml:lang="en">Client</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="server">
        <xs:annotation>
          <xs:documentation xml:lang="en">Server</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="RestfulCapabilityMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">The mode of a RESTful capability statement.</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="RestfulCapabilityMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="UnknownContentCode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="no">
        <xs:annotation>
          <xs:documentation xml:lang="en">Neither Elements or Extensions</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="extensions">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown Extensions</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="elements">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown Elements</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="both">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown Elements and Extensions</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="UnknownContentCode">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code that indicates whether an application accepts unknown elements or extensions when reading resources.</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="UnknownContentCode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TypeRestfulInteraction-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="read">
        <xs:annotation>
          <xs:documentation xml:lang="en">read</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="vread">
        <xs:annotation>
          <xs:documentation xml:lang="en">vread</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="update">
        <xs:annotation>
          <xs:documentation xml:lang="en">update</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="patch">
        <xs:annotation>
          <xs:documentation xml:lang="en">patch</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="delete">
        <xs:annotation>
          <xs:documentation xml:lang="en">delete</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="history-instance">
        <xs:annotation>
          <xs:documentation xml:lang="en">history-instance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="history-type">
        <xs:annotation>
          <xs:documentation xml:lang="en">history-type</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="create">
        <xs:annotation>
          <xs:documentation xml:lang="en">create</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="search-type">
        <xs:annotation>
          <xs:documentation xml:lang="en">search-type</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TypeRestfulInteraction">
    <xs:annotation>
      <xs:documentation xml:lang="en">Operations supported by REST at the type or instance level.</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="TypeRestfulInteraction-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SystemRestfulInteraction-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="transaction">
        <xs:annotation>
          <xs:documentation xml:lang="en">transaction</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="batch">
        <xs:annotation>
          <xs:documentation xml:lang="en">batch</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="search-system">
        <xs:annotation>
          <xs:documentation xml:lang="en">search-system</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="history-system">
        <xs:annotation>
          <xs:documentation xml:lang="en">history-system</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SystemRestfulInteraction">
    <xs:annotation>
      <xs:documentation xml:lang="en">Operations supported by REST at the system level.</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="SystemRestfulInteraction-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConditionalReadStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="not-supported">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not Supported</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="modified-since">
        <xs:annotation>
          <xs:documentation xml:lang="en">If-Modified-Since</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not-match">
        <xs:annotation>
          <xs:documentation xml:lang="en">If-None-Match</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="full-support">
        <xs:annotation>
          <xs:documentation xml:lang="en">Full Support</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConditionalReadStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code that indicates how the server supports conditional read.</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="ConditionalReadStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ReferenceHandlingPolicy-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="literal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Literal References</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="logical">
        <xs:annotation>
          <xs:documentation xml:lang="en">Logical References</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="resolves">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resolves References</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="enforced">
        <xs:annotation>
          <xs:documentation xml:lang="en">Reference Integrity Enforced</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="local">
        <xs:annotation>
          <xs:documentation xml:lang="en">Local References Only</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ReferenceHandlingPolicy">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of flags that defines how references are supported.</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="ReferenceHandlingPolicy-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConditionalDeleteStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="not-supported">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not Supported</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="single">
        <xs:annotation>
          <xs:documentation xml:lang="en">Single Deletes Supported</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="multiple">
        <xs:annotation>
          <xs:documentation xml:lang="en">Multiple Deletes Supported</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConditionalDeleteStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code that indicates how the server supports conditional delete.</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="ConditionalDeleteStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CarePlan" type="CarePlan">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CarePlan">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</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">This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the protocol, questionnaire, guideline or other specification the care plan should be conducted in accordance with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A care plan that is fulfilled in whole or in part by this care plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="replaces" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Completed or terminated care plan whose function is taken by this new care plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A larger care plan of which this particular care plan is a component or step.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="CarePlanStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="intent" minOccurs="1" maxOccurs="1" type="CarePlanIntent">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human-friendly name for the CarePlan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the scope and nature of the plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the patient or group whose intended care is described by the plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the original context in which this particular CarePlan was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates when the plan did (or is intended to) come into effect and end.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the individual(s) or ogranization who is responsible for the content of the care plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="careTeam" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="addresses" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingInfo" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="goal" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the intended objective(s) of carrying out the care plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="activity" type="CarePlan.Activity" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">General notes about the care plan not covered elsewhere.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan.Activity">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="outcomeCodeableConcept" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the outcome at the point when the status of the activity is assessed.  For example, the outcome of an education activity could be patient understands (or not).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcomeReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details of the outcome or action resulting from the activity.  The reference to an "event" resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself.  The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a “request” resource).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="progress" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Notes about the adherence/status/progress of the activity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The details of the proposed activity represented in a specific resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="CarePlan.Detail" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CarePlan.Detail">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">High-level categorization of the type of activity in a care plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="goal" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Internal reference that identifies the goals that this activity is intended to contribute towards meeting.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="CarePlanActivityStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies what progress is being made for the specific activity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="statusReason" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prohibited" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, indicates that the described activity is one that should be engaged in when following the plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period, timing or frequency upon which the described activity is to occur.</xs:documentation>
            </xs:annotation>
            <xs:element name="scheduledTiming" type="Timing" />
            <xs:element name="scheduledPeriod" type="Period" />
            <xs:element name="scheduledString" type="string" />
          </xs:choice>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies who's expected to be involved in the activity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the food, drug or other product to be consumed or supplied in the activity.</xs:documentation>
            </xs:annotation>
            <xs:element name="productCodeableConcept" type="CodeableConcept" />
            <xs:element name="productReference" type="Reference" />
          </xs:choice>
          <xs:element name="dailyAmount" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the quantity expected to be consumed in a given day.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the quantity expected to be supplied, administered or consumed by the subject.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pending</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Suspended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation xml:lang="en">Cancelled</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.</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="CarePlanStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanActivityStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="not-started">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not Started</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="scheduled">
        <xs:annotation>
          <xs:documentation xml:lang="en">Scheduled</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Hold</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanActivityStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates where the activity is at in its overall life cycle.</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="CarePlanActivityStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CarePlanIntent-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="proposal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Proposal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="plan">
        <xs:annotation>
          <xs:documentation xml:lang="en">Plan</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="order">
        <xs:annotation>
          <xs:documentation xml:lang="en">Order</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="option">
        <xs:annotation>
          <xs:documentation xml:lang="en">Option</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CarePlanIntent">
    <xs:annotation>
      <xs:documentation xml:lang="en">Codes indicating the degree of authority/intentionality associated with a care plan</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="CarePlanIntent-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CareTeam" type="CareTeam">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CareTeam">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.</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">This records identifiers associated with this care team that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="CareTeamStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the current state of the care team.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies what kind of team.  This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A label for human use intended to distinguish like teams.  E.g. the "red" vs. "green" trauma teams.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the patient or group whose intended care is handled by the team.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter or episode of care that establishes the context for this care team.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates when the team did (or is intended to) come into effect and end.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="CareTeam.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies all people and organizations who are expected to be involved in the care team.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes why the care team exists.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Condition(s) that this care team addresses.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization responsible for the care team.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments made about the CareTeam.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CareTeam.Participant">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates specific responsibility of an individual within the care team, such as "Primary care physician", "Trained social worker counselor", "Caregiver", etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="member" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specific person or organization who is participating/expected to participate in the care team.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization of the practitioner.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates when the specific member or organization did (or is intended to) come into effect and end.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CareTeamStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Proposed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Suspended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</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="CareTeamStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates the status of the care team.</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="CareTeamStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ChargeItem" type="ChargeItem">
    <xs:annotation>
      <xs:documentation xml:lang="en">The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ChargeItem">
    <xs:annotation>
      <xs:documentation xml:lang="en">The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifiers assigned to this event performer or other systems.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">References the source of pricing information, rules of application for the code this ChargeItem uses.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ChargeItemStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The current state of the ChargeItem.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">ChargeItems can be grouped to larger ChargeItems covering the whole set.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that identifies the charge, like a billing code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual or set of individuals the action is being or was performed on.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter or episode of care that establishes the context for this event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date/time(s) or duration when the charged service was applied.</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime" />
            <xs:element name="occurrencePeriod" type="Period" />
            <xs:element name="occurrenceTiming" type="Timing" />
          </xs:choice>
          <xs:element name="participant" type="ChargeItem.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates who or what performed or participated in the charged service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization requesting the service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization performing the service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Quantity of which the charge item has been serviced.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodysite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The anatomical location where the related service has been applied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="factorOverride" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Factor overriding the factor determined by the rules associated with the code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priceOverride" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Total price of the charge overriding the list price associated with the code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="overrideReason" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the list price or the rule based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="enterer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner, etc. who entered the charge item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="enteredDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date the charge item was entered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes why the event occurred in coded or textual form.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicated the rendered service that caused this charge.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="account" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Account into which this ChargeItems belongs.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments made about the event by the performer, subject or other participants.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingInformation" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Further information supporting the this charge.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ChargeItem.Participant">
    <xs:annotation>
      <xs:documentation xml:lang="en">The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the type of performance or participation(e.g. primary surgeon, anaesthesiologiest, etc.).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner, etc. who performed or participated in the service.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ChargeItemStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation xml:lang="en">Planned</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="billable">
        <xs:annotation>
          <xs:documentation xml:lang="en">Billable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not-billable">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not billable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="aborted">
        <xs:annotation>
          <xs:documentation xml:lang="en">Aborted</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="billed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Billed</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:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ChargeItemStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Codes identifying the stage lifecycle stage of a ChargeItem</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="ChargeItemStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Claim" type="Claim">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Claim">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
      <xs:documentation 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">The business identifier for the instance: claim number, pre-determination or pre-authorization number.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The category of claim, eg, oral, pharmacy, vision, insitutional, professional.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Use">
            <xs:annotation>
              <xs:documentation xml:lang="en">Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Patient Resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="billablePeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The billable period for which charges are being submitted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when the enclosed suite of services were performed or completed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="enterer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Person who created the invoice/claim/pre-determination or pre-authorization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="insurer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Insurer who is target of the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The provider which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is responsible for the bill, claim pre-determination, pre-authorization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Immediate (STAT), best effort (NORMAL), deferred (DEFER).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fundsReserve" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="related" type="Claim.Related" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Other claims which are related to this claim such as prior claim versions or for related services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prescription" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Prescription to support the dispensing of Pharmacy or Vision products.</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 superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payee" type="Claim.Payee" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party to be reimbursed for the services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referral" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The referral resource which lists the date, practitioner, reason and other supporting information.</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="careTeam" type="Claim.CareTeam" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The members of the team who provided the overall service as well as their role and whether responsible and qualifications.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="information" type="Claim.Information" 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. Often there are mutiple jurisdiction specific valuesets which are required.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="Claim.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of patient diagnosis for which care is sought.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="procedure" type="Claim.Procedure" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Ordered list of patient procedures performed to support the adjudication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="insurance" type="Claim.Insurance" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Financial instrument by which payment information for health care.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="accident" type="Claim.Accident" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An accident which resulted in the need for healthcare services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="employmentImpacted" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="hospitalization" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The start and optional end dates of when the patient was confined to a treatment center.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="item" type="Claim.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">First tier of goods and services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="total" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total value of the claim.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Claim.Related">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="claim" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Other claims which are related to this claim such as prior claim versions or for related services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">For example prior or umbrella.</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 - eg Property/Casualy insurer claim # or Workers Compensation case # .</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Claim.Payee">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resourceType" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">organization | patient | practitioner | relatedperson.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="party" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Claim.CareTeam">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Sequence of the careTeam which serves to order and provide a link.</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 overall service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="responsible" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party who is billing and responsible for the claimed good or service rendered to the patient.</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 multidisiplinary team.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="qualification" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The qualification which is applicable for this service.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Claim.Information">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Sequence of the information element which serves to provide a link.</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 which may influence the adjudication.</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="timingDate" type="date" />
            <xs:element name="timingPeriod" type="Period" />
          </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="valueString" type="string" />
            <xs:element name="valueQuantity" type="Quantity" />
            <xs:element name="valueAttachment" type="Attachment" />
            <xs:element name="valueReference" type="Reference" />
          </xs:choice>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">For example, provides the reason for: the additional stay, or missing tooth or any other 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="Claim.Diagnosis">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Sequence of diagnosis which serves to provide a link.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The diagnosis.</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">The type of the Diagnosis, for example: admitting, primary, secondary, discharge.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="packageCode" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The package billing code, for example DRG, based on the assigned grouping code system.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Claim.Procedure">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Sequence of procedures which serves to order and provide a link.</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 procedure code.</xs:documentation>
            </xs:annotation>
            <xs:element name="procedureCodeableConcept" type="CodeableConcept" />
            <xs:element name="procedureReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Claim.Insurance">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Sequence of coverage which serves to provide a link and convey coordination of benefit order.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <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 the focus for adjudication. The Coverage against which the claim is to be adjudicated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the program or plan identification, underwriter or payor.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="businessArrangement" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The contract number of a business agreement which describes the terms and conditions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="preAuthRef" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of references from the Insurer to which these services pertain.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="claimResponse" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Coverages adjudication details.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Claim.Accident">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date of an accident which these services are addressing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of accident: work, auto, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Accident Place.</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="Claim.Item">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A service line number.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="careTeamLinkId" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">CareTeam applicable for this service or product line.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="diagnosisLinkId" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Diagnosis applicable for this service or product line.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="procedureLinkId" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Procedures applicable for this service or product line.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="informationLinkId" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Exceptions, special conditions and supporting information pplicable for this service or product line.</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 reveneu 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">Health Care Service Type Codes  to identify the classification of service or benefits.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,RXNorm,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.</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, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="programCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">For programs which require reason codes for the inclusion or covering of this billed item under the program or sub-program.</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 enclosed suite of services were 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 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="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 a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation 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="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of Unique Device Identifiers associated with this line item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <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 site, eg. limb region or tooth surface(s).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A billed item may include goods or services provided in multiple encounters.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="Claim.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="Claim.Detail">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A service line number.</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 reveneu 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">Health Care Service Type Codes  to identify the classification of service or benefits.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.</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, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="programCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.</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 a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation 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="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of Unique Device Identifiers associated with this line item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subDetail" type="Claim.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="Claim.SubDetail">
    <xs:annotation>
      <xs:documentation xml:lang="en">A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A service line number.</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 reveneu 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">Health Care Service Type Codes  to identify the classification of service or benefits.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).</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, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="programCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.</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">The fee for an addittional service or product or charge.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation 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="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of Unique Device Identifiers associated with this line item.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="Use-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="complete">
        <xs:annotation>
          <xs:documentation xml:lang="en">Complete</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Proposed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="exploratory">
        <xs:annotation>
          <xs:documentation xml:lang="en">Exploratory</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation xml:lang="en">Other</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="Use">
    <xs:annotation>
      <xs:documentation xml:lang="en">Complete, proposed, exploratory, other</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="Use-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="FinancialResourceStatusCodes-list">
    <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="FinancialResourceStatusCodes">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code specifying the state of the resource instance.</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="FinancialResourceStatusCodes-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ClaimResponse" type="ClaimResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ClaimResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</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">The Response business identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Patient Resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when the enclosed suite of services were performed or completed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="insurer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Insurer who produced this adjudicated response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Original request resource referrence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Processing outcome errror, partial or complete processing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the status of the adjudication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payeeType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="item" type="ClaimResponse.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The first tier service adjudications for submitted services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="addItem" type="ClaimResponse.AddItem" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The first tier service adjudications for payor added services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="error" type="ClaimResponse.Error" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Mutually exclusive with Services Provided (Item).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="totalCost" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total cost of the services reported.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="unallocDeductable" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of deductible applied which was not allocated to any particular service line.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="totalBenefit" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payment" type="ClaimResponse.Payment" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Payment details for the claim if the claim has been paid.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reserved" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Status of funds reservation (For provider, for Patient, None).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The form to be used for printing the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="processNote" type="ClaimResponse.ProcessNote" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Note text.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="communicationRequest" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Request for additional supporting or authorizing information, such as: documents, images or resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="insurance" type="ClaimResponse.Insurance" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Financial instrument by which payment information for health care.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Item">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A service line number.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of note references to the notes provided below.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ClaimResponse.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudication results.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="ClaimResponse.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The second tier service adjudications for submitted services.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Adjudication">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="category" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Adjudication reason such as limit reached.</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 code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">A non-monetary value for example a percentage. Mutually exclusive to the amount element above.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Detail">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A service line number.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of note references to the notes provided below.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ClaimResponse.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudications results.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subDetail" type="ClaimResponse.SubDetail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The third tier service adjudications for submitted services.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.SubDetail">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A service line number.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of note references to the notes provided below.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ClaimResponse.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudications results.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.AddItem">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of input service items which this service line is intended to replace.</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 reveneu 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">Health Care Service Type Codes  to identify the classification of service or benefits.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate the Professional Service or Product supplied.</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, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fee" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The fee charged for the professional service or product..</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of note references to the notes provided below.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ClaimResponse.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudications results.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="ClaimResponse.Detail1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The second tier service adjudications for payor added services.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Detail1">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="revenue" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of reveneu 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">Health Care Service Type Codes  to identify the classification of service or benefits.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate the Professional Service or Product supplied.</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, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fee" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The fee charged for the professional service or product..</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of note references to the notes provided below.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="adjudication" type="ClaimResponse.Adjudication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The adjudications results.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Error">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detailSequenceLinkId" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subdetailSequenceLinkId" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">An error code,from a specified code system, which details why the claim could not be adjudicated.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Payment">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this represents partial or complete payment of the claim.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="adjustment" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Adjustment to the payment of this transaction which is not related to adjudication of this transaction.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="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 payment data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">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">Payment identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.ProcessNote">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="number" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">An integer associated with each note which may be referred to from each service line item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The note purpose: Print/Display.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The note text.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClaimResponse.Insurance">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequence" minOccurs="1" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A service line item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="focal" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the program or plan identification, underwriter or payor.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="businessArrangement" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The contract number of a business agreement which describes the terms and conditions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="preAuthRef" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of references from the Insurer to which these services pertain.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="claimResponse" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Coverages adjudication details.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ClinicalImpression" type="ClinicalImpression">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ClinicalImpression">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score.</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 the clinical impression that remains consistent regardless of what server the impression is stored on.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ClinicalImpressionStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the workflow status of the assessment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Categorizes the type of clinical assessment performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A summary of the context and/or cause of the assessment - why / where was it performed, and what patient events/status prompted it.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient or group of individuals assessed as part of this record.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter or episode of care this impression was created as part of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The point in time or period over which the subject was assessed.</xs:documentation>
            </xs:annotation>
            <xs:element name="effectiveDateTime" type="dateTime" />
            <xs:element name="effectivePeriod" type="Period" />
          </xs:choice>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates when the documentation of the assessment was complete.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assessor" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The clinician performing the assessment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="previous" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="problem" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">This a list of the relevant problems/conditions for a patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="investigation" type="ClinicalImpression.Investigation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="protocol" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="summary" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A text summary of the investigations and the diagnosis.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="finding" type="ClinicalImpression.Finding" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prognosisCodeableConcept" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Estimate of likely outcome.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prognosisReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">RiskAssessment expressing likely outcome.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action taken as part of assessment procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Commentary about the impression, typically recorded after the impression itself was made, though supplemental notes by the original author could also appear.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClinicalImpression.Investigation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="item" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A record of a specific investigation that was undertaken.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ClinicalImpression.Finding">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specific text, code or reference for finding or diagnosis, which may include ruled-out or resolved conditions.</xs:documentation>
            </xs:annotation>
            <xs:element name="itemCodeableConcept" type="CodeableConcept" />
            <xs:element name="itemReference" type="Reference" />
          </xs:choice>
          <xs:element name="basis" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Which investigations support finding or diagnosis.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ClinicalImpressionStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation xml:lang="en">In progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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="ClinicalImpressionStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The workflow state of a clinical impression.</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="ClinicalImpressionStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CodeSystem" type="CodeSystem">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code system resource specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CodeSystem">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code system resource specifies a set of codes drawn from one or more code systems.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. The URL SHOULD include the major version of the code system. For more information see [Technical and Business Versions](resource.html#versions). This is used in [Coding]{datatypes.html#Coding}.system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding]{datatypes.html#Coding}.version.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the code system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this code system. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this code system is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the code system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the code system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the code system from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate code system instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the code system is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this code system is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="caseSensitive" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If code comparison is case sensitive when codes within this system are compared to each other.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="valueSet" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Canonical URL of value set that contains the entire code system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="hierarchyMeaning" minOccurs="0" maxOccurs="1" type="CodeSystemHierarchyMeaning">
            <xs:annotation>
              <xs:documentation xml:lang="en">The meaning of the hierarchy of concepts.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="compositional" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">True If code system defines a post-composition grammar.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="versionNeeded" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="1" maxOccurs="1" type="CodeSystemContentMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">How much of the content of the code system - the concepts and codes it defines - are represented in this resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="count" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="filter" type="CodeSystem.Filter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A filter that can be used in a value set compose statement when selecting concepts using a filter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="property" type="CodeSystem.Property" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A property defines an additional slot through which additional information can be provided about a concept.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="concept" type="CodeSystem.Concept" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CodeSystem.Filter">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code system resource specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The code that identifies this filter when it is used in the instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of how or why the filter is used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="operator" minOccurs="1" maxOccurs="unbounded" type="FilterOperator">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of operators that can be used with the filter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of what the value for the filter should be.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CodeSystem.Property">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code system resource specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="uri" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the property- why it is defined, and how its value might be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="PropertyType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to anotherr defined concept).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CodeSystem.Concept">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code system resource specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code - a text symbol - that uniquely identifies the concept within the code system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A human readable string that is the recommended default way to present this concept to a user.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="designation" type="CodeSystem.Designation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="property" type="CodeSystem.Property1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A property value for this concept.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="concept" type="CodeSystem.Concept" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CodeSystem.Designation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code system resource specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The language this designation is defined for.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that details how this designation would be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The text value for this designation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CodeSystem.Property1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code system resource specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that is a reference to CodeSystem.property.code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of this property.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueCode" type="code" />
            <xs:element name="valueCoding" type="Coding" />
            <xs:element name="valueString" type="string" />
            <xs:element name="valueInteger" type="integer" />
            <xs:element name="valueBoolean" type="boolean" />
            <xs:element name="valueDateTime" type="dateTime" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="FilterOperator-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="=">
        <xs:annotation>
          <xs:documentation xml:lang="en">Equals</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="is-a">
        <xs:annotation>
          <xs:documentation xml:lang="en">Is A (by subsumption)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="descendent-of">
        <xs:annotation>
          <xs:documentation xml:lang="en">Descendent Of (by subsumption)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="is-not-a">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not (Is A) (by subsumption)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="regex">
        <xs:annotation>
          <xs:documentation xml:lang="en">Regular Expression</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Set</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not-in">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not in Set</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="generalizes">
        <xs:annotation>
          <xs:documentation xml:lang="en">Generalizes (by Subsumption)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="exists">
        <xs:annotation>
          <xs:documentation xml:lang="en">Exists</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="FilterOperator">
    <xs:annotation>
      <xs:documentation xml:lang="en">The kind of operation to perform as a part of a property based filter.</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="FilterOperator-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="PropertyType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="code">
        <xs:annotation>
          <xs:documentation xml:lang="en">code (internal reference)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Coding">
        <xs:annotation>
          <xs:documentation xml:lang="en">Coding (external reference)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="string">
        <xs:annotation>
          <xs:documentation xml:lang="en">string</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="integer">
        <xs:annotation>
          <xs:documentation xml:lang="en">integer</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="boolean">
        <xs:annotation>
          <xs:documentation xml:lang="en">boolean</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dateTime">
        <xs:annotation>
          <xs:documentation xml:lang="en">dateTime</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="PropertyType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of a property value</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="PropertyType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CodeSystemHierarchyMeaning-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="grouped-by">
        <xs:annotation>
          <xs:documentation xml:lang="en">Grouped By</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="is-a">
        <xs:annotation>
          <xs:documentation xml:lang="en">Is-A</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="part-of">
        <xs:annotation>
          <xs:documentation xml:lang="en">Part Of</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="classified-with">
        <xs:annotation>
          <xs:documentation xml:lang="en">Classified With</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CodeSystemHierarchyMeaning">
    <xs:annotation>
      <xs:documentation xml:lang="en">The meaning of the hierarchy of concepts in a code system</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="CodeSystemHierarchyMeaning-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CodeSystemContentMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="not-present">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not Present</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="example">
        <xs:annotation>
          <xs:documentation xml:lang="en">Example</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fragment">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fragment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="complete">
        <xs:annotation>
          <xs:documentation xml:lang="en">Complete</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CodeSystemContentMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">How much of the content of the code system - the concepts and codes it defines - are represented in a code system resource</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="CodeSystemContentMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Communication" type="Communication">
    <xs:annotation>
      <xs:documentation xml:lang="en">An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Communication">
    <xs:annotation>
      <xs:documentation xml:lang="en">An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.</xs:documentation>
      <xs:documentation 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">Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A protocol, guideline, or other definition that was adhered to in whole or in part by this communication event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">An order, proposal or plan fulfilled in whole or in part by this Communication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Part of this action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EventStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the transmission.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notDone" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If true, indicates that the described communication event did not actually occur.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notDoneReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes why the communication event did not occur in coded and/or textual form.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of message conveyed such as alert, notification, reminder, instruction, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="medium" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A channel that was used for this communication (e.g. email, fax).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient or group that was the focus of this communication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recipient" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="topic" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resources which were responsible for or related to producing this communication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter within which the communication was sent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sent" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time when this communication was sent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="received" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time when this communication arrived at the destination.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sender" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reason or justification for the communication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates another resource whose existence justifies this communication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payload" type="Communication.Payload" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Text, attachment(s), or resource(s) that was communicated to the recipient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional notes or commentary about the communication by the sender, receiver or other interested parties.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Communication.Payload">
    <xs:annotation>
      <xs:documentation xml:lang="en">An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A communicated content (or for multi-part communications, one portion of the communication).</xs:documentation>
            </xs:annotation>
            <xs:element name="contentString" type="string" />
            <xs:element name="contentAttachment" type="Attachment" />
            <xs:element name="contentReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EventStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="preparation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Preparation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Suspended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="aborted">
        <xs:annotation>
          <xs:documentation xml:lang="en">Aborted</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EventStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The status of the communication.</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="EventStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CommunicationRequest" type="CommunicationRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CommunicationRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>
      <xs:documentation 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 ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A plan or proposal that is fulfilled in whole or in part by this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="replaces" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Completed or terminated request(s) whose function is taken by this new request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="groupIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="RequestStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the proposal or order.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of message to be sent such as alert, notification, reminder, instruction, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="RequestPriority">
            <xs:annotation>
              <xs:documentation xml:lang="en">Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="medium" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A channel that was used for this communication (e.g. email, fax).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient or group that is the focus of this communication request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recipient" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The entity (e.g. person, organization, clinical information system, device, group, or care team) which is the intended target of the communication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="topic" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resources which were related to producing this communication request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter or episode of care within which the communication request was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payload" type="CommunicationRequest.Payload" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Text, attachment(s), or resource(s) to be communicated to the recipient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time when this communication is to occur.</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime" />
            <xs:element name="occurrencePeriod" type="Period" />
          </xs:choice>
          <xs:element name="authoredOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">For draft requests, indicates the date of initial creation.  For requests with other statuses, indicates the date of activation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sender" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requester" type="CommunicationRequest.Requester" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual who initiated the request and has responsibility for its activation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes why the request is being made in coded or textual form.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates another resource whose existence justifies this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments made about the request by the requester, sender, recipient, subject or other participants.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CommunicationRequest.Payload">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The communicated content (or for multi-part communications, one portion of the communication).</xs:documentation>
            </xs:annotation>
            <xs:element name="contentString" type="string" />
            <xs:element name="contentAttachment" type="Attachment" />
            <xs:element name="contentReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CommunicationRequest.Requester">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="agent" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner, etc. who initiated the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization the device or practitioner was acting on behalf of.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="RequestStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation xml:lang="en">Draft</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Suspended</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="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="RequestStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The status of the communication request.</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="RequestStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="RequestPriority-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="routine">
        <xs:annotation>
          <xs:documentation xml:lang="en">Routine</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="urgent">
        <xs:annotation>
          <xs:documentation xml:lang="en">Urgent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="asap">
        <xs:annotation>
          <xs:documentation xml:lang="en">ASAP</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stat">
        <xs:annotation>
          <xs:documentation xml:lang="en">STAT</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="RequestPriority">
    <xs:annotation>
      <xs:documentation xml:lang="en">Codes indicating the relative importance of a communication request.</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="RequestPriority-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="CompartmentDefinition" type="CompartmentDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A compartment definition that defines how resources are accessed on a server.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CompartmentDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A compartment definition that defines how resources are accessed on a server.</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="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published. The URL SHOULD include the major version of the compartment definition. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the compartment definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the compartment definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this compartment definition. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this compartment definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the compartment definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the compartment definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the compartment definition from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this compartment definition is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate compartment definition instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the compartment definition is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CompartmentType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Which compartment this definition describes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="search" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the search syntax is supported,.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" type="CompartmentDefinition.Resource" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about how a resource is related to the compartment.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="CompartmentDefinition.Resource">
    <xs:annotation>
      <xs:documentation xml:lang="en">A compartment definition that defines how resources are accessed on a server.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of a resource supported by the server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="param" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment in more than one way,.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional documentation about the resource and compartment.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CompartmentType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="Patient">
        <xs:annotation>
          <xs:documentation xml:lang="en">Patient</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Encounter">
        <xs:annotation>
          <xs:documentation xml:lang="en">Encounter</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RelatedPerson">
        <xs:annotation>
          <xs:documentation xml:lang="en">RelatedPerson</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Practitioner">
        <xs:annotation>
          <xs:documentation xml:lang="en">Practitioner</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Device">
        <xs:annotation>
          <xs:documentation xml:lang="en">Device</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CompartmentType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Which compartment a compartment definition describes</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="CompartmentType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Composition" type="Composition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Composition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Logical identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="CompositionStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="class" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the clinical encounter or type of care this documentation is associated with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The composition editing time, when the composition was last logically changed by the author.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="1" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies who is responsible for the information in the composition, not necessarily who typed it in.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Official human-readable label for the composition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="confidentiality" minOccurs="0" maxOccurs="1" type="ConfidentialityClassification">
            <xs:annotation>
              <xs:documentation xml:lang="en">The code specifying the level of confidentiality of the Composition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="attester" type="Composition.Attester" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A participant who has attested to the accuracy of the composition/document.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="custodian" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relatesTo" type="Composition.RelatesTo" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Relationships that this composition has with other compositions or documents that already exist.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="event" type="Composition.Event" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The clinical service, such as a colonoscopy or an appendectomy, being documented.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="section" type="Composition.Section" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The root of the sections that make up the composition.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Composition.Attester">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="1" maxOccurs="unbounded" type="CompositionAttestationMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of attestation the authenticator offers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="time" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the composition was attested by the party.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="party" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who attested the composition in the specified way.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Composition.RelatesTo">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="DocumentRelationshipType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of relationship that this composition has with anther composition or document.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The target composition/document of this relationship.</xs:documentation>
            </xs:annotation>
            <xs:element name="targetIdentifier" type="Identifier" />
            <xs:element name="targetReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Composition.Event">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Composition.Section">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code identifying the kind of content contained within the section. This must be consistent with the section title.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="Narrative">
            <xs:annotation>
              <xs:documentation xml:lang="en">A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="0" maxOccurs="1" type="ListMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="orderedBy" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies the order applied to the items in the section entries.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="entry" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the actual resource from which the narrative in the section is derived.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="emptyReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="section" type="Composition.Section" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A nested sub-section within this section.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CompositionStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="preliminary">
        <xs:annotation>
          <xs:documentation xml:lang="en">Preliminary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="final">
        <xs:annotation>
          <xs:documentation xml:lang="en">Final</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="amended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Amended</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="CompositionStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The workflow/clinical status of the composition.</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="CompositionStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConfidentialityClassification-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="U">
        <xs:annotation>
          <xs:documentation xml:lang="en">unrestricted</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="L">
        <xs:annotation>
          <xs:documentation xml:lang="en">low</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="M">
        <xs:annotation>
          <xs:documentation xml:lang="en">moderate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="N">
        <xs:annotation>
          <xs:documentation xml:lang="en">normal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="R">
        <xs:annotation>
          <xs:documentation xml:lang="en">restricted</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="V">
        <xs:annotation>
          <xs:documentation xml:lang="en">very restricted</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConfidentialityClassification">
    <xs:annotation>
      <xs:documentation xml:lang="en">Codes specifying the level of confidentiality of the composition.</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="ConfidentialityClassification-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DocumentRelationshipType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="replaces">
        <xs:annotation>
          <xs:documentation xml:lang="en">Replaces</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="transforms">
        <xs:annotation>
          <xs:documentation xml:lang="en">Transforms</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="signs">
        <xs:annotation>
          <xs:documentation xml:lang="en">Signs</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="appends">
        <xs:annotation>
          <xs:documentation xml:lang="en">Appends</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DocumentRelationshipType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of relationship between documents.</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="DocumentRelationshipType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="CompositionAttestationMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="personal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Personal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="professional">
        <xs:annotation>
          <xs:documentation xml:lang="en">Professional</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="legal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Legal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="official">
        <xs:annotation>
          <xs:documentation xml:lang="en">Official</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CompositionAttestationMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">The way in which a person authenticated a composition.</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="CompositionAttestationMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ListMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="working">
        <xs:annotation>
          <xs:documentation xml:lang="en">Working List</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="snapshot">
        <xs:annotation>
          <xs:documentation xml:lang="en">Snapshot List</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="changes">
        <xs:annotation>
          <xs:documentation xml:lang="en">Change List</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ListMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">The processing mode that applies to this section.</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="ListMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ConceptMap" type="ConceptMap">
    <xs:annotation>
      <xs:documentation xml:lang="en">A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ConceptMap">
    <xs:annotation>
      <xs:documentation xml:lang="en">A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</xs:documentation>
      <xs:documentation 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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published. The URL SHOULD include the major version of the concept map. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the concept map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the concept map. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the concept map.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this concept map. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this concept map is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the concept map was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the concept map.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the concept map from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate concept map instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the concept map is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this concept map is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the concept map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the concept map.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The source value set that specifies the concepts that are being mapped.</xs:documentation>
            </xs:annotation>
            <xs:element name="sourceUri" type="uri" />
            <xs:element name="sourceReference" type="Reference" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.</xs:documentation>
            </xs:annotation>
            <xs:element name="targetUri" type="uri" />
            <xs:element name="targetReference" type="Reference" />
          </xs:choice>
          <xs:element name="group" type="ConceptMap.Group" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A group of mappings that all have the same source and target system.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ConceptMap.Group">
    <xs:annotation>
      <xs:documentation xml:lang="en">A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sourceVersion" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specific version of the code system, as determined by the code system authority.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="targetVersion" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specific version of the code system, as determined by the code system authority.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="element" type="ConceptMap.Element" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Mappings for an individual concept in the source to one or more concepts in the target.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="unmapped" type="ConceptMap.Unmapped" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">What to do when there is no match in the mappings in the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ConceptMap.Element">
    <xs:annotation>
      <xs:documentation xml:lang="en">A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identity (code or path) or the element/item being mapped.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" type="ConceptMap.Target" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A concept from the target value set that this concept maps to.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ConceptMap.Target">
    <xs:annotation>
      <xs:documentation xml:lang="en">A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identity (code or path) or the element/item that the map refers to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="equivalence" minOccurs="0" maxOccurs="1" type="ConceptMapEquivalence">
            <xs:annotation>
              <xs:documentation xml:lang="en">The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of status/issues in mapping that conveys additional information not represented in  the structured data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dependsOn" type="ConceptMap.DependsOn" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="product" type="ConceptMap.DependsOn" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ConceptMap.DependsOn">
    <xs:annotation>
      <xs:documentation xml:lang="en">A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="property" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to an element that holds a coded value that corresponds to a code system property. The idea is that the information model carries an element somwhere that is labeled to correspond with a code system property.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identity (code or path) or the element/item/ValueSet that the map depends on / refers to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ConceptMap.Unmapped">
    <xs:annotation>
      <xs:documentation xml:lang="en">A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="ConceptMapGroupUnmappedMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines which action to take if there is no match in the group. One of 3 actions is possible: use the unmapped code (this is useful when doing a mapping between versions, and only a few codes have changed), use a fixed code (a default code), or alternatively, a reference to a different concept map can be provided (by canonical URL).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The fixed code to use when the mode = 'fixed'  - all unmapped codes are mapped to a single fixed code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The canonical URL of the map to use if this map contains no mapping.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConceptMapGroupUnmappedMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="provided">
        <xs:annotation>
          <xs:documentation xml:lang="en">Provided Code</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fixed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fixed Code</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other-map">
        <xs:annotation>
          <xs:documentation xml:lang="en">Other Map</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConceptMapGroupUnmappedMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines which action to take if there is no match in the group.</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="ConceptMapGroupUnmappedMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Condition" type="Condition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Condition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</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">This records identifiers associated with this condition that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="clinicalStatus" minOccurs="0" maxOccurs="1" type="ConditionClinicalStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The clinical status of the condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="verificationStatus" minOccurs="0" maxOccurs="1" type="ConditionVerificationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The verification status to support the clinical status of the condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A category assigned to the condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="severity" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A subjective assessment of the severity of the condition as evaluated by the clinician.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identification of the condition, problem or diagnosis.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The anatomical location where this condition manifests itself.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the patient or group who the condition record is associated with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Encounter during which the condition was first asserted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Estimated or actual date or date-time  the condition began, in the opinion of the clinician.</xs:documentation>
            </xs:annotation>
            <xs:element name="onsetDateTime" type="dateTime" />
            <xs:element name="onsetAge" type="Age" />
            <xs:element name="onsetPeriod" type="Period" />
            <xs:element name="onsetRange" type="Range" />
            <xs:element name="onsetString" type="string" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate.</xs:documentation>
            </xs:annotation>
            <xs:element name="abatementDateTime" type="dateTime" />
            <xs:element name="abatementAge" type="Age" />
            <xs:element name="abatementBoolean" type="boolean" />
            <xs:element name="abatementPeriod" type="Period" />
            <xs:element name="abatementRange" type="Range" />
            <xs:element name="abatementString" type="string" />
          </xs:choice>
          <xs:element name="assertedDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the existance of the Condition was first asserted or acknowledged.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="asserter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Individual who is making the condition statement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="stage" type="Condition.Stage" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Clinical stage or grade of a condition. May include formal severity assessments.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="evidence" type="Condition.Evidence" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information about the Condition. This is a general notes/comments entry  for description of the Condition, its diagnosis and prognosis.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.Stage">
    <xs:annotation>
      <xs:documentation xml:lang="en">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="summary" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assessment" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to a formal record of the evidence on which the staging assessment is based.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Condition.Evidence">
    <xs:annotation>
      <xs:documentation xml:lang="en">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A manifestation or symptom that led to the recording of this condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Links to other relevant information, including pathology reports.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConditionVerificationStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="provisional">
        <xs:annotation>
          <xs:documentation xml:lang="en">Provisional</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="differential">
        <xs:annotation>
          <xs:documentation xml:lang="en">Differential</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="confirmed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Confirmed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refuted">
        <xs:annotation>
          <xs:documentation xml:lang="en">Refuted</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:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConditionVerificationStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The verification status to support or decline the clinical status of the condition or diagnosis.</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="ConditionVerificationStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConditionClinicalStatusCodes-list">
    <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="recurrence">
        <xs:annotation>
          <xs:documentation xml:lang="en">Recurrence</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="remission">
        <xs:annotation>
          <xs:documentation xml:lang="en">Remission</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="resolved">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resolved</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConditionClinicalStatusCodes">
    <xs:annotation>
      <xs:documentation xml:lang="en">The clinical status of the condition or diagnosis.</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="ConditionClinicalStatusCodes-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Consent" type="Consent">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Consent">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique identifier for this copy of the Consent Statement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ConsentState">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the current state of this consent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient/healthcare consumer to whom this consent applies.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Relevant time or time-period when this Consent is applicable.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dateTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When this  Consent was issued / created / indexed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="consentingParty" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is the entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actor" type="Consent.Actor" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who or what is controlled by this consent. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Actions controlled by this consent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization that manages the consent, and the framework within which it is executed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The source on which this consent statement is based. The source might be a scanned original paper form, or a reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.</xs:documentation>
            </xs:annotation>
            <xs:element name="sourceAttachment" type="Attachment" />
            <xs:element name="sourceIdentifier" type="Identifier" />
            <xs:element name="sourceReference" type="Reference" />
          </xs:choice>
          <xs:element name="policy" type="Consent.Policy" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="policyRule" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A referece to the specific computable policy.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="securityLabel" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of security labels that define which resources are controlled by this consent. If more than one label is specified, all resources must have all the specified labels.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The context of the activities a user is taking - why the user is accessing the data - that are controlled by this consent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dataPeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Clinical or Operational Relevant period of time that bounds the data controlled by this consent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="data" type="Consent.Data" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resources controlled by this consent, if specific resources are referenced.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="except" type="Consent.Except" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.Actor">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the individual is involved in the resources content that is described in the consent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resource that identifies the actor. To identify a actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers').</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.Policy">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="authority" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="uri" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.Data">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="meaning" minOccurs="1" maxOccurs="1" type="ConsentDataMeaning">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the resource reference is interpreted when testing consent restrictions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a specific resource that defines which resources are covered by this consent.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.Except">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="ConsentExceptType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action  to take - permit or deny - when the exception conditions are met.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The timeframe in this exception is valid.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actor" type="Consent.Actor1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who or what is controlled by this Exception. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Actions controlled by this Exception.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="securityLabel" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of security labels that define which resources are controlled by this exception. If more than one label is specified, all resources must have all the specified labels.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The context of the activities a user is taking - why the user is accessing the data - that are controlled by this exception.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="class" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The class of information covered by this exception. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this code is found in an instance, then the exception applies.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dataPeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Clinical or Operational Relevant period of time that bounds the data controlled by this exception.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="data" type="Consent.Data1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resources controlled by this exception, if specific resources are referenced.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.Actor1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the individual is involved in the resources content that is described in the exception.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resource that identifies the actor. To identify a actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers').</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Consent.Data1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="meaning" minOccurs="1" maxOccurs="1" type="ConsentDataMeaning">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the resource reference is interpreted when testing consent restrictions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a specific resource that defines which resources are covered by this consent.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConsentDataMeaning-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="instance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Instance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="related">
        <xs:annotation>
          <xs:documentation xml:lang="en">Related</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dependents">
        <xs:annotation>
          <xs:documentation xml:lang="en">Dependents</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="authoredby">
        <xs:annotation>
          <xs:documentation xml:lang="en">AuthoredBy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConsentDataMeaning">
    <xs:annotation>
      <xs:documentation xml:lang="en">How a resource reference is interpreted when testing consent restrictions</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="ConsentDataMeaning-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConsentState-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pending</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Proposed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation xml:lang="en">Rejected</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</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="ConsentState">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates the state of the consent</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="ConsentState-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ConsentExceptType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="deny">
        <xs:annotation>
          <xs:documentation xml:lang="en">Opt Out</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="permit">
        <xs:annotation>
          <xs:documentation xml:lang="en">Opt In</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConsentExceptType">
    <xs:annotation>
      <xs:documentation xml:lang="en">How an exception statement is applied, such as adding additional consent or removing consent</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="ConsentExceptType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Contract" type="Contract">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Contract">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique identifier for this Contract.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="ContractResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="issued" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When this  Contract was issued.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="applies" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Relevant time or time-period when this Contract is applicable.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The target entity impacted by or of interest to parties to the agreement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="topic" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The matter of concern in the context of this agreement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="authority" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="domain" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">More specific type or specialization of an overarching or more general contract such as auto insurance, home owner  insurance, prenupial agreement, Advanced-Directive, or privacy consent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action stipulated by this Contract.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actionReason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason for action stipulated by this Contract.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="decisionType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of decision made by a grantor with respect to an offer made by a grantee.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contentDerivative" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The minimal content derived from the basal information source at a specific stage in its lifecycle.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="securityLabel" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of security labels that define which resources are controlled by this consent. If more than one label is specified, all resources must have all the specified labels.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="agent" type="Contract.Agent" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="signer" type="Contract.Signer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="valuedItem" type="Contract.ValuedItem" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contract Valued Item List.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="term" type="Contract.Term" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.</xs:documentation>
            </xs:annotation>
            <xs:element name="bindingAttachment" type="Attachment" />
            <xs:element name="bindingReference" type="Reference" />
          </xs:choice>
          <xs:element name="friendly" type="Contract.Friendly" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="legal" type="Contract.Legal" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of Legal expressions or representations of this Contract.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rule" type="Contract.Rule" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of Computable Policy Rule Language Representations of this Contract.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.Agent">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="actor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who or what parties are assigned roles in this Contract.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Role type of agent assigned roles in this Contract.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.Signer">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Role of this Contract signer, e.g. notary, grantee.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="party" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Party which is a signator to this Contract.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="signature" minOccurs="1" maxOccurs="unbounded" type="Signature">
            <xs:annotation>
              <xs:documentation xml:lang="en">Legally binding Contract DSIG signature contents in Base64.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.ValuedItem">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specific type of Contract Valued Item that may be priced.</xs:documentation>
            </xs:annotation>
            <xs:element name="entityCodeableConcept" type="CodeableConcept" />
            <xs:element name="entityReference" type="Reference" />
          </xs:choice>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a Contract Valued Item instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="effectiveTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the time during which this Contract ValuedItem information is effective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">A Contract Valued Item unit valuation measure.</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 the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.Term">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique identifier for this particular Contract Provision.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="issued" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When this Contract Provision was issued.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="applies" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Relevant time or time-period when this Contract Provision is applicable.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="topic" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The matter of concern in the context of this provision of the agrement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action stipulated by this Contract Provision.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actionReason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason or purpose for the action stipulated by this Contract Provision.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="securityLabel" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of security labels that define which terms are controlled by this condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="agent" type="Contract.Agent1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human readable form of this Contract Provision.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="valuedItem" type="Contract.ValuedItem1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contract Provision Valued Item List.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="group" type="Contract.Term" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Nested group of Contract Provisions.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.Agent1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="actor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The agent assigned a role in this Contract Provision.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Role played by the agent assigned this role in the execution of this Contract Provision.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.ValuedItem1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specific type of Contract Provision Valued Item that may be priced.</xs:documentation>
            </xs:annotation>
            <xs:element name="entityCodeableConcept" type="CodeableConcept" />
            <xs:element name="entityReference" type="Reference" />
          </xs:choice>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a Contract Provision Valued Item instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="effectiveTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the time during which this Contract Term ValuedItem information is effective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="unitPrice" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">A Contract Provision Valued Item unit valuation measure.</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 the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="points" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.Friendly">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.</xs:documentation>
            </xs:annotation>
            <xs:element name="contentAttachment" type="Attachment" />
            <xs:element name="contentReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.Legal">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contract legal text in human renderable form.</xs:documentation>
            </xs:annotation>
            <xs:element name="contentAttachment" type="Attachment" />
            <xs:element name="contentReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Contract.Rule">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal agreement between parties regarding the conduct of business, exchange of information or other matters.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).</xs:documentation>
            </xs:annotation>
            <xs:element name="contentAttachment" type="Attachment" />
            <xs:element name="contentReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ContractResourceStatusCodes-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="amended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Amended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="appended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Appended</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="disputed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Disputed</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:enumeration value="executable">
        <xs:annotation>
          <xs:documentation xml:lang="en">Executable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="executed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Executed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="negotiable">
        <xs:annotation>
          <xs:documentation xml:lang="en">Negotiable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="offered">
        <xs:annotation>
          <xs:documentation xml:lang="en">Offered</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="policy">
        <xs:annotation>
          <xs:documentation xml:lang="en">Policy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation xml:lang="en">Rejected</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="renewed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Renewed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="revoked">
        <xs:annotation>
          <xs:documentation xml:lang="en">Revoked</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="resolved">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resolved</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="terminated">
        <xs:annotation>
          <xs:documentation xml:lang="en">Terminated</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ContractResourceStatusCodes">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code specifying the state of the resource instance.</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="ContractResourceStatusCodes-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Coverage" type="Coverage">
    <xs:annotation>
      <xs:documentation xml:lang="en">Financial instrument which may be used to reimburse or pay for health care products and services.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Coverage">
    <xs:annotation>
      <xs:documentation xml:lang="en">Financial instrument which may be used to reimburse or pay for health care products and services.</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">The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Certificate number, Personal Health Number or Case ID. May be constructed as the concatination of the Coverage.SubscriberID and the Coverage.dependant.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</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 of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="policyHolder" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party who 'owns' the insurance policy,  may be an individual, corporation or the subscriber's employer.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subscriber" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subscriberId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The insurer assigned ID for the Subscriber.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="beneficiary" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The party who benefits from the insurance coverage., the patient when services are provided.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The relationship of beneficiary (patient) to the subscriber.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payor" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. May provide multiple identifiers such as insurance company identifier or business identifier (BIN number).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="grouping" type="Coverage.Grouping" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A suite of underwrite specific classifiers, for example may be used to identify a class of coverage or employer group, Policy, Plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dependent" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A unique identifier for a dependent under the coverage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sequence" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">An optional counter for a particular instance of the identified coverage which increments upon each renewal.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="order" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The order of applicability of this coverage relative to other coverages which are currently inforce. Note, there may be gaps in the numbering and this does not imply primary, secondard etc. as the specific positioning of coverages depends upon the episode of care.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="network" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contract" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The policy(s) which constitute this insurance coverage.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Coverage.Grouping">
    <xs:annotation>
      <xs:documentation xml:lang="en">Financial instrument which may be used to reimburse or pay for health care products and services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="group" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify an employer group. May also be referred to as a Policy or Group ID.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="groupDisplay" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description for the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subGroup" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a subset of an employer group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subGroupDisplay" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description for the subgroup.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="plan" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a style or collective of coverage issued by the underwriter, for example may be used to identify a collection of benefits provided to employees. May be referred to as a Section or Division ID.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="planDisplay" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description for the plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subPlan" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a sub-style or sub-collective of coverage issued by the underwriter, for example may be used to identify a subset of a collection of benefits provided to employees.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subPlanDisplay" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description for the subplan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="class" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage such as a level of deductables or co-payment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="classDisplay" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description for the class.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subClass" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a subclass of coverage such as a sub-level of deductables or co-payment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subClassDisplay" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description for the subclass.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DataElement" type="DataElement">
    <xs:annotation>
      <xs:documentation xml:lang="en">The formal description of a single piece of information that can be gathered and reported.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DataElement">
    <xs:annotation>
      <xs:documentation xml:lang="en">The formal description of a single piece of information that can be gathered and reported.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. The URL SHOULD include the major version of the data element. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the data element when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the data element author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this data element. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this data element is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the data element was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the data element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the data element. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the data element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate data element instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the data element is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the data element and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the data element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="stringency" minOccurs="0" maxOccurs="1" type="DataElementStringency">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies how precise the data element is in its definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mapping" type="DataElement.Mapping" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="element" minOccurs="1" maxOccurs="unbounded" type="ElementDefinition">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines the structure, type, allowed values and other constraining characteristics of the data element.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DataElement.Mapping">
    <xs:annotation>
      <xs:documentation xml:lang="en">The formal description of a single piece of information that can be gathered and reported.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identity" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="uri" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that identifies the specification that this mapping is expressed to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name for the specification that is being mapped to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DataElementStringency-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="comparable">
        <xs:annotation>
          <xs:documentation xml:lang="en">Comparable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fully-specified">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fully Specified</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="equivalent">
        <xs:annotation>
          <xs:documentation xml:lang="en">Equivalent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="convertable">
        <xs:annotation>
          <xs:documentation xml:lang="en">Convertable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="scaleable">
        <xs:annotation>
          <xs:documentation xml:lang="en">Scaleable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="flexible">
        <xs:annotation>
          <xs:documentation xml:lang="en">Flexible</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DataElementStringency">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates the degree of precision of the data element definition.</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="DataElementStringency-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DetectedIssue" type="DetectedIssue">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DetectedIssue">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>
      <xs:documentation 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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Business identifier associated with the detected issue record.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ObservationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the status of the detected issue.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the general type of issue identified.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="severity" minOccurs="0" maxOccurs="1" type="DetectedIssueSeverity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the patient whose record the detected issue is associated with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date or date-time when the detected issue was initially identified.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Individual or device responsible for the issue being raised.  For example, a decision support application or a pharmacist conducting a medication review.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="implicated" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the resource representing the current activity or proposed activity that is potentially problematic.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A textual explanation of the detected issue.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mitigation" type="DetectedIssue.Mitigation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting.  Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DetectedIssue.Mitigation">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="action" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates when the mitigating action was documented.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ObservationStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="registered">
        <xs:annotation>
          <xs:documentation xml:lang="en">Registered</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="preliminary">
        <xs:annotation>
          <xs:documentation xml:lang="en">Preliminary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="final">
        <xs:annotation>
          <xs:documentation xml:lang="en">Final</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="amended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Amended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="corrected">
        <xs:annotation>
          <xs:documentation xml:lang="en">Corrected</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="entered-in-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Entered in Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ObservationStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates the status of the identified issue</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="ObservationStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DetectedIssueSeverity-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="high">
        <xs:annotation>
          <xs:documentation xml:lang="en">High</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="moderate">
        <xs:annotation>
          <xs:documentation xml:lang="en">Moderate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="low">
        <xs:annotation>
          <xs:documentation xml:lang="en">Low</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DetectedIssueSeverity">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates the potential degree of impact of the identified issue on the patient.</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="DetectedIssueSeverity-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Device" type="Device">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.  Medical devices include durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.  Non-medical devices may include items such as a machine, cellphone, computer, application, etc.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Device">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.  Medical devices include durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.  Non-medical devices may include items such as a machine, cellphone, computer, application, etc.</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">Unique instance identifiers assigned to a device by manufacturers other organizations or owners.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="udi" type="Device.Udi" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">[Unique device identifier (UDI)](device.html#5.11.3.2.2) assigned to device label or package.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FHIRDeviceStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Status of the Device availability.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code or identifier to identify a kind of device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lotNumber" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Lot number assigned by the manufacturer.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="manufacturer" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name of the manufacturer.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="manufactureDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and time when the device was manufactured.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expirationDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and time beyond which this device is no longer valid or should not be used (if applicable).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="model" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Patient information, If the device is affixed to a person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="owner" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">An organization that is responsible for the provision and ongoing maintenance of the device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details for an organization or a particular human that is responsible for the device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The place where the device can be found.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A network address on which the device may be contacted directly.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive information, usage information or implantation information that is not captured in an existing element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="safety" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides additional safety characteristics about a medical device.  For example devices containing latex.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Device.Udi">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.  Medical devices include durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.  Non-medical devices may include items such as a machine, cellphone, computer, application, etc.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="deviceIdentifier" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name of device as used in labeling or catalog.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identity of the authoritative source for UDI generation within a  jurisdiction.  All UDIs are globally unique within a single namespace. with the appropriate repository uri as the system.  For example,  UDIs of devices managed in the U.S. by the FDA, the value is  http://hl7.org/fhir/NamingSystem/fda-udi.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="carrierHRF" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="carrierAIDC" minOccurs="0" maxOccurs="1" type="base64Binary">
            <xs:annotation>
              <xs:documentation xml:lang="en">The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - E.g a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="issuer" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
1) GS1: 
http://hl7.org/fhir/NamingSystem/gs1-di, 
2) HIBCC:
http://hl7.org/fhir/NamingSystem/hibcc-dI, 
3) ICCBBA for blood containers:
http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
4) ICCBA for other devices:
http://hl7.org/fhir/NamingSystem/iccbba-other-di.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="entryType" minOccurs="0" maxOccurs="1" type="UDIEntryType">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded entry to indicate how the data was entered.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="FHIRDeviceStatus-list">
    <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="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</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:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="FHIRDeviceStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The availability status of the device.</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="FHIRDeviceStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="UDIEntryType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="barcode">
        <xs:annotation>
          <xs:documentation xml:lang="en">BarCode</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rfid">
        <xs:annotation>
          <xs:documentation xml:lang="en">RFID</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="manual">
        <xs:annotation>
          <xs:documentation xml:lang="en">Manual</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="card">
        <xs:annotation>
          <xs:documentation xml:lang="en">Card</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="self-reported">
        <xs:annotation>
          <xs:documentation xml:lang="en">Self Reported</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="UDIEntryType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Codes to identify how UDI data was entered</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="UDIEntryType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DeviceComponent" type="DeviceComponent">
    <xs:annotation>
      <xs:documentation xml:lang="en">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DeviceComponent">
    <xs:annotation>
      <xs:documentation xml:lang="en">The characteristics, operational status and capabilities of a medical-related component of a medical device.</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="1" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The locally assigned unique identification by the software. For example: handle ID.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The component type as defined in the object-oriented or metric nomenclature partition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastSystemChange" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">The timestamp for the most recent system change which includes device configuration or setting change.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The link to the source Device that contains administrative device information such as manufacture, serial number, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parent" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The link to the parent resource. For example: Channel is linked to its VMD parent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="operationalStatus" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The current operational status of the device. For example: On, Off, Standby, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parameterGroup" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="measurementPrinciple" minOccurs="0" maxOccurs="1" type="MeasmntPrinciple">
            <xs:annotation>
              <xs:documentation xml:lang="en">The physical principle of the measurement. For example: thermal, chemical, acoustical, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="productionSpecification" type="DeviceComponent.ProductionSpecification" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The production specification such as component revision, serial number, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="languageCode" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DeviceComponent.ProductionSpecification">
    <xs:annotation>
      <xs:documentation xml:lang="en">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="specType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specification type, such as, serial number, part number, hardware revision, software revision, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="componentId" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacturer can make use of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="productionSpec" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The printable string defining the component.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MeasmntPrinciple-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Other</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="chemical">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Chemical</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="electrical">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Electrical</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="impedance">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Impedance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="nuclear">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Nuclear</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="optical">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Optical</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="thermal">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Thermal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="biological">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Biological</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="mechanical">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Mechanical</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="acoustical">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Acoustical</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="manual">
        <xs:annotation>
          <xs:documentation xml:lang="en">MSP Manual</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MeasmntPrinciple">
    <xs:annotation>
      <xs:documentation xml:lang="en">Different measurement principle supported by the device.</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="MeasmntPrinciple-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DeviceMetric" type="DeviceMetric">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DeviceMetric">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes a measurement, calculation or setting capability of a medical device.</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="1" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID.  It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="unit" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the link to the  Device that this DeviceMetric belongs to and that contains administrative device information such as manufacturer, serial number, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parent" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the link to the  DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="operationalStatus" minOccurs="0" maxOccurs="1" type="DeviceMetricOperationalStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates current operational state of the device. For example: On, Off, Standby, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="color" minOccurs="0" maxOccurs="1" type="DeviceMetricColor">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="1" maxOccurs="1" type="DeviceMetricCategory">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="measurementPeriod" minOccurs="0" maxOccurs="1" type="Timing">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="calibration" type="DeviceMetric.Calibration" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the calibrations that have been performed or that are required to be performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DeviceMetric.Calibration">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="DeviceMetricCalibrationType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the type of the calibration method.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="state" minOccurs="0" maxOccurs="1" type="DeviceMetricCalibrationState">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the state of the calibration.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="time" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the time last calibration has been performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceMetricCalibrationType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="unspecified">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unspecified</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="offset">
        <xs:annotation>
          <xs:documentation xml:lang="en">Offset</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="gain">
        <xs:annotation>
          <xs:documentation xml:lang="en">Gain</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="two-point">
        <xs:annotation>
          <xs:documentation xml:lang="en">Two Point</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceMetricCalibrationType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the type of a metric calibration.</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="DeviceMetricCalibrationType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceMetricColor-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="black">
        <xs:annotation>
          <xs:documentation xml:lang="en">Color Black</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="red">
        <xs:annotation>
          <xs:documentation xml:lang="en">Color Red</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="green">
        <xs:annotation>
          <xs:documentation xml:lang="en">Color Green</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="yellow">
        <xs:annotation>
          <xs:documentation xml:lang="en">Color Yellow</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="blue">
        <xs:annotation>
          <xs:documentation xml:lang="en">Color Blue</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="magenta">
        <xs:annotation>
          <xs:documentation xml:lang="en">Color Magenta</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cyan">
        <xs:annotation>
          <xs:documentation xml:lang="en">Color Cyan</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="white">
        <xs:annotation>
          <xs:documentation xml:lang="en">Color White</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceMetricColor">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the typical color of representation.</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="DeviceMetricColor-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceMetricCalibrationState-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="not-calibrated">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not Calibrated</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="calibration-required">
        <xs:annotation>
          <xs:documentation xml:lang="en">Calibration Required</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="calibrated">
        <xs:annotation>
          <xs:documentation xml:lang="en">Calibrated</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unspecified">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unspecified</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceMetricCalibrationState">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the state of a metric calibration.</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="DeviceMetricCalibrationState-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceMetricOperationalStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="on">
        <xs:annotation>
          <xs:documentation xml:lang="en">On</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="off">
        <xs:annotation>
          <xs:documentation xml:lang="en">Off</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="standby">
        <xs:annotation>
          <xs:documentation xml:lang="en">Standby</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="DeviceMetricOperationalStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the operational status of the DeviceMetric.</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="DeviceMetricOperationalStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceMetricCategory-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="measurement">
        <xs:annotation>
          <xs:documentation xml:lang="en">Measurement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="setting">
        <xs:annotation>
          <xs:documentation xml:lang="en">Setting</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="calculation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Calculation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unspecified">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unspecified</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceMetricCategory">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the category of the metric.</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="DeviceMetricCategory-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DeviceRequest" type="DeviceRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DeviceRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.</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">Identifiers assigned to this order by the orderer or by the receiver.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Protocol or definition followed by this request. For example: The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Plan/proposal/order fulfilled by this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priorRequest" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The request takes the place of the referenced completed or terminated request(s).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="groupIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Composite request this is part of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="RequestStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="intent" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the request is a proposal, plan, an original order or a reflex order.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="RequestPriority">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how quickly the {{title}} should be addressed with respect to other requests.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The details of the device to be used.</xs:documentation>
            </xs:annotation>
            <xs:element name="codeReference" type="Reference" />
            <xs:element name="codeCodeableConcept" type="CodeableConcept" />
          </xs:choice>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient who will use the device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">An encounter that provides additional context in which this request is made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime" />
            <xs:element name="occurrencePeriod" type="Period" />
            <xs:element name="occurrenceTiming" type="Timing" />
          </xs:choice>
          <xs:element name="authoredOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the request transitioned to being actionable.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requester" type="DeviceRequest.Requester" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual who initiated the request and has responsibility for its activation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performerType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Desired type of performer for doing the diagnostic testing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The desired perfomer for doing the diagnostic testing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason or justification for the use of this device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason or justification for the use of this device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingInfo" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional clinical information about the patient that may influence the request fulfilment.  For example, this may includes body where on the subject's the device will be used ( i.e. the target site).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relevantHistory" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Key events in the history of the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DeviceRequest.Requester">
    <xs:annotation>
      <xs:documentation xml:lang="en">Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="agent" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner, etc. who initiated the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization the device or practitioner was acting on behalf of.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DeviceUseStatement" type="DeviceUseStatement">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DeviceUseStatement">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>
      <xs:documentation 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">An external identifier for this statement such as an IRI.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="DeviceUseStatementStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient who used the device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="whenUsed" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time period over which the device was used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">How often the device was used.</xs:documentation>
            </xs:annotation>
            <xs:element name="timingTiming" type="Timing" />
            <xs:element name="timingPeriod" type="Period" />
            <xs:element name="timingDateTime" type="dateTime" />
          </xs:choice>
          <xs:element name="recordedOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time at which the statement was made/recorded.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who reported the device was being used by the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="device" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The details of the device used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="indication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason or justification for the use of the device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the site on the subject's body where the device was used ( i.e. the target site).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceUseStatementStatus-list">
    <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="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="intended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Intended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stopped</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Hold</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceUseStatementStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A coded concept indicating the current status of a the Device Usage</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="DeviceUseStatementStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DiagnosticReport" type="DiagnosticReport">
    <xs:annotation>
      <xs:documentation xml:lang="en">The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DiagnosticReport">
    <xs:annotation>
      <xs:documentation xml:lang="en">The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.</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">Identifiers assigned to this report by the performer or other systems.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details concerning a test or procedure requested.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="DiagnosticReportStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the diagnostic report as a whole.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code or name that describes this diagnostic report.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport per is about.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.</xs:documentation>
            </xs:annotation>
            <xs:element name="effectiveDateTime" type="dateTime" />
            <xs:element name="effectivePeriod" type="Period" />
          </xs:choice>
          <xs:element name="issued" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and time that this version of the report was released from the source diagnostic service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" type="DiagnosticReport.Performer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates who or what participated in producing the report.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specimen" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details about the specimens on which this diagnostic report is based.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="result" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="imagingStudy" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="image" type="DiagnosticReport.Image" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="conclusion" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Concise and clinically contextualized impression / summary of the diagnostic report.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="codedDiagnosis" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Codes for the conclusion.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="presentedForm" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DiagnosticReport.Performer">
    <xs:annotation>
      <xs:documentation xml:lang="en">The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the type of participation (e.g.  a responsible party, author, or verifier).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reference to the  practitioner or organization involved in producing the report. For example, the diagnostic service that is responsible for issuing the report.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DiagnosticReport.Image">
    <xs:annotation>
      <xs:documentation xml:lang="en">The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="link" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the image source.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DiagnosticReportStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="registered">
        <xs:annotation>
          <xs:documentation xml:lang="en">Registered</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="partial">
        <xs:annotation>
          <xs:documentation xml:lang="en">Partial</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="preliminary">
        <xs:annotation>
          <xs:documentation xml:lang="en">Preliminary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="final">
        <xs:annotation>
          <xs:documentation xml:lang="en">Final</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="amended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Amended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="corrected">
        <xs:annotation>
          <xs:documentation xml:lang="en">Corrected</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="appended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Appended</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="entered-in-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Entered in Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DiagnosticReportStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The status of the diagnostic report as a whole.</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="DiagnosticReportStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DocumentManifest" type="DocumentManifest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A collection of documents compiled for a purpose together with metadata that applies to the collection.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DocumentManifest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A collection of documents compiled for a purpose together with metadata that applies to the collection.</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="masterIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Other identifiers associated with the document manifest, including version independent  identifiers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="DocumentReferenceStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this document manifest.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated, etc.).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies who is responsible for creating the manifest, and adding  documents to it.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recipient" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A patient, practitioner, or organization for which this set of documents is intended.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the source system, application, or software that produced the document manifest.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human-readable description of the source document. This is sometimes known as the "title".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="content" type="DocumentManifest.Content" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The list of Documents included in the manifest.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="related" type="DocumentManifest.Related" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related identifiers or resources associated with the DocumentManifest.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DocumentManifest.Content">
    <xs:annotation>
      <xs:documentation xml:lang="en">A collection of documents compiled for a purpose together with metadata that applies to the collection.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.</xs:documentation>
            </xs:annotation>
            <xs:element name="pAttachment" type="Attachment" />
            <xs:element name="pReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DocumentManifest.Related">
    <xs:annotation>
      <xs:documentation xml:lang="en">A collection of documents compiled for a purpose together with metadata that applies to the collection.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related identifier to this DocumentManifest.  For example, Order numbers, accession numbers, XDW workflow numbers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ref" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related Resource to this DocumentManifest. For example, Order, ProcedureRequest,  Procedure, EligibilityRequest, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="DocumentReference" type="DocumentReference">
    <xs:annotation>
      <xs:documentation xml:lang="en">A reference to a document.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DocumentReference">
    <xs:annotation>
      <xs:documentation xml:lang="en">A reference to a document.</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="masterIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Other identifiers associated with the document, including version independent identifiers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="DocumentReferenceStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this document reference.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="docStatus" minOccurs="0" maxOccurs="1" type="CompositionStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the underlying document.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="class" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the document was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="indexed" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the document reference was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies who is responsible for adding the information to the document.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="authenticator" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Which person or organization authenticates that this document is valid.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="custodian" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relatesTo" type="DocumentReference.RelatesTo" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Relationships that this document has with other document references that already exist.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human-readable description of the source document. This is sometimes known as the "title".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="securityLabel" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="content" type="DocumentReference.Content" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The document and format referenced. There may be multiple content element repetitions, each with a different format.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" type="DocumentReference.Context" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The clinical context in which the document was prepared.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DocumentReference.RelatesTo">
    <xs:annotation>
      <xs:documentation xml:lang="en">A reference to a document.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="DocumentRelationshipType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of relationship that this document has with anther document.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The target document of this relationship.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DocumentReference.Content">
    <xs:annotation>
      <xs:documentation xml:lang="en">A reference to a document.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="attachment" minOccurs="1" maxOccurs="1" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">The document or URL of the document along with critical metadata to prove content has integrity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="format" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DocumentReference.Context">
    <xs:annotation>
      <xs:documentation xml:lang="en">A reference to a document.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the clinical encounter or type of care that the document content is associated with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="event" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time period over which the service that is described by the document was provided.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="facilityType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of facility where the patient was seen.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="practiceSetting" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sourcePatientInfo" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Patient Information as known when the document was published. May be a reference to a version specific, or contained.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="related" type="DocumentReference.Related" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related identifiers or resources associated with the DocumentReference.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DocumentReference.Related">
    <xs:annotation>
      <xs:documentation xml:lang="en">A reference to a document.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ref" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="EligibilityRequest" type="EligibilityRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">The EligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an EligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="EligibilityRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">The EligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an EligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</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">The Response business identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Immediate (STAT), best effort (NORMAL), deferred (DEFER).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Patient Resource.</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 enclosed suite of services were performed or completed.</xs:documentation>
            </xs:annotation>
            <xs:element name="servicedDate" type="date" />
            <xs:element name="servicedPeriod" type="Period" />
          </xs:choice>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when 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">Person who created the invoice/claim/pre-determination or pre-authorization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="insurer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Insurer who is target  of the request.</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="coverage" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Financial instrument by which payment information for health care.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="businessArrangement" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The contract number of a business agreement which describes the terms and conditions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="benefitCategory" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Dental, Vision, Medical, Pharmacy, Rehab etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="benefitSubCategory" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="EligibilityResponse" type="EligibilityResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides eligibility and plan details from the processing of an Eligibility resource.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="EligibilityResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides eligibility and plan details from the processing of an Eligibility resource.</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">The Response business identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when the enclosed suite of services were performed or completed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Original request resource reference.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Transaction status: error, complete.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the status of the adjudication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="insurer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Insurer who produced this adjudicated response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="inforce" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Flag indicating if the coverage provided is inforce currently  if no service date(s) specified or for the whole duration of the service dates.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="insurance" type="EligibilityResponse.Insurance" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The form to be used for printing the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="error" type="EligibilityResponse.Error" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Mutually exclusive with Services Provided (Item).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="EligibilityResponse.Insurance">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides eligibility and plan details from the processing of an Eligibility resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="coverage" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A suite of updated or additional Coverages from the Insurer.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contract" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The contract resource which may provide more detailed information.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="benefitBalance" type="EligibilityResponse.BenefitBalance" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Benefits and optionally current balances by Category.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="EligibilityResponse.BenefitBalance">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides eligibility and plan details from the processing of an Eligibility resource.</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">Dental, Vision, Medical, Pharmacy, Rehab etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subCategory" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.</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 indicated the 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, for example MED01, or DENT2.</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, for example 'DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services'.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="network" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Network designation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="unit" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unit designation: individual or 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 vistis'.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="financial" type="EligibilityResponse.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="EligibilityResponse.Financial">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides eligibility and plan details from the processing of an Eligibility resource.</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">Deductable, visits, benefit amount.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Benefits allowed.</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">Benefits used.</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:complexType name="EligibilityResponse.Error">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides eligibility and plan details from the processing of an Eligibility resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">An error code,from a specified code system, which details why the eligibility check could not be performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Encounter" type="Encounter">
    <xs:annotation>
      <xs:documentation xml:lang="en">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Encounter">
    <xs:annotation>
      <xs:documentation xml:lang="en">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
      <xs:documentation 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">Identifier(s) by which this encounter is known.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EncounterStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">planned | arrived | triaged | in-progress | onleave | finished | cancelled +.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="statusHistory" type="Encounter.StatusHistory" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="class" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">inpatient | outpatient | ambulatory | emergency +.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="classHistory" type="Encounter.ClassHistory" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The class history permits the tracking of the encounters transitions without needing to go  through the resource history.

This would be used for a case where an admission starts of as an emergency encounter, then transisions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kindof discharge from emergency to inpatient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the urgency of the encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient ro group present at the encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="episodeOfCare" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem.  The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="incomingReferral" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The referral request this encounter satisfies (incoming referral).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="Encounter.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The list of people responsible for providing the service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="appointment" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The appointment that scheduled this encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The start and end time of the encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="length" minOccurs="0" maxOccurs="1" type="Duration">
            <xs:annotation>
              <xs:documentation xml:lang="en">Quantity of time the encounter lasted. This excludes the time during leaves of absence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="Encounter.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The list of diagnosis relevant to this encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="account" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The set of accounts that may be used for billing for this Encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="hospitalization" type="Encounter.Hospitalization" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details about the admission to a healthcare service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" type="Encounter.Location" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of locations where  the patient has been during this encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="serviceProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Another Encounter of which this encounter is a part of (administratively or in time).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Encounter.StatusHistory">
    <xs:annotation>
      <xs:documentation xml:lang="en">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EncounterStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">planned | arrived | triaged | in-progress | onleave | finished | cancelled +.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="1" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time that the episode was in the specified status.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Encounter.ClassHistory">
    <xs:annotation>
      <xs:documentation xml:lang="en">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="class" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">inpatient | outpatient | ambulatory | emergency +.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="1" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time that the episode was in the specified class.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Encounter.Participant">
    <xs:annotation>
      <xs:documentation xml:lang="en">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Role of participant in encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="individual" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Persons involved in the encounter other than the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Encounter.Diagnosis">
    <xs:annotation>
      <xs:documentation xml:lang="en">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="condition" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rank" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Ranking of the diagnosis (for each role type).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Encounter.Hospitalization">
    <xs:annotation>
      <xs:documentation xml:lang="en">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="preAdmissionIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Pre-admission identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="origin" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The location from which the patient came before admission.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="admitSource" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">From where patient was admitted (physician referral, transfer).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reAdmission" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this hospitalization is a readmission and why if known.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dietPreference" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Diet preferences reported by the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specialCourtesy" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Special courtesies (VIP, board member).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specialArrangement" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Any special requests that have been made for this hospitalization encounter, such as the provision of specific equipment or other things.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="destination" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Location to which the patient is discharged.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dischargeDisposition" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Category or kind of location after discharge.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Encounter.Location">
    <xs:annotation>
      <xs:documentation xml:lang="en">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="location" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The location where the encounter takes place.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="EncounterLocationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Time period during which the patient was present at the location.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EncounterLocationStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation xml:lang="en">Planned</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="reserved">
        <xs:annotation>
          <xs:documentation xml:lang="en">Reserved</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EncounterLocationStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The status of the location.</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="EncounterLocationStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EncounterStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation xml:lang="en">Planned</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="arrived">
        <xs:annotation>
          <xs:documentation xml:lang="en">Arrived</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="triaged">
        <xs:annotation>
          <xs:documentation xml:lang="en">Triaged</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="onleave">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Leave</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="finished">
        <xs:annotation>
          <xs:documentation xml:lang="en">Finished</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="entered-in-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Entered in Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EncounterStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Current state of the encounter</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="EncounterStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Endpoint" type="Endpoint">
    <xs:annotation>
      <xs:documentation xml:lang="en">The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Endpoint">
    <xs:annotation>
      <xs:documentation xml:lang="en">The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information.</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">Identifier for the organization that is used to identify the endpoint across multiple disparate systems.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EndpointStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">active | suspended | error | off | test.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="connectionType" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded value that represents the technical details of the usage of this endpoint, such as what WSDLs should be used in what way. (e.g. XDS.b/DICOM/cds-hook).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A friendly name that this endpoint can be referred to with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization that manages this endpoint (even if technically another organisation is hosting this in the cloud, it is the organisation associated with the data).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The interval during which the endpoint is expected to be operational.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payloadType" minOccurs="1" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The payload type describes the acceptable content that can be communicated on the endpoint.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payloadMimeType" minOccurs="0" maxOccurs="unbounded" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The uri that describes the actual end-point to connect to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="header" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional headers / information to send as part of the notification.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EndpointStatus-list">
    <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="suspended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Suspended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="off">
        <xs:annotation>
          <xs:documentation xml:lang="en">Off</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:enumeration value="test">
        <xs:annotation>
          <xs:documentation xml:lang="en">Test</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="EndpointStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The status of the endpoint</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="EndpointStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="EnrollmentRequest" type="EnrollmentRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the insurance enrollment details to the insurer regarding a specified coverage.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="EnrollmentRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the insurance enrollment details to the insurer regarding a specified coverage.</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">The Response business identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when this resource was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="insurer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Insurer who is target  of the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Patient Resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="coverage" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the program or plan identification, underwriter or payor.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="EnrollmentResponse" type="EnrollmentResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides enrollment and plan details from the processing of an Enrollment resource.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="EnrollmentResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides enrollment and plan details from the processing of an Enrollment resource.</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">The Response business identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Original request resource reference.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Processing status: error, complete.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the status of the adjudication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when the enclosed suite of services were performed or completed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Insurer who produced this adjudicated response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="EpisodeOfCare" type="EpisodeOfCare">
    <xs:annotation>
      <xs:documentation xml:lang="en">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="EpisodeOfCare">
    <xs:annotation>
      <xs:documentation xml:lang="en">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>
      <xs:documentation 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">The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EpisodeOfCareStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">planned | waitlist | active | onhold | finished | cancelled.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="statusHistory" type="EpisodeOfCare.StatusHistory" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="EpisodeOfCare.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The list of diagnosis relevant to this episode of care.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient who is the focus of this episode of care.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization that has assumed the specific responsibilities for the specified duration.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The interval during which the managing organization assumes the defined responsibility.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referralRequest" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="careManager" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner that is the care manager/care co-ordinator for this patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="team" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The list of practitioners that may be facilitating this episode of care for specific purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="account" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The set of accounts that may be used for billing for this EpisodeOfCare.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="EpisodeOfCare.StatusHistory">
    <xs:annotation>
      <xs:documentation xml:lang="en">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EpisodeOfCareStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">planned | waitlist | active | onhold | finished | cancelled.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="1" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during this EpisodeOfCare that the specific status applied.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="EpisodeOfCare.Diagnosis">
    <xs:annotation>
      <xs:documentation xml:lang="en">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="condition" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rank" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Ranking of the diagnosis (for each role type).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="EpisodeOfCareStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation xml:lang="en">Planned</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="waitlist">
        <xs:annotation>
          <xs:documentation xml:lang="en">Waitlist</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="onhold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Hold</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="finished">
        <xs:annotation>
          <xs:documentation xml:lang="en">Finished</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="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="EpisodeOfCareStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The status of the episode of care.</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="EpisodeOfCareStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ExpansionProfile" type="ExpansionProfile">
    <xs:annotation>
      <xs:documentation xml:lang="en">Resource to define constraints on the Expansion of a FHIR ValueSet.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ExpansionProfile">
    <xs:annotation>
      <xs:documentation xml:lang="en">Resource to define constraints on the Expansion of a FHIR ValueSet.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published. The URL SHOULD include the major version of the expansion profile. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the expansion profile author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the expansion profile. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this expansion profile. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this expansion profile is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the expansion profile was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the expansion profile changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the expansion profile.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the expansion profile from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate expansion profile instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the expansion profile is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fixedVersion" type="ExpansionProfile.FixedVersion" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Fix use of a particular code system to a particular version.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="excludedSystem" type="ExpansionProfile.ExcludedSystem" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code system, or a particular version of a code system to be excluded from value set expansions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="includeDesignations" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Controls whether concept designations are to be included or excluded in value set expansions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="designation" type="ExpansionProfile.Designation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="includeDefinition" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Controls whether the value set definition is included or excluded in value set expansions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="activeOnly" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Controls whether inactive concepts are included or excluded in value set expansions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="excludeNested" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="excludeNotForUI" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="excludePostCoordinated" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Controls whether or not the value set expansion includes post coordinated codes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="displayLanguage" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="limitedExpansion" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete, using the extension [http://hl7.org/fhir/StructureDefinition/valueset-toocostly](extension-valueset-toocostly.html).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExpansionProfile.FixedVersion">
    <xs:annotation>
      <xs:documentation xml:lang="en">Resource to define constraints on the Expansion of a FHIR ValueSet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="system" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specific system for which to fix the version.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version of the code system from which codes in the expansion should be included.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="SystemVersionProcessingMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">How to manage the intersection between a fixed version in a value set, and this fixed version of the system in the expansion profile.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExpansionProfile.ExcludedSystem">
    <xs:annotation>
      <xs:documentation xml:lang="en">Resource to define constraints on the Expansion of a FHIR ValueSet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="system" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI which is the code system to be excluded.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version of the code system from which codes in the expansion should be excluded.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExpansionProfile.Designation">
    <xs:annotation>
      <xs:documentation xml:lang="en">Resource to define constraints on the Expansion of a FHIR ValueSet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="include" type="ExpansionProfile.Include" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Designations to be included.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="exclude" type="ExpansionProfile.Exclude" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Designations to be excluded.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExpansionProfile.Include">
    <xs:annotation>
      <xs:documentation xml:lang="en">Resource to define constraints on the Expansion of a FHIR ValueSet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="designation" type="ExpansionProfile.Designation1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A data group for each designation to be included.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExpansionProfile.Designation1">
    <xs:annotation>
      <xs:documentation xml:lang="en">Resource to define constraints on the Expansion of a FHIR ValueSet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The language this designation is defined for.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Which kinds of designation to include in the expansion.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExpansionProfile.Exclude">
    <xs:annotation>
      <xs:documentation xml:lang="en">Resource to define constraints on the Expansion of a FHIR ValueSet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="designation" type="ExpansionProfile.Designation2" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A data group for each designation to be excluded.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExpansionProfile.Designation2">
    <xs:annotation>
      <xs:documentation xml:lang="en">Resource to define constraints on the Expansion of a FHIR ValueSet.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The language this designation is defined for.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Which kinds of designation to exclude from the expansion.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SystemVersionProcessingMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="default">
        <xs:annotation>
          <xs:documentation xml:lang="en">Default Version</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="check">
        <xs:annotation>
          <xs:documentation xml:lang="en">Check ValueSet Version</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="override">
        <xs:annotation>
          <xs:documentation xml:lang="en">Override ValueSet Version</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SystemVersionProcessingMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">How to manage the intersection between a fixed version in a value set, and a fixed version of the system in the expansion profile</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="SystemVersionProcessingMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <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">The EOB Business Identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" 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="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The category of claim, eg, oral, pharmacy, vision, insitutional, professional.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Patient Resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="billablePeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The billable period for which charges are being submitted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when the EOB 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">The person who created the explanation of benefit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="insurer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The insurer which is responsible for the explanation of benefit.</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.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The provider which is responsible for the claim.</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 resource which lists the date, practitioner, reason and other supporting information.</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: invoice number, claim number, pre-determination or pre-authorization number.</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: invoice number, claim number, pre-determination or pre-authorization number.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Processing outcome errror, partial or complete processing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the status of the adjudication.</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 claim versions or for related services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prescription" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Prescription to support the dispensing of Pharmacy or Vision products.</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 superceded by this prescription to support the dispensing of pharmacy services, medications or products. For example, a physician may prescribe a medication which the pharmacy determines is contraindicated, or for which the patient has an intolerance, and therefor issues a new precription for an alternate medication which has the same theraputic intent. The prescription from the pharmacy becomes the 'prescription' and that from the physician becomes the 'original prescription'.</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 the services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="information" type="ExplanationOfBenefit.Information" 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. Often there are mutiple jurisdiction specific valuesets which are required.</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 overall service as well as their role and whether responsible and qualifications.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="diagnosis" type="ExplanationOfBenefit.Diagnosis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Ordered list of patient diagnosis for which care is sought.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="procedure" type="ExplanationOfBenefit.Procedure" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Ordered list of patient procedures performed to support the adjudication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="precedence" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Precedence (primary, secondary, etc.).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="insurance" type="ExplanationOfBenefit.Insurance" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Financial instrument by which payment information for health care.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="accident" type="ExplanationOfBenefit.Accident" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An accident which resulted in the need for healthcare services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="employmentImpacted" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="hospitalization" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The start and optional end dates of when the patient was confined to a treatment center.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="item" type="ExplanationOfBenefit.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">First tier of goods and services.</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 payor added services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="totalCost" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total cost of the services reported.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="unallocDeductable" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of deductable applied which was not allocated to any particular service line.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="totalBenefit" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payment" type="ExplanationOfBenefit.Payment" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Payment details for the claim if the claim has been paid.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The form to be used for printing the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="processNote" type="ExplanationOfBenefit.ProcessNote" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Note text.</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">Other claims which are related to this claim such as prior claim versions or for related services.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">For example prior or umbrella.</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 - eg Property/Casualy insurer claim # or Workers Compensation case # .</xs:documentation>
            </xs:annotation>
          </xs:element>
        </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, provider, other.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resourceType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">organization | patient | practitioner | relatedperson.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="party" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Party to be reimbursed: Subscriber, provider, other.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExplanationOfBenefit.Information">
    <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">Sequence of the information element which serves to provide a link.</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 which may influence the adjudication.</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="timingDate" type="date" />
            <xs:element name="timingPeriod" type="Period" />
          </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="valueString" type="string" />
            <xs:element name="valueQuantity" type="Quantity" />
            <xs:element name="valueAttachment" type="Attachment" />
            <xs:element name="valueReference" type="Reference" />
          </xs:choice>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">For example, provides the reason for: the additional stay, or missing tooth or any other 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.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">Sequence of careteam which serves to order and provide a link.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The members of the team who provided the overall service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="responsible" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who is billing and responsible for the claimed services rendered to the patient.</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 multidisiplinary team.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="qualification" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The qualification which is applicable for this service.</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">Sequence of diagnosis which serves to provide a link.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The diagnosis.</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">The type of the Diagnosis, for example: admitting, primary, secondary, discharge.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="packageCode" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The package billing code, for example DRG, based on the assigned grouping code system.</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">Sequence of procedures which serves to order and provide a link.</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 procedure code.</xs:documentation>
            </xs:annotation>
            <xs:element name="procedureCodeableConcept" type="CodeableConcept" />
            <xs:element name="procedureReference" type="Reference" />
          </xs:choice>
        </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="coverage" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the program or plan identification, underwriter or payor.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="preAuthRef" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of references from the Insurer to which these services pertain.</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 which these services are addressing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of accident: work, auto, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the accident occurred.</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 service line number.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="careTeamLinkId" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Careteam applicable for this service or product line.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="diagnosisLinkId" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Diagnosis applicable for this service or product line.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="procedureLinkId" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Procedures applicable for this service or product line.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="informationLinkId" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Exceptions, special conditions and supporting information pplicable for this service or product line.</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 reveneu 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">Health Care Service Type Codes  to identify the classification of service or benefits.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.</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, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="programCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.</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 enclosed suite of services were 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 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="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 a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation 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="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of Unique Device Identifiers associated with this line item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <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 site, eg. limb region or tooth surface(s).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A billed item may include goods or services provided in multiple encounters.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of note references to the notes provided below.</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 adjudications results.</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.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">Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Adjudication reason such as limit reached.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Monitory amount associated with the code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">A non-monetary value for example a percentage. Mutually exclusive to the amount element above.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="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 service line number.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of product or service.</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 reveneu 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">Health Care Service Type Codes  to identify the classification of service or benefits.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.</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, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="programCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.</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 a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation 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="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of 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">A list of note references to the notes provided below.</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 adjudications 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 service line number.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of product or service.</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 reveneu 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">Health Care Service Type Codes  to identify the classification of service or benefits.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).</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, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="programCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.</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">The fee for an addittional service or product or charge.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="factor" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation 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="net" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="udi" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of 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">A list of note references to the notes provided below.</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 adjudications 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="sequenceLinkId" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of input service items which this service line is intended to replace.</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 reveneu 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">Health Care Service Type Codes  to identify the classification of service or benefits.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this is an actual service or product line, ie. not a Group, then use code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then use a group code to indicate the type of thing being grouped eg. 'glasses' or 'compound'.</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, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fee" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The fee charged for the professional service or product.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of note references to the notes provided below.</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 adjudications 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 payor added services.</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="revenue" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of reveneu 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">Health Care Service Type Codes  to identify the classification of service or benefits.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="service" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).</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, eg for Oral whether the treatment is cosmetic or associated with TMJ, or for medical whether the treatment was outside the clinic or out of office hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fee" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">The fee charged for the professional service or product.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="noteNumber" minOccurs="0" maxOccurs="unbounded" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of note references to the notes provided below.</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 adjudications results.</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 claim.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="adjustment" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Adjustment to the payment of this transaction which is not related to adjudication of this transaction.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="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 payment date.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">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">Payment identifer.</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="number" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">An integer associated with each note which may be referred to from each service line item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The note purpose: Print/Display.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The note text.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.</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">Dental, Vision, Medical, Pharmacy, Rehab etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subCategory" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.</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 indicated the 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, for example MED01, or DENT2.</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, for example 'DENT2 covers 100% of basic, 50% of major but exclused Ortho, Implants and Costmetic services'.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="network" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Network designation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="unit" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unit designation: individual or 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 vistis'.</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">Deductable, visits, benefit amount.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Benefits allowed.</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">Benefits used.</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="ExplanationOfBenefitStatus-list">
    <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">A code specifying the state of the resource instance.</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="ExplanationOfBenefitStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="FamilyMemberHistory" type="FamilyMemberHistory">
    <xs:annotation>
      <xs:documentation xml:lang="en">Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="FamilyMemberHistory">
    <xs:annotation>
      <xs:documentation xml:lang="en">Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.</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">This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A protocol or questionnaire that was adhered to in whole or in part by this event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="FamilyHistoryStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code specifying the status of the record of the family history of a specific family member.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notDone" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If true, indicates the taking of an individual family member's history did not occur. The notDone element should not be used to document negated conditions, such as a family member that did not have a condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notDoneReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes why the family member's history is absent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person who this history concerns.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date (and possibly time) when the family member history was taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of relationship this person has to the patient (father, mother, brother etc.).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation xml:lang="en">Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual or approximate date of birth of the relative.</xs:documentation>
            </xs:annotation>
            <xs:element name="bornPeriod" type="Period" />
            <xs:element name="bornDate" type="date" />
            <xs:element name="bornString" type="string" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The age of the relative at the time the family member history is recorded.</xs:documentation>
            </xs:annotation>
            <xs:element name="ageAge" type="Age" />
            <xs:element name="ageRange" type="Range" />
            <xs:element name="ageString" type="string" />
          </xs:choice>
          <xs:element name="estimatedAge" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If true, indicates that the age value specified is an estimated value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.</xs:documentation>
            </xs:annotation>
            <xs:element name="deceasedBoolean" type="boolean" />
            <xs:element name="deceasedAge" type="Age" />
            <xs:element name="deceasedRange" type="Range" />
            <xs:element name="deceasedDate" type="date" />
            <xs:element name="deceasedString" type="string" />
          </xs:choice>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes why the family member history occurred in coded or textual form.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="condition" type="FamilyMemberHistory.Condition" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="FamilyMemberHistory.Condition">
    <xs:annotation>
      <xs:documentation xml:lang="en">Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates what happened as a result of this condition.  If the condition resulted in death, deceased date is captured on the relation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.</xs:documentation>
            </xs:annotation>
            <xs:element name="onsetAge" type="Age" />
            <xs:element name="onsetRange" type="Range" />
            <xs:element name="onsetPeriod" type="Period" />
            <xs:element name="onsetString" type="string" />
          </xs:choice>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">An area where general notes can be placed about this specific condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="FamilyHistoryStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="partial">
        <xs:annotation>
          <xs:documentation xml:lang="en">Partial</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="health-unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Health unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="FamilyHistoryStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code that identifies the status of the family history record.</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="FamilyHistoryStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Flag" type="Flag">
    <xs:annotation>
      <xs:documentation xml:lang="en">Prospective warnings of potential issues when providing care to the patient.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Flag">
    <xs:annotation>
      <xs:documentation xml:lang="en">Prospective warnings of potential issues when providing care to the patient.</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">Identifier assigned to the flag for external use (outside the FHIR environment).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="FlagStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Supports basic workflow.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The coded value or textual component of the flag to display to the user.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient, location, group , organization , or practitioner, etc. this is about record this flag is associated with.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">This alert is only relevant during the encounter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person, organization or device that created the flag.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="FlagStatus-list">
    <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="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</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="FlagStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates whether this flag is active and needs to be displayed to a user, or whether it is no longer needed or entered in error.</xs:documentation>
      <xs:documentation 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="FlagStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Goal" type="Goal">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Goal">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</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">This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="GoalStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the goal has been reached and is still considered relevant.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates a category the goal falls within.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the patient, group or organization for whom the goal is being established.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date or event after which the goal should begin being pursued.</xs:documentation>
            </xs:annotation>
            <xs:element name="startDate" type="date" />
            <xs:element name="startCodeableConcept" type="CodeableConcept" />
          </xs:choice>
          <xs:element name="target" type="Goal.Target" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates what should be done by when.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="statusDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="statusReason" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Captures the reason for the current status.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expressedBy" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whose goal this is - patient goal, practitioner goal, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="addresses" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identified conditions and other health record elements that are intended to be addressed by the goal.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Any comments related to the goal.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcomeCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the change (or lack of change) at the point when the status of the goal is assessed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcomeReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details of what's changed (or not changed).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Goal.Target">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="measure" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.</xs:documentation>
            </xs:annotation>
            <xs:element name="detailQuantity" type="Quantity" />
            <xs:element name="detailRange" type="Range" />
            <xs:element name="detailCodeableConcept" type="CodeableConcept" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates either the date or the duration after start by which the goal should be met.</xs:documentation>
            </xs:annotation>
            <xs:element name="dueDate" type="date" />
            <xs:element name="dueDuration" type="Duration" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="GoalStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Proposed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation xml:lang="en">Accepted</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="planned">
        <xs:annotation>
          <xs:documentation xml:lang="en">Planned</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-target">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Target</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ahead-of-target">
        <xs:annotation>
          <xs:documentation xml:lang="en">Ahead of Target</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="behind-target">
        <xs:annotation>
          <xs:documentation xml:lang="en">Behind Target</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sustaining">
        <xs:annotation>
          <xs:documentation xml:lang="en">Sustaining</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="achieved">
        <xs:annotation>
          <xs:documentation xml:lang="en">Achieved</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Hold</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="entered-in-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Entered In Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation xml:lang="en">Rejected</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="GoalStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates whether the goal has been met and is still being targeted</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="GoalStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="GraphDefinition" type="GraphDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="GraphDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this graph definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this graph definition is (or will be) published. The URL SHOULD include the major version of the graph definition. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the graph definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the graph definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the graph definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this graph definition. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this graph definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the graph definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the graph definition changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the graph definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the graph definition from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate graph definition instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the graph definition is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this graph definition is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="start" minOccurs="1" maxOccurs="1" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of FHIR resource at which instances of this graph start.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The profile that describes the use of the base resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="link" type="GraphDefinition.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Links this graph makes rules about.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="GraphDefinition.Link">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="path" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Path in the resource that contains the link.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sliceName" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Which slice (if profiled).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="min" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Minimum occurrences for this link.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="max" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Maximum occurrences for this link.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about why this link is of interest in this graph definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" type="GraphDefinition.Target" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Potential target for the link.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="GraphDefinition.Target">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of resource this link refers to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Profile for the target resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="compartment" type="GraphDefinition.Compartment" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Compartment Consistency Rules.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="link" type="GraphDefinition.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional links from target resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="GraphDefinition.Compartment">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CompartmentType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the compartment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rule" minOccurs="1" maxOccurs="1" type="GraphCompartmentRule">
            <xs:annotation>
              <xs:documentation xml:lang="en">identical | matching | different | no-rule | custom.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Custom rule, as a FHIRPath expression.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Documentation for FHIRPath expression.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="GraphCompartmentRule-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="identical">
        <xs:annotation>
          <xs:documentation xml:lang="en">Identical</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="matching">
        <xs:annotation>
          <xs:documentation xml:lang="en">Matching</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="different">
        <xs:annotation>
          <xs:documentation xml:lang="en">Different</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="custom">
        <xs:annotation>
          <xs:documentation xml:lang="en">Custom</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="GraphCompartmentRule">
    <xs:annotation>
      <xs:documentation xml:lang="en">How a compartment must be linked</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="GraphCompartmentRule-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Group" type="Group">
    <xs:annotation>
      <xs:documentation xml:lang="en">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Group">
    <xs:annotation>
      <xs:documentation xml:lang="en">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>
      <xs:documentation 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 business identifier for this group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the record for the group is available for use or is merely being retained for historical purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="GroupType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the broad classification of the kind of resources the group includes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actual" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A label assigned to the group for human identification and communication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">A count of the number of resource instances that are part of the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="characteristic" type="Group.Characteristic" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the traits shared by members of the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="member" type="Group.Member" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the resource instances that are members of the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Group.Characteristic">
    <xs:annotation>
      <xs:documentation xml:lang="en">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that identifies the kind of trait being asserted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the trait that holds (or does not hold - see 'exclude') for members of the group.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueCodeableConcept" type="CodeableConcept" />
            <xs:element name="valueBoolean" type="boolean" />
            <xs:element name="valueQuantity" type="Quantity" />
            <xs:element name="valueRange" type="Range" />
          </xs:choice>
          <xs:element name="exclude" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If true, indicates the characteristic is one that is NOT held by members of the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Group.Member">
    <xs:annotation>
      <xs:documentation xml:lang="en">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="entity" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the entity that is a member of the group. Must be consistent with Group.type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period that the member was in the group, if known.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="inactive" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A flag to indicate that the member is no longer in the group, but previously may have been a member.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="GroupType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="person">
        <xs:annotation>
          <xs:documentation xml:lang="en">Person</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="animal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Animal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="practitioner">
        <xs:annotation>
          <xs:documentation xml:lang="en">Practitioner</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="device">
        <xs:annotation>
          <xs:documentation xml:lang="en">Device</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="medication">
        <xs:annotation>
          <xs:documentation xml:lang="en">Medication</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="substance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Substance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="GroupType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Types of resources that are part of group</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="GroupType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="GuidanceResponse" type="GuidanceResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="GuidanceResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken.</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="requestId" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Allows a service to provide a unique, business identifier for the response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="module" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the knowledge module that was invoked.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="GuidanceResponseStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient for which the request was processed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Allows the context of the guidance response to be provided if available. In a service context, this would likely be unavailable.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="occurrenceDateTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates when the guidance response was processed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a reference to the device that performed the guidance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the reason the request was initiated. This is typically provided as a parameter to the evaluation and echoed by the service, although for some use cases, such as subscription- or event-based scenarios, it may provide an indication of the cause for the response.</xs:documentation>
            </xs:annotation>
            <xs:element name="reasonCodeableConcept" type="CodeableConcept" />
            <xs:element name="reasonReference" type="Reference" />
          </xs:choice>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a mechanism to communicate additional information about the response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="evaluationMessage" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outputParameters" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="result" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actions, if any, produced by the evaluation of the artifact.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dataRequirement" minOccurs="0" maxOccurs="unbounded" type="DataRequirement">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="GuidanceResponseStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="success">
        <xs:annotation>
          <xs:documentation xml:lang="en">Success</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="data-requested">
        <xs:annotation>
          <xs:documentation xml:lang="en">Data Requested</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="data-required">
        <xs:annotation>
          <xs:documentation xml:lang="en">Data Required</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="failure">
        <xs:annotation>
          <xs:documentation xml:lang="en">Failure</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="GuidanceResponseStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The status of a guidance response</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="GuidanceResponseStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="HealthcareService" type="HealthcareService">
    <xs:annotation>
      <xs:documentation xml:lang="en">The details of a healthcare service available at a location.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="HealthcareService">
    <xs:annotation>
      <xs:documentation xml:lang="en">The details of a healthcare service available at a location.</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">External identifiers for this item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this healthcareservice record is in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="providedBy" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization that provides this healthcare service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the broad category of service being performed or delivered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specific type of service that may be delivered or performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specialty" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Collection of specialties handled by the service site. This is more of a medical term.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The location(s) where this healthcare service may be provided.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Further description of the service as it would be presented to a consumer while searching.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="extraDetails" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Extra details about the service that can't be placed in the other fields.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="photo" minOccurs="0" maxOccurs="1" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of contacts related to this specific healthcare service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="coverageArea" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The location(s) that this service is available to (not where the service is provided).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="serviceProvisionCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The code(s) that detail the conditions under which the healthcare service is available/offered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="eligibility" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Does this service have specific eligibility requirements that need to be met in order to use the service?</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="eligibilityNote" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the eligibility conditions for the service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="programName" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Program Names that can be used to categorize the service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="characteristic" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Collection of characteristics (attributes).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referralMethod" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="appointmentRequired" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="availableTime" type="HealthcareService.AvailableTime" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A collection of times that the Service Site is available.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notAvailable" type="HealthcareService.NotAvailable" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The HealthcareService is not available during this period of time due to the provided reason.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="availabilityExceptions" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="HealthcareService.AvailableTime">
    <xs:annotation>
      <xs:documentation xml:lang="en">The details of a healthcare service available at a location.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="daysOfWeek" minOccurs="0" maxOccurs="unbounded" type="DaysOfWeek">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates which days of the week are available between the start and end Times.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="allDay" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Is this always available? (hence times are irrelevant) e.g. 24 hour service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="availableStartTime" minOccurs="0" maxOccurs="1" type="time">
            <xs:annotation>
              <xs:documentation xml:lang="en">The opening time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="availableEndTime" minOccurs="0" maxOccurs="1" type="time">
            <xs:annotation>
              <xs:documentation xml:lang="en">The closing time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="HealthcareService.NotAvailable">
    <xs:annotation>
      <xs:documentation xml:lang="en">The details of a healthcare service available at a location.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reason that can be presented to the user as to why this time is not available.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="during" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Service is not available (seasonally or for a public holiday) from this date.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DaysOfWeek-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="mon">
        <xs:annotation>
          <xs:documentation xml:lang="en">Monday</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="tue">
        <xs:annotation>
          <xs:documentation xml:lang="en">Tuesday</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="wed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Wednesday</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="thu">
        <xs:annotation>
          <xs:documentation xml:lang="en">Thursday</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fri">
        <xs:annotation>
          <xs:documentation xml:lang="en">Friday</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sat">
        <xs:annotation>
          <xs:documentation xml:lang="en">Saturday</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sun">
        <xs:annotation>
          <xs:documentation xml:lang="en">Sunday</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DaysOfWeek">
    <xs:annotation>
      <xs:documentation xml:lang="en">The days of the week.</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="DaysOfWeek-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ImagingManifest" type="ImagingManifest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A text description of the DICOM SOP instances selected in the ImagingManifest; or the reason for, or significance of, the selection.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ImagingManifest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A text description of the DICOM SOP instances selected in the ImagingManifest; or the reason for, or significance of, the selection.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique identifier of the DICOM Key Object Selection (KOS) that this resource represents.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingManifest.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="authoringTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Author of ImagingManifest. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Free text narrative description of the ImagingManifest.  
The value may be derived from the DICOM Standard Part 16, CID-7010 descriptions (e.g. Best in Set, Complete Study Content). Note that those values cover the wide range of uses of the DICOM Key Object Selection object, several of which are not supported by ImagingManifest. Specifically, there is no expected behavior associated with descriptions that suggest referenced images be removed or not used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="study" type="ImagingManifest.Study" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Study identity and locating information of the DICOM SOP instances in the selection.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingManifest.Study">
    <xs:annotation>
      <xs:documentation xml:lang="en">A text description of the DICOM SOP instances selected in the ImagingManifest; or the reason for, or significance of, the selection.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation xml:lang="en">Study instance UID of the SOP instances in the selection.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="imagingStudy" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the Imaging Study in FHIR form.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The network service providing access (e.g., query, view, or retrieval) for the study. See implementation notes for information about using DICOM endpoints. A study-level endpoint applies to each series in the study, unless overridden by a series-level endpoint with the same Endpoint.type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="series" type="ImagingManifest.Series" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Series identity and locating information of the DICOM SOP instances in the selection.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingManifest.Series">
    <xs:annotation>
      <xs:documentation xml:lang="en">A text description of the DICOM SOP instances selected in the ImagingManifest; or the reason for, or significance of, the selection.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation xml:lang="en">Series instance UID of the SOP instances in the selection.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The network service providing access (e.g., query, view, or retrieval) for this series. See implementation notes for information about using DICOM endpoints. A series-level endpoint, if present, has precedence over a study-level endpoint with the same Endpoint.type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="instance" type="ImagingManifest.Instance" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identity and locating information of the selected DICOM SOP instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingManifest.Instance">
    <xs:annotation>
      <xs:documentation xml:lang="en">A text description of the DICOM SOP instances selected in the ImagingManifest; or the reason for, or significance of, the selection.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sopClass" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation xml:lang="en">SOP class UID of the selected instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation xml:lang="en">SOP Instance UID of the selected instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ImagingStudy" type="ImagingStudy">
    <xs:annotation>
      <xs:documentation xml:lang="en">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ImagingStudy">
    <xs:annotation>
      <xs:documentation xml:lang="en">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>
      <xs:documentation 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="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation xml:lang="en">Formal identifier for the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="accession" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions.  See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Other identifiers for the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="availability" minOccurs="0" maxOccurs="1" type="InstanceAvailability">
            <xs:annotation>
              <xs:documentation xml:lang="en">Availability of study (online, offline, or nearline).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="modalityList" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient imaged in the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter or episode at which the request is initiated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="started" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date and time the study started.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of the diagnostic requests that resulted in this imaging study being performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referrer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The requesting/referring physician.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="interpreter" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who read the study and interpreted the images or other content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The network service providing access (e.g., query, view, or retrieval) for the study. See implementation notes for information about using DICOM endpoints. A study-level endpoint applies to each series in the study, unless overridden by a series-level endpoint with the same Endpoint.type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="numberOfSeries" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Number of Series in the Study. This value given may be larger than the number of series elements this Resource contains due to resource availability, security, or other factors. This element should be present if any series elements are present.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="numberOfInstances" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Number of SOP Instances in Study. This value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="procedureReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the performed Procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="procedureCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The code for the performed procedure type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Description of clinical condition indicating why the ImagingStudy was requested.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Institution-generated description or classification of the Study performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="series" type="ImagingStudy.Series" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Each study has one or more series of images or other content.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingStudy.Series">
    <xs:annotation>
      <xs:documentation xml:lang="en">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation xml:lang="en">Formal identifier for this series.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="number" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The numeric identifier of this series in the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="modality" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The modality of this series sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the series.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="numberOfInstances" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Number of SOP Instances in the Study. The value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="availability" minOccurs="0" maxOccurs="1" type="InstanceAvailability">
            <xs:annotation>
              <xs:documentation xml:lang="en">Availability of series (online, offline or nearline).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The network service providing access (e.g., query, view, or retrieval) for this series. See implementation notes for information about using DICOM endpoints. A series-level endpoint, if present, has precedence over a study-level endpoint with the same Endpoint.type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings. The bodySite may indicate the laterality of body part imaged; if so, it shall be consistent with any content of ImagingStudy.series.laterality.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="laterality" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The laterality of the (possibly paired) anatomic structures examined. E.g., the left knee, both lungs, or unpaired abdomen. If present, shall be consistent with any laterality information indicated in ImagingStudy.series.bodySite.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="started" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and time the series was started.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The physician or operator (often the radiology technician)  who performed the series. The performer is recorded at the series level, since each series in a study may be performed by a different practitioner, at different times, and using different devices. A series may be performed by multiple practitioners.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="instance" type="ImagingStudy.Instance" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A single SOP instance within the series, e.g. an image, or presentation state.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImagingStudy.Instance">
    <xs:annotation>
      <xs:documentation xml:lang="en">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="uid" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation xml:lang="en">Formal identifier for this image or other content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="number" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The number of instance in the series.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sopClass" minOccurs="1" maxOccurs="1" type="oid">
            <xs:annotation>
              <xs:documentation xml:lang="en">DICOM instance  type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The description of the instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="InstanceAvailability-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="ONLINE">
        <xs:annotation>
          <xs:documentation xml:lang="en">Online</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OFFLINE">
        <xs:annotation>
          <xs:documentation xml:lang="en">Offline</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NEARLINE">
        <xs:annotation>
          <xs:documentation xml:lang="en">Nearline</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="UNAVAILABLE">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unavailable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="InstanceAvailability">
    <xs:annotation>
      <xs:documentation xml:lang="en">Availability of the resource</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="InstanceAvailability-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Immunization" type="Immunization">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Immunization">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed.</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 immunization record.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ImmunizationStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the current status of the vaccination event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notGiven" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates if the vaccination was or was not given.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="vaccineCode" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Vaccine that was administered or was to be administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient who either received or did not receive the immunization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The visit or admission or other contact between patient and health care provider the immunization was performed as part of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date vaccine administered or was to be administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="primarySource" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reportOrigin" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The service delivery location where the vaccine administration occurred.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="manufacturer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name of vaccine manufacturer.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lotNumber" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Lot number of the  vaccine product.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expirationDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date vaccine batch expires.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="site" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Body site where vaccine was administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="route" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The path by which the vaccine product is taken into the body.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="doseQuantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity of vaccine product that was administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="practitioner" type="Immunization.Practitioner" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates who or what performed the event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Extra information about the immunization that is not conveyed by the other attributes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="explanation" type="Immunization.Explanation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reasons why a vaccine was or was not administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reaction" type="Immunization.Reaction" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Categorical data indicating that an adverse event is associated in time to an immunization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="vaccinationProtocol" type="Immunization.VaccinationProtocol" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contains information about the protocol(s) under which the vaccine was administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Immunization.Practitioner">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the type of performance (e.g. ordering provider, administering provider, etc.).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner, etc. who performed the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Immunization.Explanation">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reasons why a vaccine was administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonNotGiven" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reason why a vaccine was not administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Immunization.Reaction">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date of reaction to the immunization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details of the reaction.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reported" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Self-reported indicator.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Immunization.VaccinationProtocol">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="doseSequence" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Nominal position in a series.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contains the description about the protocol under which the vaccine was administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="authority" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the authority who published the protocol.  E.g. ACIP.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="series" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">One possible path to achieve presumed immunity against a disease - within the context of an authority.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="seriesDoses" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The recommended number of doses to achieve immunity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="targetDisease" minOccurs="1" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The targeted disease.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="doseStatus" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates if the immunization event should "count" against  the protocol.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="doseStatusReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides an explanation as to why an immunization event should or should not count against the protocol.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ImmunizationStatusCodes-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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="ImmunizationStatusCodes">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of codes indicating the current status of an Immunization</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="ImmunizationStatusCodes-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ImmunizationRecommendation" type="ImmunizationRecommendation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ImmunizationRecommendation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification.</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 particular recommendation record.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient the recommendations are for.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recommendation" type="ImmunizationRecommendation.Recommendation" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Vaccine administration recommendations.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImmunizationRecommendation.Recommendation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date the immunization recommendation was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="vaccineCode" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Vaccine that pertains to the recommendation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="targetDisease" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The targeted disease for the recommendation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="doseNumber" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The next recommended dose number (e.g. dose 2 is the next recommended dose).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="forecastStatus" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Vaccine administration status.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dateCriterion" type="ImmunizationRecommendation.DateCriterion" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Vaccine date recommendations.  For example, earliest date to administer, latest date to administer, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="protocol" type="ImmunizationRecommendation.Protocol" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contains information about the protocol under which the vaccine was administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingImmunization" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Immunization event history that supports the status and recommendation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingPatientInformation" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Patient Information that supports the status and recommendation.  This includes patient observations, adverse reactions and allergy/intolerance information.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImmunizationRecommendation.DateCriterion">
    <xs:annotation>
      <xs:documentation xml:lang="en">A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date classification of recommendation.  For example, earliest date to give, latest date to give, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date whose meaning is specified by dateCriterion.code.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImmunizationRecommendation.Protocol">
    <xs:annotation>
      <xs:documentation xml:lang="en">A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="doseSequence" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the nominal position in a series of the next dose.  This is the recommended dose number as per a specified protocol.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contains the description about the protocol under which the vaccine was administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="authority" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the authority who published the protocol.  For example, ACIP.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="series" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">One possible path to achieve presumed immunity against a disease - within the context of an authority.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ImplementationGuide" type="ImplementationGuide">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of rules of how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ImplementationGuide">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of rules of how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</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="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. The URL SHOULD include the major version of the implementation guide. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the implementation guide. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this implementation guide. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this implementation guide is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the implementation guide was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the implementation guide.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the implementation guide from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate implementation guide instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the implementation guide is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fhirVersion" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dependency" type="ImplementationGuide.Dependency" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="package" type="ImplementationGuide.Package" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A logical group of resources. Logical groups can be used when building pages.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="global" type="ImplementationGuide.Global" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of profiles that all resources covered by this implementation guide must conform to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="binary" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A binary file that is included in the  implementation guide when it is published.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="page" type="ImplementationGuide.Page" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A page / section in the implementation guide. The root page is the implementation guide home page.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImplementationGuide.Dependency">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of rules of how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="GuideDependencyType">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the dependency is represented when the guide is published.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="uri" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the dependency is located.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImplementationGuide.Package">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of rules of how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name for the group, as used in page.package.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human readable text describing the package.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" type="ImplementationGuide.Resource" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImplementationGuide.Resource">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of rules of how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="example" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the reason that a resource has been included in the implementation guide.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="acronym" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short code that may be used to identify the resource throughout the implementation guide.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where this resource is found.</xs:documentation>
            </xs:annotation>
            <xs:element name="sourceUri" type="uri" />
            <xs:element name="sourceReference" type="Reference" />
          </xs:choice>
          <xs:element name="exampleFor" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImplementationGuide.Global">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of rules of how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of resource that all instances must conform to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the profile that all instances must conform to.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ImplementationGuide.Page">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of rules of how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="source" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The source address for the page.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="kind" minOccurs="1" maxOccurs="1" type="GuidePageKind">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">For constructed pages, what kind of resources to include in the list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="package" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">For constructed pages, a list of packages to include in the page (or else empty for everything).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="format" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The format of the page.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="page" type="ImplementationGuide.Page" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Nested Pages/Sections under this page.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="GuideDependencyType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="reference">
        <xs:annotation>
          <xs:documentation xml:lang="en">Reference</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inclusion">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inclusion</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="GuideDependencyType">
    <xs:annotation>
      <xs:documentation xml:lang="en">How a dependency is represented when the guide is published.</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="GuideDependencyType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="GuidePageKind-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="page">
        <xs:annotation>
          <xs:documentation xml:lang="en">Page</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="example">
        <xs:annotation>
          <xs:documentation xml:lang="en">Example</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="list">
        <xs:annotation>
          <xs:documentation xml:lang="en">List</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="include">
        <xs:annotation>
          <xs:documentation xml:lang="en">Include</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="directory">
        <xs:annotation>
          <xs:documentation xml:lang="en">Directory</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dictionary">
        <xs:annotation>
          <xs:documentation xml:lang="en">Dictionary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="toc">
        <xs:annotation>
          <xs:documentation xml:lang="en">Table Of Contents</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="resource">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="GuidePageKind">
    <xs:annotation>
      <xs:documentation xml:lang="en">The kind of an included page.</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="GuidePageKind-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Library" type="Library">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Library">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this library when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this library is (or will be) published. The URL SHOULD include the major version of the library. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this library when it is represented in other formats, or referenced in a specification, model, design or an instance. e.g. CMS or NQF identifiers for a measure artifact. Note that at least one identifier is required for non-experimental active artifacts.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the library when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the library author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the library. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the library.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this library. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this library is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the type of library such as a Logic Library, Model Definition, Asset Collection, or Module Definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the library was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the library changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the library.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the library from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this library is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="usage" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A detailed description of how the library is used from a clinical perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="approvalDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastReviewDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="effectivePeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during which the library content was or is planned to be in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate library instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the library is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="topic" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive topics related to the content of the library. Topics provide a high-level categorization of the library that can be useful for filtering and searching.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contributor" minOccurs="0" maxOccurs="unbounded" type="Contributor">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contributor to the content of the library, including authors, editors, reviewers, and endorsers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the library and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the library.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relatedArtifact" minOccurs="0" maxOccurs="unbounded" type="RelatedArtifact">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="ParameterDefinition">
            <xs:annotation>
              <xs:documentation xml:lang="en">The parameter element defines parameters used by the library.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dataRequirement" minOccurs="0" maxOccurs="unbounded" type="DataRequirement">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes a set of data that must be provided in order to be able to successfully perform the computations defined by the library.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the contentType of the attachment determines how to interpret the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Linkage" type="Linkage">
    <xs:annotation>
      <xs:documentation xml:lang="en">Identifies two or more records (resource instances) that are referring to the same real-world "occurrence".</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Linkage">
    <xs:annotation>
      <xs:documentation xml:lang="en">Identifies two or more records (resource instances) that are referring to the same real-world "occurrence".</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="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the asserted set of linkages are considered to be "in effect".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="item" type="Linkage.Item" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Linkage.Item">
    <xs:annotation>
      <xs:documentation xml:lang="en">Identifies two or more records (resource instances) that are referring to the same real-world "occurrence".</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="LinkageType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resource instance being linked as part of the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="LinkageType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="source">
        <xs:annotation>
          <xs:documentation xml:lang="en">Source of truth</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="alternate">
        <xs:annotation>
          <xs:documentation xml:lang="en">Alternate record</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="historical">
        <xs:annotation>
          <xs:documentation xml:lang="en">Historical/obsolete record</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="LinkageType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Used to distinguish different roles a resource can play within a set of linked resources</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="LinkageType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="List" type="List">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of information summarized from a list of other resources.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="List">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of information summarized from a list of other resources.</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">Identifier for the List assigned for business purposes outside the context of FHIR.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ListStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the current state of this list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="ListMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A label for the list assigned by the author.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This code defines the purpose of the list - why it was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The common subject (or patient) of the resources that are in the list, if there is one.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter that is the context in which this list was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date that the list was prepared.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="orderedBy" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">What order applies to the items in the list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments that apply to the overall list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="entry" type="List.Entry" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Entries in this list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="emptyReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the list is empty, why the list is empty.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="List.Entry">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of information summarized from a list of other resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="flag" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The flag allows the system constructing the list to indicate the role and significance of the item in the list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="deleted" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">True if this item is marked as deleted in the list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When this item was added to the list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="item" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the actual resource from which data was derived.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ListStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="current">
        <xs:annotation>
          <xs:documentation xml:lang="en">Current</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="retired">
        <xs:annotation>
          <xs:documentation xml:lang="en">Retired</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="ListStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The current state of the list</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="ListStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Location" type="Location">
    <xs:annotation>
      <xs:documentation xml:lang="en">Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Location">
    <xs:annotation>
      <xs:documentation xml:lang="en">Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.</xs:documentation>
      <xs:documentation 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">Unique code or number identifying the location to its users.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="LocationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status property covers the general availability of the resource, not the current value which may be covered by the operationStatus, or by a schedule/slots if they are configured for the location.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="operationalStatus" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Operational status covers operation values most relevant to beds (but can also apply to rooms/units/chair/etc such as an isolation unit/dialisys chair). This typically covers concepts such as contamination, housekeeping and other activities like maintenance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name of the location as used by humans. Does not need to be unique.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="alias" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of alternate names that the location is known as, or was known as in the past.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Description of the Location, which helps in finding or referencing the place.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="0" maxOccurs="1" type="LocationMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether a resource instance represents a specific location or a class of locations.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the type of function performed at the location.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="1" type="Address">
            <xs:annotation>
              <xs:documentation xml:lang="en">Physical location.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="physicalType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Physical form of the location, e.g. building, room, vehicle, road.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="position" type="Location.Position" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization responsible for the provisioning and upkeep of the location.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Another Location which this Location is physically part of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Technical endpoints providing access to services operated for the location.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Location.Position">
    <xs:annotation>
      <xs:documentation xml:lang="en">Details and position information for a physical place where services are provided  and resources and participants may be stored, found, contained or accommodated.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="longitude" minOccurs="1" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="latitude" minOccurs="1" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="altitude" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="LocationMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="instance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Instance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="kind">
        <xs:annotation>
          <xs:documentation xml:lang="en">Kind</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="LocationMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates whether a resource instance represents a specific location or a class of locations.</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="LocationMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="LocationStatus-list">
    <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="suspended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Suspended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="LocationStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates whether the location is still in use.</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="LocationStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Measure" type="Measure">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Measure resource provides the definition of a quality measure.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Measure">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Measure resource provides the definition of a quality measure.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this measure when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this measure is (or will be) published. The URL SHOULD include the major version of the measure. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this measure when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the measure when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the measure author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the measure. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this measure. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this measure is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the measure was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the measure changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the measure from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this measure is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="usage" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A detailed description of how the measure is used from a clinical perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="approvalDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastReviewDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="effectivePeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during which the measure content was or is planned to be in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate measure instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the measure is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="topic" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive topics related to the content of the measure. Topics provide a high-level categorization of the type of the measure that can be useful for filtering and searching.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contributor" minOccurs="0" maxOccurs="unbounded" type="Contributor">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contributor to the content of the measure, including authors, editors, reviewers, and endorsers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the measure and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relatedArtifact" minOccurs="0" maxOccurs="unbounded" type="RelatedArtifact">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="library" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a Library resource containing the formal logic used by the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="disclaimer" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Notices and disclaimers regarding the use of the measure, or related to intellectual property (such as code systems) referenced by the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="scoring" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how the calculation is performed for the measure, including proportion, ratio, continuous variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="compositeScoring" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this is a composite measure, the scoring method used to combine the component measures to determine the composite score.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the measure is used to examine a process, an outcome over time, a patient-reported outcome, or a structure measure such as utilization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="riskAdjustment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rateAggregation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes how to combine the information calculated, based on logic in each of several populations, into one summarized result.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rationale" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a succint statement of the need for the measure. Usually includes statements pertaining to importance criterion: impact, gap in care, and evidence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="clinicalRecommendationStatement" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a summary of relevant clinical guidelines or other clinical recommendations supporting the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="improvementNotation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information on whether an increase or decrease in score is the preferred result (e.g., a higher score indicates better quality OR a lower score indicates better quality OR quality is whthin a range).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a description of an individual term used within the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="guidance" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="set" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The measure set, e.g. Preventive Care and Screening.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="group" type="Measure.Group" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A group of population criteria for the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supplementalData" type="Measure.SupplementalData" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Measure.Group">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Measure resource provides the definition of a quality measure.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="1" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A unique identifier for the group. This identifier will used to report data for the group in the measure report.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Optional name or short description of this group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The human readable description of this population group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="population" type="Measure.Population" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A population criteria for the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="stratifier" type="Measure.Stratifier" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Measure.Population">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Measure resource provides the definition of a quality measure.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of population criteria.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Optional name or short description of this population.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The human readable description of this population criteria.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="criteria" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Measure.Stratifier">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Measure resource provides the definition of a quality measure.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier for the stratifier used to coordinate the reported data back to this stratifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="criteria" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The criteria for the stratifier. This must be the name of an expression defined within a referenced library.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="path" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The path to an element that defines the stratifier, specified as a valid FHIR resource path.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Measure.SupplementalData">
    <xs:annotation>
      <xs:documentation xml:lang="en">The Measure resource provides the definition of a quality measure.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier for the supplemental data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="usage" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="criteria" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="path" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MeasureReport" type="MeasureReport">
    <xs:annotation>
      <xs:documentation xml:lang="en">The MeasureReport resource contains the results of evaluating a measure.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MeasureReport">
    <xs:annotation>
      <xs:documentation xml:lang="en">The MeasureReport resource contains the results of evaluating a measure.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this report when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="MeasureReportStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The report status. No data will be available until the report status is complete.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="MeasureReportType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of measure report. This may be an individual report, which provides a single patient's score for the measure; a patient listing, which returns the list of patients that meet the various criteria in the measure; or a summary report, which returns a population count for each of the criteria in the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="measure" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the Measure that was evaluated to produce this report.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Optional Patient if the report was requested for a single patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date this measure report was generated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reportingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reporting Organization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="1" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reporting period for which the report was calculated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="group" type="MeasureReport.Group" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The results of the calculation, one for each population group in the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="evaluatedResources" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a Bundle containing the Resources that were used in the evaluation of this report.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MeasureReport.Group">
    <xs:annotation>
      <xs:documentation xml:lang="en">The MeasureReport resource contains the results of evaluating a measure.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="1" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier of the population group as defined in the measure definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="population" type="MeasureReport.Population" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The populations that make up the population group, one for each type of population appropriate for the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="measureScore" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="stratifier" type="MeasureReport.Stratifier" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MeasureReport.Population">
    <xs:annotation>
      <xs:documentation xml:lang="en">The MeasureReport resource contains the results of evaluating a measure.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier of the population being reported, as defined by the population element of the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of the population.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="count" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">The number of members of the population.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patients" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">This element refers to a List of patient level MeasureReport resources, one for each patient in this population.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MeasureReport.Stratifier">
    <xs:annotation>
      <xs:documentation xml:lang="en">The MeasureReport resource contains the results of evaluating a measure.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier of this stratifier, as defined in the measure definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="stratum" type="MeasureReport.Stratum" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MeasureReport.Stratum">
    <xs:annotation>
      <xs:documentation xml:lang="en">The MeasureReport resource contains the results of evaluating a measure.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="population" type="MeasureReport.Population1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The populations that make up the stratum, one for each type of population appropriate to the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="measureScore" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MeasureReport.Population1">
    <xs:annotation>
      <xs:documentation xml:lang="en">The MeasureReport resource contains the results of evaluating a measure.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier of the population being reported, as defined by the population element of the measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of the population.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="count" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">The number of members of the population in this stratum.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patients" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MeasureReportStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="complete">
        <xs:annotation>
          <xs:documentation xml:lang="en">Complete</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="pending">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pending</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MeasureReportStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The status of the measure report</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="MeasureReportStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MeasureReportType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="individual">
        <xs:annotation>
          <xs:documentation xml:lang="en">Individual</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="patient-list">
        <xs:annotation>
          <xs:documentation xml:lang="en">Patient List</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="summary">
        <xs:annotation>
          <xs:documentation xml:lang="en">Summary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MeasureReportType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of the measure report</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="MeasureReportType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Media" type="Media">
    <xs:annotation>
      <xs:documentation xml:lang="en">A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Media">
    <xs:annotation>
      <xs:documentation xml:lang="en">A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.</xs:documentation>
      <xs:documentation 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">Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A procedure that is fulfilled in whole or in part by the creation of this media.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="DigitalMediaType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the media is a photo (still image), an audio recording, or a video recording.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subtype" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="view" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the imaging view e.g. Lateral or Antero-posterior (AP).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who/What this Media is a record of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter or episode of care that establishes the context for this media.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and time(s) at which the media was collected.</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime" />
            <xs:element name="occurrencePeriod" type="Period" />
          </xs:choice>
          <xs:element name="operator" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person who administered the collection of the image.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes why the event occurred in coded or textual form.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the site on the subject's body where the media was collected (i.e. the target site).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="device" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device used to collect the media.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="height" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Height of the image in pixels (photo/video).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="width" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Width of the image in pixels (photo/video).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="frames" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="duration" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">The duration of the recording in seconds - for audio and video.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="1" maxOccurs="1" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual content of the media - inline or by direct reference to the media source file.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments made about the media by the performer, subject or other participants.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DigitalMediaType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="photo">
        <xs:annotation>
          <xs:documentation xml:lang="en">Photo</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="video">
        <xs:annotation>
          <xs:documentation xml:lang="en">Video</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="audio">
        <xs:annotation>
          <xs:documentation xml:lang="en">Audio</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DigitalMediaType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Whether the media is a photo, video, or audio</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="DigitalMediaType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Medication" type="Medication">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Medication">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.</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="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="MedicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate if the medication is in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="isBrand" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Set to true if the item is attributable to a specific manufacturer.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="isOverTheCounter" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Set to true if the medication can be obtained without an order from a prescriber.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="manufacturer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the form of the item.  Powder; tablets; capsule.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ingredient" type="Medication.Ingredient" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a particular constituent of interest in the product.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="package" type="Medication.Package" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information that only applies to packages (not products).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="image" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">Photo(s) or graphic representation(s) of the medication.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Medication.Ingredient">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual ingredient - either a substance (simple ingredient) or another medication.</xs:documentation>
            </xs:annotation>
            <xs:element name="itemCodeableConcept" type="CodeableConcept" />
            <xs:element name="itemReference" type="Reference" />
          </xs:choice>
          <xs:element name="isActive" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indication of whether this ingredient affects the therapeutic action of the drug.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Medication.Package">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="container" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of container that this package comes as.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="content" type="Medication.Content" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of components that go to make up the described item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="batch" type="Medication.Batch" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about a group of medication produced or packaged from one production run.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Medication.Content">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies one of the items in the package.</xs:documentation>
            </xs:annotation>
            <xs:element name="itemCodeableConcept" type="CodeableConcept" />
            <xs:element name="itemReference" type="Reference" />
          </xs:choice>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of the product that is in the package.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Medication.Batch">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="lotNumber" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The assigned lot number of a batch of the specified product.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expirationDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When this specific batch of product will expire.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationStatus-list">
    <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="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</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="MedicationStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A coded concept defining if the medication is in active use</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="MedicationStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MedicationAdministration" type="MedicationAdministration">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MedicationAdministration">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>
      <xs:documentation 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">External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A protocol, guideline, orderset or other definition that was adhered to in whole or in part by this event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A larger event of which this particular event is a component or step.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="MedicationAdministrationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the type of medication administration and where the medication is expected to be consumed or administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>
            </xs:annotation>
            <xs:element name="medicationCodeableConcept" type="CodeableConcept" />
            <xs:element name="medicationReference" type="Reference" />
          </xs:choice>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person or animal or group receiving the medication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingInformation" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information (for example, patient height and weight) that supports the administration of the medication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.</xs:documentation>
            </xs:annotation>
            <xs:element name="effectiveDateTime" type="dateTime" />
            <xs:element name="effectivePeriod" type="Period" />
          </xs:choice>
          <xs:element name="performer" type="MedicationAdministration.Performer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual who was responsible for giving the medication to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notGiven" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Set this to true if the record is saying that the medication was NOT administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonNotGiven" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code indicating why the administration was not performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code indicating why the medication was given.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Condition or observation that supports why the medication was administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prescription" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The original request, instruction or authority to perform the administration.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="device" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device used in administering the medication to the patient.  For example, a particular infusion pump.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Extra information about the medication administration that is not conveyed by the other attributes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dosage" type="MedicationAdministration.Dosage" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the medication dosage information details e.g. dose, rate, site, route, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="eventHistory" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A summary of the events of interest that have occurred, such as when the administration was verified.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationAdministration.Performer">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="actor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner, etc. who performed the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization the device or practitioner was acting on behalf of.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationAdministration.Dosage">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.

The dosage instructions should reflect the dosage of the medication that was administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="site" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded specification of the anatomic site where the medication first entered the body.  For example, "left arm".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="route" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient.  For example, topical, intravenous, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dose" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of the medication given at one administration event.   Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the speed with which the medication was or will be introduced into the patient.  Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.</xs:documentation>
            </xs:annotation>
            <xs:element name="rateRatio" type="Ratio" />
            <xs:element name="rateQuantity" type="Quantity" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationAdministrationStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Hold</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stopped</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationAdministrationStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A set of codes indicating the current status of a MedicationAdministration.</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="MedicationAdministrationStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MedicationDispense" type="MedicationDispense">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MedicationDispense">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</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">Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The procedure that the dispense is done because of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="MedicationDispenseStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code specifying the state of the set of dispense events.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates type of medication dispense and where the medication is expected to be consumed or administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>
            </xs:annotation>
            <xs:element name="medicationCodeableConcept" type="CodeableConcept" />
            <xs:element name="medicationReference" type="Reference" />
          </xs:choice>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to a resource representing the person or the group to whom the medication will be given.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter or episode of care that establishes the context for this event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingInformation" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information that supports the medication being dispensed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" type="MedicationDispense.Performer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates who or what performed the event.  It should be assumed that the performer is the dispenser of the medication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="authorizingPrescription" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the medication order that is being dispensed against.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of medication that has been dispensed. Includes unit of measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="daysSupply" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of medication expressed as a timing amount.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="whenPrepared" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time when the dispensed product was packaged and reviewed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="whenHandedOver" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time the dispensed product was provided to the patient or their representative.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="destination" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identification of the facility/location where the medication was shipped to, as part of the dispense event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="receiver" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the person who picked up the medication.  This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Extra information about the dispense that could not be conveyed in the other attributes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dosageInstruction" minOccurs="0" maxOccurs="unbounded" type="Dosage">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how the medication is to be used by the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="substitution" type="MedicationDispense.Substitution" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether or not substitution was made as part of the dispense.  In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen.  This block explains what substitution did or did not happen and why.  If nothing is specified, substitution was not done.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detectedIssue" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, duplicate therapy, dosage alert etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notDone" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">True if the dispense was not performed for some reason.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the reason why a dispense was not performed.</xs:documentation>
            </xs:annotation>
            <xs:element name="notDoneReasonCodeableConcept" type="CodeableConcept" />
            <xs:element name="notDoneReasonReference" type="Reference" />
          </xs:choice>
          <xs:element name="eventHistory" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A summary of the events of interest that have occurred, such as when the dispense was verified.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationDispense.Performer">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="actor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization the device or practitioner was acting on behalf of.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationDispense.Substitution">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="wasSubstituted" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">True if the dispenser dispensed a different drug or product from what was prescribed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code signifying whether a different drug was dispensed from what was prescribed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="responsibleParty" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person or organization that has primary responsibility for the substitution.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationDispenseStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="preparation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Preparation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Hold</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stopped</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationDispenseStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A coded concept specifying the state of the dispense event.</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="MedicationDispenseStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MedicationRequest" type="MedicationRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MedicationRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</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">This records identifiers associated with this medication request that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. For example a re-imbursement system might issue its own id for each prescription that is created.  This is particularly important where FHIR only provides part of an entire workflow process where records must be tracked through an entire system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Protocol or definition followed by this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A plan or request that is fulfilled in whole or in part by this medication request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="groupIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition or prescription.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="MedicationRequestStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code specifying the current state of the order.  Generally this will be active or completed state.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="intent" minOccurs="1" maxOccurs="1" type="MedicationRequestIntent">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the request is a proposal, plan, or an original order.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the type of medication order and where the medication is expected to be consumed or administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="MedicationRequestPriority">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how quickly the Medication Request should be addressed with respect to other requests.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the medication being requested. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>
            </xs:annotation>
            <xs:element name="medicationCodeableConcept" type="CodeableConcept" />
            <xs:element name="medicationReference" type="Reference" />
          </xs:choice>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to a resource representing the person or set of individuals to whom the medication will be given.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to an encounter, or episode of care, that identifies the particular occurrence or set occurrences of contact between patient and health care provider.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingInformation" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Include additional information (for example, patient height and weight) that supports the ordering of the medication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="authoredOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date (and perhaps time) when the prescription was initially written or authored on.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requester" type="MedicationRequest.Requester" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual, organization or device that initiated the request and has responsibility for its activation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recorder" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person who entered the order on behalf of another individual for example in the case of a verbal or a telephone order.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reason or the indication for ordering the medication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Condition or observation that supports why the medication was ordered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Extra information about the prescription that could not be conveyed by the other attributes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dosageInstruction" minOccurs="0" maxOccurs="unbounded" type="Dosage">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how the medication is to be used by the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dispenseRequest" type="MedicationRequest.DispenseRequest" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order).  Note that this information is not always sent with the order.  There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="substitution" type="MedicationRequest.Substitution" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priorPrescription" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to a resource representing an earlier order related order or prescription.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detectedIssue" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, duplicate therapy, dosage alert etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="eventHistory" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Links to Provenance records for past versions of this resource or fulfilling request or event resources that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationRequest.Requester">
    <xs:annotation>
      <xs:documentation xml:lang="en">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="agent" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The healthcare professional responsible for authorizing the initial prescription.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization the device or practitioner was acting on behalf of.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationRequest.DispenseRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="validityPeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">This indicates the validity period of a prescription (stale dating the Prescription).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="numberOfRepeatsAllowed" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">An integer indicating the number of times, in addition to the original dispense, (aka refills or repeats) that the patient can receive the prescribed medication. Usage Notes: This integer does not include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount that is to be dispensed for one fill.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expectedSupplyDuration" minOccurs="0" maxOccurs="1" type="Duration">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the intended dispensing Organization specified by the prescriber.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MedicationRequest.Substitution">
    <xs:annotation>
      <xs:documentation xml:lang="en">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="allowed" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">True if the prescriber allows a different drug to be dispensed from what was prescribed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the reason for the substitution, or why substitution must or must not be performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationRequestStatus-list">
    <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="on-hold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Hold</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="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stopped</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="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationRequestStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A coded concept specifying the state of the prescribing event. Describes the lifecycle of the prescription</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="MedicationRequestStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationRequestPriority-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="routine">
        <xs:annotation>
          <xs:documentation xml:lang="en">Routine</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="urgent">
        <xs:annotation>
          <xs:documentation xml:lang="en">Urgent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stat">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stat</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="asap">
        <xs:annotation>
          <xs:documentation xml:lang="en">ASAP</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationRequestPriority">
    <xs:annotation>
      <xs:documentation xml:lang="en">Identifies the level of importance to be assigned to actioning the request</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="MedicationRequestPriority-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationRequestIntent-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="proposal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Proposal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="plan">
        <xs:annotation>
          <xs:documentation xml:lang="en">Plan</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="order">
        <xs:annotation>
          <xs:documentation xml:lang="en">Order</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="instance-order">
        <xs:annotation>
          <xs:documentation xml:lang="en">Instance Order</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationRequestIntent">
    <xs:annotation>
      <xs:documentation xml:lang="en">The kind of medication order</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="MedicationRequestIntent-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MedicationStatement" type="MedicationStatement">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a medication that is being consumed by a patient.   A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay.   The medication information may come from sources such as the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains 

The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement is often, if not always, less specific.  There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise.  As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains.  Medication administration is more formal and is not missing detailed information.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MedicationStatement">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a medication that is being consumed by a patient.   A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay.   The medication information may come from sources such as the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains 

The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement is often, if not always, less specific.  There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise.  As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains.  Medication administration is more formal and is not missing detailed information.</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">External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A plan, proposal or order that is fulfilled in whole or in part by this event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A larger event of which this particular event is a component or step.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter or episode of care that establishes the context for this MedicationStatement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="MedicationStatementStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code representing the patient or other source's judgment about the state of the medication used that this statement is about.  Generally this will be active or completed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates where type of medication statement and where the medication is expected to be consumed or administered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>
            </xs:annotation>
            <xs:element name="medicationCodeableConcept" type="CodeableConcept" />
            <xs:element name="medicationReference" type="Reference" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).</xs:documentation>
            </xs:annotation>
            <xs:element name="effectiveDateTime" type="dateTime" />
            <xs:element name="effectivePeriod" type="Period" />
          </xs:choice>
          <xs:element name="dateAsserted" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when the medication statement was asserted by the information source.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="informationSource" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g Claim or MedicationRequest.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person, animal or group who is/was taking the medication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="derivedFrom" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Allows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="taken" minOccurs="1" maxOccurs="1" type="MedicationStatementTaken">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicator of the certainty of whether the medication was taken by the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonNotTaken" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code indicating why the medication was not taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reason for why the medication is being/was taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Condition or observation that supports why the medication is being/was taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides extra information about the medication statement that is not conveyed by the other attributes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dosage" minOccurs="0" maxOccurs="unbounded" type="Dosage">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how the medication is/was or should be taken by the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationStatementStatus-list">
    <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="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="intended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Intended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stopped</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Hold</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationStatementStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A coded concept indicating the current status of a MedicationStatement.</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="MedicationStatementStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="MedicationStatementTaken-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="y">
        <xs:annotation>
          <xs:documentation xml:lang="en">Yes</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="n">
        <xs:annotation>
          <xs:documentation xml:lang="en">No</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unk">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="na">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not Applicable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="MedicationStatementTaken">
    <xs:annotation>
      <xs:documentation xml:lang="en">A coded concept identifying level of certainty if patient has taken or has not taken the medication</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="MedicationStatementTaken-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MessageDefinition" type="MessageDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MessageDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this message definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this message definition is (or will be) published. The URL SHOULD include the major version of the message definition. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the message definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this message definition. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the message definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the message definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the message definition from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate message definition instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the message definition is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this message definition is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="base" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The MessageDefinition that is the basis for the contents of this resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parent" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies a protocol or workflow that this MessageDefinition represents a step in.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="replaces" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A MessageDefinition that is superseded by this definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="event" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded identifier of a supported messaging event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="MessageSignificanceCategory">
            <xs:annotation>
              <xs:documentation xml:lang="en">The impact of the content of the message.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="focus" type="MessageDefinition.Focus" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the resource (or resources) that are being addressed by the event.  For example, the Encounter for an admit message or two Account records for a merge.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="responseRequired" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether a response is required for this message.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="allowedResponse" type="MessageDefinition.AllowedResponse" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates what types of messages may be sent as an application-level response to this message.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageDefinition.Focus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of resource that must be the focus for this message.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A profile that reflects constraints for the focal resource (and potentially for related resources).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="min" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="max" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageDefinition.AllowedResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="message" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the message definition that must be adhered to by this supported response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="situation" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="MessageHeader" type="MessageHeader">
    <xs:annotation>
      <xs:documentation xml:lang="en">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MessageHeader">
    <xs:annotation>
      <xs:documentation xml:lang="en">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
      <xs:documentation 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="event" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-events".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="destination" type="MessageHeader.Destination" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The destination application which the message is intended for.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="receiver" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sender" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the sending system to allow the use of a trust relationship.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="timestamp" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time that the message was sent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="enterer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person or device that performed the data entry leading to this message. When there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The logical author of the message - the person or device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="source" type="MessageHeader.Source" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The source application from which this message originated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="responsible" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="response" type="MessageHeader.Response" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Information about the message that this message is a response to.  Only present if this message is a response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="focus" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual data of the message - a reference to the root/focus class of the event.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageHeader.Destination">
    <xs:annotation>
      <xs:documentation xml:lang="en">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human-readable name for the target system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the target end system in situations where the initial message transmission is to an intermediary system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates where the message should be routed to.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageHeader.Source">
    <xs:annotation>
      <xs:documentation xml:lang="en">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human-readable name for the source system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="software" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">May include configuration or other information useful in debugging.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Can convey versions of multiple systems in situations where a message passes through multiple hands.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="1" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">An e-mail, phone, website or other contact point to use to resolve issues with message communications.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the routing target to send acknowledgements to.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="MessageHeader.Response">
    <xs:annotation>
      <xs:documentation xml:lang="en">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The MessageHeader.id of the message to which this message is a response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="ResponseType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="details" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Full details of any issues found in the message.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResponseType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="ok">
        <xs:annotation>
          <xs:documentation xml:lang="en">OK</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="transient-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Transient Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fatal-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fatal Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ResponseType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The kind of response to a message</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="ResponseType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="NamingSystem" type="NamingSystem">
    <xs:annotation>
      <xs:documentation xml:lang="en">A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a "System" used within the Identifier and Coding data types.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="NamingSystem">
    <xs:annotation>
      <xs:documentation xml:lang="en">A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a "System" used within the Identifier and Coding data types.</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="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the naming system. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this naming system. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="kind" minOccurs="1" maxOccurs="1" type="NamingSystemType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the purpose for the naming system - what kinds of things does it make unique?</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the naming system was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the naming system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="responsible" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Categorizes a naming system for easier search by grouping related naming systems.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate naming system instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the naming system is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="usage" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="uniqueId" type="NamingSystem.UniqueId" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how the system may be identified when referenced in electronic exchange.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="replacedBy" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">For naming systems that are retired, indicates the naming system that should be used in their place (if any).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NamingSystem.UniqueId">
    <xs:annotation>
      <xs:documentation xml:lang="en">A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a "System" used within the Identifier and Coding data types.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="NamingSystemIdentifierType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the unique identifier scheme used for this particular identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The string that should be sent over the wire to identify the code system or identifier system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="preferred" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether this identifier is the "preferred" identifier of this type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Notes about the past or intended usage of this identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the period of time over which this identifier is considered appropriate to refer to the naming system.  Outside of this window, the identifier might be non-deterministic.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NamingSystemIdentifierType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="oid">
        <xs:annotation>
          <xs:documentation xml:lang="en">OID</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uuid">
        <xs:annotation>
          <xs:documentation xml:lang="en">UUID</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uri">
        <xs:annotation>
          <xs:documentation xml:lang="en">URI</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation xml:lang="en">Other</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NamingSystemIdentifierType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Identifies the style of unique identifier used to identify a namespace.</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="NamingSystemIdentifierType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NamingSystemType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="codesystem">
        <xs:annotation>
          <xs:documentation xml:lang="en">Code System</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="identifier">
        <xs:annotation>
          <xs:documentation xml:lang="en">Identifier</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="root">
        <xs:annotation>
          <xs:documentation xml:lang="en">Root</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="NamingSystemType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Identifies the purpose of the naming system.</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="NamingSystemType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="NutritionOrder" type="NutritionOrder">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="NutritionOrder">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</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">Identifiers assigned to this order by the order sender or by the order receiver.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="NutritionOrderStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The workflow status of the nutrition order/request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">An encounter that provides additional information about the healthcare context in which this request is made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dateTime" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and time that this nutrition order was requested.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="orderer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="allergyIntolerance" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to a record of allergies or intolerances  which should be included in the nutrition order.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="foodPreferenceModifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="excludeFoodModifier" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or  Gluten-Free.  While it should not be necessary to repeat allergy or intolerance information captured in the referenced AllergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason.  This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="oralDiet" type="NutritionOrder.OralDiet" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Diet given orally in contrast to enteral (tube) feeding.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supplement" type="NutritionOrder.Supplement" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Oral nutritional products given in order to add further nutritional value to the patient's diet.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="enteralFormula" type="NutritionOrder.EnteralFormula" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.OralDiet">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="schedule" minOccurs="0" maxOccurs="unbounded" type="Timing">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time period and frequency at which the diet should be given.  The diet should be given for the combination of all schedules if more than one schedule is present.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="nutrient" type="NutritionOrder.Nutrient" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="texture" type="NutritionOrder.Texture" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Class that describes any texture modifications required for the patient to safely consume various types of solid foods.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fluidConsistencyType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="instruction" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Free text or additional instructions or information pertaining to the oral diet.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.Nutrient">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="modifier" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The nutrient that is being modified such as carbohydrate or sodium.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity of the specified nutrient to include in diet.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.Texture">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="modifier" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="foodType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The food type(s) (e.g. meats, all foods)  that the texture modification applies to.  This could be all foods types.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.Supplement">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="productName" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The product or brand name of the nutritional supplement such as "Acme Protein Shake".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="schedule" minOccurs="0" maxOccurs="unbounded" type="Timing">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time period and frequency at which the supplement(s) should be given.  The supplement should be given for the combination of all schedules if more than one schedule is present.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of the nutritional supplement to be given.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="instruction" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Free text or additional instructions or information pertaining to the oral supplement.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.EnteralFormula">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="baseFormulaType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="baseFormulaProductName" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="additiveType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="additiveProductName" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The product or brand name of the type of modular component to be added to the formula.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="caloricDensity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz.  For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="routeofAdministration" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The route or physiological path of administration into the patient's gastrointestinal  tract for purposes of providing the formula feeding, e.g. nasogastric tube.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="administration" type="NutritionOrder.Administration" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Formula administration instructions as structured data.  This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding.  An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="maxVolumeToDeliver" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="administrationInstruction" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Free text formula administration, feeding instructions or additional instructions or information.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionOrder.Administration">
    <xs:annotation>
      <xs:documentation xml:lang="en">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="schedule" minOccurs="0" maxOccurs="1" type="Timing">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time period and frequency at which the enteral formula should be delivered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The volume of formula to provide to the patient per the specified administration schedule.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.</xs:documentation>
            </xs:annotation>
            <xs:element name="rateQuantity" type="Quantity" />
            <xs:element name="rateRatio" type="Ratio" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NutritionOrderStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="proposed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Proposed</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="planned">
        <xs:annotation>
          <xs:documentation xml:lang="en">Planned</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation xml:lang="en">Requested</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On-Hold</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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="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="NutritionOrderStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Codes specifying the state of the request. Describes the lifecycle of the nutrition order.</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="NutritionOrderStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Observation" type="Observation">
    <xs:annotation>
      <xs:documentation xml:lang="en">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Observation">
    <xs:annotation>
      <xs:documentation xml:lang="en">Measurements and simple assertions made about a patient, device or other subject.</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 observation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A plan, proposal or order that is fulfilled in whole or in part by this event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ObservationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the result value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that classifies the general type of observation being made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes what was observed. Sometimes this is called the observation "name".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus, donor,  other observer (for example a relative or EMT), or any observation made about the subject.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.</xs:documentation>
            </xs:annotation>
            <xs:element name="effectiveDateTime" type="dateTime" />
            <xs:element name="effectivePeriod" type="Period" />
          </xs:choice>
          <xs:element name="issued" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and time this observation was made available to providers, typically after the results have been reviewed and verified.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who was responsible for asserting the observed value as "true".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The information determined as a result of making the observation, if the information has a simple value.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueQuantity" type="Quantity" />
            <xs:element name="valueCodeableConcept" type="CodeableConcept" />
            <xs:element name="valueString" type="string" />
            <xs:element name="valueBoolean" type="boolean" />
            <xs:element name="valueRange" type="Range" />
            <xs:element name="valueRatio" type="Ratio" />
            <xs:element name="valueSampledData" type="SampledData" />
            <xs:element name="valueAttachment" type="Attachment" />
            <xs:element name="valueTime" type="time" />
            <xs:element name="valueDateTime" type="dateTime" />
            <xs:element name="valuePeriod" type="Period" />
          </xs:choice>
          <xs:element name="dataAbsentReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a reason why the expected value in the element Observation.value[x] is missing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="interpretation" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the site on the subject's body where the observation was made (i.e. the target site).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the mechanism used to perform the observation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specimen" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specimen that was used when this observation was made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="device" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device used to generate the observation data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referenceRange" type="Observation.ReferenceRange" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Guidance on how to interpret the value by comparison to a normal or recommended range.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="related" type="Observation.Related" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A  reference to another resource (usually another Observation) whose relationship is defined by the relationship type code.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="component" type="Observation.Component" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Some observations have multiple component observations.  These component observations are expressed as separate code value pairs that share the same attributes.  Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Observation.ReferenceRange">
    <xs:annotation>
      <xs:documentation xml:lang="en">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="low" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the low bound of the reference range.  The low bound of the reference range endpoint is inclusive of the value (e.g.  reference range is &gt;=5 - &lt;=9).   If the low bound is omitted,  it is assumed to be meaningless (e.g. reference range is &lt;=2.3).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="high" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the high bound of the reference range.  The high bound of the reference range endpoint is inclusive of the value (e.g.  reference range is &gt;=5 - &lt;=9).   If the high bound is omitted,  it is assumed to be meaningless (e.g. reference range is &gt;= 2.3).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="appliesTo" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Codes to indicate the target population this reference range applies to.  For example, a reference range may be based on the normal population or a particular sex or race.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="age" minOccurs="0" maxOccurs="1" type="Range">
            <xs:annotation>
              <xs:documentation xml:lang="en">The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of "Negative" or a list or table of 'normals'.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Observation.Related">
    <xs:annotation>
      <xs:documentation xml:lang="en">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="ObservationRelationshipType">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code specifying the kind of relationship that exists with the target resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Observation.Component">
    <xs:annotation>
      <xs:documentation xml:lang="en">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes what was observed. Sometimes this is called the observation "code".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The information determined as a result of making the observation, if the information has a simple value.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueQuantity" type="Quantity" />
            <xs:element name="valueCodeableConcept" type="CodeableConcept" />
            <xs:element name="valueString" type="string" />
            <xs:element name="valueRange" type="Range" />
            <xs:element name="valueRatio" type="Ratio" />
            <xs:element name="valueSampledData" type="SampledData" />
            <xs:element name="valueAttachment" type="Attachment" />
            <xs:element name="valueTime" type="time" />
            <xs:element name="valueDateTime" type="dateTime" />
            <xs:element name="valuePeriod" type="Period" />
          </xs:choice>
          <xs:element name="dataAbsentReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a reason why the expected value in the element Observation.value[x] is missing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="interpretation" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referenceRange" type="Observation.ReferenceRange" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Guidance on how to interpret the value by comparison to a normal or recommended range.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ObservationRelationshipType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="has-member">
        <xs:annotation>
          <xs:documentation xml:lang="en">Has Member</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="derived-from">
        <xs:annotation>
          <xs:documentation xml:lang="en">Derived From</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sequel-to">
        <xs:annotation>
          <xs:documentation xml:lang="en">Sequel To</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="replaces">
        <xs:annotation>
          <xs:documentation xml:lang="en">Replaces</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="qualified-by">
        <xs:annotation>
          <xs:documentation xml:lang="en">Qualified By</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="interfered-by">
        <xs:annotation>
          <xs:documentation xml:lang="en">Interfered By</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ObservationRelationshipType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Codes specifying how two observations are related.</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="ObservationRelationshipType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="OperationDefinition" type="OperationDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="OperationDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published. The URL SHOULD include the major version of the operation definition. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the operation definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the operation definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the operation definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this operation definition. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="kind" minOccurs="1" maxOccurs="1" type="OperationKind">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this is an operation or a named query.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this operation definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the operation definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the operation definition changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the operation definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the operation definition from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate operation definition instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the operation definition is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this operation definition is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="idempotent" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name used to invoke the operation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information about how to use this operation or named query.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="base" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates that this operation definition is a constraining profile on the base.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" minOccurs="0" maxOccurs="unbounded" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The types on which this operation can be executed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="system" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a specific resource id for the context).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="instance" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether this operation can be invoked on a particular instance of one of the given types.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parameter" type="OperationDefinition.Parameter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The parameters for the operation/query.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="overload" type="OperationDefinition.Overload" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines an appropriate combination of parameters to use when invoking this operation, to help code generators when generating overloaded parameter sets for this operation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OperationDefinition.Parameter">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of used to identify the parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="1" maxOccurs="1" type="OperationParameterUse">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this is an input or an output parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="min" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">The minimum number of times this parameter SHALL appear in the request or response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="max" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The maximum number of times this element is permitted to appear in the request or response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the meaning or use of this parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="FHIRAllTypes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type for this parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="searchType" minOccurs="0" maxOccurs="1" type="SearchParamType">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A profile the specifies the rules that this parameter must conform to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="binding" type="OperationDefinition.Binding" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="part" type="OperationDefinition.Parameter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The parts of a nested Parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OperationDefinition.Binding">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="strength" minOccurs="1" maxOccurs="1" type="BindingStrength">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueSetUri" type="uri" />
            <xs:element name="valueSetReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OperationDefinition.Overload">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="parameterName" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name of parameter to include in overload.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments to go on overload.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="FHIRAllTypes-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="Address">
        <xs:annotation>
          <xs:documentation xml:lang="en">Address</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Age">
        <xs:annotation>
          <xs:documentation xml:lang="en">Age</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Annotation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Annotation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Attachment">
        <xs:annotation>
          <xs:documentation xml:lang="en">Attachment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BackboneElement">
        <xs:annotation>
          <xs:documentation xml:lang="en">BackboneElement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CodeableConcept">
        <xs:annotation>
          <xs:documentation xml:lang="en">CodeableConcept</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Coding">
        <xs:annotation>
          <xs:documentation xml:lang="en">Coding</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ContactDetail">
        <xs:annotation>
          <xs:documentation xml:lang="en">ContactDetail</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ContactPoint">
        <xs:annotation>
          <xs:documentation xml:lang="en">ContactPoint</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Contributor">
        <xs:annotation>
          <xs:documentation xml:lang="en">Contributor</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Count">
        <xs:annotation>
          <xs:documentation xml:lang="en">Count</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DataRequirement">
        <xs:annotation>
          <xs:documentation xml:lang="en">DataRequirement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Distance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Distance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Dosage">
        <xs:annotation>
          <xs:documentation xml:lang="en">Dosage</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Duration">
        <xs:annotation>
          <xs:documentation xml:lang="en">Duration</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Element">
        <xs:annotation>
          <xs:documentation xml:lang="en">Element</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ElementDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">ElementDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Extension">
        <xs:annotation>
          <xs:documentation xml:lang="en">Extension</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HumanName">
        <xs:annotation>
          <xs:documentation xml:lang="en">HumanName</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Identifier">
        <xs:annotation>
          <xs:documentation xml:lang="en">Identifier</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Meta">
        <xs:annotation>
          <xs:documentation xml:lang="en">Meta</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Money">
        <xs:annotation>
          <xs:documentation xml:lang="en">Money</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Narrative">
        <xs:annotation>
          <xs:documentation xml:lang="en">Narrative</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ParameterDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">ParameterDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Period">
        <xs:annotation>
          <xs:documentation xml:lang="en">Period</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Quantity">
        <xs:annotation>
          <xs:documentation xml:lang="en">Quantity</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Range">
        <xs:annotation>
          <xs:documentation xml:lang="en">Range</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Ratio">
        <xs:annotation>
          <xs:documentation xml:lang="en">Ratio</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Reference">
        <xs:annotation>
          <xs:documentation xml:lang="en">Reference</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RelatedArtifact">
        <xs:annotation>
          <xs:documentation xml:lang="en">RelatedArtifact</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SampledData">
        <xs:annotation>
          <xs:documentation xml:lang="en">SampledData</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Signature">
        <xs:annotation>
          <xs:documentation xml:lang="en">Signature</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SimpleQuantity">
        <xs:annotation>
          <xs:documentation xml:lang="en">SimpleQuantity</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Timing">
        <xs:annotation>
          <xs:documentation xml:lang="en">Timing</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TriggerDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">TriggerDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="UsageContext">
        <xs:annotation>
          <xs:documentation xml:lang="en">UsageContext</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="base64Binary">
        <xs:annotation>
          <xs:documentation xml:lang="en">base64Binary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="boolean">
        <xs:annotation>
          <xs:documentation xml:lang="en">boolean</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="code">
        <xs:annotation>
          <xs:documentation xml:lang="en">code</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="date">
        <xs:annotation>
          <xs:documentation xml:lang="en">date</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dateTime">
        <xs:annotation>
          <xs:documentation xml:lang="en">dateTime</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="decimal">
        <xs:annotation>
          <xs:documentation xml:lang="en">decimal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="id">
        <xs:annotation>
          <xs:documentation xml:lang="en">id</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="instant">
        <xs:annotation>
          <xs:documentation xml:lang="en">instant</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="integer">
        <xs:annotation>
          <xs:documentation xml:lang="en">integer</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="markdown">
        <xs:annotation>
          <xs:documentation xml:lang="en">markdown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="oid">
        <xs:annotation>
          <xs:documentation xml:lang="en">oid</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="positiveInt">
        <xs:annotation>
          <xs:documentation xml:lang="en">positiveInt</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="string">
        <xs:annotation>
          <xs:documentation xml:lang="en">string</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="time">
        <xs:annotation>
          <xs:documentation xml:lang="en">time</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unsignedInt">
        <xs:annotation>
          <xs:documentation xml:lang="en">unsignedInt</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uri">
        <xs:annotation>
          <xs:documentation xml:lang="en">uri</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uuid">
        <xs:annotation>
          <xs:documentation xml:lang="en">uuid</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="xhtml">
        <xs:annotation>
          <xs:documentation xml:lang="en">XHTML</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Account">
        <xs:annotation>
          <xs:documentation xml:lang="en">Account</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ActivityDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">ActivityDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AdverseEvent">
        <xs:annotation>
          <xs:documentation xml:lang="en">AdverseEvent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AllergyIntolerance">
        <xs:annotation>
          <xs:documentation xml:lang="en">AllergyIntolerance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Appointment">
        <xs:annotation>
          <xs:documentation xml:lang="en">Appointment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AppointmentResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">AppointmentResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AuditEvent">
        <xs:annotation>
          <xs:documentation xml:lang="en">AuditEvent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Basic">
        <xs:annotation>
          <xs:documentation xml:lang="en">Basic</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Binary">
        <xs:annotation>
          <xs:documentation xml:lang="en">Binary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BodySite">
        <xs:annotation>
          <xs:documentation xml:lang="en">BodySite</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Bundle">
        <xs:annotation>
          <xs:documentation xml:lang="en">Bundle</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CapabilityStatement">
        <xs:annotation>
          <xs:documentation xml:lang="en">CapabilityStatement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CarePlan">
        <xs:annotation>
          <xs:documentation xml:lang="en">CarePlan</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CareTeam">
        <xs:annotation>
          <xs:documentation xml:lang="en">CareTeam</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ChargeItem">
        <xs:annotation>
          <xs:documentation xml:lang="en">ChargeItem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Claim">
        <xs:annotation>
          <xs:documentation xml:lang="en">Claim</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ClaimResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">ClaimResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ClinicalImpression">
        <xs:annotation>
          <xs:documentation xml:lang="en">ClinicalImpression</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CodeSystem">
        <xs:annotation>
          <xs:documentation xml:lang="en">CodeSystem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Communication">
        <xs:annotation>
          <xs:documentation xml:lang="en">Communication</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CommunicationRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">CommunicationRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CompartmentDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">CompartmentDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Composition">
        <xs:annotation>
          <xs:documentation xml:lang="en">Composition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ConceptMap">
        <xs:annotation>
          <xs:documentation xml:lang="en">ConceptMap</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Condition">
        <xs:annotation>
          <xs:documentation xml:lang="en">Condition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Consent">
        <xs:annotation>
          <xs:documentation xml:lang="en">Consent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Contract">
        <xs:annotation>
          <xs:documentation xml:lang="en">Contract</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Coverage">
        <xs:annotation>
          <xs:documentation xml:lang="en">Coverage</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DataElement">
        <xs:annotation>
          <xs:documentation xml:lang="en">DataElement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DetectedIssue">
        <xs:annotation>
          <xs:documentation xml:lang="en">DetectedIssue</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Device">
        <xs:annotation>
          <xs:documentation xml:lang="en">Device</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceComponent">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceComponent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceMetric">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceMetric</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceUseStatement">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceUseStatement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DiagnosticReport">
        <xs:annotation>
          <xs:documentation xml:lang="en">DiagnosticReport</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DocumentManifest">
        <xs:annotation>
          <xs:documentation xml:lang="en">DocumentManifest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DocumentReference">
        <xs:annotation>
          <xs:documentation xml:lang="en">DocumentReference</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DomainResource">
        <xs:annotation>
          <xs:documentation xml:lang="en">DomainResource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EligibilityRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">EligibilityRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EligibilityResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">EligibilityResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Encounter">
        <xs:annotation>
          <xs:documentation xml:lang="en">Encounter</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Endpoint">
        <xs:annotation>
          <xs:documentation xml:lang="en">Endpoint</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EnrollmentRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">EnrollmentRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EnrollmentResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">EnrollmentResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EpisodeOfCare">
        <xs:annotation>
          <xs:documentation xml:lang="en">EpisodeOfCare</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ExpansionProfile">
        <xs:annotation>
          <xs:documentation xml:lang="en">ExpansionProfile</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ExplanationOfBenefit">
        <xs:annotation>
          <xs:documentation xml:lang="en">ExplanationOfBenefit</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="FamilyMemberHistory">
        <xs:annotation>
          <xs:documentation xml:lang="en">FamilyMemberHistory</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Flag">
        <xs:annotation>
          <xs:documentation xml:lang="en">Flag</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Goal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Goal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="GraphDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">GraphDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Group">
        <xs:annotation>
          <xs:documentation xml:lang="en">Group</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="GuidanceResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">GuidanceResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HealthcareService">
        <xs:annotation>
          <xs:documentation xml:lang="en">HealthcareService</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImagingManifest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImagingManifest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImagingStudy">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImagingStudy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Immunization">
        <xs:annotation>
          <xs:documentation xml:lang="en">Immunization</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImmunizationRecommendation">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImmunizationRecommendation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImplementationGuide">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImplementationGuide</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Library">
        <xs:annotation>
          <xs:documentation xml:lang="en">Library</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Linkage">
        <xs:annotation>
          <xs:documentation xml:lang="en">Linkage</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="List">
        <xs:annotation>
          <xs:documentation xml:lang="en">List</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Location">
        <xs:annotation>
          <xs:documentation xml:lang="en">Location</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Measure">
        <xs:annotation>
          <xs:documentation xml:lang="en">Measure</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MeasureReport">
        <xs:annotation>
          <xs:documentation xml:lang="en">MeasureReport</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Media">
        <xs:annotation>
          <xs:documentation xml:lang="en">Media</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Medication">
        <xs:annotation>
          <xs:documentation xml:lang="en">Medication</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationAdministration">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationAdministration</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationDispense">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationDispense</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationStatement">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationStatement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MessageDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">MessageDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MessageHeader">
        <xs:annotation>
          <xs:documentation xml:lang="en">MessageHeader</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NamingSystem">
        <xs:annotation>
          <xs:documentation xml:lang="en">NamingSystem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NutritionOrder">
        <xs:annotation>
          <xs:documentation xml:lang="en">NutritionOrder</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Observation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Observation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OperationDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">OperationDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OperationOutcome">
        <xs:annotation>
          <xs:documentation xml:lang="en">OperationOutcome</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Organization">
        <xs:annotation>
          <xs:documentation xml:lang="en">Organization</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Parameters">
        <xs:annotation>
          <xs:documentation xml:lang="en">Parameters</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Patient">
        <xs:annotation>
          <xs:documentation xml:lang="en">Patient</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PaymentNotice">
        <xs:annotation>
          <xs:documentation xml:lang="en">PaymentNotice</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PaymentReconciliation">
        <xs:annotation>
          <xs:documentation xml:lang="en">PaymentReconciliation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Person">
        <xs:annotation>
          <xs:documentation xml:lang="en">Person</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PlanDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">PlanDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Practitioner">
        <xs:annotation>
          <xs:documentation xml:lang="en">Practitioner</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PractitionerRole">
        <xs:annotation>
          <xs:documentation xml:lang="en">PractitionerRole</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Procedure">
        <xs:annotation>
          <xs:documentation xml:lang="en">Procedure</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProcedureRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ProcedureRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProcessRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ProcessRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProcessResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">ProcessResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Provenance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Provenance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Questionnaire">
        <xs:annotation>
          <xs:documentation xml:lang="en">Questionnaire</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="QuestionnaireResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">QuestionnaireResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ReferralRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ReferralRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RelatedPerson">
        <xs:annotation>
          <xs:documentation xml:lang="en">RelatedPerson</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RequestGroup">
        <xs:annotation>
          <xs:documentation xml:lang="en">RequestGroup</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ResearchStudy">
        <xs:annotation>
          <xs:documentation xml:lang="en">ResearchStudy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ResearchSubject">
        <xs:annotation>
          <xs:documentation xml:lang="en">ResearchSubject</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Resource">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RiskAssessment">
        <xs:annotation>
          <xs:documentation xml:lang="en">RiskAssessment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Schedule">
        <xs:annotation>
          <xs:documentation xml:lang="en">Schedule</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SearchParameter">
        <xs:annotation>
          <xs:documentation xml:lang="en">SearchParameter</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Sequence">
        <xs:annotation>
          <xs:documentation xml:lang="en">Sequence</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ServiceDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">ServiceDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Slot">
        <xs:annotation>
          <xs:documentation xml:lang="en">Slot</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Specimen">
        <xs:annotation>
          <xs:documentation xml:lang="en">Specimen</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StructureDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">StructureDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StructureMap">
        <xs:annotation>
          <xs:documentation xml:lang="en">StructureMap</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Subscription">
        <xs:annotation>
          <xs:documentation xml:lang="en">Subscription</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Substance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Substance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SupplyDelivery">
        <xs:annotation>
          <xs:documentation xml:lang="en">SupplyDelivery</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SupplyRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">SupplyRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Task">
        <xs:annotation>
          <xs:documentation xml:lang="en">Task</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TestReport">
        <xs:annotation>
          <xs:documentation xml:lang="en">TestReport</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TestScript">
        <xs:annotation>
          <xs:documentation xml:lang="en">TestScript</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ValueSet">
        <xs:annotation>
          <xs:documentation xml:lang="en">ValueSet</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VisionPrescription">
        <xs:annotation>
          <xs:documentation xml:lang="en">VisionPrescription</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Type">
        <xs:annotation>
          <xs:documentation xml:lang="en">Type</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Any">
        <xs:annotation>
          <xs:documentation xml:lang="en">Any</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="FHIRAllTypes">
    <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="FHIRAllTypes-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="OperationParameterUse-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="in">
        <xs:annotation>
          <xs:documentation xml:lang="en">In</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="out">
        <xs:annotation>
          <xs:documentation xml:lang="en">Out</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="OperationParameterUse">
    <xs:annotation>
      <xs:documentation xml:lang="en">Whether an operation parameter is an input or an output parameter.</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="OperationParameterUse-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="OperationKind-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="operation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Operation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="query">
        <xs:annotation>
          <xs:documentation xml:lang="en">Query</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="OperationKind">
    <xs:annotation>
      <xs:documentation xml:lang="en">Whether an operation is a normal operation or a query.</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="OperationKind-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="OperationOutcome" type="OperationOutcome">
    <xs:annotation>
      <xs:documentation xml:lang="en">A collection of error, warning or information messages that result from a system action.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="OperationOutcome">
    <xs:annotation>
      <xs:documentation xml:lang="en">A collection of error, warning or information messages that result from a system action.</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="issue" type="OperationOutcome.Issue" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An error, warning or information message that results from a system action.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OperationOutcome.Issue">
    <xs:annotation>
      <xs:documentation xml:lang="en">A collection of error, warning or information messages that result from a system action.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="severity" minOccurs="1" maxOccurs="1" type="IssueSeverity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the issue indicates a variation from successful processing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="IssueType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="details" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional details about the error. This may be a text description of the error, or a system code that identifies the error.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="diagnostics" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional diagnostic information about the issue.  Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.  For HTTP errors, will be "http." + the parameter name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A simple FHIRPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="IssueType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="invalid">
        <xs:annotation>
          <xs:documentation xml:lang="en">Invalid Content</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="structure">
        <xs:annotation>
          <xs:documentation xml:lang="en">Structural Issue</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="required">
        <xs:annotation>
          <xs:documentation xml:lang="en">Required element missing</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="value">
        <xs:annotation>
          <xs:documentation xml:lang="en">Element value invalid</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="invariant">
        <xs:annotation>
          <xs:documentation xml:lang="en">Validation rule failed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="security">
        <xs:annotation>
          <xs:documentation xml:lang="en">Security Problem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="login">
        <xs:annotation>
          <xs:documentation xml:lang="en">Login Required</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown User</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="expired">
        <xs:annotation>
          <xs:documentation xml:lang="en">Session Expired</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="forbidden">
        <xs:annotation>
          <xs:documentation xml:lang="en">Forbidden</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suppressed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Information  Suppressed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="processing">
        <xs:annotation>
          <xs:documentation xml:lang="en">Processing Failure</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not-supported">
        <xs:annotation>
          <xs:documentation xml:lang="en">Content not supported</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="duplicate">
        <xs:annotation>
          <xs:documentation xml:lang="en">Duplicate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not-found">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not Found</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="too-long">
        <xs:annotation>
          <xs:documentation xml:lang="en">Content Too Long</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="code-invalid">
        <xs:annotation>
          <xs:documentation xml:lang="en">Invalid Code</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="extension">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unacceptable Extension</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="too-costly">
        <xs:annotation>
          <xs:documentation xml:lang="en">Operation Too Costly</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="business-rule">
        <xs:annotation>
          <xs:documentation xml:lang="en">Business Rule Violation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="conflict">
        <xs:annotation>
          <xs:documentation xml:lang="en">Edit Version Conflict</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="incomplete">
        <xs:annotation>
          <xs:documentation xml:lang="en">Incomplete Results</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="transient">
        <xs:annotation>
          <xs:documentation xml:lang="en">Transient Issue</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="lock-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Lock Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="no-store">
        <xs:annotation>
          <xs:documentation xml:lang="en">No Store Available</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="exception">
        <xs:annotation>
          <xs:documentation xml:lang="en">Exception</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="timeout">
        <xs:annotation>
          <xs:documentation xml:lang="en">Timeout</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="throttled">
        <xs:annotation>
          <xs:documentation xml:lang="en">Throttled</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="informational">
        <xs:annotation>
          <xs:documentation xml:lang="en">Informational Note</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="IssueType">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code that describes the type of issue.</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="IssueType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="IssueSeverity-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="fatal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fatal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="warning">
        <xs:annotation>
          <xs:documentation xml:lang="en">Warning</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="information">
        <xs:annotation>
          <xs:documentation xml:lang="en">Information</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="IssueSeverity">
    <xs:annotation>
      <xs:documentation xml:lang="en">How the issue affects the success of the action.</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="IssueSeverity-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Organization" type="Organization">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Organization">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.</xs:documentation>
      <xs:documentation 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">Identifier for the organization that is used to identify the organization across multiple disparate systems.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the organization's record is still in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind(s) of organization that this is.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name associated with the organization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="alias" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A list of alternate names that the organization is known as, or was known as in the past.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contact detail for the organization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="unbounded" type="Address">
            <xs:annotation>
              <xs:documentation xml:lang="en">An address for the organization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization of which this organization forms a part.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" type="Organization.Contact" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact for the organization for a certain purpose.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Technical endpoints providing access to services operated for the organization.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Organization.Contact">
    <xs:annotation>
      <xs:documentation xml:lang="en">A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates a purpose for which the contact can be reached.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="HumanName">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name associated with the contact.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="1" type="Address">
            <xs:annotation>
              <xs:documentation xml:lang="en">Visiting or postal addresses for the contact.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Parameters" type="Parameters">
    <xs:annotation>
      <xs:documentation xml:lang="en">This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Parameters">
    <xs:annotation>
      <xs:documentation xml:lang="en">This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it.</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="Resource">
        <xs:sequence>
          <xs:element name="parameter" type="Parameters.Parameter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A parameter passed to or received from the operation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Parameters.Parameter">
    <xs:annotation>
      <xs:documentation xml:lang="en">This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the parameter (reference to the operation definition).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the parameter is a data type.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueBase64Binary" type="base64Binary" />
            <xs:element name="valueBoolean" type="boolean" />
            <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="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="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="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="valueReference" type="Reference" />
            <xs:element name="valueSampledData" type="SampledData" />
            <xs:element name="valueSignature" type="Signature" />
            <xs:element name="valueTiming" type="Timing" />
            <xs:element name="valueMeta" type="Meta" />
          </xs:choice>
          <xs:element name="resource" minOccurs="0" maxOccurs="1" type="ResourceContainer">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the parameter is a whole resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="part" type="Parameters.Parameter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A named part of a multi-part parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Patient" type="Patient">
    <xs:annotation>
      <xs:documentation xml:lang="en">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Patient">
    <xs:annotation>
      <xs:documentation xml:lang="en">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</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">An identifier for this patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this patient record is in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="unbounded" type="HumanName">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name associated with the individual.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation xml:lang="en">Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="birthDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date of birth for the individual.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates if the individual is deceased or not.</xs:documentation>
            </xs:annotation>
            <xs:element name="deceasedBoolean" type="boolean" />
            <xs:element name="deceasedDateTime" type="dateTime" />
          </xs:choice>
          <xs:element name="address" minOccurs="0" maxOccurs="unbounded" type="Address">
            <xs:annotation>
              <xs:documentation xml:lang="en">Addresses for the individual.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="maritalStatus" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">This field contains a patient's most recent marital (civil) status.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).</xs:documentation>
            </xs:annotation>
            <xs:element name="multipleBirthBoolean" type="boolean" />
            <xs:element name="multipleBirthInteger" type="integer" />
          </xs:choice>
          <xs:element name="photo" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">Image of the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" type="Patient.Contact" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contact party (e.g. guardian, partner, friend) for the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="animal" type="Patient.Animal" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">This patient is known to be an animal.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="communication" type="Patient.Communication" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Languages which may be used to communicate with the patient about his or her health.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="generalPractitioner" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Patient's nominated care provider.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Organization that is the custodian of the patient record.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="link" type="Patient.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Link to another patient resource that concerns the same actual patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Patient.Contact">
    <xs:annotation>
      <xs:documentation xml:lang="en">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="relationship" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The nature of the relationship between the patient and the contact person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="HumanName">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name associated with the contact person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="1" type="Address">
            <xs:annotation>
              <xs:documentation xml:lang="en">Address for the contact person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation xml:lang="en">Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Organization on behalf of which the contact is acting or for which the contact is working.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during which this contact person or organization is valid to be contacted relating to this patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Patient.Animal">
    <xs:annotation>
      <xs:documentation xml:lang="en">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="species" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the high level taxonomic categorization of the kind of animal.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="breed" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the detailed categorization of the kind of animal.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="genderStatus" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the current state of the animal's reproductive organs.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Patient.Communication">
    <xs:annotation>
      <xs:documentation xml:lang="en">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="language" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="preferred" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Patient.Link">
    <xs:annotation>
      <xs:documentation xml:lang="en">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="other" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The other patient resource that the link refers to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="LinkType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of link between this patient resource and another patient resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="LinkType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="replaced-by">
        <xs:annotation>
          <xs:documentation xml:lang="en">Replaced-by</xs:documentation>
          <xs:documentation xml:lang="nl">vervangen</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="replaces">
        <xs:annotation>
          <xs:documentation xml:lang="en">Replaces</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refer">
        <xs:annotation>
          <xs:documentation xml:lang="en">Refer</xs:documentation>
          <xs:documentation xml:lang="nl">verwijzing</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="seealso">
        <xs:annotation>
          <xs:documentation xml:lang="en">See also</xs:documentation>
          <xs:documentation xml:lang="nl">zie ook</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="LinkType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of link between this patient resource and another patient resource.</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="LinkType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="PaymentNotice" type="PaymentNotice">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the status of the payment for goods and services rendered, and the request and response resource references.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="PaymentNotice">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the status of the payment for goods and services rendered, and the request and response resource references.</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">The notice business identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference of resource for which payment is being made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference of response to resource for which payment is being made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="statusDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when the above payment action occurrred.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when this resource was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Insurer who is target  of the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="paymentStatus" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The payment status, typically paid: payment sent, cleared: payment received.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="PaymentReconciliation" type="PaymentReconciliation">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides payment details and claim references supporting a bulk payment.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="PaymentReconciliation">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides payment details and claim references supporting a bulk payment.</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">The Response business identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period of time for which payments have been gathered into this bulk payment for settlement.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when the enclosed suite of services were performed or completed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Insurer who produced this adjudicated response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Original request resource reference.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Transaction status: error, complete.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the status of the adjudication.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" type="PaymentReconciliation.Detail" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of individual settlement amounts and the corresponding transaction.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The form to be used for printing the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="total" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Total payment amount.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="processNote" type="PaymentReconciliation.ProcessNote" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Suite of notes.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PaymentReconciliation.Detail">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides payment details and claim references supporting a bulk payment.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Code to indicate the nature of the payment, adjustment, funds advance, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The claim or financial resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The claim response resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="submitter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Organization which submitted the claim or financial transaction.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payee" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is receiving the payment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date of the invoice or financial resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Money">
            <xs:annotation>
              <xs:documentation xml:lang="en">Amount paid for this detail.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PaymentReconciliation.ProcessNote">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides payment details and claim references supporting a bulk payment.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The note purpose: Print/Display.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The note text.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Person" type="Person">
    <xs:annotation>
      <xs:documentation xml:lang="en">Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Person">
    <xs:annotation>
      <xs:documentation xml:lang="en">Demographics and administrative information about a person independent of a specific health-related context.</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">Identifier for a person within a particular scope.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="unbounded" type="HumanName">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name associated with the person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation xml:lang="en">Administrative Gender.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="birthDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The birth date for the person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="unbounded" type="Address">
            <xs:annotation>
              <xs:documentation xml:lang="en">One or more addresses for the person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="photo" minOccurs="0" maxOccurs="1" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="managingOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization that is the custodian of the person record.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this person's record is in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="link" type="Person.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Link to a resource that concerns the same actual person.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Person.Link">
    <xs:annotation>
      <xs:documentation xml:lang="en">Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="target" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resource to which this actual person is associated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assurance" minOccurs="0" maxOccurs="1" type="IdentityAssuranceLevel">
            <xs:annotation>
              <xs:documentation xml:lang="en">Level of assurance that this link is actually associated with the target resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="IdentityAssuranceLevel-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="level1">
        <xs:annotation>
          <xs:documentation xml:lang="en">Level 1</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="level2">
        <xs:annotation>
          <xs:documentation xml:lang="en">Level 2</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="level3">
        <xs:annotation>
          <xs:documentation xml:lang="en">Level 3</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="level4">
        <xs:annotation>
          <xs:documentation xml:lang="en">Level 4</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="IdentityAssuranceLevel">
    <xs:annotation>
      <xs:documentation xml:lang="en">The level of confidence that this link represents the same actual person, based on NIST Authentication Levels.</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="IdentityAssuranceLevel-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="PlanDefinition" type="PlanDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="PlanDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this plan definition is (or will be) published. The URL SHOULD include the major version of the plan definition. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this plan definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the plan definition.</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 of asset the plan definition represents, e.g. an order set, protocol, or event-condition-action rule.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this plan definition. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the plan definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the plan definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the plan definition from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this plan definition is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="usage" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A detailed description of how the asset is used from a clinical perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="approvalDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastReviewDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="effectivePeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during which the plan definition content was or is planned to be in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate plan definition instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the plan definition is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="topic" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive topics related to the content of the plan definition. Topics provide a high-level categorization of the definition that can be useful for filtering and searching.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contributor" minOccurs="0" maxOccurs="unbounded" type="Contributor">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contributor to the content of the asset, including authors, editors, reviewers, and endorsers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relatedArtifact" minOccurs="0" maxOccurs="unbounded" type="RelatedArtifact">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="library" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a Library resource containing any formal logic used by the plan definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="goal" type="PlanDefinition.Goal" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" type="PlanDefinition.Action" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An action to be taken as part of the plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PlanDefinition.Goal">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates a category the goal falls within.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the expected level of importance associated with reaching/sustaining the defined goal.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="start" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The event after which the goal should begin being pursued.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="addresses" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies problems, conditions, issues, or concerns the goal is intended to address.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="unbounded" type="RelatedArtifact">
            <xs:annotation>
              <xs:documentation xml:lang="en">Didactic or other informational resources associated with the goal that provide further supporting information about the goal. Information resources can include inline text commentary and links to web resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" type="PlanDefinition.Target" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates what should be done and within what timeframe.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PlanDefinition.Target">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="measure" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The parameter whose value is to be tracked, e.g. body weigth, blood pressure, or hemoglobin A1c level.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. Whan a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.</xs:documentation>
            </xs:annotation>
            <xs:element name="detailQuantity" type="Quantity" />
            <xs:element name="detailRange" type="Range" />
            <xs:element name="detailCodeableConcept" type="CodeableConcept" />
          </xs:choice>
          <xs:element name="due" minOccurs="0" maxOccurs="1" type="Duration">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the timeframe after the start of the goal in which the goal should be met.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PlanDefinition.Action">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="label" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A user-visible label for the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The title of the action displayed to a user.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description of the action used to provide a summary to display to the user.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="textEquivalent" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a the section of a documentation template.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of why this action is necessary or appropriate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="unbounded" type="RelatedArtifact">
            <xs:annotation>
              <xs:documentation xml:lang="en">Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="goalId" minOccurs="0" maxOccurs="unbounded" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="triggerDefinition" minOccurs="0" maxOccurs="unbounded" type="TriggerDefinition">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of when the action should be triggered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="condition" type="PlanDefinition.Condition" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An expression that describes applicability criteria, or start/stop conditions for the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="input" minOccurs="0" maxOccurs="unbounded" type="DataRequirement">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines input data requirements for the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="output" minOccurs="0" maxOccurs="unbounded" type="DataRequirement">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines the outputs of the action, if any.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relatedAction" type="PlanDefinition.RelatedAction" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A relationship to another action such as "before" or "30-60 minutes after start of".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An optional value describing when the action should be performed.</xs:documentation>
            </xs:annotation>
            <xs:element name="timingDateTime" type="dateTime" />
            <xs:element name="timingPeriod" type="Period" />
            <xs:element name="timingDuration" type="Duration" />
            <xs:element name="timingRange" type="Range" />
            <xs:element name="timingTiming" type="Timing" />
          </xs:choice>
          <xs:element name="participant" type="PlanDefinition.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates who should participate in performing the action described.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of action to perform (create, update, remove).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="groupingBehavior" minOccurs="0" maxOccurs="1" type="ActionGroupingBehavior">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines the grouping behavior for the action and its children.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="selectionBehavior" minOccurs="0" maxOccurs="1" type="ActionSelectionBehavior">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines the selection behavior for the action and its children.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requiredBehavior" minOccurs="0" maxOccurs="1" type="ActionRequiredBehavior">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines the requiredness behavior for the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="precheckBehavior" minOccurs="0" maxOccurs="1" type="ActionPrecheckBehavior">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines whether the action should usually be preselected.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="cardinalityBehavior" minOccurs="0" maxOccurs="1" type="ActionCardinalityBehavior">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines whether the action can be selected multiple times.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="transform" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dynamicValue" type="PlanDefinition.DynamicValue" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" type="PlanDefinition.Action" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PlanDefinition.Condition">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="kind" minOccurs="1" maxOccurs="1" type="ActionConditionKind">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A brief, natural language description of the condition that effectively communicates the intended semantics.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The media type of the language for the expression.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">An expression that returns true or false, indicating whether or not the condition is satisfied.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PlanDefinition.RelatedAction">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="actionId" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The element id of the related action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="ActionRelationshipType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The relationship of this action to the related action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.</xs:documentation>
            </xs:annotation>
            <xs:element name="offsetDuration" type="Duration" />
            <xs:element name="offsetRange" type="Range" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PlanDefinition.Participant">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="ActionParticipantType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of participant in the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The role the participant should play in performing the described action.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PlanDefinition.DynamicValue">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A brief, natural language description of the intended semantics of the dynamic value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="path" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The media type of the language for the expression.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">An expression specifying the value of the customized element.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ActionRequiredBehavior-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="must">
        <xs:annotation>
          <xs:documentation xml:lang="en">Must</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="could">
        <xs:annotation>
          <xs:documentation xml:lang="en">Could</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="must-unless-documented">
        <xs:annotation>
          <xs:documentation xml:lang="en">Must Unless Documented</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ActionRequiredBehavior">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines requiredness behavior for selecting an action or an action group</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="ActionRequiredBehavior-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ActionRelationshipType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="before-start">
        <xs:annotation>
          <xs:documentation xml:lang="en">Before Start</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="before">
        <xs:annotation>
          <xs:documentation xml:lang="en">Before</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="before-end">
        <xs:annotation>
          <xs:documentation xml:lang="en">Before End</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="concurrent-with-start">
        <xs:annotation>
          <xs:documentation xml:lang="en">Concurrent With Start</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="concurrent">
        <xs:annotation>
          <xs:documentation xml:lang="en">Concurrent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="concurrent-with-end">
        <xs:annotation>
          <xs:documentation xml:lang="en">Concurrent With End</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="after-start">
        <xs:annotation>
          <xs:documentation xml:lang="en">After Start</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="after">
        <xs:annotation>
          <xs:documentation xml:lang="en">After</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="after-end">
        <xs:annotation>
          <xs:documentation xml:lang="en">After End</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ActionRelationshipType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines the types of relationships between actions</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="ActionRelationshipType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ActionGroupingBehavior-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="visual-group">
        <xs:annotation>
          <xs:documentation xml:lang="en">Visual Group</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="logical-group">
        <xs:annotation>
          <xs:documentation xml:lang="en">Logical Group</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sentence-group">
        <xs:annotation>
          <xs:documentation xml:lang="en">Sentence Group</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ActionGroupingBehavior">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines organization behavior of a group</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="ActionGroupingBehavior-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ActionSelectionBehavior-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="any">
        <xs:annotation>
          <xs:documentation xml:lang="en">Any</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="all">
        <xs:annotation>
          <xs:documentation xml:lang="en">All</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="all-or-none">
        <xs:annotation>
          <xs:documentation xml:lang="en">All Or None</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="exactly-one">
        <xs:annotation>
          <xs:documentation xml:lang="en">Exactly One</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="at-most-one">
        <xs:annotation>
          <xs:documentation xml:lang="en">At Most One</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="one-or-more">
        <xs:annotation>
          <xs:documentation xml:lang="en">One Or More</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ActionSelectionBehavior">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines selection behavior of a group</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="ActionSelectionBehavior-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ActionCardinalityBehavior-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="single">
        <xs:annotation>
          <xs:documentation xml:lang="en">Single</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="multiple">
        <xs:annotation>
          <xs:documentation xml:lang="en">Multiple</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ActionCardinalityBehavior">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines behavior for an action or a group for how many times that item may be repeated</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="ActionCardinalityBehavior-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ActionPrecheckBehavior-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="yes">
        <xs:annotation>
          <xs:documentation xml:lang="en">Yes</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="no">
        <xs:annotation>
          <xs:documentation xml:lang="en">No</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ActionPrecheckBehavior">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines selection frequency behavior for an action or group</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="ActionPrecheckBehavior-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ActionConditionKind-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="applicability">
        <xs:annotation>
          <xs:documentation xml:lang="en">Applicability</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="start">
        <xs:annotation>
          <xs:documentation xml:lang="en">Start</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stop">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stop</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ActionConditionKind">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines the kinds of conditions that can appear on actions</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="ActionConditionKind-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Practitioner" type="Practitioner">
    <xs:annotation>
      <xs:documentation xml:lang="en">A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Practitioner">
    <xs:annotation>
      <xs:documentation xml:lang="en">A person who is directly or indirectly involved in the provisioning of healthcare.</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">An identifier that applies to this person in this role.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this practitioner's record is in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="unbounded" type="HumanName">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name(s) associated with the practitioner.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contact detail for the practitioner, e.g. a telephone number or an email address.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="unbounded" type="Address">
            <xs:annotation>
              <xs:documentation xml:lang="en">Address(es) of the practitioner that are not role specific (typically home address). 
Work addresses are not typically entered in this property as they are usually role dependent.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation xml:lang="en">Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="birthDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date of birth for the practitioner.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="photo" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">Image of the person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="qualification" type="Practitioner.Qualification" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Qualifications obtained by training and certification.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="communication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A language the practitioner is able to use in patient communication.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Practitioner.Qualification">
    <xs:annotation>
      <xs:documentation xml:lang="en">A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier that applies to this person's qualification in this role.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Coded representation of the qualification.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Period during which the qualification is valid.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="issuer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Organization that regulates and issues the qualification.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="PractitionerRole" type="PractitionerRole">
    <xs:annotation>
      <xs:documentation xml:lang="en">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="PractitionerRole">
    <xs:annotation>
      <xs:documentation xml:lang="en">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</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">Business Identifiers that are specific to a role/location.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this practitioner's record is in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during which the person is authorized to act as a practitioner in these role(s) for the organization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="practitioner" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Practitioner that is able to provide the defined services for the organation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization where the Practitioner performs the roles associated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Roles which this practitioner is authorized to perform for the organization.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specialty" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specific specialty of the practitioner.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The location(s) at which this practitioner provides care.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="healthcareService" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The list of healthcare services that this worker provides for this role's Organization/Location(s).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details that are specific to the role/location/service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="availableTime" type="PractitionerRole.AvailableTime" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A collection of times that the Service Site is available.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notAvailable" type="PractitionerRole.NotAvailable" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The HealthcareService is not available during this period of time due to the provided reason.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="availabilityExceptions" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Technical endpoints providing access to services operated for the practitioner with this role.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PractitionerRole.AvailableTime">
    <xs:annotation>
      <xs:documentation xml:lang="en">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="daysOfWeek" minOccurs="0" maxOccurs="unbounded" type="DaysOfWeek">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates which days of the week are available between the start and end Times.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="allDay" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Is this always available? (hence times are irrelevant) e.g. 24 hour service.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="availableStartTime" minOccurs="0" maxOccurs="1" type="time">
            <xs:annotation>
              <xs:documentation xml:lang="en">The opening time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="availableEndTime" minOccurs="0" maxOccurs="1" type="time">
            <xs:annotation>
              <xs:documentation xml:lang="en">The closing time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PractitionerRole.NotAvailable">
    <xs:annotation>
      <xs:documentation xml:lang="en">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reason that can be presented to the user as to why this time is not available.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="during" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Service is not available (seasonally or for a public holiday) from this date.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Procedure" type="Procedure">
    <xs:annotation>
      <xs:documentation xml:lang="en">An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Procedure">
    <xs:annotation>
      <xs:documentation xml:lang="en">An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy.</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">This records identifiers associated with this procedure that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A protocol, guideline, orderset or other definition that was adhered to in whole or in part by this procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a resource that contains details of the request for this procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A larger event of which this particular procedure is a component or step.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EventStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code specifying the state of the procedure. Generally this will be in-progress or completed state.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notDone" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Set this to true if the record is saying that the procedure was NOT performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="notDoneReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code indicating why the procedure was not performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure").</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person, animal or group on which the procedure was performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter during which the procedure was performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.</xs:documentation>
            </xs:annotation>
            <xs:element name="performedDateTime" type="dateTime" />
            <xs:element name="performedPeriod" type="Period" />
          </xs:choice>
          <xs:element name="performer" type="Procedure.Performer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Limited to 'real' people rather than equipment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The coded reason why the procedure was performed. This may be coded entity of some type, or may simply be present as text.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The condition that is the reason why the procedure was performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The outcome of the procedure - did it resolve reasons for the procedure being performed?</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="report" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">This could be a histology result, pathology report, surgical report, etc..</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="complication" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="complicationDetail" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Any complications that occurred during the procedure, or in the immediate post-performance period.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="followUp" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Any other notes about the procedure.  E.g. the operative notes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="focalDevice" type="Procedure.FocalDevice" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="usedReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies medications, devices and any other substance used as part of the procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="usedCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies coded items that were used as part of the procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Procedure.Performer">
    <xs:annotation>
      <xs:documentation xml:lang="en">An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">For example: surgeon, anaethetist, endoscopist.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who was involved in the procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization the device or practitioner was acting on behalf of.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Procedure.FocalDevice">
    <xs:annotation>
      <xs:documentation xml:lang="en">An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="action" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of change that happened to the device during the procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="manipulated" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device that was manipulated (changed) during the procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ProcedureRequest" type="ProcedureRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a request for diagnostic investigations, treatments, or operations to be performed.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ProcedureRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a request for diagnostic investigations, treatments, or operations to be performed.</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">Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Protocol or definition followed by this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Plan/proposal/order fulfilled by this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="replaces" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The request takes the place of the referenced completed or terminated request(s).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requisition" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A shared identifier common to all procedure or diagnostic requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="RequestStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the order.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="intent" minOccurs="1" maxOccurs="1" type="RequestIntent">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the request is a proposal, plan, an original order or a reflex order.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="RequestPriority">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how quickly the ProcedureRequest should be addressed with respect to other requests.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="doNotPerform" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Set this to true if the record is saying that the procedure should NOT be performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure").</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that identifies a particular procedure, diagnostic investigation, or panel of investigations, that have been requested.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">On whom or what the procedure or diagnostic is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">An encounter or episode of care that provides additional information about the healthcare context in which this request is made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date/time at which the diagnostic testing should occur.</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime" />
            <xs:element name="occurrencePeriod" type="Period" />
            <xs:element name="occurrenceTiming" type="Timing" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.  For example "pain", "on flare-up", etc.</xs:documentation>
            </xs:annotation>
            <xs:element name="asNeededBoolean" type="boolean" />
            <xs:element name="asNeededCodeableConcept" type="CodeableConcept" />
          </xs:choice>
          <xs:element name="authoredOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the request transitioned to being actionable.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requester" type="ProcedureRequest.Requester" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual who initiated the request and has responsibility for its activation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performerType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Desired type of performer for doing the diagnostic testing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The desired perfomer for doing the diagnostic testing.  For example, the surgeon, dermatopathologist, endoscopist, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">An explanation or justification for why this diagnostic investigation is being requested in coded or textual form.   This is often for billing purposes.  May relate to the resources referred to in supportingInformation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates another resource that provides a justification for why this diagnostic investigation is being requested.   May relate to the resources referred to in supportingInformation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingInfo" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional clinical information about the patient or specimen that may influence the procedure or diagnostics or their interpretations.     This information includes diagnosis, clinical findings and other observations.  In laboratory ordering these are typically referred to as "ask at order entry questions (AOEs)".  This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example,  reporting the amount of inspired oxygen for blood gas measurements.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specimen" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">One or more specimens that the laboratory procedure will use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Anatomic location where the procedure should be performed. This is the target site.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Any other notes and comments made about the service request. For example, letting provider know that "patient hates needles" or other provider instructions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relevantHistory" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Key events in the history of the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ProcedureRequest.Requester">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a request for diagnostic investigations, treatments, or operations to be performed.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="agent" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner or organization who initiated the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization the device or practitioner was acting on behalf of.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="RequestIntent-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="proposal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Proposal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="plan">
        <xs:annotation>
          <xs:documentation xml:lang="en">Plan</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="order">
        <xs:annotation>
          <xs:documentation xml:lang="en">Order</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="original-order">
        <xs:annotation>
          <xs:documentation xml:lang="en">Original Order</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="reflex-order">
        <xs:annotation>
          <xs:documentation xml:lang="en">Reflex Order</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="filler-order">
        <xs:annotation>
          <xs:documentation xml:lang="en">Filler Order</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="instance-order">
        <xs:annotation>
          <xs:documentation xml:lang="en">Instance Order</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="option">
        <xs:annotation>
          <xs:documentation xml:lang="en">Option</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="RequestIntent">
    <xs:annotation>
      <xs:documentation xml:lang="en">The kind of procedure or diagnostic request</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="RequestIntent-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ProcessRequest" type="ProcessRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ProcessRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources.</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">The ProcessRequest business identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" minOccurs="0" maxOccurs="1" type="ActionList">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is the target of the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when this resource was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="provider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who is responsible for the action specified in this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is responsible for the action speccified in this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference of resource which is the target or subject of this action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference of a prior response to resource which is the target or subject of this action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="nullify" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If true remove all history excluding audit.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reference" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to supply which authenticates the process.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="item" type="ProcessRequest.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="include" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Names of resource types to include.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Names of resource types to exclude.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">A period of time during which the fulfilling resources would have been created.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ProcessRequest.Item">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="sequenceLinkId" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">A service line number.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ActionList-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="cancel">
        <xs:annotation>
          <xs:documentation xml:lang="en">Cancel, Reverse or Nullify</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="poll">
        <xs:annotation>
          <xs:documentation xml:lang="en">Poll</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="reprocess">
        <xs:annotation>
          <xs:documentation xml:lang="en">Re-Process</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="status">
        <xs:annotation>
          <xs:documentation xml:lang="en">Status Check</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ActionList">
    <xs:annotation>
      <xs:documentation xml:lang="en">List of allowable action which this resource can request.</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="ActionList-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ProcessResponse" type="ProcessResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides processing status, errors and notes from the processing of a resource.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ProcessResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides processing status, errors and notes from the processing of a resource.</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">The Response business identifier.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="created" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when the enclosed suite of services were performed or completed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="organization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization who produced this adjudicated response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Original request resource reference.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="outcome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Transaction status: error, complete, held.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="disposition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the status of the adjudication or processing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestProvider" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestOrganization" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization which is responsible for the services rendered to the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="form" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The form to be used for printing the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="processNote" type="ProcessResponse.ProcessNote" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Suite of processing notes or additional requirements if the processing has been held.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="error" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Processing errors.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="communicationRequest" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Request for additional supporting or authorizing information, such as: documents, images or resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ProcessResponse.ProcessNote">
    <xs:annotation>
      <xs:documentation xml:lang="en">This resource provides processing status, errors and notes from the processing of a resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The note purpose: Print/Display.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The note text.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Provenance" type="Provenance">
    <xs:annotation>
      <xs:documentation xml:lang="en">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Provenance">
    <xs:annotation>
      <xs:documentation xml:lang="en">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</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="target" minOccurs="1" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during which the activity occurred.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recorded" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">The instant of time at which the activity was recorded.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="policy" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the activity occurred, if relevant.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reason that the activity was taking place.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="activity" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="agent" type="Provenance.Agent" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An actor taking a role in an activity  for which it can be assigned some degree of responsibility for the activity taking place.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="entity" type="Provenance.Entity" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An entity used in this activity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="signature" minOccurs="0" maxOccurs="unbounded" type="Signature">
            <xs:annotation>
              <xs:documentation xml:lang="en">A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Provenance.Agent">
    <xs:annotation>
      <xs:documentation xml:lang="en">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual, device or organization that participated in the event.</xs:documentation>
            </xs:annotation>
            <xs:element name="whoUri" type="uri" />
            <xs:element name="whoReference" type="Reference" />
          </xs:choice>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual, device, or organization for whom the change was made.</xs:documentation>
            </xs:annotation>
            <xs:element name="onBehalfOfUri" type="uri" />
            <xs:element name="onBehalfOfReference" type="Reference" />
          </xs:choice>
          <xs:element name="relatedAgentType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of relationship between agents.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Provenance.Entity">
    <xs:annotation>
      <xs:documentation xml:lang="en">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="role" minOccurs="1" maxOccurs="1" type="ProvenanceEntityRole">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the entity was used during the activity.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative.</xs:documentation>
            </xs:annotation>
            <xs:element name="whatUri" type="uri" />
            <xs:element name="whatReference" type="Reference" />
            <xs:element name="whatIdentifier" type="Identifier" />
          </xs:choice>
          <xs:element name="agent" type="Provenance.Agent" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ProvenanceEntityRole-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="derivation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Derivation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="revision">
        <xs:annotation>
          <xs:documentation xml:lang="en">Revision</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="quotation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Quotation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="source">
        <xs:annotation>
          <xs:documentation xml:lang="en">Source</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="removal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Removal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ProvenanceEntityRole">
    <xs:annotation>
      <xs:documentation xml:lang="en">How an entity was used in an activity.</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="ProvenanceEntityRole-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Questionnaire" type="Questionnaire">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Questionnaire">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. The URL SHOULD include the major version of the questionnaire. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the questionnaire.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this questionnaire. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the questionnaire was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the questionnaire.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the questionnaire from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this questionnaire is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="approvalDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastReviewDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="effectivePeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during which the questionnaire content was or is planned to be in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate questionnaire instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the questionnaire is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier for this question or group of questions in a particular terminology such as LOINC.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subjectType" minOccurs="0" maxOccurs="unbounded" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The types of subjects that can be the subject of responses created for the questionnaire.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="item" type="Questionnaire.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A particular question, question grouping or display text that is part of the questionnaire.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Questionnaire.Item">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="linkId" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to an [[[ElementDefinition]]] that provides the details for the item. If a definition is provided, then the following element values can be inferred from the definition: 

* code (ElementDefinition.code)
* type (ElementDefinition.type)
* required (ElementDefinition.min)
* repeats (ElementDefinition.max)
* maxLength (ElementDefinition.maxLength)
* options (ElementDefinition.binding)

Any information provided in these elements on a Questionnaire Item overrides the information from the definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prefix" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of a section, the text of a question or text content for a display item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="QuestionnaireItemType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="enableWhen" type="Questionnaire.EnableWhen" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="required" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indication, if true, that the item must be present in a "completed" QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="repeats" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indication, if true, that the item may occur multiple times in the response, collecting multiple answers answers for questions or multiple sets of answers for groups.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="readOnly" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="maxLength" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="options" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="option" type="Questionnaire.Option" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">One of the permitted answers for a "choice" or "open-choice" question.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value that should be defaulted when initially rendering the questionnaire for user input.</xs:documentation>
            </xs:annotation>
            <xs:element name="initialBoolean" type="boolean" />
            <xs:element name="initialDecimal" type="decimal" />
            <xs:element name="initialInteger" type="integer" />
            <xs:element name="initialDate" type="date" />
            <xs:element name="initialDateTime" type="dateTime" />
            <xs:element name="initialTime" type="time" />
            <xs:element name="initialString" type="string" />
            <xs:element name="initialUri" type="uri" />
            <xs:element name="initialAttachment" type="Attachment" />
            <xs:element name="initialCoding" type="Coding" />
            <xs:element name="initialQuantity" type="Quantity" />
            <xs:element name="initialReference" type="Reference" />
          </xs:choice>
          <xs:element name="item" type="Questionnaire.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Text, questions and other groups to be nested beneath a question or group.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Questionnaire.EnableWhen">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="question" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="hasAnswer" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indication that this item should be enabled only if the specified question is answered (hasAnswer=true) or not answered (hasAnswer=false).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An answer that the referenced question must match in order for the item to be enabled.</xs:documentation>
            </xs:annotation>
            <xs:element name="answerBoolean" type="boolean" />
            <xs:element name="answerDecimal" type="decimal" />
            <xs:element name="answerInteger" type="integer" />
            <xs:element name="answerDate" type="date" />
            <xs:element name="answerDateTime" type="dateTime" />
            <xs:element name="answerTime" type="time" />
            <xs:element name="answerString" type="string" />
            <xs:element name="answerUri" type="uri" />
            <xs:element name="answerAttachment" type="Attachment" />
            <xs:element name="answerCoding" type="Coding" />
            <xs:element name="answerQuantity" type="Quantity" />
            <xs:element name="answerReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Questionnaire.Option">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A potential answer that's allowed as the answer to this question.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueInteger" type="integer" />
            <xs:element name="valueDate" type="date" />
            <xs:element name="valueTime" type="time" />
            <xs:element name="valueString" type="string" />
            <xs:element name="valueCoding" type="Coding" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="QuestionnaireItemType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="group">
        <xs:annotation>
          <xs:documentation xml:lang="en">Group</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="display">
        <xs:annotation>
          <xs:documentation xml:lang="en">Display</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="boolean">
        <xs:annotation>
          <xs:documentation xml:lang="en">Boolean</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="decimal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Decimal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="integer">
        <xs:annotation>
          <xs:documentation xml:lang="en">Integer</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="date">
        <xs:annotation>
          <xs:documentation xml:lang="en">Date</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dateTime">
        <xs:annotation>
          <xs:documentation xml:lang="en">Date Time</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="time">
        <xs:annotation>
          <xs:documentation xml:lang="en">Time</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="string">
        <xs:annotation>
          <xs:documentation xml:lang="en">String</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="text">
        <xs:annotation>
          <xs:documentation xml:lang="en">Text</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="url">
        <xs:annotation>
          <xs:documentation xml:lang="en">Url</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="choice">
        <xs:annotation>
          <xs:documentation xml:lang="en">Choice</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="open-choice">
        <xs:annotation>
          <xs:documentation xml:lang="en">Open Choice</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="attachment">
        <xs:annotation>
          <xs:documentation xml:lang="en">Attachment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="reference">
        <xs:annotation>
          <xs:documentation xml:lang="en">Reference</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="quantity">
        <xs:annotation>
          <xs:documentation xml:lang="en">Quantity</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="QuestionnaireItemType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Distinguishes groups from questions and display text and indicates data type for questions</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="QuestionnaireItemType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="QuestionnaireResponse" type="QuestionnaireResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="QuestionnaireResponse">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A business identifier assigned to a particular completed (or partially completed) questionnaire.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.  For example, a ProcedureRequest seeking an intake assessment or a decision support recommendation to assess for post-partum depression.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parent" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A procedure or observation that this questionnaire was performed as part of the execution of.  For example, the surgery a checklist was executed as part of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="questionnaire" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Questionnaire that defines and organizes the questions for which answers are being provided.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="QuestionnaireResponseStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The position of the questionnaire response within its overall lifecycle.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter or episode of care with primary association to the questionnaire response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="authored" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and/or time that this set of answers were last changed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="source" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person who answered the questions about the subject.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="item" type="QuestionnaireResponse.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A group or question item from the original questionnaire for which answers are provided.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="QuestionnaireResponse.Item">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="linkId" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to an [[[ElementDefinition]]] that provides the details for the item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="text" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Text that is displayed above the contents of the group or as the text of the question being answered.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="answer" type="QuestionnaireResponse.Answer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The respondent's answer(s) to the question.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="item" type="QuestionnaireResponse.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Questions or sub-groups nested beneath a question or group.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="QuestionnaireResponse.Answer">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The answer (or one of the answers) provided by the respondent to the question.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueBoolean" type="boolean" />
            <xs:element name="valueDecimal" type="decimal" />
            <xs:element name="valueInteger" type="integer" />
            <xs:element name="valueDate" type="date" />
            <xs:element name="valueDateTime" type="dateTime" />
            <xs:element name="valueTime" type="time" />
            <xs:element name="valueString" type="string" />
            <xs:element name="valueUri" type="uri" />
            <xs:element name="valueAttachment" type="Attachment" />
            <xs:element name="valueCoding" type="Coding" />
            <xs:element name="valueQuantity" type="Quantity" />
            <xs:element name="valueReference" type="Reference" />
          </xs:choice>
          <xs:element name="item" type="QuestionnaireResponse.Item" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Nested groups and/or questions found within this particular answer.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="QuestionnaireResponseStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="amended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Amended</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:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stopped</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="QuestionnaireResponseStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Lifecycle status of the questionnaire response.</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="QuestionnaireResponseStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ReferralRequest" type="ReferralRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ReferralRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization.</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">Business identifier that uniquely identifies the referral/care transfer request instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="replaces" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Completed or terminated request(s) whose function is taken by this new request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="groupIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The business identifier of the logical "grouping" request/order that this referral is a part of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="RequestStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the authorization/intention reflected by the referral request record.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="intent" minOccurs="1" maxOccurs="1" type="RequestIntent">
            <xs:annotation>
              <xs:documentation xml:lang="en">Distinguishes the "level" of authorization/demand implicit in this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indication of the type of referral (or where applicable the type of transfer of care) request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="RequestPriority">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indication of the urgency of referral (or where applicable the type of transfer of care) request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="serviceRequested" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The service(s) that is/are requested to be provided to the patient.  For example: cardiac pacemaker insertion.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient who is the subject of a referral or transfer of care request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter at which the request for referral or transfer of care is initiated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period of time within which the services identified in the referral/transfer of care is specified or required to occur.</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime" />
            <xs:element name="occurrencePeriod" type="Period" />
          </xs:choice>
          <xs:element name="authoredOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date/DateTime of creation for draft requests and date of activation for active requests.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requester" type="ReferralRequest.Requester" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual who initiated the request and has responsibility for its activation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specialty" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.  For example: Cardiology Gastroenterology Diabetology.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recipient" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonCode" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Description of clinical condition indicating why referral/transfer of care is requested.  For example:  Pathological Anomalies, Disabled (physical or mental),  Behavioral Management.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonReference" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates another resource whose existence justifies this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supportingInfo" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.  For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments made about the referral request by any of the participants.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relevantHistory" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Links to Provenance records for past versions of this resource or fulfilling request or event resources that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ReferralRequest.Requester">
    <xs:annotation>
      <xs:documentation xml:lang="en">Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="agent" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner, etc. who initiated the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization the device or practitioner was acting on behalf of.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="RelatedPerson" type="RelatedPerson">
    <xs:annotation>
      <xs:documentation xml:lang="en">Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="RelatedPerson">
    <xs:annotation>
      <xs:documentation xml:lang="en">Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>
      <xs:documentation 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">Identifier for a person within a particular scope.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this related person record is in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient this person is related to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The nature of the relationship between a patient and the related person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="unbounded" type="HumanName">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name associated with the person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="telecom" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="gender" minOccurs="0" maxOccurs="1" type="AdministrativeGender">
            <xs:annotation>
              <xs:documentation xml:lang="en">Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="birthDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the related person was born.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="address" minOccurs="0" maxOccurs="unbounded" type="Address">
            <xs:annotation>
              <xs:documentation xml:lang="en">Address where the related person can be contacted or visited.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="photo" minOccurs="0" maxOccurs="unbounded" type="Attachment">
            <xs:annotation>
              <xs:documentation xml:lang="en">Image of the person.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="RequestGroup" type="RequestGroup">
    <xs:annotation>
      <xs:documentation xml:lang="en">A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one".</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="RequestGroup">
    <xs:annotation>
      <xs:documentation xml:lang="en">A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one".</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">Allows a service to provide a unique, business identifier for the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="definition" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A plan, proposal or order that is fulfilled in whole or in part by this request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="replaces" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Completed or terminated request(s) whose function is taken by this new request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="groupIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="RequestStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The current state of the request. For request groups, the status reflects the status of all the requests in the group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="intent" minOccurs="1" maxOccurs="1" type="RequestIntent">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the level of authority/intentionality associated with the request and where the request fits into the workflow chain.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="RequestPriority">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how quickly the request should be addressed with respect to other requests.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The subject for which the request group was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the context of the request group, if any.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="authoredOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates when the request group was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="author" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a reference to the author of the request group.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the reason the request group was created. This is typically provided as a parameter to the evaluation and echoed by the service, although for some use cases, such as subscription- or event-based scenarios, it may provide an indication of the cause for the response.</xs:documentation>
            </xs:annotation>
            <xs:element name="reasonCodeableConcept" type="CodeableConcept" />
            <xs:element name="reasonReference" type="Reference" />
          </xs:choice>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides a mechanism to communicate additional information about the response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" type="RequestGroup.Action" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The actions, if any, produced by the evaluation of the artifact.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RequestGroup.Action">
    <xs:annotation>
      <xs:documentation xml:lang="en">A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one".</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="label" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A user-visible label for the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The title of the action displayed to a user.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description of the action used to provide a summary to display to the user.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="textEquivalent" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a the section of a documentation template.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="unbounded" type="RelatedArtifact">
            <xs:annotation>
              <xs:documentation xml:lang="en">Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="condition" type="RequestGroup.Condition" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An expression that describes applicability criteria, or start/stop conditions for the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relatedAction" type="RequestGroup.RelatedAction" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A relationship to another action such as "before" or "30-60 minutes after start of".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An optional value describing when the action should be performed.</xs:documentation>
            </xs:annotation>
            <xs:element name="timingDateTime" type="dateTime" />
            <xs:element name="timingPeriod" type="Period" />
            <xs:element name="timingDuration" type="Duration" />
            <xs:element name="timingRange" type="Range" />
            <xs:element name="timingTiming" type="Timing" />
          </xs:choice>
          <xs:element name="participant" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The participant that should perform or be responsible for this action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of action to perform (create, update, remove).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="groupingBehavior" minOccurs="0" maxOccurs="1" type="ActionGroupingBehavior">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines the grouping behavior for the action and its children.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="selectionBehavior" minOccurs="0" maxOccurs="1" type="ActionSelectionBehavior">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines the selection behavior for the action and its children.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requiredBehavior" minOccurs="0" maxOccurs="1" type="ActionRequiredBehavior">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines the requiredness behavior for the action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="precheckBehavior" minOccurs="0" maxOccurs="1" type="ActionPrecheckBehavior">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines whether the action should usually be preselected.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="cardinalityBehavior" minOccurs="0" maxOccurs="1" type="ActionCardinalityBehavior">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines whether the action can be selected multiple times.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resource that is the target of the action (e.g. CommunicationRequest).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" type="RequestGroup.Action" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Sub actions.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RequestGroup.Condition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one".</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="kind" minOccurs="1" maxOccurs="1" type="ActionConditionKind">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of condition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A brief, natural language description of the condition that effectively communicates the intended semantics.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The media type of the language for the expression.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">An expression that returns true or false, indicating whether or not the condition is satisfied.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RequestGroup.RelatedAction">
    <xs:annotation>
      <xs:documentation xml:lang="en">A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one".</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="actionId" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The element id of the action this is related to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relationship" minOccurs="1" maxOccurs="1" type="ActionRelationshipType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The relationship of this action to the related action.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.</xs:documentation>
            </xs:annotation>
            <xs:element name="offsetDuration" type="Duration" />
            <xs:element name="offsetRange" type="Range" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ResearchStudy" type="ResearchStudy">
    <xs:annotation>
      <xs:documentation xml:lang="en">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ResearchStudy">
    <xs:annotation>
      <xs:documentation xml:lang="en">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</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">Identifiers assigned to this research study by the sponsor or other systems.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive user-friendly label for the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="protocol" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The set of steps expected to be performed as part of the execution of the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A larger research study of which this particular study is a component or step.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ResearchStudyStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The current state of the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="focus" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The condition(s), medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in learning more about or engaging with the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relatedArtifact" minOccurs="0" maxOccurs="unbounded" type="RelatedArtifact">
            <xs:annotation>
              <xs:documentation xml:lang="en">Citations, references and other related documents.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="keyword" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Key terms to aid in searching for or filtering the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates a country, state or other region where the study is taking place.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A full description of how the study is being conducted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="enrollment" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to a Group that defines the criteria for and quantity of subjects participating in the study.  E.g. " 200 female Europeans between the ages of 20 and 45 with early onset diabetes".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the start date and the expected (or actual, depending on status) end date for the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sponsor" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization responsible for the execution of the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="principalInvestigator" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the individual who has primary oversite of the execution of the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="site" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Clinic, hospital or other healthcare location that is participating in the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reasonStopped" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description and/or code explaining the premature termination of the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments made about the event by the performer, subject or other participants.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="arm" type="ResearchStudy.Arm" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes an expected sequence of events for one of the participants of a study.  E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ResearchStudy.Arm">
    <xs:annotation>
      <xs:documentation xml:lang="en">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique, human-readable label for this arm of the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Categorization of study arm, e.g. experimental, active comparator, placebo comparater.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A succinct description of the path through the study that would be followed by a subject adhering to this arm.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResearchStudyStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation xml:lang="en">Draft</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In-progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Suspended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stopped</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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="ResearchStudyStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Codes that convey the current status of the research study</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="ResearchStudyStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ResearchSubject" type="ResearchSubject">
    <xs:annotation>
      <xs:documentation xml:lang="en">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ResearchSubject">
    <xs:annotation>
      <xs:documentation xml:lang="en">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifiers assigned to this research study by the sponsor or other systems.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ResearchSubjectStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The current state of the subject.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The dates the subject began and ended their participation in the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="study" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the study the subject is participating in.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="individual" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The record of the person or animal who is involved in the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assignedArm" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the arm in the study the subject is expected to follow as part of this study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actualArm" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the arm in the study the subject actually followed as part of this study.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="consent" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A record of the patient's informed agreement to participate in the study.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ResearchSubjectStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="candidate">
        <xs:annotation>
          <xs:documentation xml:lang="en">Candidate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="enrolled">
        <xs:annotation>
          <xs:documentation xml:lang="en">Enrolled</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Suspended</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="withdrawn">
        <xs:annotation>
          <xs:documentation xml:lang="en">Withdrawn</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ResearchSubjectStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Indicates the progression of a study subject through a study</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="ResearchSubjectStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="RiskAssessment" type="RiskAssessment">
    <xs:annotation>
      <xs:documentation xml:lang="en">An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="RiskAssessment">
    <xs:annotation>
      <xs:documentation xml:lang="en">An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>
      <xs:documentation 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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Business identifier assigned to the risk assessment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the request that is fulfilled by this risk assessment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parent" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a resource that this risk assessment is part of, such as a Procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="ObservationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the RiskAssessment, using the same statuses as an Observation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The algorithm, process or mechanism used to evaluate the risk.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of the risk assessment performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient or group the risk assessment applies to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The encounter where the assessment was performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date (and possibly time) the risk assessment was performed.</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime" />
            <xs:element name="occurrencePeriod" type="Period" />
          </xs:choice>
          <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">For assessments or prognosis specific to a particular condition, indicates the condition being assessed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The provider or software application that performed the assessment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reason the risk assessment was performed.</xs:documentation>
            </xs:annotation>
            <xs:element name="reasonCodeableConcept" type="CodeableConcept" />
            <xs:element name="reasonReference" type="Reference" />
          </xs:choice>
          <xs:element name="basis" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prediction" type="RiskAssessment.Prediction" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Describes the expected outcome for the subject.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mitigation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the steps that might be taken to reduce the identified risk(s).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional comments about the risk assessment.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RiskAssessment.Prediction">
    <xs:annotation>
      <xs:documentation xml:lang="en">An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="outcome" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">How likely is the outcome (in the specified timeframe).</xs:documentation>
            </xs:annotation>
            <xs:element name="probabilityDecimal" type="decimal" />
            <xs:element name="probabilityRange" type="Range" />
          </xs:choice>
          <xs:element name="qualitativeRisk" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">How likely is the outcome (in the specified timeframe), expressed as a qualitative value (e.g. low, medium, high).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relativeRisk" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general.  (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the period of time or age range of the subject to which the specified probability applies.</xs:documentation>
            </xs:annotation>
            <xs:element name="whenPeriod" type="Period" />
            <xs:element name="whenRange" type="Range" />
          </xs:choice>
          <xs:element name="rationale" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information explaining the basis for the prediction.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Schedule" type="Schedule">
    <xs:annotation>
      <xs:documentation xml:lang="en">A container for slots of time that may be available for booking appointments.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Schedule">
    <xs:annotation>
      <xs:documentation xml:lang="en">A container for slots of time that may be available for booking appointments.</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">External Ids for this item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="active" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this schedule record is in active use, or should not be used (such as was entered in error).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="serviceCategory" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A broad categorisation of the service that is to be performed during this appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="serviceType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specific service that is to be performed during this appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specialty" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specialty of a practitioner that would be required to perform the service requested in this appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="1" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, PractitionerRole, Device, Patient or RelatedPerson.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="planningHorizon" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These  cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments on the availability to describe any extended information. Such as custom constraints on the slots that may be associated.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="SearchParameter" type="SearchParameter">
    <xs:annotation>
      <xs:documentation xml:lang="en">A search parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="SearchParameter">
    <xs:annotation>
      <xs:documentation xml:lang="en">A search parameter that defines a named search item that can be used to search/filter on a resource.</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="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published. The URL SHOULD include the major version of the search parameter. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the search parameter when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the search parameter author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the search parameter. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this search parameter. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this search parameter is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the search parameter was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the search parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate search parameter instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the search parameter is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this search parameter is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The code used in the URL or the parameter name in a parameters resource for this search parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="base" minOccurs="1" maxOccurs="unbounded" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The base resource type(s) that this search parameter can be used against.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="SearchParamType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of value a search parameter refers to, and how the content is interpreted.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="derivedFrom" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. I.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="1" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the search parameter from a consumer's perspective. and how it used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A FHIRPath expression that returns a set of elements for the search parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="xpath" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">An XPath expression that returns a set of elements for the search parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="xpathUsage" minOccurs="0" maxOccurs="1" type="XPathUsageType">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the search parameter relates to the set of elements returned by evaluating the xpath query.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" minOccurs="0" maxOccurs="unbounded" type="ResourceType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Types of resource (if a resource is referenced).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comparator" minOccurs="0" maxOccurs="unbounded" type="SearchComparator">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comparators supported for the search parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="unbounded" type="SearchModifierCode">
            <xs:annotation>
              <xs:documentation xml:lang="en">A modifier supported for the search parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="chain" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="component" type="SearchParameter.Component" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Used to define the parts of a composite search parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SearchParameter.Component">
    <xs:annotation>
      <xs:documentation xml:lang="en">A search parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="definition" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The definition of the search parameter that describes this part.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="XPathUsageType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="normal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Normal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="phonetic">
        <xs:annotation>
          <xs:documentation xml:lang="en">Phonetic</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="nearby">
        <xs:annotation>
          <xs:documentation xml:lang="en">Nearby</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="distance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Distance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation xml:lang="en">Other</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="XPathUsageType">
    <xs:annotation>
      <xs:documentation xml:lang="en">How a search parameter relates to the set of elements returned by evaluating its xpath query.</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="XPathUsageType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SearchModifierCode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="missing">
        <xs:annotation>
          <xs:documentation xml:lang="en">Missing</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="exact">
        <xs:annotation>
          <xs:documentation xml:lang="en">Exact</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="contains">
        <xs:annotation>
          <xs:documentation xml:lang="en">Contains</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="text">
        <xs:annotation>
          <xs:documentation xml:lang="en">Text</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in">
        <xs:annotation>
          <xs:documentation xml:lang="en">In</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not-in">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not In</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="below">
        <xs:annotation>
          <xs:documentation xml:lang="en">Below</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="above">
        <xs:annotation>
          <xs:documentation xml:lang="en">Above</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="type">
        <xs:annotation>
          <xs:documentation xml:lang="en">Type</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SearchModifierCode">
    <xs:annotation>
      <xs:documentation xml:lang="en">A supported modifier for a search parameter.</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="SearchModifierCode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SearchComparator-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="eq">
        <xs:annotation>
          <xs:documentation xml:lang="en">Equals</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ne">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not Equals</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="gt">
        <xs:annotation>
          <xs:documentation xml:lang="en">Greater Than</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="lt">
        <xs:annotation>
          <xs:documentation xml:lang="en">Less Then</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ge">
        <xs:annotation>
          <xs:documentation xml:lang="en">Greater or Equals</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="le">
        <xs:annotation>
          <xs:documentation xml:lang="en">Less of Equal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sa">
        <xs:annotation>
          <xs:documentation xml:lang="en">Starts After</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="eb">
        <xs:annotation>
          <xs:documentation xml:lang="en">Ends Before</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ap">
        <xs:annotation>
          <xs:documentation xml:lang="en">Approximately</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SearchComparator">
    <xs:annotation>
      <xs:documentation xml:lang="en">What Search Comparator Codes are supported in search</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="SearchComparator-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Sequence" type="Sequence">
    <xs:annotation>
      <xs:documentation xml:lang="en">Raw data describing a biological sequence.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Sequence">
    <xs:annotation>
      <xs:documentation xml:lang="en">Raw data describing a biological sequence.</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 for this particular sequence instance. This is a FHIR-defined id.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">Amino Acid Sequence/ DNA Sequence / RNA Sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="coordinateSystem" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The patient whose sequencing results are described by this resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specimen" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specimen used for sequencing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="device" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The method for sequencing, for example, chip information.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization or lab that should be responsible for this result.</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 copies of the seqeunce of interest. (RNASeq).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referenceSeq" type="Sequence.ReferenceSeq" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A sequence that is used as a reference to describe variants that are present in a sequence analyzed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="variant" type="Sequence.Variant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The definition of variant here originates from Sequence ontology ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.)  It can represent some complex mutation or segment variation with the assist of CIGAR string.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="observedSeq" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quality" type="Sequence.Quality" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality score ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="readCoverage" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="repository" type="Sequence.Repository" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="pointer" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Pointer to next atomic sequence which at most contains one variant.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Sequence.ReferenceSeq">
    <xs:annotation>
      <xs:documentation xml:lang="en">Raw data describing a biological sequence.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="chromosome" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="genomeBuild" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'.  Version number must be included if a versioned release of a primary build was used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referenceSeqId" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referenceSeqPointer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A Pointer to another Sequence entity as reference sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referenceSeqString" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A string like "ACGT".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="strand" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive  and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="windowStart" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="windowEnd" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">End position of the window on the reference sequence. If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Sequence.Variant">
    <xs:annotation>
      <xs:documentation xml:lang="en">Raw data describing a biological sequence.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="start" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Start position of the variant on the  reference sequence.If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">End position of the variant on the reference sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="observedAllele" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).  Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed  sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="referenceAllele" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="cigar" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="variantPointer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A pointer to an Observation containing variant information.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Sequence.Quality">
    <xs:annotation>
      <xs:documentation xml:lang="en">Raw data describing a biological sequence.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="qualityType">
            <xs:annotation>
              <xs:documentation xml:lang="en">INDEL / SNP / Undefined variant.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="standardSequence" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Gold standard sequence used for comparing against.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="start" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">End position of the sequence.If the coordinate system is 0-based then end is is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="score" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Which method is used to get sequence quality.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="truthTP" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="queryTP" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">True positives, from the perspective of the query data, i.e. the number of sites in the Query Call Set for which there are paths through the Truth Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="truthFN" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">False negatives, i.e. the number of sites in the Truth Call Set for which there is no path through the Query Call Set that is consistent with all of the alleles at this site, or sites for which there is an inaccurate genotype call for the event. Sites with correct variant but incorrect genotype are counted here.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="queryFP" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">False positives, i.e. the number of sites in the Query Call Set for which there is no path through the Truth Call Set that is consistent with this site. Sites with correct variant but incorrect genotype are counted here.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="gtFP" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">The number of false positives where the non-REF alleles in the Truth and Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1 or similar).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="precision" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">QUERY.TP / (QUERY.TP + QUERY.FP).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recall" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">TRUTH.TP / (TRUTH.TP + TRUTH.FN).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fScore" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Sequence.Repository">
    <xs:annotation>
      <xs:documentation xml:lang="en">Raw data describing a biological sequence.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="repositoryType">
            <xs:annotation>
              <xs:documentation xml:lang="en">Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">URI of an external repository which contains further details about the genetics data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">URI of an external repository which contains further details about the genetics data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="datasetId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="variantsetId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="readsetId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Id of the read in this external repository.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="repositoryType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="directlink">
        <xs:annotation>
          <xs:documentation xml:lang="en">Click and see</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="openapi">
        <xs:annotation>
          <xs:documentation xml:lang="en">The URL is the RESTful or other kind of API that can access to the result.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="login">
        <xs:annotation>
          <xs:documentation xml:lang="en">Result cannot be access unless an account is logged in</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="oauth">
        <xs:annotation>
          <xs:documentation xml:lang="en">Result need to be fetched with API and need LOGIN( or cookies are required when visiting the link of resource)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="other">
        <xs:annotation>
          <xs:documentation xml:lang="en">Some other complicated or particular way to get resource from URL.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="repositoryType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Type for access of external URI</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="repositoryType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="qualityType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="indel">
        <xs:annotation>
          <xs:documentation xml:lang="en">INDEL Comparison</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="snp">
        <xs:annotation>
          <xs:documentation xml:lang="en">SNP Comparison</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">UNKNOWN Comparison</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="qualityType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Type for quality report</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="qualityType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ServiceDefinition" type="ServiceDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">The ServiceDefinition describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ServiceDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">The ServiceDefinition describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this service definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this service definition is (or will be) published. The URL SHOULD include the major version of the service definition. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this service definition when it is represented in other formats, or referenced in a specification, model, design or an instance. This is used for CMS or NQF identifiers for a measure artifact. Note that at least one identifier is required for non-experimental active artifacts.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the service definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the service definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the service definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the service definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this service definition. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this service definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the service definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the service definition changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the service definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the service definition from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this service definition is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="usage" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A detailed description of how the module is used from a clinical perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="approvalDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastReviewDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="effectivePeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during which the service definition content was or is planned to be in active use.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate service definition instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the service definition is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="topic" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive topics related to the module. Topics provide a high-level categorization of the module that can be useful for filtering and searching.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contributor" minOccurs="0" maxOccurs="unbounded" type="Contributor">
            <xs:annotation>
              <xs:documentation xml:lang="en">A contributor to the content of the module, including authors, editors, reviewers, and endorsers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the service definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the service definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relatedArtifact" minOccurs="0" maxOccurs="unbounded" type="RelatedArtifact">
            <xs:annotation>
              <xs:documentation xml:lang="en">Related resources such as additional documentation, justification, or bibliographic references.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="trigger" minOccurs="0" maxOccurs="unbounded" type="TriggerDefinition">
            <xs:annotation>
              <xs:documentation xml:lang="en">The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dataRequirement" minOccurs="0" maxOccurs="unbounded" type="DataRequirement">
            <xs:annotation>
              <xs:documentation xml:lang="en">Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="operationDefinition" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to the operation that is used to invoke this service.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Slot" type="Slot">
    <xs:annotation>
      <xs:documentation xml:lang="en">A slot of time on a schedule that may be available for booking appointments.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Slot">
    <xs:annotation>
      <xs:documentation xml:lang="en">A slot of time on a schedule that may be available for booking appointments.</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">External Ids for this item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="serviceCategory" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A broad categorisation of the service that is to be performed during this appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="serviceType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specialty" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specialty of a practitioner that would be required to perform the service requested in this appointment.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="appointmentType" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The style of appointment or patient that may be booked in the slot (not service type).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="schedule" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The schedule resource that this slot defines an interval of status information.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="SlotStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">busy | free | busy-unavailable | busy-tentative | entered-in-error.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="start" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date/Time that the slot is to begin.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="1" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">Date/Time that the slot is to conclude.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="overbooked" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">This slot has already been overbooked, appointments are unlikely to be accepted for this time.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments on the slot to describe any extended information. Such as custom constraints on the slot.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SlotStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="busy">
        <xs:annotation>
          <xs:documentation xml:lang="en">Busy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="free">
        <xs:annotation>
          <xs:documentation xml:lang="en">Free</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="busy-unavailable">
        <xs:annotation>
          <xs:documentation xml:lang="en">Busy (Unavailable)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="busy-tentative">
        <xs:annotation>
          <xs:documentation xml:lang="en">Busy (Tentative)</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="SlotStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The free/busy status of the slot.</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="SlotStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Specimen" type="Specimen">
    <xs:annotation>
      <xs:documentation xml:lang="en">A sample to be used for analysis.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Specimen">
    <xs:annotation>
      <xs:documentation xml:lang="en">A sample to be used for analysis.</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">Id for specimen.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="accessionIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="SpecimenStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The availability of the specimen.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of material that forms the specimen.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the specimen came from. This may be from the patient(s) or from the environment or a device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="receivedTime" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">Time when specimen was received for processing or testing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parent" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="request" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details concerning a test or procedure request that required a specimen to be collected.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="collection" type="Specimen.Collection" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details concerning the specimen collection.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="processing" type="Specimen.Processing" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details concerning processing and processing steps for the specimen.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="container" type="Specimen.Container" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">To communicate any details or issues about the specimen or during the specimen collection. (for example: broken vial, sent with patient, frozen).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Specimen.Collection">
    <xs:annotation>
      <xs:documentation xml:lang="en">A sample to be used for analysis.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="collector" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Person who collected the specimen.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Time when specimen was collected from subject - the physiologically relevant time.</xs:documentation>
            </xs:annotation>
            <xs:element name="collectedDateTime" type="dateTime" />
            <xs:element name="collectedPeriod" type="Period" />
          </xs:choice>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="method" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded value specifying the technique that is used to perform the procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="bodySite" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Anatomical location from which the specimen was collected (if subject is a patient). This is the target site.  This element is not used for environmental specimens.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Specimen.Processing">
    <xs:annotation>
      <xs:documentation xml:lang="en">A sample to be used for analysis.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Textual description of procedure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="procedure" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A coded value specifying the procedure used to process the specimen.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="additive" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Material used in the processing step.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A record of the time or period when the specimen processing occurred.  For example the time of sample fixation or the period of time the sample was in formalin.</xs:documentation>
            </xs:annotation>
            <xs:element name="timeDateTime" type="dateTime" />
            <xs:element name="timePeriod" type="Period" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Specimen.Container">
    <xs:annotation>
      <xs:documentation xml:lang="en">A sample to be used for analysis.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Textual description of the container.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of container associated with the specimen (e.g. slide, aliquot, etc.).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="capacity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The capacity (volume or other measure) the container may contain.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="specimenQuantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.</xs:documentation>
            </xs:annotation>
            <xs:element name="additiveCodeableConcept" type="CodeableConcept" />
            <xs:element name="additiveReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SpecimenStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="available">
        <xs:annotation>
          <xs:documentation xml:lang="en">Available</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unavailable">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unavailable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unsatisfactory">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unsatisfactory</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="SpecimenStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Codes providing the status/availability of a specimen.</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="SpecimenStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="StructureDefinition" type="StructureDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="StructureDefinition">
    <xs:annotation>
      <xs:documentation xml:lang="en">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</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="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. The URL SHOULD include the major version of the structure definition. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this structure definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the structure definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this structure definition. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the structure definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the structure definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the structure definition from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate structure definition instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the structure definition is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this structure definition is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="keyword" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fhirVersion" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mapping" type="StructureDefinition.Mapping" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An external specification that the content is mapped to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="kind" minOccurs="1" maxOccurs="1" type="StructureDefinitionKind">
            <xs:annotation>
              <xs:documentation xml:lang="en">Defines the kind of structure that this definition is describing.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="abstract" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contextType" minOccurs="0" maxOccurs="1" type="ExtensionContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this is an extension, Identifies the context within FHIR resources where the extension can be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the types of resource or data type elements to which the extension can be applied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contextInvariant" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of rules as Fluent Invariants about when the extension can be used (e.g. co-occurrence variants for the extension).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="baseDefinition" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="derivation" minOccurs="0" maxOccurs="1" type="TypeDerivationRule">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the type relates to the baseDefinition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="snapshot" type="StructureDefinition.Snapshot" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="differential" type="StructureDefinition.Differential" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureDefinition.Mapping">
    <xs:annotation>
      <xs:documentation xml:lang="en">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identity" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">An Internal id that is used to identify this mapping set when specific mappings are made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="uri" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that identifies the specification that this mapping is expressed to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name for the specification that is being mapped to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="comment" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureDefinition.Snapshot">
    <xs:annotation>
      <xs:documentation xml:lang="en">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="element" minOccurs="1" maxOccurs="unbounded" type="ElementDefinition">
            <xs:annotation>
              <xs:documentation xml:lang="en">Captures constraints on each element within the resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureDefinition.Differential">
    <xs:annotation>
      <xs:documentation xml:lang="en">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="element" minOccurs="1" maxOccurs="unbounded" type="ElementDefinition">
            <xs:annotation>
              <xs:documentation xml:lang="en">Captures constraints on each element within the resource.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="StructureDefinitionKind-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="primitive-type">
        <xs:annotation>
          <xs:documentation xml:lang="en">Primitive Data Type</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="complex-type">
        <xs:annotation>
          <xs:documentation xml:lang="en">Complex Data Type</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="resource">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="logical">
        <xs:annotation>
          <xs:documentation xml:lang="en">Logical Model</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="StructureDefinitionKind">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines the type of structure that a definition is describing.</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="StructureDefinitionKind-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TypeDerivationRule-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="specialization">
        <xs:annotation>
          <xs:documentation xml:lang="en">Specialization</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="constraint">
        <xs:annotation>
          <xs:documentation xml:lang="en">Constraint</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TypeDerivationRule">
    <xs:annotation>
      <xs:documentation xml:lang="en">How a type relates to its baseDefinition.</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="TypeDerivationRule-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ExtensionContext-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="resource">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="datatype">
        <xs:annotation>
          <xs:documentation xml:lang="en">Datatype</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="extension">
        <xs:annotation>
          <xs:documentation xml:lang="en">Extension</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ExtensionContext">
    <xs:annotation>
      <xs:documentation xml:lang="en">How an extension context is interpreted.</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="ExtensionContext-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="StructureMap" type="StructureMap">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="StructureMap">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Map of relationships between 2 structures that can be used to transform data.</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="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. The URL SHOULD include the major version of the structure map. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the structure map.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this structure map. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the structure map was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the structure map.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the structure map from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate structure map instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the structure map is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this structure map is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="structure" type="StructureMap.Structure" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="import" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Other maps used by this map (canonical URLs).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="group" type="StructureMap.Group" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Organizes the mapping into managable chunks for human review/ease of maintenance.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureMap.Structure">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The canonical URL that identifies the structure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="StructureMapModelMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the referenced structure is used in this mapping.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="alias" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name used for this type in the map.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Documentation that describes how the structure is used in the mapping.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureMap.Group">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">A unique name for the group for the convenience of human readers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="extends" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Another group that this group adds rules to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="typeMode" minOccurs="1" maxOccurs="1" type="StructureMapGroupTypeMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this is the default rule set to apply for thie source type, or this combination of types.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional supporting documentation that explains the purpose of the group and the types of mappings within it.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="input" type="StructureMap.Input" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name assigned to an instance of data. The instance must be provided when the mapping is invoked.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rule" type="StructureMap.Rule" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Transform Rule from source to target.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureMap.Input">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name for this instance of data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type for this instance of data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="mode" minOccurs="1" maxOccurs="1" type="StructureMapInputMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">Mode for this instance of data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Documentation for this instance of data.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureMap.Rule">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name of the rule for internal references.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="source" type="StructureMap.Source" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Source inputs to the mapping.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="target" type="StructureMap.Target" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Content to create because of this mapping rule.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rule" type="StructureMap.Rule" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Rules contained in this rule.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dependent" type="StructureMap.Dependent" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Which other rules to apply in the context of this rule.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="documentation" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Documentation for this instance of data.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureMap.Source">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="context" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type or variable this rule applies to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="min" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="max" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A value to use if there is no existing value in the source object.</xs:documentation>
            </xs:annotation>
            <xs:element name="defaultValueBase64Binary" type="base64Binary" />
            <xs:element name="defaultValueBoolean" type="boolean" />
            <xs:element name="defaultValueCode" type="code" />
            <xs:element name="defaultValueDate" type="date" />
            <xs:element name="defaultValueDateTime" type="dateTime" />
            <xs:element name="defaultValueDecimal" type="decimal" />
            <xs:element name="defaultValueId" type="id" />
            <xs:element name="defaultValueInstant" type="instant" />
            <xs:element name="defaultValueInteger" type="integer" />
            <xs:element name="defaultValueMarkdown" type="markdown" />
            <xs:element name="defaultValueOid" type="oid" />
            <xs:element name="defaultValuePositiveInt" type="positiveInt" />
            <xs:element name="defaultValueString" type="string" />
            <xs:element name="defaultValueTime" type="time" />
            <xs:element name="defaultValueUnsignedInt" type="unsignedInt" />
            <xs:element name="defaultValueUri" type="uri" />
            <xs:element name="defaultValueAddress" type="Address" />
            <xs:element name="defaultValueAge" type="Age" />
            <xs:element name="defaultValueAnnotation" type="Annotation" />
            <xs:element name="defaultValueAttachment" type="Attachment" />
            <xs:element name="defaultValueCodeableConcept" type="CodeableConcept" />
            <xs:element name="defaultValueCoding" type="Coding" />
            <xs:element name="defaultValueContactPoint" type="ContactPoint" />
            <xs:element name="defaultValueCount" type="Count" />
            <xs:element name="defaultValueDistance" type="Distance" />
            <xs:element name="defaultValueDuration" type="Duration" />
            <xs:element name="defaultValueHumanName" type="HumanName" />
            <xs:element name="defaultValueIdentifier" type="Identifier" />
            <xs:element name="defaultValueMoney" type="Money" />
            <xs:element name="defaultValuePeriod" type="Period" />
            <xs:element name="defaultValueQuantity" type="Quantity" />
            <xs:element name="defaultValueRange" type="Range" />
            <xs:element name="defaultValueRatio" type="Ratio" />
            <xs:element name="defaultValueReference" type="Reference" />
            <xs:element name="defaultValueSampledData" type="SampledData" />
            <xs:element name="defaultValueSignature" type="Signature" />
            <xs:element name="defaultValueTiming" type="Timing" />
            <xs:element name="defaultValueMeta" type="Meta" />
          </xs:choice>
          <xs:element name="element" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Optional field for this source.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="listMode" minOccurs="0" maxOccurs="1" type="StructureMapSourceListMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">How to handle the list mode for this element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="variable" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Named context for field, if a field is specified.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="condition" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">FHIRPath expression  - must be true or the rule does not apply.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="check" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">FHIRPath expression  - must be true or the mapping engine throws an error instead of completing.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureMap.Target">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type or variable this rule applies to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contextType" minOccurs="0" maxOccurs="1" type="StructureMapContextType">
            <xs:annotation>
              <xs:documentation xml:lang="en">How to interpret the context.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="element" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Field to create in the context.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="variable" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Named context for field, if desired, and a field is specified.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="listMode" minOccurs="0" maxOccurs="unbounded" type="StructureMapTargetListMode">
            <xs:annotation>
              <xs:documentation xml:lang="en">If field is a list, how to manage the list.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="listRuleId" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Internal rule reference for shared list items.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="transform" minOccurs="0" maxOccurs="1" type="StructureMapTransform">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the data is copied / created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parameter" type="StructureMap.Parameter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Parameters to the transform.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureMap.Parameter">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Parameter value - variable or literal.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueId" type="id" />
            <xs:element name="valueString" type="string" />
            <xs:element name="valueBoolean" type="boolean" />
            <xs:element name="valueInteger" type="integer" />
            <xs:element name="valueDecimal" type="decimal" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="StructureMap.Dependent">
    <xs:annotation>
      <xs:documentation xml:lang="en">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name of a rule or group to apply.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="variable" minOccurs="1" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Variable to pass to the rule or group.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="StructureMapInputMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="source">
        <xs:annotation>
          <xs:documentation xml:lang="en">Source Instance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="target">
        <xs:annotation>
          <xs:documentation xml:lang="en">Target Instance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="StructureMapInputMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">Mode for this instance of data</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="StructureMapInputMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="StructureMapContextType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="type">
        <xs:annotation>
          <xs:documentation xml:lang="en">Type</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="variable">
        <xs:annotation>
          <xs:documentation xml:lang="en">Variable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="StructureMapContextType">
    <xs:annotation>
      <xs:documentation xml:lang="en">How to interpret the context</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="StructureMapContextType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="StructureMapTargetListMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="first">
        <xs:annotation>
          <xs:documentation xml:lang="en">First</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="share">
        <xs:annotation>
          <xs:documentation xml:lang="en">Share</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="last">
        <xs:annotation>
          <xs:documentation xml:lang="en">Last</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="collate">
        <xs:annotation>
          <xs:documentation xml:lang="en">Collate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="StructureMapTargetListMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">If field is a list, how to manage the production</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="StructureMapTargetListMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="StructureMapTransform-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="create">
        <xs:annotation>
          <xs:documentation xml:lang="en">create</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="copy">
        <xs:annotation>
          <xs:documentation xml:lang="en">copy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="truncate">
        <xs:annotation>
          <xs:documentation xml:lang="en">truncate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="escape">
        <xs:annotation>
          <xs:documentation xml:lang="en">escape</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cast">
        <xs:annotation>
          <xs:documentation xml:lang="en">cast</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="append">
        <xs:annotation>
          <xs:documentation xml:lang="en">append</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="translate">
        <xs:annotation>
          <xs:documentation xml:lang="en">translate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="reference">
        <xs:annotation>
          <xs:documentation xml:lang="en">reference</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dateOp">
        <xs:annotation>
          <xs:documentation xml:lang="en">dateOp</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uuid">
        <xs:annotation>
          <xs:documentation xml:lang="en">uuid</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="pointer">
        <xs:annotation>
          <xs:documentation xml:lang="en">pointer</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="evaluate">
        <xs:annotation>
          <xs:documentation xml:lang="en">evaluate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cc">
        <xs:annotation>
          <xs:documentation xml:lang="en">cc</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="c">
        <xs:annotation>
          <xs:documentation xml:lang="en">c</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="qty">
        <xs:annotation>
          <xs:documentation xml:lang="en">qty</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="id">
        <xs:annotation>
          <xs:documentation xml:lang="en">id</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cp">
        <xs:annotation>
          <xs:documentation xml:lang="en">cp</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="StructureMapTransform">
    <xs:annotation>
      <xs:documentation xml:lang="en">How data is copied/created</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="StructureMapTransform-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="StructureMapSourceListMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="first">
        <xs:annotation>
          <xs:documentation xml:lang="en">First</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not_first">
        <xs:annotation>
          <xs:documentation xml:lang="en">All but the first</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="last">
        <xs:annotation>
          <xs:documentation xml:lang="en">Last</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not_last">
        <xs:annotation>
          <xs:documentation xml:lang="en">All but the last</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="only_one">
        <xs:annotation>
          <xs:documentation xml:lang="en">Enforce only one</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="StructureMapSourceListMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">If field is a list, how to manage the source</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="StructureMapSourceListMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="StructureMapGroupTypeMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="none">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not a Default</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="types">
        <xs:annotation>
          <xs:documentation xml:lang="en">Default for Type Combination</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="type-and-types">
        <xs:annotation>
          <xs:documentation xml:lang="en">Default for type + combination</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="StructureMapGroupTypeMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">If this is the default rule set to apply for the source type, or this combination of types</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="StructureMapGroupTypeMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="StructureMapModelMode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="source">
        <xs:annotation>
          <xs:documentation xml:lang="en">Source Structure Definition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="queried">
        <xs:annotation>
          <xs:documentation xml:lang="en">Queried Structure Definition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="target">
        <xs:annotation>
          <xs:documentation xml:lang="en">Target Structure Definition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="produced">
        <xs:annotation>
          <xs:documentation xml:lang="en">Produced Structure Definition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="StructureMapModelMode">
    <xs:annotation>
      <xs:documentation xml:lang="en">How the referenced structure is used in this mapping</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="StructureMapModelMode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Subscription" type="Subscription">
    <xs:annotation>
      <xs:documentation xml:lang="en">The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Subscription">
    <xs:annotation>
      <xs:documentation xml:lang="en">The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action.</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="status" minOccurs="1" maxOccurs="1" type="SubscriptionStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the subscription, which marks the server state for managing the subscription.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time for the server to turn the subscription off.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of why this subscription is defined.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="criteria" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The rules that the server should use to determine when to generate notifications for this subscription.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="error" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A record of the last error that occurred when the server processed a notification.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="channel" type="Subscription.Channel" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details where to send notifications when resources are received that meet the criteria.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="tag" minOccurs="0" maxOccurs="unbounded" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A tag to add to any resource that matches the criteria, after the subscription is processed.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Subscription.Channel">
    <xs:annotation>
      <xs:documentation xml:lang="en">The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="SubscriptionChannelType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of channel to send notifications on.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The uri that describes the actual end-point to send messages to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="payload" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The mime type to send the payload in - either application/fhir+xml, or application/fhir+json. If the payload is not present, then there is no payload in the notification, just a notification.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="header" minOccurs="0" maxOccurs="unbounded" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional headers / information to send as part of the notification.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SubscriptionStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation xml:lang="en">Requested</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="off">
        <xs:annotation>
          <xs:documentation xml:lang="en">Off</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SubscriptionStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The status of a subscription.</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="SubscriptionStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SubscriptionChannelType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="rest-hook">
        <xs:annotation>
          <xs:documentation xml:lang="en">Rest Hook</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="websocket">
        <xs:annotation>
          <xs:documentation xml:lang="en">Websocket</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="email">
        <xs:annotation>
          <xs:documentation xml:lang="en">Email</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sms">
        <xs:annotation>
          <xs:documentation xml:lang="en">SMS</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="message">
        <xs:annotation>
          <xs:documentation xml:lang="en">Message</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SubscriptionChannelType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of method used to execute a subscription.</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="SubscriptionChannelType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Substance" type="Substance">
    <xs:annotation>
      <xs:documentation xml:lang="en">A homogeneous material with a definite composition.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Substance">
    <xs:annotation>
      <xs:documentation xml:lang="en">A homogeneous material with a definite composition.</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">Unique identifier for the substance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FHIRSubstanceStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code to indicate if the substance is actively used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code (or set of codes) that identify this substance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of the substance - its appearance, handling requirements, and other usage notes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="instance" type="Substance.Instance" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ingredient" type="Substance.Ingredient" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A substance can be composed of other substances.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Substance.Instance">
    <xs:annotation>
      <xs:documentation xml:lang="en">A homogeneous material with a definite composition.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifier associated with the package/container (usually a label affixed directly).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expiry" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of the substance.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Substance.Ingredient">
    <xs:annotation>
      <xs:documentation xml:lang="en">A homogeneous material with a definite composition.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Ratio">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of the ingredient in the substance - a concentration ratio.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Another substance that is a component of this substance.</xs:documentation>
            </xs:annotation>
            <xs:element name="substanceCodeableConcept" type="CodeableConcept" />
            <xs:element name="substanceReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="FHIRSubstanceStatus-list">
    <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="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</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="FHIRSubstanceStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">A code to indicate if the substance is actively used</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="FHIRSubstanceStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="SupplyDelivery" type="SupplyDelivery">
    <xs:annotation>
      <xs:documentation xml:lang="en">Record of delivery of what is supplied.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="SupplyDelivery">
    <xs:annotation>
      <xs:documentation xml:lang="en">Record of delivery of what is supplied.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifier assigned by the dispensing facility when the item(s) is dispensed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A plan, proposal or order that is fulfilled in whole or in part by this event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A larger event of which this particular event is a component or step.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="SupplyDeliveryStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code specifying the state of the dispense event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to a resource representing the person whom the delivered item is for.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="suppliedItem" type="SupplyDelivery.SuppliedItem" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The item that is being delivered or has been supplied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date or time(s) the activity occurred.</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime" />
            <xs:element name="occurrencePeriod" type="Period" />
            <xs:element name="occurrenceTiming" type="Timing" />
          </xs:choice>
          <xs:element name="supplier" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual responsible for dispensing the medication, supplier or device.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="destination" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identification of the facility/location where the Supply was shipped to, as part of the dispense event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="receiver" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the person who picked up the Supply.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SupplyDelivery.SuppliedItem">
    <xs:annotation>
      <xs:documentation xml:lang="en">Record of delivery of what is supplied.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of supply that has been dispensed. Includes unit of measure.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.</xs:documentation>
            </xs:annotation>
            <xs:element name="itemCodeableConcept" type="CodeableConcept" />
            <xs:element name="itemReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SupplyDeliveryStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Delivered</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="abandoned">
        <xs:annotation>
          <xs:documentation xml:lang="en">Abandoned</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="SupplyDeliveryStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Status of the supply delivery.</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="SupplyDeliveryStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="SupplyRequest" type="SupplyRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a request for a medication, substance or device used in the healthcare setting.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="SupplyRequest">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a request for a medication, substance or device used in the healthcare setting.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Unique identifier for this supply request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="SupplyRequestStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">Status of the supply request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Category of supply, e.g.  central, non-stock, etc. This is used to support work flows associated with the supply process.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="RequestPriority">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how quickly this SupplyRequest should be addressed with respect to other requests.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="orderedItem" type="SupplyRequest.OrderedItem" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The item being requested.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the request should be fulfilled.</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime" />
            <xs:element name="occurrencePeriod" type="Period" />
            <xs:element name="occurrenceTiming" type="Timing" />
          </xs:choice>
          <xs:element name="authoredOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the request was made.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requester" type="SupplyRequest.Requester" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The individual who initiated the request and has responsibility for its activation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="supplier" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who is intended to fulfill the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Why the supply item was requested.</xs:documentation>
            </xs:annotation>
            <xs:element name="reasonCodeableConcept" type="CodeableConcept" />
            <xs:element name="reasonReference" type="Reference" />
          </xs:choice>
          <xs:element name="deliverFrom" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the supply is expected to come from.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="deliverTo" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the supply is destined to go.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SupplyRequest.OrderedItem">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a request for a medication, substance or device used in the healthcare setting.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="quantity" minOccurs="1" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount that is being ordered of the indicated item.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The item that is requested to be supplied. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.</xs:documentation>
            </xs:annotation>
            <xs:element name="itemCodeableConcept" type="CodeableConcept" />
            <xs:element name="itemReference" type="Reference" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SupplyRequest.Requester">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of a request for a medication, substance or device used in the healthcare setting.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="agent" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner, etc. who initiated the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization the device or practitioner was acting on behalf of.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SupplyRequestStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation xml:lang="en">Draft</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="suspended">
        <xs:annotation>
          <xs:documentation xml:lang="en">Suspended</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="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SupplyRequestStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">Status of the supply request</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="SupplyRequestStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="Task" type="Task">
    <xs:annotation>
      <xs:documentation xml:lang="en">A task to be performed.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Task">
    <xs:annotation>
      <xs:documentation xml:lang="en">A task to be performed.</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">The business identifier for this task.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reference to a formal or informal definition of the task.  For example, a protocol, a step within a defined workflow definition, etc.</xs:documentation>
            </xs:annotation>
            <xs:element name="definitionUri" type="uri" />
            <xs:element name="definitionReference" type="Reference" />
          </xs:choice>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">BasedOn refers to a higher-level authorization that triggered the creation of the task.  It references a "request" resource such as a ProcedureRequest, MedicationRequest, ProcedureRequest, CarePlan, etc. which is distinct from the "request" resource the task is seeking to fulfil.  This latter resource is referenced by FocusOn.  For example, based on a ProcedureRequest (= BasedOn), a task is created to fulfil a procedureRequest ( = FocusOn ) to collect a specimen from a patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="groupIdentifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier that links together multiple tasks and other requests that were created in the same context.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Task that this particular task is part of.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="TaskStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The current status of the task.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="statusReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">An explanation as to why this task is held, failed, was refused, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="businessStatus" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contains business-specific nuances of the business state.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="intent" minOccurs="1" maxOccurs="1" type="RequestIntent">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the "level" of actionability associated with the Task.  I.e. Is this a proposed task, a planned task, an actionable task, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="RequestPriority">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates how quickly the Task should be addressed with respect to other requests.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A name or code (or both) briefly describing what the task involves.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free-text description of what is to be performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="focus" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The request being actioned or the resource being manipulated by this task.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="for" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The entity who benefits from the performance of the service specified in the task (e.g., the patient).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="context" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="executionPeriod" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="authoredOn" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and time this task was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="lastModified" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date and time of last modification to this task.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requester" type="Task.Requester" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The creator of the task.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="performerType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of participant that can execute the task.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="owner" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Individual organization or Device currently responsible for task execution.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description or code indicating why this task needs to be performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Free-text information captured about the task as it progresses.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="relevantHistory" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="restriction" type="Task.Restriction" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the Task.focus is a request resource and the task is seeking fulfillment (i.e is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="input" type="Task.Input" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional information that may be needed in the execution of the task.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="output" type="Task.Output" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Outputs produced by the Task.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Task.Requester">
    <xs:annotation>
      <xs:documentation xml:lang="en">A task to be performed.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="agent" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The device, practitioner, etc. who initiated the task.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="onBehalfOf" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization the device or practitioner was acting on behalf of when they initiated the task.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Task.Restriction">
    <xs:annotation>
      <xs:documentation xml:lang="en">A task to be performed.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="repetitions" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the number of times the requested action should occur.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="period" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">Over what time-period is fulfillment sought.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="recipient" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Task.Input">
    <xs:annotation>
      <xs:documentation xml:lang="en">A task to be performed.</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 code or description indicating how the input is intended to be used as part of the task execution.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the input parameter as a basic type.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueBase64Binary" type="base64Binary" />
            <xs:element name="valueBoolean" type="boolean" />
            <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="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="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="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="valueReference" type="Reference" />
            <xs:element name="valueSampledData" type="SampledData" />
            <xs:element name="valueSignature" type="Signature" />
            <xs:element name="valueTiming" type="Timing" />
            <xs:element name="valueMeta" type="Meta" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Task.Output">
    <xs:annotation>
      <xs:documentation xml:lang="en">A task to be performed.</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">The name of the Output parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the Output parameter as a basic type.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueBase64Binary" type="base64Binary" />
            <xs:element name="valueBoolean" type="boolean" />
            <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="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="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="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="valueReference" type="Reference" />
            <xs:element name="valueSampledData" type="SampledData" />
            <xs:element name="valueSignature" type="Signature" />
            <xs:element name="valueTiming" type="Timing" />
            <xs:element name="valueMeta" type="Meta" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TaskStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="draft">
        <xs:annotation>
          <xs:documentation xml:lang="en">Draft</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation xml:lang="en">Requested</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="received">
        <xs:annotation>
          <xs:documentation xml:lang="en">Received</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="accepted">
        <xs:annotation>
          <xs:documentation xml:lang="en">Accepted</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rejected">
        <xs:annotation>
          <xs:documentation xml:lang="en">Rejected</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ready">
        <xs:annotation>
          <xs:documentation xml:lang="en">Ready</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="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="on-hold">
        <xs:annotation>
          <xs:documentation xml:lang="en">On Hold</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="failed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Failed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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="TaskStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The current status of the task.</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="TaskStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="TestReport" type="TestReport">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="TestReport">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</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="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifier for the TestScript assigned for external purposes outside the context of FHIR.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language name identifying the executed TestScript.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="TestReportStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The current state of this test report.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="testScript" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="result" minOccurs="1" maxOccurs="1" type="TestReportResult">
            <xs:annotation>
              <xs:documentation xml:lang="en">The overall result from the execution of the TestScript.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="score" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">The final score (percentage of tests passed) resulting from the execution of the TestScript.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="tester" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name of the tester producing this report (Organization or individual).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="issued" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the TestScript was executed and this TestReport was generated.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="TestReport.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A participant in the test execution, either the execution engine, a client, or a server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="setup" type="TestReport.Setup" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The results of the series of required setup operations before the tests were executed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="test" type="TestReport.Test" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A test executed from the test script.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="teardown" type="TestReport.Teardown" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The results of the series of operations required to clean up after the all the tests were executed (successfully or otherwise).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Participant">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="TestReportParticipantType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of participant.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="uri" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The uri of the participant. An absolute URL is preferred.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The display name of the participant.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Setup">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="action" type="TestReport.Action" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action would contain either an operation or an assertion.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Action">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="operation" type="TestReport.Operation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The operation performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assert" type="TestReport.Assert" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The results of the assertion performed on the previous operations.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Operation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="result" minOccurs="1" maxOccurs="1" type="TestReportActionResult">
            <xs:annotation>
              <xs:documentation xml:lang="en">The result of this operation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="message" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">An explanatory message associated with the result.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to further details on the result.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Assert">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="result" minOccurs="1" maxOccurs="1" type="TestReportActionResult">
            <xs:annotation>
              <xs:documentation xml:lang="en">The result of this assertion.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="message" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">An explanatory message associated with the result.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to further details on the result.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Test">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of this test used for tracking/logging purposes by test engines.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description of the test used by test engines for tracking and reporting purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" type="TestReport.Action1" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action would contain either an operation or an assertion.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Action1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="operation" type="TestReport.Operation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An operation would involve a REST request to a server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assert" type="TestReport.Assert" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The results of the assertion performed on the previous operations.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Teardown">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="action" type="TestReport.Action2" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The teardown action will only contain an operation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Action2">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="operation" type="TestReport.Operation" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An operation would involve a REST request to a server.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TestReportStatus-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="waiting">
        <xs:annotation>
          <xs:documentation xml:lang="en">Waiting</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stopped</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="TestReportStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The current status of the test report.</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="TestReportStatus-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TestReportActionResult-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="pass">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pass</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="skip">
        <xs:annotation>
          <xs:documentation xml:lang="en">Skip</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fail">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fail</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="warning">
        <xs:annotation>
          <xs:documentation xml:lang="en">Warning</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TestReportActionResult">
    <xs:annotation>
      <xs:documentation xml:lang="en">The results of executing an action.</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="TestReportActionResult-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TestReportParticipantType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="test-engine">
        <xs:annotation>
          <xs:documentation xml:lang="en">Test Engine</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="client">
        <xs:annotation>
          <xs:documentation xml:lang="en">Client</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="server">
        <xs:annotation>
          <xs:documentation xml:lang="en">Server</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TestReportParticipantType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of participant.</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="TestReportParticipantType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TestReportResult-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="pass">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pass</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fail">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fail</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="pending">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pending</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TestReportResult">
    <xs:annotation>
      <xs:documentation xml:lang="en">The reported execution result.</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="TestReportResult-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="TestScript" type="TestScript">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="TestScript">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</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="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this test script is (or will be) published. The URL SHOULD include the major version of the test script. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the test script.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this test script. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the test script was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the test script.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the test script from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate test script instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the test script is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this test script is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="origin" type="TestScript.Origin" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An abstract server used in operations within this test script in the origin element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="destination" type="TestScript.Destination" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">An abstract server used in operations within this test script in the destination element.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="metadata" type="TestScript.Metadata" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The required capability must exist and are assumed to function correctly on the FHIR server being tested.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="fixture" type="TestScript.Fixture" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the profile to be used for validation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="variable" type="TestScript.Variable" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Variable is set based either on element value in response body or on header field value in the response headers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rule" type="TestScript.Rule" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Assert rule to be used in one or more asserts within the test script.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" type="TestScript.Ruleset" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contains one or more rules.  Offers a way to group rules so assertions could reference the group of rules and have them all applied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="setup" type="TestScript.Setup" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A series of required setup operations before tests are executed.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="test" type="TestScript.Test" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A test in this script.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="teardown" type="TestScript.Teardown" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A series of operations required to clean up after the all the tests are executed (successfully or otherwise).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Origin">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="index" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of origin profile the test system supports.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Destination">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="index" minOccurs="1" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="profile" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of destination profile the test system supports.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Metadata">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="link" type="TestScript.Link" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to the FHIR specification that this test is covering.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="capability" type="TestScript.Capability" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Link">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="url" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">URL to a particular requirement or feature within the FHIR specification.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Short description of the link.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Capability">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="required" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="validated" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Description of the capabilities that this test script is requiring the server to support.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="origin" minOccurs="0" maxOccurs="unbounded" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Which origin server these requirements apply to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="destination" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Which server these requirements apply to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="link" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Links to the FHIR specification that describes this interaction and the resources involved in more detail.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="capabilities" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Fixture">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="autocreate" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="autodelete" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the resource (containing the contents of the resource needed for operations).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Variable">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive name for this variable.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="defaultValue" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A default, hard-coded, or user-defined value for this variable.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the variable and its purpose.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The fluentpath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="headerField" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="hint" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Displayable text string with hint help information to the user when entering a default value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="path" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sourceId" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Rule">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="resource" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the resource (containing the contents of the rule needed for assertions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="param" type="TestScript.Param" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Each rule template can take one or more parameters for rule evaluation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Param">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive name for this parameter that matches the external assert rule parameter name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The explicit or dynamic value for the parameter that will be passed on to the external rule template.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Ruleset">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="resource" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Reference to the resource (containing the contents of the ruleset needed for assertions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rule" type="TestScript.Rule1" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The referenced rule within the external ruleset template.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Rule1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="ruleId" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Id of the referenced rule within the external ruleset template.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="param" type="TestScript.Param1" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Each rule template can take one or more parameters for rule evaluation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Param1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive name for this parameter that matches the external assert ruleset rule parameter name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value for the parameter that will be passed on to the external ruleset rule template.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Setup">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="action" type="TestScript.Action" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action would contain either an operation or an assertion.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Action">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="operation" type="TestScript.Operation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The operation to perform.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assert" type="TestScript.Assert" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Evaluates the results of previous operations to determine if the server under test behaves appropriately.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Operation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">Server interaction or operation type.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" minOccurs="0" maxOccurs="1" type="FHIRDefinedType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of the resource.  See http://build.fhir.org/resourcelist.html.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="label" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The label would be used for tracking/logging purposes by test engines.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The description would be used by test engines for tracking and reporting purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="accept" minOccurs="0" maxOccurs="1" type="ContentType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content-type or mime-type to use for RESTful operation in the 'Accept' header.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contentType" minOccurs="0" maxOccurs="1" type="ContentType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="destination" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="encodeRequestUrl" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="origin" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="params" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Path plus parameters after [type].  Used to set parts of the request URL explicitly.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestHeader" type="TestScript.RequestHeader" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Header elements would be used to set HTTP headers.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestId" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The fixture id (maybe new) to map to the request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="responseId" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The fixture id (maybe new) to map to the response.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sourceId" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The id of the fixture used as the body of a PUT or POST request.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="targetId" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="url" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Complete request URL.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.RequestHeader">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="field" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The HTTP header field e.g. "Accept".</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the header e.g. "application/fhir+xml".</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Assert">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="label" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The label would be used for tracking/logging purposes by test engines.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The description would be used by test engines for tracking and reporting purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="direction" minOccurs="0" maxOccurs="1" type="AssertionDirectionType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The direction to use for the assertion.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="compareToSourceId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="compareToSourceExpression" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The fluentpath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="compareToSourcePath" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contentType" minOccurs="0" maxOccurs="1" type="ContentType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expression" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The fluentpath expression to be evaluated against the request or response message contents - HTTP headers and payload.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="headerField" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The HTTP header field name e.g. 'Location'.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="minimumId" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="navigationLinks" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether or not the test execution performs validation on the bundle navigation links.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="operator" minOccurs="0" maxOccurs="1" type="AssertionOperatorType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The operator type defines the conditional behavior of the assert. If not defined, the default is equals.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="path" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestMethod" minOccurs="0" maxOccurs="1" type="TestScriptRequestMethodCode">
            <xs:annotation>
              <xs:documentation xml:lang="en">The request method or HTTP operation code to compare against that used by the client system under test.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="requestURL" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value to use in a comparison against the request URL path string.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="resource" minOccurs="0" maxOccurs="1" type="FHIRDefinedType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of the resource.  See http://build.fhir.org/resourcelist.html.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="response" minOccurs="0" maxOccurs="1" type="AssertionResponseTypes">
            <xs:annotation>
              <xs:documentation xml:lang="en">okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="responseCode" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the HTTP response code to be tested.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rule" type="TestScript.Rule2" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The TestScript.rule this assert will evaluate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="ruleset" type="TestScript.Ruleset1" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The TestScript.ruleset this assert will evaluate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sourceId" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Fixture to evaluate the XPath/JSONPath expression or the headerField  against.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="validateProfileId" minOccurs="0" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The ID of the Profile to validate against.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value to compare to.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="warningOnly" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether or not the test execution will produce a warning only on error for this assert.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Rule2">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="ruleId" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The TestScript.rule id value this assert will evaluate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="param" type="TestScript.Param2" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Each rule template can take one or more parameters for rule evaluation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Param2">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive name for this parameter that matches the external assert rule parameter name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value for the parameter that will be passed on to the external rule template.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Ruleset1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="rulesetId" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">The TestScript.ruleset id value this assert will evaluate.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="rule" type="TestScript.Rule3" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The referenced rule within the external ruleset template.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Rule3">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="ruleId" minOccurs="1" maxOccurs="1" type="id">
            <xs:annotation>
              <xs:documentation xml:lang="en">Id of the referenced rule within the external ruleset template.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="param" type="TestScript.Param3" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Each rule template can take one or more parameters for rule evaluation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Param3">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Descriptive name for this parameter that matches the external assert ruleset rule parameter name.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value for the parameter that will be passed on to the external ruleset rule template.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Test">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of this test used for tracking/logging purposes by test engines.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description of the test used by test engines for tracking and reporting purposes.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="action" type="TestScript.Action1" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action would contain either an operation or an assertion.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Action1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="operation" type="TestScript.Operation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An operation would involve a REST request to a server.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="assert" type="TestScript.Assert" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Evaluates the results of previous operations to determine if the server under test behaves appropriately.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Teardown">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="action" type="TestScript.Action2" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The teardown action will only contain an operation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestScript.Action2">
    <xs:annotation>
      <xs:documentation xml:lang="en">A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="operation" type="TestScript.Operation" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An operation would involve a REST request to a server.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="FHIRDefinedType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="Address">
        <xs:annotation>
          <xs:documentation xml:lang="en">Address</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Age">
        <xs:annotation>
          <xs:documentation xml:lang="en">Age</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Annotation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Annotation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Attachment">
        <xs:annotation>
          <xs:documentation xml:lang="en">Attachment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BackboneElement">
        <xs:annotation>
          <xs:documentation xml:lang="en">BackboneElement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CodeableConcept">
        <xs:annotation>
          <xs:documentation xml:lang="en">CodeableConcept</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Coding">
        <xs:annotation>
          <xs:documentation xml:lang="en">Coding</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ContactDetail">
        <xs:annotation>
          <xs:documentation xml:lang="en">ContactDetail</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ContactPoint">
        <xs:annotation>
          <xs:documentation xml:lang="en">ContactPoint</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Contributor">
        <xs:annotation>
          <xs:documentation xml:lang="en">Contributor</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Count">
        <xs:annotation>
          <xs:documentation xml:lang="en">Count</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DataRequirement">
        <xs:annotation>
          <xs:documentation xml:lang="en">DataRequirement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Distance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Distance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Dosage">
        <xs:annotation>
          <xs:documentation xml:lang="en">Dosage</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Duration">
        <xs:annotation>
          <xs:documentation xml:lang="en">Duration</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Element">
        <xs:annotation>
          <xs:documentation xml:lang="en">Element</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ElementDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">ElementDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Extension">
        <xs:annotation>
          <xs:documentation xml:lang="en">Extension</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HumanName">
        <xs:annotation>
          <xs:documentation xml:lang="en">HumanName</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Identifier">
        <xs:annotation>
          <xs:documentation xml:lang="en">Identifier</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Meta">
        <xs:annotation>
          <xs:documentation xml:lang="en">Meta</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Money">
        <xs:annotation>
          <xs:documentation xml:lang="en">Money</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Narrative">
        <xs:annotation>
          <xs:documentation xml:lang="en">Narrative</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ParameterDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">ParameterDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Period">
        <xs:annotation>
          <xs:documentation xml:lang="en">Period</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Quantity">
        <xs:annotation>
          <xs:documentation xml:lang="en">Quantity</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Range">
        <xs:annotation>
          <xs:documentation xml:lang="en">Range</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Ratio">
        <xs:annotation>
          <xs:documentation xml:lang="en">Ratio</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Reference">
        <xs:annotation>
          <xs:documentation xml:lang="en">Reference</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RelatedArtifact">
        <xs:annotation>
          <xs:documentation xml:lang="en">RelatedArtifact</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SampledData">
        <xs:annotation>
          <xs:documentation xml:lang="en">SampledData</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Signature">
        <xs:annotation>
          <xs:documentation xml:lang="en">Signature</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SimpleQuantity">
        <xs:annotation>
          <xs:documentation xml:lang="en">SimpleQuantity</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Timing">
        <xs:annotation>
          <xs:documentation xml:lang="en">Timing</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TriggerDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">TriggerDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="UsageContext">
        <xs:annotation>
          <xs:documentation xml:lang="en">UsageContext</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="base64Binary">
        <xs:annotation>
          <xs:documentation xml:lang="en">base64Binary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="boolean">
        <xs:annotation>
          <xs:documentation xml:lang="en">boolean</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="code">
        <xs:annotation>
          <xs:documentation xml:lang="en">code</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="date">
        <xs:annotation>
          <xs:documentation xml:lang="en">date</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="dateTime">
        <xs:annotation>
          <xs:documentation xml:lang="en">dateTime</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="decimal">
        <xs:annotation>
          <xs:documentation xml:lang="en">decimal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="id">
        <xs:annotation>
          <xs:documentation xml:lang="en">id</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="instant">
        <xs:annotation>
          <xs:documentation xml:lang="en">instant</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="integer">
        <xs:annotation>
          <xs:documentation xml:lang="en">integer</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="markdown">
        <xs:annotation>
          <xs:documentation xml:lang="en">markdown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="oid">
        <xs:annotation>
          <xs:documentation xml:lang="en">oid</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="positiveInt">
        <xs:annotation>
          <xs:documentation xml:lang="en">positiveInt</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="string">
        <xs:annotation>
          <xs:documentation xml:lang="en">string</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="time">
        <xs:annotation>
          <xs:documentation xml:lang="en">time</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unsignedInt">
        <xs:annotation>
          <xs:documentation xml:lang="en">unsignedInt</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uri">
        <xs:annotation>
          <xs:documentation xml:lang="en">uri</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="uuid">
        <xs:annotation>
          <xs:documentation xml:lang="en">uuid</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="xhtml">
        <xs:annotation>
          <xs:documentation xml:lang="en">XHTML</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Account">
        <xs:annotation>
          <xs:documentation xml:lang="en">Account</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ActivityDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">ActivityDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AdverseEvent">
        <xs:annotation>
          <xs:documentation xml:lang="en">AdverseEvent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AllergyIntolerance">
        <xs:annotation>
          <xs:documentation xml:lang="en">AllergyIntolerance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Appointment">
        <xs:annotation>
          <xs:documentation xml:lang="en">Appointment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AppointmentResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">AppointmentResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AuditEvent">
        <xs:annotation>
          <xs:documentation xml:lang="en">AuditEvent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Basic">
        <xs:annotation>
          <xs:documentation xml:lang="en">Basic</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Binary">
        <xs:annotation>
          <xs:documentation xml:lang="en">Binary</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="BodySite">
        <xs:annotation>
          <xs:documentation xml:lang="en">BodySite</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Bundle">
        <xs:annotation>
          <xs:documentation xml:lang="en">Bundle</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CapabilityStatement">
        <xs:annotation>
          <xs:documentation xml:lang="en">CapabilityStatement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CarePlan">
        <xs:annotation>
          <xs:documentation xml:lang="en">CarePlan</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CareTeam">
        <xs:annotation>
          <xs:documentation xml:lang="en">CareTeam</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ChargeItem">
        <xs:annotation>
          <xs:documentation xml:lang="en">ChargeItem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Claim">
        <xs:annotation>
          <xs:documentation xml:lang="en">Claim</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ClaimResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">ClaimResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ClinicalImpression">
        <xs:annotation>
          <xs:documentation xml:lang="en">ClinicalImpression</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CodeSystem">
        <xs:annotation>
          <xs:documentation xml:lang="en">CodeSystem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Communication">
        <xs:annotation>
          <xs:documentation xml:lang="en">Communication</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CommunicationRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">CommunicationRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="CompartmentDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">CompartmentDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Composition">
        <xs:annotation>
          <xs:documentation xml:lang="en">Composition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ConceptMap">
        <xs:annotation>
          <xs:documentation xml:lang="en">ConceptMap</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Condition">
        <xs:annotation>
          <xs:documentation xml:lang="en">Condition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Consent">
        <xs:annotation>
          <xs:documentation xml:lang="en">Consent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Contract">
        <xs:annotation>
          <xs:documentation xml:lang="en">Contract</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Coverage">
        <xs:annotation>
          <xs:documentation xml:lang="en">Coverage</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DataElement">
        <xs:annotation>
          <xs:documentation xml:lang="en">DataElement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DetectedIssue">
        <xs:annotation>
          <xs:documentation xml:lang="en">DetectedIssue</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Device">
        <xs:annotation>
          <xs:documentation xml:lang="en">Device</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceComponent">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceComponent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceMetric">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceMetric</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DeviceUseStatement">
        <xs:annotation>
          <xs:documentation xml:lang="en">DeviceUseStatement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DiagnosticReport">
        <xs:annotation>
          <xs:documentation xml:lang="en">DiagnosticReport</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DocumentManifest">
        <xs:annotation>
          <xs:documentation xml:lang="en">DocumentManifest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DocumentReference">
        <xs:annotation>
          <xs:documentation xml:lang="en">DocumentReference</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DomainResource">
        <xs:annotation>
          <xs:documentation xml:lang="en">DomainResource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EligibilityRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">EligibilityRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EligibilityResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">EligibilityResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Encounter">
        <xs:annotation>
          <xs:documentation xml:lang="en">Encounter</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Endpoint">
        <xs:annotation>
          <xs:documentation xml:lang="en">Endpoint</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EnrollmentRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">EnrollmentRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EnrollmentResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">EnrollmentResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EpisodeOfCare">
        <xs:annotation>
          <xs:documentation xml:lang="en">EpisodeOfCare</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ExpansionProfile">
        <xs:annotation>
          <xs:documentation xml:lang="en">ExpansionProfile</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ExplanationOfBenefit">
        <xs:annotation>
          <xs:documentation xml:lang="en">ExplanationOfBenefit</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="FamilyMemberHistory">
        <xs:annotation>
          <xs:documentation xml:lang="en">FamilyMemberHistory</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Flag">
        <xs:annotation>
          <xs:documentation xml:lang="en">Flag</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Goal">
        <xs:annotation>
          <xs:documentation xml:lang="en">Goal</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="GraphDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">GraphDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Group">
        <xs:annotation>
          <xs:documentation xml:lang="en">Group</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="GuidanceResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">GuidanceResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="HealthcareService">
        <xs:annotation>
          <xs:documentation xml:lang="en">HealthcareService</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImagingManifest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImagingManifest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImagingStudy">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImagingStudy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Immunization">
        <xs:annotation>
          <xs:documentation xml:lang="en">Immunization</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImmunizationRecommendation">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImmunizationRecommendation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ImplementationGuide">
        <xs:annotation>
          <xs:documentation xml:lang="en">ImplementationGuide</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Library">
        <xs:annotation>
          <xs:documentation xml:lang="en">Library</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Linkage">
        <xs:annotation>
          <xs:documentation xml:lang="en">Linkage</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="List">
        <xs:annotation>
          <xs:documentation xml:lang="en">List</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Location">
        <xs:annotation>
          <xs:documentation xml:lang="en">Location</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Measure">
        <xs:annotation>
          <xs:documentation xml:lang="en">Measure</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MeasureReport">
        <xs:annotation>
          <xs:documentation xml:lang="en">MeasureReport</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Media">
        <xs:annotation>
          <xs:documentation xml:lang="en">Media</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Medication">
        <xs:annotation>
          <xs:documentation xml:lang="en">Medication</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationAdministration">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationAdministration</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationDispense">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationDispense</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MedicationStatement">
        <xs:annotation>
          <xs:documentation xml:lang="en">MedicationStatement</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MessageDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">MessageDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MessageHeader">
        <xs:annotation>
          <xs:documentation xml:lang="en">MessageHeader</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NamingSystem">
        <xs:annotation>
          <xs:documentation xml:lang="en">NamingSystem</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="NutritionOrder">
        <xs:annotation>
          <xs:documentation xml:lang="en">NutritionOrder</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Observation">
        <xs:annotation>
          <xs:documentation xml:lang="en">Observation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OperationDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">OperationDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="OperationOutcome">
        <xs:annotation>
          <xs:documentation xml:lang="en">OperationOutcome</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Organization">
        <xs:annotation>
          <xs:documentation xml:lang="en">Organization</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Parameters">
        <xs:annotation>
          <xs:documentation xml:lang="en">Parameters</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Patient">
        <xs:annotation>
          <xs:documentation xml:lang="en">Patient</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PaymentNotice">
        <xs:annotation>
          <xs:documentation xml:lang="en">PaymentNotice</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PaymentReconciliation">
        <xs:annotation>
          <xs:documentation xml:lang="en">PaymentReconciliation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Person">
        <xs:annotation>
          <xs:documentation xml:lang="en">Person</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PlanDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">PlanDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Practitioner">
        <xs:annotation>
          <xs:documentation xml:lang="en">Practitioner</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PractitionerRole">
        <xs:annotation>
          <xs:documentation xml:lang="en">PractitionerRole</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Procedure">
        <xs:annotation>
          <xs:documentation xml:lang="en">Procedure</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProcedureRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ProcedureRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProcessRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ProcessRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ProcessResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">ProcessResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Provenance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Provenance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Questionnaire">
        <xs:annotation>
          <xs:documentation xml:lang="en">Questionnaire</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="QuestionnaireResponse">
        <xs:annotation>
          <xs:documentation xml:lang="en">QuestionnaireResponse</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ReferralRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">ReferralRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RelatedPerson">
        <xs:annotation>
          <xs:documentation xml:lang="en">RelatedPerson</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RequestGroup">
        <xs:annotation>
          <xs:documentation xml:lang="en">RequestGroup</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ResearchStudy">
        <xs:annotation>
          <xs:documentation xml:lang="en">ResearchStudy</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ResearchSubject">
        <xs:annotation>
          <xs:documentation xml:lang="en">ResearchSubject</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Resource">
        <xs:annotation>
          <xs:documentation xml:lang="en">Resource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="RiskAssessment">
        <xs:annotation>
          <xs:documentation xml:lang="en">RiskAssessment</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Schedule">
        <xs:annotation>
          <xs:documentation xml:lang="en">Schedule</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SearchParameter">
        <xs:annotation>
          <xs:documentation xml:lang="en">SearchParameter</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Sequence">
        <xs:annotation>
          <xs:documentation xml:lang="en">Sequence</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ServiceDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">ServiceDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Slot">
        <xs:annotation>
          <xs:documentation xml:lang="en">Slot</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Specimen">
        <xs:annotation>
          <xs:documentation xml:lang="en">Specimen</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StructureDefinition">
        <xs:annotation>
          <xs:documentation xml:lang="en">StructureDefinition</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="StructureMap">
        <xs:annotation>
          <xs:documentation xml:lang="en">StructureMap</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Subscription">
        <xs:annotation>
          <xs:documentation xml:lang="en">Subscription</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Substance">
        <xs:annotation>
          <xs:documentation xml:lang="en">Substance</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SupplyDelivery">
        <xs:annotation>
          <xs:documentation xml:lang="en">SupplyDelivery</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SupplyRequest">
        <xs:annotation>
          <xs:documentation xml:lang="en">SupplyRequest</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Task">
        <xs:annotation>
          <xs:documentation xml:lang="en">Task</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TestReport">
        <xs:annotation>
          <xs:documentation xml:lang="en">TestReport</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="TestScript">
        <xs:annotation>
          <xs:documentation xml:lang="en">TestScript</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ValueSet">
        <xs:annotation>
          <xs:documentation xml:lang="en">ValueSet</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="VisionPrescription">
        <xs:annotation>
          <xs:documentation xml:lang="en">VisionPrescription</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="FHIRDefinedType">
    <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="FHIRDefinedType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="ContentType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="xml">
        <xs:annotation>
          <xs:documentation xml:lang="en">xml</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="json">
        <xs:annotation>
          <xs:documentation xml:lang="en">json</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ttl">
        <xs:annotation>
          <xs:documentation xml:lang="en">ttl</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="none">
        <xs:annotation>
          <xs:documentation xml:lang="en">none</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ContentType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The content or mime type.</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="ContentType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AssertionDirectionType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="response">
        <xs:annotation>
          <xs:documentation xml:lang="en">response</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="request">
        <xs:annotation>
          <xs:documentation xml:lang="en">request</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AssertionDirectionType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of direction to use for assertion.</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="AssertionDirectionType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AssertionOperatorType-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="equals">
        <xs:annotation>
          <xs:documentation xml:lang="en">equals</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="notEquals">
        <xs:annotation>
          <xs:documentation xml:lang="en">notEquals</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in">
        <xs:annotation>
          <xs:documentation xml:lang="en">in</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="notIn">
        <xs:annotation>
          <xs:documentation xml:lang="en">notIn</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="greaterThan">
        <xs:annotation>
          <xs:documentation xml:lang="en">greaterThan</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="lessThan">
        <xs:annotation>
          <xs:documentation xml:lang="en">lessThan</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="empty">
        <xs:annotation>
          <xs:documentation xml:lang="en">empty</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="notEmpty">
        <xs:annotation>
          <xs:documentation xml:lang="en">notEmpty</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="contains">
        <xs:annotation>
          <xs:documentation xml:lang="en">contains</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="notContains">
        <xs:annotation>
          <xs:documentation xml:lang="en">notContains</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="eval">
        <xs:annotation>
          <xs:documentation xml:lang="en">evaluate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AssertionOperatorType">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of operator to use for assertion.</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="AssertionOperatorType-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="AssertionResponseTypes-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="okay">
        <xs:annotation>
          <xs:documentation xml:lang="en">okay</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="created">
        <xs:annotation>
          <xs:documentation xml:lang="en">created</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="noContent">
        <xs:annotation>
          <xs:documentation xml:lang="en">noContent</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="notModified">
        <xs:annotation>
          <xs:documentation xml:lang="en">notModified</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="bad">
        <xs:annotation>
          <xs:documentation xml:lang="en">bad</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="forbidden">
        <xs:annotation>
          <xs:documentation xml:lang="en">forbidden</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="notFound">
        <xs:annotation>
          <xs:documentation xml:lang="en">notFound</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="methodNotAllowed">
        <xs:annotation>
          <xs:documentation xml:lang="en">methodNotAllowed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="conflict">
        <xs:annotation>
          <xs:documentation xml:lang="en">conflict</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="gone">
        <xs:annotation>
          <xs:documentation xml:lang="en">gone</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="preconditionFailed">
        <xs:annotation>
          <xs:documentation xml:lang="en">preconditionFailed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unprocessable">
        <xs:annotation>
          <xs:documentation xml:lang="en">unprocessable</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="AssertionResponseTypes">
    <xs:annotation>
      <xs:documentation xml:lang="en">The type of response code to use for assertion.</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="AssertionResponseTypes-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TestScriptRequestMethodCode-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="delete">
        <xs:annotation>
          <xs:documentation xml:lang="en">DELETE</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="get">
        <xs:annotation>
          <xs:documentation xml:lang="en">GET</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="options">
        <xs:annotation>
          <xs:documentation xml:lang="en">OPTIONS</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="patch">
        <xs:annotation>
          <xs:documentation xml:lang="en">PATCH</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="post">
        <xs:annotation>
          <xs:documentation xml:lang="en">POST</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="put">
        <xs:annotation>
          <xs:documentation xml:lang="en">PUT</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TestScriptRequestMethodCode">
    <xs:annotation>
      <xs:documentation xml:lang="en">The allowable request method or HTTP operation codes.</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="TestScriptRequestMethodCode-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="ValueSet" type="ValueSet">
    <xs:annotation>
      <xs:documentation xml:lang="en">A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ValueSet">
    <xs:annotation>
      <xs:documentation xml:lang="en">A value set specifies a set of codes drawn from one or more code systems.</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="url" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published. The URL SHOULD include the major version of the value set. For more information see [Technical and Business Versions](resource.html#versions).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the value set. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short, descriptive, user-friendly title for the value set.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="PublicationStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of this value set. Enables tracking the life-cycle of the content.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="experimental" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A boolean value to indicate that this value set is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date  (and optionally time) when the value set was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the value set changes. (e.g. the 'content logical definition').</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="publisher" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the individual or organization that published the value set.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactDetail">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language description of the value set from a consumer's perspective.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="useContext" minOccurs="0" maxOccurs="unbounded" type="UsageContext">
            <xs:annotation>
              <xs:documentation xml:lang="en">The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate value set instances.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="jurisdiction" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A legal or geographic region in which the value set is intended to be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="immutable" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="purpose" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Explaination of why this value set is needed and why it has been designed as it has.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="copyright" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="extensible" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether this is intended to be used with an extensible binding or not.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="compose" type="ValueSet.Compose" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A set of criteria that define the content logical definition of the value set by including or excluding codes from outside this value set. This I also known as the "Content Logical Definition" (CLD).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="expansion" type="ValueSet.Expansion" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Compose">
    <xs:annotation>
      <xs:documentation xml:lang="en">A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="lockedDate" minOccurs="0" maxOccurs="1" type="date">
            <xs:annotation>
              <xs:documentation xml:lang="en">If a locked date is defined, then the Content Logical Definition must be evaluated using the current version as of the locked date for referenced code system(s) and value set instances where ValueSet.compose.include.version is not defined.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="inactive" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable ExpansionProfile (but generally, inactive codes would be expected to be included).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="include" type="ValueSet.Include" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Include one or more codes from a code system or other value set(s).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="exclude" type="ValueSet.Include" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Exclude one or more codes from the value set based on code system filters and/or other value sets.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Include">
    <xs:annotation>
      <xs:documentation xml:lang="en">A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="system" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI which is the code system from which the selected codes come from.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version of the code system that the codes are selected from.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="concept" type="ValueSet.Concept" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies a concept to be included or excluded.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="filter" type="ValueSet.Filter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="valueSet" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Selects concepts found in this value set. This is an absolute URI that is a reference to ValueSet.url.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Concept">
    <xs:annotation>
      <xs:documentation xml:lang="en">A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies a code for the concept to be included or excluded.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="designation" type="ValueSet.Designation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Designation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="language" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The language this designation is defined for.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="use" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that details how this designation would be used.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The text value for this designation.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Filter">
    <xs:annotation>
      <xs:documentation xml:lang="en">A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="property" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that identifies a property defined in the code system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="op" minOccurs="1" maxOccurs="1" type="FilterOperator">
            <xs:annotation>
              <xs:documentation xml:lang="en">The kind of operation to perform as a part of the filter criteria.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value when the operation is 'regex', or one of the values (true and false), when the operation is 'exists'.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Expansion">
    <xs:annotation>
      <xs:documentation xml:lang="en">A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="timestamp" minOccurs="1" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time at which the expansion was produced by the expanding system.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="total" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="offset" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">If paging is being used, the offset at which this resource starts.  I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="parameter" type="ValueSet.Parameter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contains" type="ValueSet.Contains" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The codes that are contained in the value set expansion.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Parameter">
    <xs:annotation>
      <xs:documentation xml:lang="en">A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of the parameter.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value of the parameter.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueString" type="string" />
            <xs:element name="valueBoolean" type="boolean" />
            <xs:element name="valueInteger" type="integer" />
            <xs:element name="valueDecimal" type="decimal" />
            <xs:element name="valueUri" type="uri" />
            <xs:element name="valueCode" type="code" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueSet.Contains">
    <xs:annotation>
      <xs:documentation xml:lang="en">A value set specifies a set of codes drawn from one or more code systems.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="system" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">An absolute URI which is the code system in which the code for this item in the expansion is defined.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="abstract" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="inactive" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understanding legacy data.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="version" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The recommended display for this item in the expansion.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="designation" type="ValueSet.Designation" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="contains" type="ValueSet.Contains" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Other codes and entries contained under this entry in the hierarchy.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="VisionPrescription" type="VisionPrescription">
    <xs:annotation>
      <xs:documentation xml:lang="en">An authorization for the supply of glasses and/or contact lenses to a patient.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="VisionPrescription">
    <xs:annotation>
      <xs:documentation xml:lang="en">An authorization for the supply of glasses and/or contact lenses to a patient.</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">Business identifier which may be used by other parties to reference or identify the prescription.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="0" maxOccurs="1" type="FinancialResourceStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the resource instance.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="patient" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to a resource representing the person to whom the vision products will be supplied.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to a resource that identifies the particular occurrence of contact between patient and health care provider.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="dateWritten" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date (and perhaps time) when the prescription was written.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prescriber" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The healthcare professional responsible for authorizing the prescription.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">Can be the reason or the indication for writing the prescription.</xs:documentation>
            </xs:annotation>
            <xs:element name="reasonCodeableConcept" type="CodeableConcept" />
            <xs:element name="reasonReference" type="Reference" />
          </xs:choice>
          <xs:element name="dispense" type="VisionPrescription.Dispense" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Deals with details of the dispense part of the supply specification.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="VisionPrescription.Dispense">
    <xs:annotation>
      <xs:documentation xml:lang="en">An authorization for the supply of glasses and/or contact lenses to a patient.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="product" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the type of vision correction product which is required for the patient.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="eye" minOccurs="0" maxOccurs="1" type="VisionEyes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The eye for which the lens applies.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="sphere" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Lens power measured in diopters (0.25 units).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="cylinder" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Power adjustment for astigmatism measured in diopters (0.25 units).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="axis" minOccurs="0" maxOccurs="1" type="integer">
            <xs:annotation>
              <xs:documentation xml:lang="en">Adjustment for astigmatism measured in integer degrees.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="prism" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Amount of prism to compensate for eye alignment in fractional units.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="base" minOccurs="0" maxOccurs="1" type="VisionBase">
            <xs:annotation>
              <xs:documentation xml:lang="en">The relative base, or reference lens edge, for the prism.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="add" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Power adjustment for multifocal lenses measured in diopters (0.25 units).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="power" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact lens power measured in diopters (0.25 units).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="backCurve" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Back curvature measured in millimeters.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="diameter" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact lens diameter measured in millimeters.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="duration" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The recommended maximum wear period for the lens.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="color" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Special color or pattern.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="brand" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Brand recommendations or restrictions.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Notes for special requirements such as coatings and lens materials.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="VisionBase-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="up">
        <xs:annotation>
          <xs:documentation xml:lang="en">Up</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="down">
        <xs:annotation>
          <xs:documentation xml:lang="en">Down</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in">
        <xs:annotation>
          <xs:documentation xml:lang="en">In</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="out">
        <xs:annotation>
          <xs:documentation xml:lang="en">Out</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="VisionBase">
    <xs:annotation>
      <xs:documentation xml:lang="en">A coded concept listing the base codes.</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="VisionBase-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="VisionEyes-list">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="right">
        <xs:annotation>
          <xs:documentation xml:lang="en">Right Eye</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="left">
        <xs:annotation>
          <xs:documentation xml:lang="en">Left Eye</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="VisionEyes">
    <xs:annotation>
      <xs:documentation xml:lang="en">A coded concept listing the eye codes.</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="VisionEyes-list" use="optional" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>