<!--
		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="StudentPersonalType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>Extreme</privacyRating>
      </xs:appinfo>
      <xs:documentation>Contains all the personal information related to the student.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="StudentPersonalRefId" minOccurs="0" nillable="true" type="RefIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</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="StudentPersonalLocalId" minOccurs="0" nillable="true" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</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. This identifier may be set for each student independently for each provider. Each identifier is only available to be retrieved or maintained by the provider that created it.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="NationalStudentNumber" minOccurs="0" type="xs:positiveInteger">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>The unique identifier allocated to every student in New Zealand, also known as the NSN.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="NZQAStudentId" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>NZQA's unique identifier for a student who has been registered for assessments
			 to be conducted against the NZQA framework to achieve unit/achievement standards
			 and national qualifications.
			</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="FirstNZSchoolingDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The date a student first ever started schooling in New
			Zealand. This field is used to establish most students’
			Funding Year Level.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EarlyChildhoodEducation" minOccurs="0" nillable="true" type="EarlyChildhoodEducationType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The type of early childhood education the student received before enrolling in their first school.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PersonInfo" minOccurs="0" type="PersonInfoType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Personal Information </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="BiographicChangeReason" minOccurs="0" nillable="true" type="NZCodeSetsBiographicChangeReasonType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The reason that the persons biographic data was changed.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="CustodyNote" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Notes about a students care and custody status.</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="StudentPersonal" type="StudentPersonalType">
    <xs:unique name="StudentPersonalKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./StudentPersonalRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="StudentPersonalCollectionType">
    <xs:sequence>
      <xs:element name="StudentPersonal" type="StudentPersonalType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="StudentPersonals" type="StudentPersonalCollectionType" />

</xs:schema>