<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2006 sp2 U (http://www.altova.com) by Edward Kort (Dept of Veteran Affairs) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:FILTERS1000="filters1000" targetNamespace="filters1000" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="filter">
		<xs:annotation>
			<xs:documentation>Represents the set of database filters and the single xpath filter for a read query.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="filterId" type="FILTERS1000:FilterId" minOccurs="0">
					<xs:annotation>
						<xs:documentation>CURRENTLY NOT USED To optionally support saved filters, with all the parameters set.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="subject">
					<xs:annotation>
						<xs:documentation>Supports a query on a set of subjects.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="vpid" maxOccurs="1000">
								<xs:annotation>
									<xs:documentation>Subject identifier is represented as a simple string.</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string"/>
								</xs:simpleType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="startDate" type="FILTERS1000:DateParameter" minOccurs="0">
					<xs:annotation>
						<xs:documentation>For readability, this parameter is defined as a date. This may change in the future.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="endDate" type="FILTERS1000:DateParameter" minOccurs="0">
					<xs:annotation>
						<xs:documentation>For readability, this parameter is defined as a date. This may change in the future.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="record" type="xs:string" minOccurs="0" maxOccurs="1000">
					<xs:annotation>
						<xs:documentation>This filter optionally supports the return of multiple specified records. The specified paradigm for defining an enterprise-unique record is by the use of a record number (ICN?) and the station number. This is expected to change.</xs:documentation>
					</xs:annotation>
					<!--xs:complexType>
						<xs:sequence>
							<xs:element name="recordNumber" type="xs:string"/>
							<xs:element name="stationNumber" minOccurs="0">
								<xs:simpleType>
									<xs:restriction base="xs:integer">
										<xs:minInclusive value="100"/>
										<xs:maxInclusive value="999"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
						</xs:sequence>
					</xs:complexType-->
				</xs:element>
				<xs:element name="xpathQuery" minOccurs="0">
					<xs:annotation>
						<xs:documentation>This element represents the domain-level queries that can be represented by xpath queries. Three forms of this filter are supported: a fully qualified xpath (the filter values are included in the xpath), parameterized filters with a set of name/value pair parameters, and a reference to a parameterized filter and the name/value pair parameters.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:choice>
							<xs:element name="preparedXpath">
								<xs:annotation>
									<xs:documentation>This filter contains both the parameterized xpath and the parameter list.</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<xs:element name="queryPath" type="FILTERS1000:QueryPath"/>
										<xs:element name="parameter" type="FILTERS1000:Parameter" minOccurs="0" maxOccurs="100"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="referencedXpath">
								<xs:annotation>
									<xs:documentation>This referenced, parameterized filter contains an ID for the parameterized xpath. There is also an optional list of parameters.</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<xs:element name="filterId" type="FILTERS1000:FilterId"/>
										<xs:element name="parameter" type="FILTERS1000:Parameter" minOccurs="0" maxOccurs="100"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:choice>
						<xs:attribute name="xpathType" type="FILTERS1000:XpathType" use="required"/>
					</xs:complexType>
				</xs:element>
				<xs:element name="entryPoint" type="FILTERS1000:EntryPoint">
					<xs:annotation>
						<xs:documentation>An entry point, represented as a string, is included because the interpretation of the fixed constraints is dependant upon this value. It also serves as a check on the entry point specified for the xpath constraint.</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="vhimVersion" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="DateParameter">
		<xs:restriction base="xs:dateTime"/>
	</xs:simpleType>
	<xs:complexType name="Parameter">
		<xs:all>
			<xs:element name="value">
				<xs:annotation>
					<xs:documentation>A Parameter contains a name and a value pair.</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string"/>
				</xs:simpleType>
			</xs:element>
		</xs:all>
		<xs:attribute name="name" use="required">
			<xs:annotation>
				<xs:documentation>This name must match a parameter name in the xpath statement.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="type"/>
	</xs:complexType>
	<xs:simpleType name="XpathType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="VDM"/>
			<xs:enumeration value="CDM"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="QueryPath">
		<xs:annotation>
			<xs:documentation>A query xpath must contain both the xpath and the root.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="xpath" type="FILTERS1000:XPath"/>
			<xs:element name="entryPoint" type="FILTERS1000:EntryPoint"/>
		</xs:sequence>
	</xs:complexType>
	<xs:simpleType name="XPath">
		<xs:annotation>
			<xs:documentation>For now, the xpath is represented as a simple string.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string"/>
	</xs:simpleType>
	<xs:simpleType name="EntryPoint">
		<xs:annotation>
			<xs:documentation>For now, define the entry point as a qualified name.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string"/>
	</xs:simpleType>
	<xs:simpleType name="FilterId">
		<xs:restriction base="xs:string"/>
	</xs:simpleType>
</xs:schema>
