<?xml version="1.0" encoding="utf-8" ?> 
<xs:schema targetNamespace="urn:esr-vha-gov:internal:hl7-messages" xmlns="urn:esr-vha-gov:internal:hl7-messages" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    elementFormDefault="qualified">
	
   <!-- Include all common schemas  --> 
  <xs:include schemaLocation="edb/messaging/hl7/xsd/HL7Messages.xsd" />
  <xs:include schemaLocation="edb/messaging/hl7/xsd/HL7Segments.xsd" />
  <xs:include schemaLocation="edb/messaging/hl7/xsd/HL7Tables.xsd" />
  <xs:include schemaLocation="edb/messaging/hl7/xsd/HL7Types.xsd" />
  <xs:include schemaLocation="edb/messaging/hl7/xsd/VATables.xsd" />
  <xs:include schemaLocation="edb/messaging/hl7/xsd/ZSegments.xsd" />
	
  <!-- Include specific vista inbound schema -->
  <xs:include schemaLocation="edb/messaging/hl7/xsd/messages/vista/inbound/Segments.xsd" />

  <xs:element name="qbp-q21" substitutionGroup="anyMessage">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="anyMessage.content">
          <xs:sequence>
            <xs:element name="msh" type="inbound.msh.content" minOccurs="1" maxOccurs="1" />            
            <xs:element name="qpd" type="qpd.content" minOccurs="1" maxOccurs="1" />
            <xs:element name="rcp" type="rcp.content" minOccurs="0" maxOccurs="1" />            
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
</xs:schema>
