<!--
		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="WellbeingAlertType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>High</privacyRating>
      </xs:appinfo>
      <xs:documentation>Alert indicating to teachers and systems that this student has a 'concern' that needs
        to be known for 'duty of care', which could be Medical, Legal or other.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="WellbeingAlertRefId" 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="WellbeingAlertLocalId" 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>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Generic object reference to the student to whom this WellbeingAlert belongs.</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>Generic object reference to the school for which this WellbeingAlert is being reported.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StaffMember" minOccurs="0" nillable="true" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Generic object reference to the staff member that is a key contact for this wellbeing alert.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PublishedDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The calendar date on which this wellbeing alert was published.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StartDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The date the wellbeing alert period commenced.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EndDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The date the wellbeing alert is due to finish.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AlertCategory" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingAlertCategoryType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Category of WellbeingAlert.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AlertDescription" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Description of this particular wellbeing alert.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AcknowledgementList" minOccurs="0" nillable="true" type="AcknowledgementListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>Key Contact to get information about this wellbeing alert from.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="KeyContactList" minOccurs="0" nillable="true" type="KeyContactListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of key contacts for the alert.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingResponseList" minOccurs="0" nillable="true" type="WellbeingResponseListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of the Wellbeing Responses that contributed to the creation of this Wellbeing Alert.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingAppealList" minOccurs="0" nillable="true" type="WellbeingAppealListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of the Wellbeing Appeal outcomes that contributed to the creation of this Wellbeing Alert.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingCharacteristicList" minOccurs="0" nillable="true" type="WellbeingCharacteristicListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of the Wellbeing Characteristics that contributed to the creation of this Wellbeing Alert.</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="WellbeingAlert" type="WellbeingAlertType">
    <xs:unique name="WellbeingAlertKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./WellbeingAlertRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="WellbeingAlertCollectionType">
    <xs:sequence>
      <xs:element name="WellbeingAlert" type="WellbeingAlertType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="WellbeingAlerts" type="WellbeingAlertCollectionType" />

</xs:schema>