<schema attributeFormDefault="unqualified" elementFormDefault="qualified"
        targetNamespace="http://xmlns.oracle.com/ProtocolStateManager"
        xmlns:psm="http://xmlns.oracle.com/ProtocolStateManager"
        xmlns="http://www.w3.org/2001/XMLSchema">

  <element name="EnterPatientRequestProcessRequest">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="enterPatientRequestType" type="psm:EnterPatientRequestType"/>
      </choice>
    </complexType>
  </element>
  <element name="EnterPatientRequestProcessResponse">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="enterPatientRequestType" type="psm:EnterPatientRequestType"/>
      </choice>
    </complexType>
  </element>

  <element name="EnrollPatientRequestProcessRequest">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="enrollPatientRequestType" type="psm:EnrollPatientRequestType"/>
      </choice>
    </complexType>
  </element>
  <element name="EnrollPatientRequestProcessResponse">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="enrollPatientRequestType" type="psm:EnrollPatientRequestType"/>
      </choice>
    </complexType>
  </element>

  <element name="PatientScreenVisitsScheduledProcessRequest">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="patientScreeningVisitsScheduledType" type="psm:PatientScreeningVisitsScheduledType"/>
      </choice>
    </complexType>
  </element>
  <element name="PatientScreenVisitsScheduledProcessResponse">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="patientScreeningVisitsScheduledType" type="psm:PatientScreeningVisitsScheduledType"/>
      </choice>
    </complexType>
  </element>

  <element name="PatientScreenVisitRecordedProcessRequest">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="patientScreeningVisitRecordedType" type="psm:PatientScreeningVisitRecordedType"/>
      </choice>
    </complexType>
  </element>
  <element name="PatientScreenVisitRecordedProcessResponse">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="patientScreeningVisitRecordedType" type="psm:PatientScreeningVisitRecordedType"/>
      </choice>
    </complexType>
  </element>

  <element name="PatientStudyVisitsScheduledProcessRequest">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="patientStudyVisitsScheduledType" type="psm:PatientStudyVisitsScheduledType"/>
      </choice>
    </complexType>
  </element>
  <element name="PatientStudyVisitsScheduledProcessResponse">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="patientStudyVisitsScheduledType" type="psm:PatientStudyVisitsScheduledType"/>
      </choice>
    </complexType>
  </element>

  <element name="PatientStudyVisitRecordedProcessRequest">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="patientStudyVisitRecordedType" type="psm:PatientStudyVisitRecordedType"/>
      </choice>
    </complexType>
  </element>
  <element name="PatientStudyVisitRecordedProcessResponse">
    <complexType>
      <choice minOccurs="1" maxOccurs="1">
        <element name="patientStudyVisitRecordedType" type="psm:PatientStudyVisitRecordedType"/>
      </choice>
    </complexType>
  </element>

  <!--  <element name="ProtocolStateManagerProcessRequest">
  <complexType>
   <choice minOccurs="1" maxOccurs="1">
    <element name="enterPatientRequestType" type="psm:EnterPatientRequestType"/>
    <element name="enrollPatientRequestType" type="psm:EnrollPatientRequestType"/>
    <element name="PatientScreeningVisitsScheduledType" type="psm:PatientScreeningVisitsScheduledType"/>
    <element name="PatientScreeningVisitRecordedType" type="psm:PatientScreeningVisitRecordedType"/>
    <element name="patientStudyVisitsScheduledType" type="psm:PatientStudyVisitsScheduledType"/>
    <element name="patientStudyVisitRecordedType" type="psm:PatientStudyVisitRecordedType"/>
   </choice>
  </complexType>
 </element>
 <element name="ProtocolStateManagerProcessResponse">
  <complexType>
   <choice minOccurs="1" maxOccurs="1">
    <element name="enterPatientRequestType" type="psm:EnterPatientRequestType"/>
    <element name="enrollPatientRequestType" type="psm:EnrollPatientRequestType"/>
    <element name="PatientScreeningVisitsScheduledType" type="psm:PatientScreeningVisitsScheduledType"/>
    <element name="PatientScreeningVisitRecordedType" type="psm:PatientScreeningVisitRecordedType"/>
    <element name="patientStudyVisitsScheduledType" type="psm:PatientStudyVisitsScheduledType"/>
    <element name="patientStudyVisitRecordedType" type="psm:PatientStudyVisitRecordedType"/>
   </choice>
  </complexType>
 </element>-->

  <!--CUSTOM-->
  <!--  need patient information and study information
        EnterPatientRequestType can also be used for the return of candidateID?-->
  <complexType name="EnterPatientRequestType">
    <sequence>
      <element name="patient" type="psm:PatientType"/>
      <element name="study" type="psm:StudyType"/>
    </sequence>
  </complexType>

  <!--  need patient for candidateID of the patient being scheduled for screening visits
        need studyID to associate the candidate with the study
        need schedule information-->
  <complexType name="PatientScreeningVisitsScheduledType">
    <sequence>
      <element name="patient" type="psm:PatientType"/>
      <element name="studyID" type="string"/>
      <element name="schedule" type="psm:ScreeningVisitScheduleType"/>
    </sequence>
  </complexType>

  <!--  need patient for candidateID of patient being recorded for screening visit
        need studyID to associate the candidate with the study
        need visit information for the screening visit being recorded-->
  <complexType name="PatientScreeningVisitRecordedType">
    <sequence>
      <element name="patient" type="psm:PatientType"/>
      <element name="studyID" type="string"/>
      <element name="visit" type="psm:ScreenVisitType"/>
    </sequence>
  </complexType>

  <!--  need patient information and study information
        EnterPatientRequestType can also be used for the return of subjectID?-->
  <complexType name="EnrollPatientRequestType">
    <sequence>
      <element name="patient" type="psm:PatientType"/>
      <element name="study" type="psm:StudyType"/>
    </sequence>
  </complexType>

  <!--  need patient for subjectID of the patient being scheduled for visits
        need studyID to associate the subject with the study
        need schedule information-->
  <complexType name="PatientStudyVisitsScheduledType">
    <sequence>
      <element name="patient" type="psm:PatientType"/>
      <element name="studyID" type="string"/>
      <element name="schedule" type="psm:StudyVisitScheduleType"/>
    </sequence>
  </complexType>

  <!--  need patient for subjectID of patient being recorded for visit
        need studyID to associate the subject with the study
        need visit information for the visit being recorded-->
  <complexType name="PatientStudyVisitRecordedType">
    <sequence>
      <element name="patient" type="psm:PatientType"/>
      <element name="studyID" type="string"/>
      <element name="visit" type="psm:StudyVisitType"/>
    </sequence>
  </complexType>

  <!--  patient information should NOT include emrID?
        should contain placeholder for candidateID and subjectID
        what specific demographics data is needed?
          Should this be a generic type so that an XML standard can be passed?-->
  <complexType name="PatientType">
    <sequence>
      <!--<element name="emrID" type="string"/>-->
      <element name="candidateID" type="string"/>
      <element name="subjectID" type="string"/>
      <element name="name" type="string"/>
      <element name="address" type="string"/>
      <element name="dob" type="string"/>
    </sequence>
  </complexType>

  <!--  studyID to identify the study
        should studyData be a generic type to store an XML standard-->
  <complexType name="StudyType">
    <sequence>
      <element name="studyID" type="string"/>
      <element name="studyData" type="string"/>
    </sequence>
  </complexType>


  <complexType name="ScreenVisitType">
    <sequence>
      <element name="visitID" type="string"/>
      <element name="candidateID" type="string"/>
      <element name="date" type="string"/>
      <element name="screenVisitData" type="string"/>
    </sequence>
  </complexType>

  <complexType name="StudyVisitType">
    <sequence>
      <element name="visitID" type="string"/>
      <element name="subjectID" type="string"/>
      <element name="date" type="string"/>
      <element name="studyVisitData" type="string"/>
    </sequence>
  </complexType>

  <complexType name="ScreeningVisitScheduleType">
    <sequence>
      <element name="visit" type="psm:ScreenVisitType" maxOccurs="unbounded"/>
    </sequence>
  </complexType>

  <complexType name="StudyVisitScheduleType">
    <sequence>
      <element name="visit" type="psm:StudyVisitType" maxOccurs="unbounded"/>
    </sequence>
  </complexType>
</schema>




