<!--
		SIF Implementation Specification (Australia) 3.4.3


		(April 5, 2018)
		
		Infrastructure Version: v3
	-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sifassociation.org/datamodel/au/3.4" targetNamespace="http://www.sifassociation.org/datamodel/au/3.4" elementFormDefault="qualified" version="3.4.3">
  <xs:complexType name="WellbeingEventType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>High</privacyRating>
      </xs:appinfo>
      <xs:documentation>Event that impacts on a student’s duty of care.  This has been modelled by Sentral as an Incident, by CEOM as a behaviour support incident and by WA previously as an "Incident Report" but looking to move to terminology such as a “Wellbeing Event”.  There is an emphasis that this ‘event’ was needed to track both ‘positive’ and ‘negative’ behaviours and it not just the recording of a discipline incident or an accident.  This event is specific to a student, and is not global (e.g. a pandemic). Where an event involves more than one student, they can be listed in the person’s involved.  Where the event has an impact on a student’s wellbeing an individual record for each student should be generated.  E.g. where a student is reporting that another student fell off his bike, then the reporting student is listed as a person involved.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="StudentPersonalRefId" minOccurs="0" type="IdRefType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The ID (GUID) of the student to whom this WellbeingEvent belongs.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SchoolInfoRefId" minOccurs="0" type="IdRefType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The ID (GUID) of the school for which this WellbeingEvent is being reported.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EventId" minOccurs="0" nillable="true" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A Local Identifier for the Event. It is expected to be unique to the reporting site.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEventNotes" minOccurs="0" nillable="true" type="xs:string">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Text relating to the particular WellbeingEvent.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEventCategoryClass" minOccurs="0" type="AUCodeSetsWellbeingEventCategoryClassType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Category of WellbeingEvent.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEventCategoryList" minOccurs="0" nillable="true" type="WellbeingEventCategoryListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>List of Categories of WellbeingEvent.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ReportingStaffRefId" minOccurs="0" nillable="true" type="IdRefType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The ID (GUID) of the staff member who logged the Wellbeing Event record.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEventLocationDetails" minOccurs="0" nillable="true" type="WellbeingEventLocationDetailsType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</privacyRating>
          </xs:appinfo>
          <xs:documentation>Details of Event Location.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEventCreationTimeStamp" minOccurs="0" nillable="true" type="xs:dateTime">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Date and time of the WellbeingEvent record creation.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEventDate" minOccurs="0" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The calendar date on which this WellbeingEvent occured.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEventTime" minOccurs="0" nillable="true" type="xs:time">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>The time when WellbeingEvent occured.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEventDescription" minOccurs="0" nillable="true" type="xs:string">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>A description of the WellbeingEvent.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="WellbeingEventTimePeriod" minOccurs="0" type="AUCodeSetsWellbeingEventTimePeriodType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Time period of when the event occurred.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ConfidentialFlag" minOccurs="0" nillable="true" type="AUCodeSetsYesOrNoCategoryType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Flag indicating if the incident is confidential or not.  If ‘Y’ should not be shared with any other system/school.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PersonInvolvementList" minOccurs="0" nillable="true" type="PersonInvolvementListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>C</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>List of People involved in the Wellbeing event.  Mandatory if more people than the student to which this event occurs is involved.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="FollowUpActionList" minOccurs="0" nillable="true" type="FollowUpActionListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>List of Actions where an action resulted and is known – maybe just a link to a WellbeingResponse Object</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Status" minOccurs="0" nillable="true" type="AUCodeSetsWellbeingStatusType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>Current Status.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="DocumentList" minOccurs="0" nillable="true" type="WellbeingDocumentListType">
        <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="SIF_Metadata" minOccurs="0" nillable="true" type="SIF_MetadataType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
      <xs:element name="SIF_ExtendedElements" minOccurs="0" nillable="true" type="SIF_ExtendedElementsType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation />
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="RefId" use="required" type="RefIdType">
      <xs:annotation>
        <xs:appinfo>
          <sifChar>M</sifChar>
          <privacyRating>Low</privacyRating>
        </xs:appinfo>
        <xs:documentation>The ID (GUID) assigned to uniquely identify this WellbeingEvent.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="WellbeingEvent" type="WellbeingEventType">
    <xs:unique name="WellbeingEventKey1">
      <xs:selector xpath="./WellbeingEvent" />
      <xs:field xpath="@RefId" />
    </xs:unique>
  </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>