<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:mai="urn:P-IEEE-1636.2:2010.01:MaintenanceActionInformation" xmlns:sc="urn:IEEE-P1636-2010.01:SimicaCommon" xmlns:c="urn:IEEE-1671:2009.03:Common" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:P-IEEE-1636.2:2010.01:MaintenanceActionInformation" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
	<xs:annotation>
		<xs:documentation xml:lang="en">
		
This schema is specified in IEEE P1636.2/D5.1, "Draft Trial-Use Standard for Software Interface for Maintenance Information Collection and Analysis (SIMICA): Exchanging Maintenance Action Information (MAI) via the Extensible Markup Language (XML)."
 
This schema is a World Wide Web Consortium (W3C) Extensible 
Markup Language (XML) binding of the "Draft Trial-Use Standard for Software Interface for Maintenance Information Collection and Analysis (SIMICA): Exchanging Maintenance Action Information (MAI) via the Extensible Markup Language (XML)." component defined in IEEE P1636.2/D5.1.

The purpose of this schema is to allow the creation of IEEE P1636.2/D5.1 instance documents.This schema uses the W3C XML Schema definition language as the encoding. This allows for interoperability and the exchange of SIMICA component instances between various systems.

This schema shall not be modified but may be included in 
derivative works. 

Copyright (c) 2009 Institute of Electrical and Electronics 
Engineers, Inc.

