<!--
		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:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>High</privacyRating>
      </xs:appinfo>
      <xs:documentation>A student's association with an education provider for the purpose of receiving
				educational servics.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="StudentProviderEnrolmentRefId" minOccurs="0" nillable="true" type="RefIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The universally unique identifier for the data object record that is used across systems.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StudentProviderEnrolmentLocalId" minOccurs="0" nillable="true" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The Id of the data object record that was provided by the system that the information 
			was originally sourced from.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Student" type="StudentObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Generic object reference to the Student enrolling at the Provider</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Provider" type="ProviderObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Generic object reference to the education Provider, eg school.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StudentId" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>A unique identifier assigned to a Student for a period of enrolment by a provider.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EntryDate" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The date from when this enrolment is ACTIVE. The date
			of the student’s first attendance at the provider. If
			future dated, then the intended first attendance date of
			the enrolment.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ExitDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The date of a student’s last attendance at the provider.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Status" minOccurs="0" nillable="true" type="NZCodeSetsProviderEnrolmentStatusType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The status of the enrolment WiP</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Exit" minOccurs="0" nillable="true" type="ProviderExitType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Details of the reasons, and interventions leading up to the student's enrolment being terminated.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ECEEducationHistoryList" minOccurs="0" nillable="true" type="ECEEducationHistoryListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The list of the types of early childhood education the parent told a primary
			 school that the student received and the hours per week and/or day the student attended.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EarlyChildhoodEnrolment" minOccurs="0" nillable="true" type="StudentECEEnrolmentType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Properties of an enrolment in an early childhood service (WiP).</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SchoolEnrolmentList" minOccurs="0" nillable="true" type="StudentSchoolEnrolmentListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Properties of an enrolment in a school</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TertiaryEducationEnrolment" minOccurs="0" nillable="true" type="StudentTertiaryEnrolmentType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Properties of an enrolment in a Tertiary Education service (WiP).</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The audit details for a record, e.g. Created/Last Updated DateTime and Created/Last Updated By.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="StudentProviderEnrolment" type="StudentProviderEnrolmentType">
    <xs:key name="StudentProviderEnrolmentKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./StudentProviderEnrolmentRefId" />
    </xs:key>
  </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>