R6 Ballot (1st Draft)

This page is part of the FHIR Specification v6.0.0-ballot1: Release 6 Ballot (1st Draft) (see Ballot Notes). The current version is 5.0.0. For a full list of available versions, see the Directory of published versions

Molecularsequence.shex

Clinical Genomics Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: Patient

Raw ShEx

ShEx statement for molecularsequence

PREFIX fhir: <http://hl7.org/fhir/> 
PREFIX fhirvs: <http://hl7.org/fhir/ValueSet/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 

IMPORT <code.shex>
IMPORT <Group.shex>
IMPORT <Range.shex>
IMPORT <Device.shex>
IMPORT <string.shex>
IMPORT <Patient.shex>
IMPORT <integer.shex>
IMPORT <Specimen.shex>
IMPORT <Resource.shex>
IMPORT <Reference.shex>
IMPORT <Substance.shex>
IMPORT <Identifier.shex>
IMPORT <Attachment.shex>
IMPORT <Organization.shex>
IMPORT <DomainResource.shex>
IMPORT <BackboneElement.shex>
IMPORT <CodeableConcept.shex>
IMPORT <NutritionProduct.shex>
IMPORT <BiologicallyDerivedProduct.shex>


start=@<MolecularSequence> AND {fhir:nodeRole [fhir:treeRoot]}

# Representation of a molecular sequence
<MolecularSequence> EXTENDS @<DomainResource> CLOSED {   

    a [fhir:MolecularSequence]?;
    fhir:nodeRole [fhir:treeRoot]?;

    fhir:identifier @<OneOrMore_Identifier>?;  # Unique ID for this particular 
                                            # sequence 
    fhir:type @<code> AND
    	{fhir:v @fhirvs:sequence-type}?;  # aa | dna | rna
    fhir:subject @<Reference> AND {fhir:link 
    			@<BiologicallyDerivedProduct> OR 
    			@<Group> OR 
    			@<NutritionProduct> OR 
    			@<Patient> OR 
    			@<Substance> ? }?;  # Subject this sequence is 
                                            # associated too 
    fhir:focus @<OneOrMore_Reference_Resource>?;  # What the molecular sequence is 
                                            # about, when it is not about the 
                                            # subject of record 
    fhir:specimen @<Reference> AND {fhir:link 
    			@<Specimen> ? }?;  # Specimen used for sequencing
    fhir:device @<Reference> AND {fhir:link 
    			@<Device> ? }?;  # The method for sequencing
    fhir:performer @<Reference> AND {fhir:link 
    			@<Organization> ? }?;  # Who should be responsible for test 
                                            # result 
    fhir:literal @<string>?;                # Sequence that was observed
    fhir:formatted @<OneOrMore_Attachment>?;  # Embedded file or a link (URL) 
                                            # which contains content to 
                                            # represent the sequence 
    fhir:relative @<OneOrMore_MolecularSequence.relative>?;  # A sequence defined relative to 
                                            # another sequence 
}  

# A sequence defined relative to another sequence
<MolecularSequence.relative> EXTENDS @<BackboneElement> CLOSED {   
    fhir:coordinateSystem @<CodeableConcept>;  # Ways of identifying nucleotides or 
                                            # amino acids within a sequence 
    fhir:ordinalPosition @<integer>?;       # Indicates the order in which the 
                                            # sequence should be considered when 
                                            # putting multiple 'relative' 
                                            # elements together 
    fhir:sequenceRange @<Range>?;           # Indicates the nucleotide range in 
                                            # the composed sequence when 
                                            # multiple 'relative' elements are 
                                            # used together 
    fhir:startingSequence @<MolecularSequence.relative.startingSequence>?;  # A sequence used as starting 
                                            # sequence 
    fhir:edit @<OneOrMore_MolecularSequence.relative.edit>?;  # Changes in sequence from the 
                                            # starting sequence 
}  

# A sequence used as starting sequence
<MolecularSequence.relative.startingSequence> EXTENDS @<BackboneElement> CLOSED {   
    fhir:genomeAssembly @<CodeableConcept>?;  # The genome assembly used for 
                                            # starting sequence, e.g. GRCh38 
    fhir:chromosome @<CodeableConcept>?;    # Chromosome Identifier
    fhir:sequence @<CodeableConcept>  OR 
    			@<string>  OR 
    			(@<Reference>  AND {fhir:link @<MolecularSequence> })  ?;  # The reference sequence that 
                                            # represents the starting sequence 
    fhir:windowStart @<integer>?;           # Start position of the window on 
                                            # the starting sequence 
    fhir:windowEnd @<integer>?;             # End position of the window on the 
                                            # starting sequence 
    fhir:orientation @<code> AND
    	{fhir:v @fhirvs:orientation-type}?;  # sense | antisense
    fhir:strand @<code> AND
    	{fhir:v @fhirvs:strand-type}?;  # watson | crick
}  

# Changes in sequence from the starting sequence
<MolecularSequence.relative.edit> EXTENDS @<BackboneElement> CLOSED {   
    fhir:start @<integer>?;                 # Start position of the edit on the 
                                            # starting sequence 
    fhir:end @<integer>?;                   # End position of the edit on the 
                                            # starting sequence 
    fhir:replacementSequence @<string>?;    # Allele that was observed
    fhir:replacedSequence @<string>?;       # Allele in the starting sequence
}  

#---------------------- Cardinality Types (OneOrMore) -------------------

<OneOrMore_Identifier> CLOSED {
    rdf:first @<Identifier>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Identifier> 
}

<OneOrMore_Reference_Resource> CLOSED {
    rdf:first @<Reference> AND {fhir:link 
			@<Resource> } ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Reference_Resource> 
}

<OneOrMore_Attachment> CLOSED {
    rdf:first @<Attachment>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Attachment> 
}

<OneOrMore_MolecularSequence.relative> CLOSED {
    rdf:first @<MolecularSequence.relative>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_MolecularSequence.relative> 
}

<OneOrMore_MolecularSequence.relative.edit> CLOSED {
    rdf:first @<MolecularSequence.relative.edit>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_MolecularSequence.relative.edit> 
}

#---------------------- Value Sets ------------------------

# Type for orientation.
fhirvs:orientation-type ["sense" "antisense"]

# Type if a sequence -- DNA, RNA, or amino acid sequence.
fhirvs:sequence-type ["aa" "dna" "rna"]

# Type for strand.
fhirvs:strand-type ["watson" "crick"]


Usage note: every effort has been made to ensure that the ShEx files are correct and useful, but they are not a normative part of the specification.