USE AT YOUR OWN RISK

    </xs:documentation>
	</xs:annotation>
	<xs:import namespace="urn:IEEE-P1636-2010.01:SimicaCommon" schemaLocation="SimicaCommon.xsd"/>
	<xs:import namespace="urn:IEEE-1671:2009.03:Common" schemaLocation="Common.xsd"/>
	<xs:complexType name="ItemMaintained">
		<xs:annotation>
			<xs:documentation>Refers to the actual repair item as described in an associated IEEE Std 1232 XML document.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="c:DocumentReference">
				<xs:sequence minOccurs="0">
					<xs:element name="RepairItem" type="c:NonBlankString">
						<xs:annotation>
							<xs:documentation>Defines an XPath to the AI-ESTATE actual repair item maintained.</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="Maintainer">
		<xs:annotation>
			<xs:documentation>A specific person performing the maintenance action on the system or item.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="c:Person">
				<xs:attribute name="category" use="required">
					<xs:annotation>
						<xs:documentation>Identifies the category to which a person belongs with respect to the current maintenance action.</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:enumeration value="Authorizer"/>
							<xs:enumeration value="Inspector"/>
							<xs:enumeration value="Performer"/>
							<xs:enumeration value="Supervisor"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
				<xs:attribute name="skillLevel" use="required">
					<xs:annotation>
						<xs:documentation>Provides the relative skill of the person as assigned by the responsible maintenance organization.</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:int">
							<xs:minInclusive value="1"/>
							<xs:maxInclusive value="5"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="MaintenanceAction">
		<xs:annotation>
			<xs:documentation>Defines a specific action taken in the maintenance of some item or entity</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="sc:SystemInstance">
				<xs:sequence>
					<xs:element name="Action">
						<xs:annotation>
							<xs:documentation>Identifies codes and descriptions used to describe a maintenance action.</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:attribute name="actionCode" type="c:NonBlankString">
								<xs:annotation>
									<xs:documentation>An application specific identifier that describes the maintenance action performed. </xs:documentation>
								</xs:annotation>
							</xs:attribute>
							<xs:attribute name="description" type="c:NonBlankString" use="required">
								<xs:annotation>
									<xs:documentation>The description that corresponds to the application specific action code of the maintenance action performed.</xs:documentation>
								</xs:annotation>
							</xs:attribute>
						</xs:complexType>
					</xs:element>
					<xs:element name="MaintenanceReason" type="mai:MaintenanceReason">
						<xs:annotation>
							<xs:documentation>This element describes the cause(s) that led to a maintenance action.</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="PersonAssigned" maxOccurs="unbounded">
						<xs:annotation>
							<xs:documentation>Provides identifying information on the person performing the maintenance action.</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:attribute name="name" type="c:NonBlankString" use="required">
								<xs:annotation>
									<xs:documentation>Identifies the name of the person assigned to a maintenance task</xs:documentation>
								</xs:annotation>
							</xs:attribute>
						</xs:complexType>
					</xs:element>
					<xs:element name="Extension" type="c:Extension" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Element provided to permit extensibility of the schema.</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
				<xs:attribute name="actionID" type="xs:ID" use="required">
					<xs:annotation>
						<xs:documentation>A descriptive or common name for the MaintenanceAction. The value of “ID” shall be unique within the context of the containing XML instance document.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="name" type="c:NonBlankString" use="optional">
					<xs:annotation>
						<xs:documentation>A user-friendly textual name for the MaintenanceAction.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="startTime" type="xs:dateTime" use="required">
					<xs:annotation>
						<xs:documentation>Provides the date and time for the initiation of a maintenance event.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="endTime" type="xs:dateTime" use="optional">
					<xs:annotation>
						<xs:documentation>Provides the date and time for the termination of a maintenance event.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="totalTime" type="xs:duration" use="required">
					<xs:annotation>
						<xs:documentation>Provides the aggregate personnel time for the actual work duration of a maintenance event.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="preventive" use="required">
					<xs:annotation>
						<xs:documentation>Indicates whether or not the maintenance action was performed as part of preventative maintenance.</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:boolean">
							<xs:whiteSpace value="collapse"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
				<xs:attribute name="relatedEvent" type="c:NonBlankString" use="optional">
					<xs:annotation>
						<xs:documentation>References the related action of the maintenance task associated with the test result or a Code that best describes the reason for not being able to take corrective action in the case where NoAction was used.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="MaintenanceReason">
		<xs:annotation>
			<xs:documentation>This element describes the cause(s) that led to a maintenance action.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:choice maxOccurs="unbounded">
				<xs:element name="StandardTestResults">
					<xs:annotation>
						<xs:documentation>Refers to an IEEE 1636.1 Test Results instance document containing the results of tests performed to identify the cause of the discrepancy.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:complexContent>
							<xs:extension base="c:DocumentReference">
								<xs:attribute name="actionID" type="c:NonBlankString" use="optional">
									<xs:annotation>
										<xs:documentation>Identifies the ID of the referenced TestResults ResultSet, TestGroup, Test, or SessionAction that identified the cause of the discrepancy.</xs:documentation>
									</xs:annotation>
								</xs:attribute>
							</xs:extension>
						</xs:complexContent>
					</xs:complexType>
				</xs:element>
				<xs:element name="NonStandardTestResult">
					<xs:annotation>
						<xs:documentation>Refers to a non-IEEE 1636.1 Test Results instance document containing the results of tests performed to identify the cause of the discrepancy.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence minOccurs="0" maxOccurs="unbounded">
							<xs:element name="AssociatedEvent" type="c:NonBlankString">
								<xs:annotation>
									<xs:documentation>Defines an XPath to an event from a non-IEEE 1636.1 Test Results instance document which further elaborates the test result.</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="identifier" type="c:NonBlankString" use="required">
							<xs:annotation>
								<xs:documentation>Uniquely identifies the non-standard test result.</xs:documentation>
							</xs:annotation>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
				<xs:element name="ParentFailureCode" type="c:NonBlankString">
					<xs:annotation>
						<xs:documentation>Defines a failure code associated with the parent cause element, including the no fault code. </xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:choice>
			<xs:element name="AssociatedDiagnosticSession" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Refers to the Session entity of an IEEE Std 1232 Dynamic Context Model XML  instance document containing the results of a diagnostic session performed on the Unit Under Test</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:complexContent>
						<xs:extension base="c:DocumentReference">
							<xs:sequence minOccurs="0">
								<xs:element name="ReferencedSession" type="c:NonBlankString">
									<xs:annotation>
										<xs:documentation>Defines an XPath to the historical AI-ESTATE diagnostic session.</xs:documentation>
									</xs:annotation>
								</xs:element>
							</xs:sequence>
						</xs:extension>
					</xs:complexContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="reportedBy" type="c:NonBlankString" use="required">
			<xs:annotation>
				<xs:documentation>The name of the person or system who reported a discrepancy or cause of the need for a maintenance action</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="whenDiscovered" type="xs:dateTime" use="optional">
			<xs:annotation>
				<xs:documentation>Provides the date and time at which the cause was first determined.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:element name="MaintenanceActionInformation">
		<xs:annotation>
			<xs:documentation>Defines the information associated with actions required for the maintenance of a product at a specific level of maintenance or at a repair facility. </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="CognizantOrganization" type="c:Organization" minOccurs="0">
					<xs:annotation>
						<xs:documentation>The organization that is responsible for the system.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="WorkOrder" type="sc:WorkOrder">
					<xs:annotation>
						<xs:documentation>Contains identifying information for the MaintenanceActionInformationDocument.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:choice>
					<xs:annotation>
						<xs:documentation>The MAI responds to whether or not the issue is software or hardware related based on the choice made here. </xs:documentation>
					</xs:annotation>
					<xs:element name="HardwareMaintained">
						<xs:annotation>
							<xs:documentation>This element supports the case where the object of maintenance is a hardware component rather than a software component.</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:complexContent>
								<xs:extension base="sc:HardwareInstance">
									<xs:sequence>
										<xs:element name="ItemMaintained" type="mai:ItemMaintained" minOccurs="0">
											<xs:annotation>
												<xs:documentation>Refers to the actual repair item as described in an associated IEEE Std 1232 XML document.</xs:documentation>
											</xs:annotation>
										</xs:element>
										<xs:element name="Warranty" type="sc:Warranty" minOccurs="0" maxOccurs="unbounded">
											<xs:annotation>
												<xs:documentation>Defines a manufacturer's legal responsibility for the support of a given system or item</xs:documentation>
											</xs:annotation>
										</xs:element>
									</xs:sequence>
								</xs:extension>
							</xs:complexContent>
						</xs:complexType>
					</xs:element>
					<xs:element name="SoftwareMaintained">
						<xs:annotation>
							<xs:documentation>This element supports the case where the object of maintenance is a software component rather than a hardware component.</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:complexContent>
								<xs:extension base="sc:SoftwareInstance">
									<xs:sequence>
										<xs:element name="ItemMaintained" type="mai:ItemMaintained" minOccurs="0">
											<xs:annotation>
												<xs:documentation>Refers to the actual repair item as described in an associated IEEE Std 1232 XML document.</xs:documentation>
											</xs:annotation>
										</xs:element>
										<xs:element name="Warranty" type="sc:Warranty" minOccurs="0" maxOccurs="unbounded">
											<xs:annotation>
												<xs:documentation>Manufacturer support program.</xs:documentation>
											</xs:annotation>
										</xs:element>
									</xs:sequence>
								</xs:extension>
							</xs:complexContent>
						</xs:complexType>
					</xs:element>
				</xs:choice>
				<xs:element name="HistoricalMAI" type="c:DocumentReference" minOccurs="0" maxOccurs="unbounded">
					<xs:annotation>
						<xs:documentation>Reference to the instance of the MAI document from the prior maintenance action for this Unit Under Test</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="MaintenanceActionStatus">
					<xs:annotation>
						<xs:documentation>Describes the state of the Unit Under Test resulting from the maintenance tasks performed on it</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:attribute name="resultStatus" use="required">
							<xs:annotation>
								<xs:documentation>Indicates the result or outcome of a maintenance action that has been performed. </xs:documentation>
							</xs:annotation>
							<xs:simpleType>
								<xs:restriction base="c:NonBlankString">
									<xs:enumeration value="AwaitingMaintenance"/>
									<xs:enumeration value="Complete"/>
									<xs:enumeration value="InWork"/>
									<xs:enumeration value="UserDefined"/>
								</xs:restriction>
							</xs:simpleType>
						</xs:attribute>
						<xs:attribute name="resultQualifier" type="c:NonBlankString" use="optional">
							<xs:annotation>
								<xs:documentation>Defines an application specific string to provide additional detail about an associated attribute of the parent entity.</xs:documentation>
							</xs:annotation>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
				<xs:element name="MaintenanceEvent">
					<xs:annotation>
						<xs:documentation>Defines an occurrence in a maintenance environment that can be decomposed into a series of compound actions.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:choice>
								<xs:choice maxOccurs="unbounded">
									<xs:annotation>
										<xs:documentation>This choice is necessary, as an instance document will either document the action resulting from maintenance or will capture the reason for non-action. For each maintenance element, one or more actions can be taken as a result of the required maintenance.</xs:documentation>
									</xs:annotation>
									<xs:element name="InstallAction" type="mai:MaintenanceAction">
										<xs:annotation>
											<xs:documentation>Installation of a component required to complete the maintenance action.</xs:documentation>
										</xs:annotation>
									</xs:element>
									<xs:element name="RemoveAction" type="mai:MaintenanceAction">
										<xs:annotation>
											<xs:documentation>The removal of a component required to complete the maintenance action.</xs:documentation>
										</xs:annotation>
									</xs:element>
									<xs:element name="RepairAction" type="mai:MaintenanceAction">
										<xs:annotation>
											<xs:documentation>Work required to restore the unit to an operational state. When something is repaired, this element lists details on the part repaired.</xs:documentation>
										</xs:annotation>
									</xs:element>
								</xs:choice>
								<xs:element name="NoAction" type="c:ItemDescription">
									<xs:annotation>
										<xs:documentation>The reason for not being able to perform maintenance on the unit. </xs:documentation>
									</xs:annotation>
								</xs:element>
							</xs:choice>
							<xs:element name="MaintenanceDelay" minOccurs="0" maxOccurs="unbounded">
								<xs:annotation>
									<xs:documentation>This is for record-keeping only and is used after the maintenance is performed to document reason(s) for the awaiting maintenance time. </xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Description" type="c:NonBlankString">
											<xs:annotation>
												<xs:documentation>Description of reason(s) for the unit to be in the awaiting maintenance condition</xs:documentation>
											</xs:annotation>
										</xs:element>
									</xs:sequence>
									<xs:attribute name="awaitingMaintenanceCode" type="c:NonBlankString" use="optional">
										<xs:annotation>
											<xs:documentation>Provides a code that explains the reason for awaiting maintenance on the unit.  Maintenance organizations typically have a list of organization-unique codes that best describe the reasons for awaiting maintenance on the unit. This attribute provides a place to record that code. The meaning and interpretation of the code is implementation-specific.</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="awaitingMaintenanceTimeStamp" type="xs:dateTime" use="required">
										<xs:annotation>
											<xs:documentation>Date/time when the unit was put on the awaiting maintenance condition</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="delayTime" type="xs:duration" use="required">
										<xs:annotation>
											<xs:documentation>Intended to capture the actual duration of the entire awaiting maintenance event</xs:documentation>
										</xs:annotation>
									</xs:attribute>
								</xs:complexType>
							</xs:element>
							<xs:element name="MaintenanceFacility" type="c:Organization">
								<xs:annotation>
									<xs:documentation>The facility where maintenance has been performed.</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="TechnicalManuals" type="c:DocumentList" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Lists relevant technical manuals that support maintenance of the Unit Under Test</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="maintenanceType" use="required">
							<xs:annotation>
								<xs:documentation>Enumerated type defining the type of maintenance being performed on the maintenance item. Valid enumerated values include "Scheduled" and "Unscheduled".</xs:documentation>
							</xs:annotation>
							<xs:simpleType>
								<xs:restriction base="c:NonBlankString">
									<xs:enumeration value="Scheduled"/>
									<xs:enumeration value="Unscheduled"/>
								</xs:restriction>
							</xs:simpleType>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
				<xs:element name="ResourcesUtilized">
					<xs:annotation>
						<xs:documentation>All necessary information (equipment data, personnel, training needs, etc) used during the maintenance action</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Equipment" type="c:ItemDescriptionReference" minOccurs="0" maxOccurs="unbounded">
								<xs:annotation>
									<xs:documentation>A description of any equipment required to complete the maintenance 
