<!--
		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="TeachingGroupType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>Medium</privacyRating>
      </xs:appinfo>
      <xs:documentation>Identifies a particular class or other group of students.  Such groups 
        can have multiple staff assigned in a variety of roles, may be assigned students from multiple year levels
        and may be taught multiple courses.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="TeachingGroupRefId" 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="TeachingGroupLocalId" 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="ShortName" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Short free format label that describes the group.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="LongName" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Longer description if required.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="GroupType" minOccurs="0" nillable="true" type="NZCodeSetsTeachingGroupTypeType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Provides the means of identifying the type of group such as roll class or subject class 
        for instance and treat them accordingly.</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>RefId  of the Provider who defines the TeachingGroup. Either RefId or LocalId must be provided.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TeachingProvider" minOccurs="0" nillable="true" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>RefId of the Provider who actually teaches the TeachingGroup. Only present when the teaching provider is not the defining provider.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ScheduleTerm" minOccurs="0" nillable="true" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>The term that the teaching groups run for, e.g. Term 1, Full Year etc.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StudentList" minOccurs="0" nillable="true" type="StudentListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>List of Students in this Teaching Group</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TeacherList" minOccurs="0" nillable="true" type="StaffListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>A List of staff associated with the group –  may or may not include the teacher timetabled in the schedule.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="CourseList" minOccurs="0" nillable="true" type="CourseListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>List of generic references denoting the Courses the TeachingGroup is being taught.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SubjectAreaList" minOccurs="0" nillable="true" type="SubjectAreaListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>List of codes denoting the Learning or Subject Areas of the Course the TeachingGroup is being taught.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="YearLevelList" minOccurs="0" nillable="true" type="YearLevelListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>For Subject Class teaching groups: the list of codes denoting the Year Levels
        of the Course the TeachingGroup is being taught.</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="TeachingGroup" type="TeachingGroupType">
    <xs:key name="TeachingGroupKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./TeachingGroupRefId" />
    </xs:key>
  </xs:element>

  <xs:complexType name="TeachingGroupCollectionType">
    <xs:sequence>
      <xs:element name="TeachingGroup" type="TeachingGroupType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="TeachingGroups" type="TeachingGroupCollectionType" />

</xs:schema>