<!--
		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="WellbeingEventType">
    <xs:sequence>
      <xs:element name="WellbeingEventRefId" minOccurs="0" nillable="true" type="RefIdType" />
      <xs:element name="WellbeingEventLocalId" minOccurs="0" nillable="true" type="LocalIdType" />
      <xs:element name="Student" type="StudentObjectReferenceType" />
      <xs:element name="ReportingProvider" type="ProviderObjectReferenceType" />
      <xs:element name="PhysicalRestraint" minOccurs="0" nillable="true" type="ObjectReferenceType" />
      <xs:element name="EventNotes" minOccurs="0" nillable="true" type="xs:normalizedString" />
      <xs:element name="PossibleMotivationList" minOccurs="0" nillable="true" type="PossibleMotivationListType" />
      <xs:element name="EventCategoryClass" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingEventCategoryClassType" />
      <xs:element name="EventCategoryList" minOccurs="0" nillable="true" type="WellbeingEventCategoryListType" />
      <xs:element name="ReportingStaffMember" minOccurs="0" nillable="true" type="ObjectReferenceType" />
      <xs:element name="EventLocationList" minOccurs="0" nillable="true" type="EventLocationListType" />
      <xs:element name="EventLocationDescription" minOccurs="0" nillable="true" type="xs:normalizedString" />
      <xs:element name="EventCreationTimeStamp" minOccurs="0" nillable="true" type="xs:dateTime" />
      <xs:element name="EventDate" minOccurs="0" nillable="true" type="xs:date" />
      <xs:element name="EventTime" minOccurs="0" nillable="true" type="xs:time" />
      <xs:element name="EventDescription" minOccurs="0" nillable="true" type="xs:normalizedString" />
      <xs:element name="EventTimePeriod" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingEventTimePeriodType" />
      <xs:element name="ConfidentialFlag" minOccurs="0" nillable="true" type="NZCodeSetsYesOrNoCategoryType" />
      <xs:element name="PersonInvolvementList" minOccurs="0" nillable="true" type="PersonInvolvementListType" />
      <xs:element name="Status" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingStatusType" />
      <xs:element name="BehaviourIdentifiedList" minOccurs="0" nillable="true" type="BehaviourIdentifiedListType" />
      <xs:element name="RestraintType" minOccurs="0" nillable="true" type="NZCodeSetsWellbeingEventRestraintTypeType" />
      <xs:element name="ActionTakenList" minOccurs="0" nillable="true" type="ActionTakenListType" />
      <xs:element name="DocumentList" minOccurs="0" nillable="true" type="DocumentListType" />
      <xs:element name="RelatedWellbeingEventList" minOccurs="0" nillable="true" type="RelatedWellbeingEventListType" />
      <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="WellbeingEvent" type="WellbeingEventType">
    <xs:key name="WellbeingEventKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./WellbeingEventRefId" />
    </xs:key>
  </xs:element>

  <xs:complexType name="WellbeingEventCollectionType">
    <xs:sequence>
      <xs:element name="WellbeingEvent" type="WellbeingEventType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="WellbeingEvents" type="WellbeingEventCollectionType" />

</xs:schema>