action.</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="Personnel" type="mai:Maintainer" maxOccurs="unbounded">
								<xs:annotation>
									<xs:documentation>Used to capture information about the person(s) performing the maintenance action on the item. </xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="uuid" type="c:Uuid" use="required">
				<xs:annotation>
					<xs:documentation>Uniquely identifies the MAI instance document.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="maintenanceStartTime" type="xs:dateTime" use="required">
				<xs:annotation>
					<xs:documentation>Provides the date and time when the maintenance action was initiated.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="maintenanceDuration" type="xs:duration" use="required">
				<xs:annotation>
					<xs:documentation>Indicates the actual duration of the entire process associated with the maintenance action.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="parentUuid" type="c:Uuid" use="optional">
				<xs:annotation>
					<xs:documentation>A reference to the parent MaintenanceActionInformationDocument.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
		<xs:key name="personKey">
			<xs:annotation>
				<xs:documentation>The unique name of a Person that is a resource.</xs:documentation>
			</xs:annotation>
			<xs:selector xpath=".//mai:ResourcesUtilized/mai:Personnel"/>
			<xs:field xpath="@name"/>
		</xs:key>
		<xs:keyref name="personRef" refer="mai:personKey">
			<xs:annotation>
				<xs:documentation>A reference from the mai:PersonAssigned/@name attribute to the mai:ResourcesUtilized/mai:Person/@name attribute.</xs:documentation>
			</xs:annotation>
			<xs:selector xpath=".//mai:PersonAssigned"/>
			<xs:field xpath="@name"/>
		</xs:keyref>
	</xs:element>
</xs:schema>
