<!--
		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="StudentContactPersonalType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>High</privacyRating>
      </xs:appinfo>
      <xs:documentation>
			Information about a Student's whānau member.
		</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="StudentContactPersonalRefId" 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="StudentContactPersonalLocalId" 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.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="HasBOTVote" minOccurs="0" nillable="true" type="NZCodeSetsYesOrNoCategoryType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>Records that this Whānau member holds the Whānau's Board of Trustees vote.</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 collected about the StudentContact, when that contact is a member
			of the Student's whānau.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="HealthcareServiceInfo" minOccurs="0" nillable="true" type="HealthcareServiceInfoType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Information about the StudentContact, when that contact is a healthcare service.
			Details about the actual healthcare pratitioner are kept in the PersonInfo fields.</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="StudentContactPersonal" type="StudentContactPersonalType">
    <xs:unique name="StudentContactPersonalKey1">
      <xs:selector xpath="." />
      <xs:field xpath="@StudentContactPersonalRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="StudentContactPersonalCollectionType">
    <xs:sequence>
      <xs:element name="StudentContactPersonal" type="StudentContactPersonalType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="StudentContactPersonals" type="StudentContactPersonalCollectionType" />

</xs:schema>