<!--
		SIF Implementation Specification (New Zealand) 3.1
		(8 December, 2020
)
		
		Infrastructure Version: v3.1
	-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sifassociation.org/datamodel/nz/3.1" targetNamespace="http://www.sifassociation.org/datamodel/nz/3.1" elementFormDefault="qualified" version="3.1 (rc 5)">
  <xs:complexType name="StudentProviderEnrolmentType">
    <xs:sequence>
      <xs:element name="StudentProviderEnrolmentRefId" minOccurs="0" nillable="true" type="RefIdType" />
      <xs:element name="StudentProviderEnrolmentLocalId" minOccurs="0" nillable="true" type="LocalIdType" />
      <xs:element name="Student" minOccurs="0" type="StudentObjectReferenceType" />
      <xs:element name="Provider" minOccurs="0" type="ProviderObjectReferenceType" />
      <xs:element name="StudentId" minOccurs="0" type="xs:normalizedString" />
      <xs:element name="EntryDate" minOccurs="0" type="xs:date" />
      <xs:element name="ExitDate" minOccurs="0" nillable="true" type="xs:date" />
      <xs:element name="Status" minOccurs="0" nillable="true" type="NZCodeSetsProviderEnrolmentStatusType" />
      <xs:element name="Exit" minOccurs="0" nillable="true" type="ProviderExitType" />
      <xs:element name="ECEEducationHistoryList" minOccurs="0" nillable="true" type="ECEEducationHistoryListType" />
      <xs:element name="EarlyChildhoodEnrolment" minOccurs="0" nillable="true" type="StudentECEEnrolmentType" />
      <xs:element name="SchoolEnrolmentList" minOccurs="0" nillable="true" type="StudentSchoolEnrolmentListType" />
      <xs:element name="TertiaryEducationEnrolment" minOccurs="0" nillable="true" type="StudentTertiaryEnrolmentType" />
      <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="StudentProviderEnrolment" type="StudentProviderEnrolmentType">
    <xs:unique name="StudentProviderEnrolmentKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./StudentProviderEnrolmentRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="StudentProviderEnrolmentCollectionType">
    <xs:sequence>
      <xs:element name="StudentProviderEnrolment" type="StudentProviderEnrolmentType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="StudentProviderEnrolments" type="StudentProviderEnrolmentCollectionType" />

</xs:schema>