<!--
		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="WellbeingResponseType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>High</privacyRating>
      </xs:appinfo>
      <xs:documentation>A record of the outcome and follow ups generated by a WellbeingEvent</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="WellbeingResponseRefId" 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="WellbeingResponseLocalId" 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" type="StudentObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Object reference to the student to whom this WellbeingResponse belongs.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Provider" type="ProviderObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Object reference to the provider for which this WellbeingResponse is being reported.</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 WellbeingResponse 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 WellbeingResponse 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 WellbeingResponse is due to finish.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ResponseStatus" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingStatusType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The current status of the response to the wellbeing event.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ResponseCategory" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingResponseCategoryType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Category of WellbeingResponse.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ResponseNotes" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Text relating to the particular WellbeingResponse.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PersonInvolvementList" minOccurs="0" nillable="true" type="PersonInvolvementListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>List of People involved in the Wellbeing Event/Response. Mandatory if more people than the student to which this event/response occurs is involved.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Suspension" minOccurs="0" nillable="true" type="SuspensionContainerType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Container for details of a Suspension or Expulsion.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Detention" minOccurs="0" nillable="true" type="DetentionContainerType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Container for details of a Detention.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PlanRequiredList" minOccurs="0" nillable="true" type="PlanRequiredListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>List of plans that are required to be generated as part of the WellbeingResponse</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Award" minOccurs="0" nillable="true" type="AwardContainerType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Container for details of an Award.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="OtherResponse" minOccurs="0" nillable="true" type="OtherWellbeingResponseContainerType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Container for details of another type of Response.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="DocumentList" minOccurs="0" nillable="true" type="DocumentListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Describes the Location of any associated documents kept in relation to this Response.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingAlert" minOccurs="0" nillable="true" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The ID (GUID) of the Wellbeing Alert that was generated in response to this WellbeingResponse.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEvent" minOccurs="0" nillable="true" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The ID (GUID) of the WellbeingEvent this WellbeingResponse is for.</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 any appeals that have been made in relation to this Wellbeing Response.</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="WellbeingResponse" type="WellbeingResponseType">
    <xs:key name="WellbeingResponseKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./WellbeingResponseRefId" />
    </xs:key>
  </xs:element>

  <xs:complexType name="WellbeingResponseCollectionType">
    <xs:sequence>
      <xs:element name="WellbeingResponse" type="WellbeingResponseType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="WellbeingResponses" type="WellbeingResponseCollectionType" />

</xs:schema>