<?xml version="1.0" encoding="UTF-8"?>
<!-- 
 * #%L
 * org.hl7.fhir.r5
 * %%
 * Copyright (C) 2014 - 2019 Health Level 7
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

/*
  Copyright (c) 2011+, HL7, Inc.
  All rights reserved.
  
  Redistribution and use in source and binary forms, with or without modification, 
  are permitted provided that the following conditions are met:
  
   * Redistributions of source code must retain the above copyright notice, this 
     list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above copyright notice, 
     this list of conditions and the following disclaimer in the documentation 
     and/or other materials provided with the distribution.
   * Neither the name of HL7 nor the names of its contributors may be used to 
     endorse or promote products derived from this software without specific 
     prior written permission.
  
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
  POSSIBILITY OF SUCH DAMAGE.
  

  Generated on Sun, Mar 26, 2023 15:21+1100 for FHIR v5.0.0 

  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources
  valid. Implementers will still need to be familiar with the content of the specification and with
  any profiles that apply to the resources in order to make a conformant implementation.

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://hl7.org/fhir" xmlns:xhtml="http://www.w3.org/1999/xhtml" targetNamespace="http://hl7.org/fhir" elementFormDefault="qualified" version="1.0">
  <xs:include schemaLocation="fhir-base.xsd"/>
  <xs:element name="GenomicStudy" type="GenomicStudy">
    <xs:annotation>
      <xs:documentation xml:lang="en">A GenomicStudy is a set of analyses performed to analyze and generate genomic data.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="GenomicStudy">
    <xs:annotation>
      <xs:documentation xml:lang="en">A GenomicStudy is a set of analyses performed to analyze and generate genomic data.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifiers for this genomic study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="GenomicStudyStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the genomic study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of the study, e.g., Familial variant segregation, Functional variation detection, or Gene expression profiling.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The primary subject of the genomic study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The healthcare event with which this genomics study is associated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="startDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the genomic study was started.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Event resources that the genomic study is based on.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="referrer" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Healthcare professional who requested or referred the genomic study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="interpreter" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Healthcare professionals who interpreted the genomic study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableReference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Why the genomic study was performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instantiatesCanonical" minOccurs="0" maxOccurs="1" type="canonical">
            <xs:annotation>
              <xs:documentation xml:lang="en">The defined protocol that describes the study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instantiatesUri" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The URL pointing to an externally maintained protocol that describes the study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments related to the genomic study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">Description of the genomic study.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="analysis" type="GenomicStudy.Analysis" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The details about a specific analysis that was performed in this GenomicStudy.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="GenomicStudy.Analysis">
    <xs:annotation>
      <xs:documentation xml:lang="en">A GenomicStudy is a set of analyses performed to analyze and generate genomic data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifiers for the analysis event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="methodType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of the methods used in the analysis, e.g., Fluorescence in situ hybridization (FISH), Karyotyping, or Microsatellite instability testing (MSI).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="changeType" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of the genomic changes studied in the analysis, e.g., DNA, RNA, or amino acid change.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="genomeBuild" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reference genome build that is used in this analysis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instantiatesCanonical" minOccurs="0" maxOccurs="1" type="canonical">
            <xs:annotation>
              <xs:documentation xml:lang="en">The defined protocol that describes the analysis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instantiatesUri" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The URL pointing to an externally maintained protocol that describes the analysis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="title" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name of the analysis event (human friendly).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="focus" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The focus of a genomic analysis when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, child, or sibling. For example, in trio testing, the GenomicStudy.subject would be the child (proband) and the GenomicStudy.analysis.focus of a specific analysis would be the parent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="specimen" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The specimen used in the analysis event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="date" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date of the analysis event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Any notes capture with the analysis event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="protocolPerformed" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The protocol that was performed for the analysis event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="regionsStudied" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The genomic regions to be studied in the analysis (BED file).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="regionsCalled" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Genomic regions actually called in the analysis event (BED file).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="input" type="GenomicStudy.Input" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Inputs for the analysis event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="output" type="GenomicStudy.Output" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Outputs for the analysis event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="performer" type="GenomicStudy.Performer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Performer for the analysis event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="device" type="GenomicStudy.Device" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Devices used for the analysis (e.g., instruments, software), with settings and parameters.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="GenomicStudy.Input">
    <xs:annotation>
      <xs:documentation xml:lang="en">A GenomicStudy is a set of analyses performed to analyze and generate genomic data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="file" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">File containing input data.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of input data, e.g., BAM, CRAM, or FASTA.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The analysis event or other GenomicStudy that generated this input file.</xs:documentation>
            </xs:annotation>
            <xs:element name="generatedByIdentifier" type="Identifier"/>
            <xs:element name="generatedByReference" type="Reference"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="GenomicStudy.Output">
    <xs:annotation>
      <xs:documentation xml:lang="en">A GenomicStudy is a set of analyses performed to analyze and generate genomic data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="file" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">File containing output data.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of output data, e.g., VCF, MAF, or BAM.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="GenomicStudy.Performer">
    <xs:annotation>
      <xs:documentation xml:lang="en">A GenomicStudy is a set of analyses performed to analyze and generate genomic data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="actor" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organization, healthcare professional, or others who participated in performing this analysis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="role" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Role of the actor for this analysis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="GenomicStudy.Device">
    <xs:annotation>
      <xs:documentation xml:lang="en">A GenomicStudy is a set of analyses performed to analyze and generate genomic data.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="device" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Device used for the analysis.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="function" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specific function for the device used for the analysis.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="GenomicStudyStatusEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="registered">
        <xs:annotation>
          <xs:documentation xml:lang="en">Registered</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="available">
        <xs:annotation>
          <xs:documentation xml:lang="en">Available</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="cancelled">
        <xs:annotation>
          <xs:documentation xml:lang="en">Cancelled</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Entered in Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="GenomicStudyStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en"></xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="GenomicStudyStatusEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
