<!--
		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:sequence>
      <xs:element name="WellbeingAppealRefId" minOccurs="0" nillable="true" type="RefIdType" />
      <xs:element name="WellbeingAppealLocalId" minOccurs="0" nillable="true" type="LocalIdType" />
      <xs:element name="Student" minOccurs="0" type="StudentObjectReferenceType" />
      <xs:element name="Provider" minOccurs="0" type="ProviderObjectReferenceType" />
      <xs:element name="WellbeingResponse" minOccurs="0" type="ObjectReferenceType" />
      <xs:element name="WellbeingAlert" minOccurs="0" nillable="true" type="ObjectReferenceType" />
      <xs:element name="AppealStatus" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingAppealStatusType" />
      <xs:element name="RegisteredDate" minOccurs="0" nillable="true" type="xs:date" />
      <xs:element name="AppealNotes" minOccurs="0" nillable="true" type="xs:normalizedString" />
      <xs:element name="AppealOutcome" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingAppealOutcomeType" />
      <xs:element name="AppealDeterminationBy" minOccurs="0" nillable="true" type="NZCodeSetsAppealDeterminationByType" />
      <xs:element name="DocumentList" minOccurs="0" nillable="true" type="DocumentListType" />
      <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="WellbeingAppeal" type="WellbeingAppealType">
    <xs:unique name="WellbeingAppealKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./WellbeingAppealRefId" />
    </xs:unique>
  </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>