<?xml version="1.0" standalone="yes"?>
<xs:schema xmlns:surveys="Surveys" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:basedatatypes="Basedatatypes" xmlns:common="Common" xmlns:sc="SurveysCommon" targetNamespace="Surveys" elementFormDefault="unqualified" attributeFormDefault="unqualified">
	<xs:import namespace="Basedatatypes" schemaLocation="Basedatatypes.xsd"/>
	<xs:import namespace="Common" schemaLocation="Common.xsd"/>
	<xs:import namespace="SurveysCommon" schemaLocation="SurveysCommon.xsd"/>
	<!-- ================================================== -->
	<!-- =====  Complex Type Definitions  -->
	<!-- ================================================== -->
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<!--  PSSurveyResponse Type -->
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<xs:complexType name="PSSurveyResponse">
		<xs:complexContent>
			<xs:restriction base="sc:SurveyResponse">
				<xs:sequence>
					<xs:element name="survey" type="surveys:PSSurvey"/>
					<xs:element name="surveyPatient" type="sc:SurveyPatient"/>
					<xs:element name="enrollmentDate" type="xs:date"/>
					<xs:element name="disenrollmentDate" type="xs:date" nillable="true" minOccurs="0"/>
					<xs:element name="activationDate" type="xs:date" nillable="true" minOccurs="0"/>
					<xs:element name="inactivationDate" type="xs:date" nillable="true" minOccurs="0"/>
					<xs:element name="vendorMRN" type="xs:string"/>
					<xs:element name="facility" type="sc:Facility"/>
					<xs:element name="vendor" type="sc:Vendor"/>
					<xs:element name="careCoordinator" type="sc:CareCoordinator" minOccurs="0"/>
					<xs:element name="scheduledDate" type="xs:date" nillable="true" minOccurs="0"/>
					<xs:element name="completedDate" type="xs:dateTime"/>
					<xs:element name="currentDialogueName" type="xs:string" minOccurs="0"/>
					<xs:element name="programName" type="xs:string" minOccurs="0"/>
					<xs:element name="deviceName" type="xs:string" minOccurs="0"/>
					<xs:element name="responseStatus" type="surveys:PSResponseStatus"/>
					<xs:element name="recordSource" type="basedatatypes:HL72FacilityIdentifier"/>
					<xs:element name="recordUpdateTime" type="basedatatypes:PointInTime"/>
					<xs:element name="surveyQuestionsAndAnswers" type="surveys:PSSurveyQuestionsAndAnswers" minOccurs="0"/>
				</xs:sequence>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<!--  ADL Survey Type  -->
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<xs:complexType name="PSSurvey">
		<xs:complexContent>
			<xs:restriction base="sc:Survey">
				<xs:sequence>
					<xs:element name="surveyTitle" type="xs:string" fixed="Patient Satisfaction"/>
					<xs:element name="surveyVersion" type="xs:string" fixed="2.0"/>
				</xs:sequence>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<!--  PSSurveyQuestionsAndAnswers  -->
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<xs:complexType name="PSSurveyQuestionsAndAnswers">
		<xs:complexContent>
			<xs:restriction base="sc:SurveyQuestionsAndAnswers">
				<xs:sequence>
					<xs:element name="surveyQuestionAndAnswer" type="surveys:PSSurveyQuestionAndAnswer" minOccurs="1" maxOccurs="8"/>
				</xs:sequence>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<!--  PSSurveyQuestionAndAnswer  -->
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<xs:complexType name="PSSurveyQuestionAndAnswer">
		<xs:complexContent>
			<xs:restriction base="sc:SurveyQuestionAndAnswer">
				<xs:sequence>
					<xs:element name="questionNumber" type="surveys:PSQuestion"/>
					<xs:element name="answer" type="surveys:PSAnswer"/>
				</xs:sequence>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<!--  PS Response Status Type  -->
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<xs:simpleType name="PSResponseStatus">
		<xs:restriction base="xs:string">
			<xs:enumeration value="ACCEPTED"/>
			<xs:enumeration value="REFUSED"/>
			<xs:enumeration value="DELAYED"/>
			<xs:enumeration value="DISENROLLED"/>
			<xs:enumeration value="REFUSED-TIME-OUT"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<!--  PS Question Type  -->
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<xs:simpleType name="PSQuestion">
		<xs:restriction base="sc:Question">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="8"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<!--  PS Answer Type  -->
	<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
	<xs:simpleType name="PSAnswer">
		<xs:restriction base="sc:Answer">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="5"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
