<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="HILIS4Genomics">
    <xs:complexType>
      <xs:sequence>
        <xs:element type="xs:dateTime" name="FileCreationDateTime">
						<xs:annotation>
							<xs:documentation>Datetime of xml file creation</xs:documentation>
						</xs:annotation>
					</xs:element>
        <xs:element name="Record">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Consent" maxOccurs="1" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="Files" maxOccurs="1" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element type="xs:string" name="file" maxOccurs="unbounded" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Consent form PDF filename (but could be any file)</xs:documentation>
								</xs:annotation>
							</xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element type="xs:dateTime" name="consent_date" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Date consent taken</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_form_version" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent form version (C1, R1/2, etc)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_given" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent given by patient (Y/N)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q1" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #1</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q10" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #10</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q11" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #11</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q12" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #12</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q13" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #13</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q14" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #14</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q2" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #2</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q3" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #3</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q4" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #4</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q5" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #5</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q6" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #6</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q7" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #7</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q8" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #8</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_q9" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Consent question #9</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consent_taken_by" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>HILIS4 user who recorded result</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="info_sheet_version" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Information sheet version (C1, C2, R1-R8)</xs:documentation>
						</xs:annotation>
					</xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="DNA" maxOccurs="1" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element type="xs:string" name="dna_lab_number" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>DNA tube ID (internal use only)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="edta1_fluidx" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>DNA Fluidx vial ID (2D barcode)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="edta1_fluidx_rack_id" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>DNA Fluidx rack ID (2D barcode)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="edta1_fluidx_rack_well" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>DNA Fluidx well location (A8, H10, etc)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:short" name="edta1_fluidx_vol" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>DNA Fluidx vial volume (microlitres)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:dateTime" name="edta1_qc_date" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>QC test result datetime</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="edta1_qc_result" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>QC test result (free text)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="edta1_qc_source" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>QC source (? internal use only)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="edta1_qc_type" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>QC result type (agarose, qubit, etc)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:short" name="volume_stored" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Sample volume retained at lab (microlitres)</xs:documentation>
						</xs:annotation>
					</xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="Demographics">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element type="xs:string" name="arm" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Participant type (Rare disease or Cancer)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:dateTime" name="dob" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Date of birth</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="first_name"/>
                    <xs:element type="xs:string" name="gender"/>
                    <xs:element type="xs:string" name="lab_number"/>
                    <xs:element type="xs:string" name="last_name"/>
                    <xs:element type="xs:long" name="nhs_number" maxOccurs="1" minOccurs="0"/>
                    <xs:element type="xs:string" name="organisation_code">
						<xs:annotation>
							<xs:documentation>Organisation code of referral location</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:int" name="participant_id" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Participant ID: 122xxxxxx (rare disease) or 223xxxxxx (cancer)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="referral_source"/>
                    <xs:element type="xs:string" name="referrer_code">
						<xs:annotation>
							<xs:documentation>GMC code of referrer</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="referrer_name"/>
                    <xs:element type="xs:dateTime" name="registered">
						<xs:annotation>
							<xs:documentation>Date request registered</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:short" name="request_id">
						<xs:annotation>
							<xs:documentation>Internal HILIS4 request ID</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:dateTime" name="screened" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Date of allocation in HILIS as cancer or rare disease</xs:documentation>
						</xs:annotation>
					</xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="Dispatch" maxOccurs="1" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element type="xs:dateTime" name="arrived_ccp" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Arrival datetime as central collection point (internal use only)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="consignment_number" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>GMC sample consignment number</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:dateTime" name="dna_dispatched" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>GMC DNA sample dispatch datetime</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:dateTime" name="omics_dispatched" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>GMC omics sample dispatch datetime</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:dateTime" name="sent_ccp" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Dispatch datetime to central collection point (internal use only)</xs:documentation>
						</xs:annotation>
					</xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="Specimens" maxOccurs="1" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element type="xs:byte" name="additional_samples" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>No. of additional samples expected (internal use only)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="edta1" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Sample ID (barcode) of 1st EDTA sample</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="edta2" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Sample ID (barcode) of 2nd EDTA sample (internal use only)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="handling_protocol" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Sample handling protocol (currently only v2 in use)</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="paxgene_rna" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Sample ID (barcode) of PAXgene RNA sample</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="pst" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Sample ID (barcode) of PST sample</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:dateTime" name="sample_taken" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Datetime sample taken</xs:documentation>
						</xs:annotation>
					</xs:element>
                    <xs:element type="xs:string" name="sst" maxOccurs="1" minOccurs="0">
						<xs:annotation>
							<xs:documentation>Sample ID (barcode) of SST sample</xs:documentation>
						</xs:annotation>
					</xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="Storage" maxOccurs="1" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="Vials" maxOccurs="1" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="vial" maxOccurs="unbounded" minOccurs="0">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element type="xs:string" name="part_number" maxOccurs="1" minOccurs="0">
									<xs:annotation>
										<xs:documentation>Original sample ID (barcode) for link with Fluidx tube</xs:documentation>
									</xs:annotation>
								</xs:element>
                                <xs:element type="xs:string" name="rack_id" maxOccurs="1" minOccurs="0">
									<xs:annotation>
										<xs:documentation>Omics sample Fluidx rack ID (barcode)</xs:documentation>
									</xs:annotation>
								</xs:element>
                                <xs:element type="xs:string" name="sample" maxOccurs="1" minOccurs="0">
									<xs:annotation>
										<xs:documentation>Omics sample type (free-text; internal use only)</xs:documentation>
									</xs:annotation>
								</xs:element>
                                <xs:element type="xs:string" name="source" maxOccurs="1" minOccurs="0">
									<xs:annotation>
										<xs:documentation>Omics sample source (SST, PST, etc)</xs:documentation>
									</xs:annotation>
								</xs:element>
                                <xs:element type="xs:string" name="vial_location" maxOccurs="1" minOccurs="0">
									<xs:annotation>
										<xs:documentation>Omics sample Fluidx vial location (A2, D7, etc)</xs:documentation>
									</xs:annotation>
								</xs:element>
                                <xs:element type="xs:string" name="vialid" maxOccurs="1" minOccurs="0">
									<xs:annotation>
										<xs:documentation>Omics sample Fluidx vial ID (barcode)</xs:documentation>
									</xs:annotation>
								</xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

