<!--
		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="StudentAttendanceSummaryType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>Low</privacyRating>
      </xs:appinfo>
      <xs:documentation>Provides a summary of a student's daily attendance and membership information for a given provider during the time period between the StartDate and EndDate, inclusive. There will be multiple instances of this object for a student in a school over the course of a school year. This summary may be generated by aggregating more granular attendance records, in which case all fields will be read-only; and RefId element may not be applicable.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="StudentAttendanceSummaryRefId" 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="StudentAttendanceSummaryLocalId" 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" minOccurs="0" type="StudentObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The ID (GUID) of the student for whom this attendance information is being reported.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Provider" minOccurs="0" type="ProviderObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The SIF ID of the Provider who is recording this attendance information.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SchoolCalendarYear" minOccurs="0" type="xs:gYear">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>School year for which the information is applicable.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StartDate" minOccurs="0" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Starting date of this attendance reporting period.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EndDate" minOccurs="0" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Ending date of this attendance reporting period.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StartDay" minOccurs="0" nillable="true" type="xs:unsignedInt">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Number of the school day represented in StartDate.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EndDay" minOccurs="0" nillable="true" type="xs:unsignedInt">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Number of the school day represented in EndDate.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="FTE" minOccurs="0" nillable="true">
        <xs:simpleType>
          <xs:restriction base="xs:decimal">
            <xs:annotation>
              <xs:appinfo>
                <sifChar>O</sifChar>
                <privacyRating>Low</privacyRating>
              </xs:appinfo>
              <xs:documentation>Full time equivalent numeric value of the student's course load during this attendance period, expressed in decimal form, where 1.00 represents a full time enrollment.</xs:documentation>
            </xs:annotation>
            <xs:minInclusive value="0" xmlns:xs="http://www.w3.org/2001/XMLSchema" />
            <xs:maxInclusive value="1" xmlns:xs="http://www.w3.org/2001/XMLSchema" />
            <xs:fractionDigits value="2" xmlns:xs="http://www.w3.org/2001/XMLSchema" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="AttendancePercentageHalfDays" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The percentage of half days the student was present when school was in session between the StartDate and EndDate, inclusive. Number of Sessions Present / Total Number of possible sessions = Percentage, e.g. 294/319 = 92.2%.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AttendanceUnjustifiedHalfDays" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The percentage of half days the student had unjustified absences when school was in session between the StartDate and EndDate, inclusive.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="HalfDaysYearPresent" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The number of half days the student was present when school was in session between the StartDate and EndDate, inclusive.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="HalfDaysYearAbsent" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The number of half days the student was absent when school was in session between the StartDate and EndDate, inclusive.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="HalfDaysYearJustified" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The number of half days the student was absent that were justified when school was in session between the StartDate and EndDate, inclusive.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="HalfDaysYearTotal" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The total number of half days.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="HalfDaysYearIntermittantUnjustified" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The number of days the student was absent from school for an unjustifiable reason when school was in session between the StartDate and EndDate, inclusive, and weren't absence for the complete half-day.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="HalfDaysYearPercentagePresent" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The percentage of half days the student was present when school was in session between the StartDate and EndDate, inclusive.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="HalfDaysYearUnjustified" minOccurs="0" nillable="true" type="xs:decimal">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The number of days the student was absent from school for an unjustifiable reason when school was in session between the StartDate and EndDate, inclusive.</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="StudentAttendanceSummary" type="StudentAttendanceSummaryType">
    <xs:unique name="StudentAttendanceSummaryKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./StudentAttendanceSummaryRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="StudentAttendanceSummaryCollectionType">
    <xs:sequence>
      <xs:element name="StudentAttendanceSummary" type="StudentAttendanceSummaryType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="StudentAttendanceSummarys" type="StudentAttendanceSummaryCollectionType" />

</xs:schema>