<!--
		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="StudentContactRelationshipType">
    <xs:sequence>
      <xs:element name="StudentContactRelationshipRefId" minOccurs="0" nillable="true" type="RefIdType" />
      <xs:element name="StudentContactRelationshipLocalId" minOccurs="0" nillable="true" type="LocalIdType" />
      <xs:element name="Status" minOccurs="0" type="NZCodeSetsStudentContactRelationshipStatusType" />
      <xs:element name="StartDate" minOccurs="0" type="xs:date" />
      <xs:element name="EndDate" minOccurs="0" nillable="true" type="xs:date" />
      <xs:element name="Student" minOccurs="0" type="StudentObjectReferenceType" />
      <xs:element name="StudentContact" minOccurs="0" type="ObjectReferenceType" />
      <xs:element name="Provider" minOccurs="0" type="ObjectReferenceType" />
      <xs:element name="Relationship" minOccurs="0" type="RelationshipType" />
      <xs:element name="LanguageUsed" minOccurs="0" nillable="true" type="NZCodeSetsLanguageType" />
      <xs:element name="HouseholdList" minOccurs="0" nillable="true" type="HouseholdListType" />
      <xs:element name="ContactFlags" minOccurs="0" nillable="true" type="ContactFlagsType" />
      <xs:element name="ContactSequence" minOccurs="0" nillable="true" type="xs:unsignedInt" />
      <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="StudentContactRelationship" type="StudentContactRelationshipType">
    <xs:unique name="StudentContactRelationshipKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./StudentContactRelationshipRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="StudentContactRelationshipCollectionType">
    <xs:sequence>
      <xs:element name="StudentContactRelationship" type="StudentContactRelationshipType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="StudentContactRelationships" type="StudentContactRelationshipCollectionType" />

</xs:schema>