<!--
		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="StudentPhysicalRestraintType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>Low</privacyRating>
      </xs:appinfo>
      <xs:documentation>
        Provides information about an incident where staff members or other parties used physical restraint on a child. 
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="StudentPhysicalRestraintRefId" 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="StudentPhysicalRestraintLocalId" 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="Provider" type="ProviderObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Generic object reference to the provider under whose supervision the student was, at the time the physical restraint incient occured.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Student" type="StudentObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Generic object refernece to the student to whom the physical restraint was applied.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PrincipalOrDelegate" 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 StaffPersonal object of the Principal or their delegate who oversaw the recording of the physical restraint incident.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEvent" 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 Wellbeing Event created for the student the physical reatrint was used on.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ConsideredNecessaryReason" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Free text description on why the physical restraint of the student was considered necessary.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="FirstTimeStudentRestrained" minOccurs="0" nillable="true" type="NZCodeSetsYesOrNoCategoryType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Indicates whether or not this was the first time the student was restrained.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="IncidentDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The date the physical restraint was used on the student.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="LocationDescription" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Free text description of the location the physical restraint of the student occurred in.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="OtherComment" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Any other comments on the physical restraint incident.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ReportedDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The date the use of physical restraint on the student was report.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RestraintEndedTime" minOccurs="0" nillable="true" type="xs:time">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The time the physical restraint stopped being used.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RestraintStartedTime" minOccurs="0" nillable="true" type="xs:time">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The time the physical restraint started being used.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RestraintReason" minOccurs="0" nillable="true" type="NZCodeSetsRestraintReasonType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The reason the physical restraint was applied to the child.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="DocumentList" minOccurs="0" nillable="true" type="DocumentListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Describes the Location of any associated documents kept in relation to this physical restraint incident.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RestraintWitnessList" minOccurs="0" nillable="true" type="RestraintWitnessListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of the people that witnessed the physical constraint.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RestraintAdministeredByList" minOccurs="0" nillable="true" type="RestraintAdministeredByListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of the people who administered the physical restraint to the student.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="BehaviourDirectedAtList" minOccurs="0" nillable="true" type="BehaviourDirectedAtListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The list of the people and/or property that the student, who was restrained, was directing their behaviour at.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StaffReflectionList" minOccurs="0" nillable="true" type="StaffReflectionListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of the reflections made by the staff members who applied the physical restraint.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RestraintDebriefingList" minOccurs="0" nillable="true" type="RestraintDebriefingListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of the debriefings that took place after the physical restraint incident occurred.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RestraintQuestionList" minOccurs="0" nillable="true" type="RestraintQuestionListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of questions and their answers about the physical restraint incident.</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="StudentPhysicalRestraint" type="StudentPhysicalRestraintType">
    <xs:key name="StudentPhysicalRestraintKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./StudentPhysicalRestraintRefId" />
    </xs:key>
  </xs:element>

  <xs:complexType name="StudentPhysicalRestraintCollectionType">
    <xs:sequence>
      <xs:element name="StudentPhysicalRestraint" type="StudentPhysicalRestraintType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="StudentPhysicalRestraints" type="StudentPhysicalRestraintCollectionType" />

</xs:schema>