<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="urn://www.health.vic.gov/vcdc/2011/01/v0.5" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn://www.health.vic.gov/vcdc/2011/01/v0.5" elementFormDefault="unqualified" attributeFormDefault="unqualified">
	<xs:element name="message">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="episodes"/>
			</xs:sequence>
			<xs:attribute name="pStart" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string"/>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="pEnd" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string"/>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="fYear" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string"/>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="OrgID" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:token"/>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="episodes">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="episode" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="episodeCosts">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="episodeCost" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="episodeCost">
		<xs:complexType>
			<xs:attribute name="area" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string"/>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="description" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="255"/>
					</xs:restriction>					
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="account" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string"/>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="dCost" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:decimal"/>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="iCost" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:decimal"/>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="location" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="3"/>
					</xs:restriction>					
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="sDate" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string"/>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="episode">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="episodeCosts"/>
			</xs:sequence>
			<xs:attribute name="eKey" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="30"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="dhKey" use="optional">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="20"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="ur" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="12"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="campus" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:token">	
					<xs:maxLength value="4"/>
				</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="encounter" use="optional">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="20"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="eStart" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:length value="15" fixed="true"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="eEnd" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:length value="15" fixed="true"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="program" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="2"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="stream" use="optional">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="4"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="clinic" use="optional">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="25"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="fund" type="xs:token" use="optional"/>
			<xs:attribute name="mediNo" use="optional">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="11"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="opMode" type="xs:short" use="optional"/>
			<xs:attribute name="opType" type="xs:short" use="optional"/>
			<xs:attribute name="dob" use="optional">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:length value="9" fixed="true"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="atsi" use="optional">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="4" fixed="true"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="pCode">
				<xs:simpleType>
					<xs:restriction base="xs:token">
						<xs:maxLength value="4"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="sex" type="xs:short" use="optional"/>
		</xs:complexType>
	</xs:element>
</xs:schema>



