<!--
		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="WellbeingAppealType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>High</privacyRating>
      </xs:appinfo>
      <xs:documentation>Records detail of any "appeal" or "request" made by involved parties in regard to a negative/punitive Wellbeing Response that was the result of a student Wellbeing Event.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="WellbeingAppealRefId" minOccurs="0" nillable="true" type="RefIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</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="WellbeingAppealLocalId" 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>Generic object reference to the student to whom this WellbeingAppeal belongs.</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>Generic object reference to the school for which this WellbeingAppeal is being reported.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingResponse" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Generic object reference to the WellbeingResponse for which this WellbeingAppeal is in response to.</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>Generic object reference to the WellbeingAlert this WellbeingAppeal's outcome has triggered.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AppealStatus" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingAppealStatusType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The status of WellbeingAppeal.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RegisteredDate" 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 WellbeingAppeal was registered.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AppealNotes" 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 WellbeingAppeal.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AppealOutcome" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingAppealOutcomeType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The outcome of the appeal.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AppealDeterminationBy" minOccurs="0" nillable="true" type="NZCodeSetsAppealDeterminationByType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The type of individual or group that determined the appeal outcome.</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 Appeal.</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="WellbeingAppeal" type="WellbeingAppealType">
    <xs:key name="WellbeingAppealKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./WellbeingAppealRefId" />
    </xs:key>
  </xs:element>

  <xs:complexType name="WellbeingAppealCollectionType">
    <xs:sequence>
      <xs:element name="WellbeingAppeal" type="WellbeingAppealType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="WellbeingAppeals" type="WellbeingAppealCollectionType" />

</xs:schema>