Release 5

This page is part of the FHIR Specification (v5.0.0: R5 - STU). This is the current published version. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3

Specimen.shex

Orders and Observations Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: Device, Patient, Practitioner

Raw ShEx

ShEx statement for specimen

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 <Device.shex>
IMPORT <string.shex>
IMPORT <Period.shex>
IMPORT <Patient.shex>
IMPORT <Location.shex>
IMPORT <dateTime.shex>
IMPORT <Quantity.shex>
IMPORT <Duration.shex>
IMPORT <Reference.shex>
IMPORT <Substance.shex>
IMPORT <Procedure.shex>
IMPORT <Identifier.shex>
IMPORT <Annotation.shex>
IMPORT <Practitioner.shex>
IMPORT <RelatedPerson.shex>
IMPORT <DomainResource.shex>
IMPORT <ServiceRequest.shex>
IMPORT <CodeableConcept.shex>
IMPORT <BackboneElement.shex>
IMPORT <PractitionerRole.shex>
IMPORT <CodeableReference.shex>
IMPORT <BiologicallyDerivedProduct.shex>


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

# Sample for analysis
<Specimen> EXTENDS @<DomainResource> CLOSED {   

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

    fhir:identifier @<OneOrMore_Identifier>?;  # External Identifier
    fhir:accessionIdentifier @<Identifier>?;  # Identifier assigned by the lab
    fhir:status @<code> AND
    	{fhir:v @fhirvs:specimen-status}?;  # available | unavailable | 
                                            # unsatisfactory | entered-in-error 
    fhir:type @<CodeableConcept>?;          # Kind of material that forms the 
                                            # specimen 
    fhir:subject @<Reference> AND {fhir:link 
    			@<BiologicallyDerivedProduct> OR 
    			@<Device> OR 
    			@<Group> OR 
    			@<Location> OR 
    			@<Patient> OR 
    			@<Substance> ? }?;  # Where the specimen came from. This 
                                            # may be from patient(s), from a 
                                            # location (e.g., the source of an 
                                            # environmental sample), or a 
                                            # sampling of a substance, a 
                                            # biologically-derived product, or a 
                                            # device 
    fhir:receivedTime @<dateTime>?;         # The time when specimen is received 
                                            # by the testing laboratory 
    fhir:parent @<OneOrMore_Reference_Specimen>?;  # Specimen from which this specimen 
                                            # originated 
    fhir:request @<OneOrMore_Reference_ServiceRequest>?;  # Why the specimen was collected
    fhir:combined @<code> AND
    	{fhir:v @fhirvs:specimen-combined}?;  # grouped | pooled
    fhir:role @<OneOrMore_CodeableConcept>?;  # The role the specimen serves
    fhir:feature @<OneOrMore_Specimen.feature>?;  # The physical feature of a specimen
    fhir:collection @<Specimen.collection>?;  # Collection details
    fhir:processing @<OneOrMore_Specimen.processing>?;  # Processing and processing step 
                                            # details 
    fhir:container @<OneOrMore_Specimen.container>?;  # Direct container of specimen 
                                            # (tube/slide, etc.) 
    fhir:condition @<OneOrMore_CodeableConcept>?;  # State of the specimen
    fhir:note @<OneOrMore_Annotation>?;     # Comments
}  

# The physical feature of a specimen
<Specimen.feature> EXTENDS @<BackboneElement> CLOSED {   
    fhir:type @<CodeableConcept>;           # Highlighted feature
    fhir:description @<string>;             # Information about the feature
}  

# Direct container of specimen (tube/slide, etc.)
<Specimen.container> EXTENDS @<BackboneElement> CLOSED {   
    fhir:device @<Reference> AND {fhir:link 
    			@<Device> ? };  # Device resource for the container
    fhir:location @<Reference> AND {fhir:link 
    			@<Location> ? }?;  # Where the container is
    fhir:specimenQuantity @<Quantity>?;     # Quantity of specimen within 
                                            # container 
}  

# Collection details
<Specimen.collection> EXTENDS @<BackboneElement> CLOSED {   
    fhir:collector @<Reference> AND {fhir:link 
    			@<Patient> OR 
    			@<Practitioner> OR 
    			@<PractitionerRole> OR 
    			@<RelatedPerson> ? }?;  # Who collected the specimen
    fhir:collected @<dateTime>  OR 
    			@<Period>  ?;  # Collection time
    fhir:duration @<Duration>?;             # How long it took to collect 
                                            # specimen 
    fhir:quantity @<Quantity>?;             # The quantity of specimen collected
    fhir:method @<CodeableConcept>?;        # Technique used to perform 
                                            # collection 
    fhir:device @<CodeableReference>?;      # Device used to perform collection
    fhir:procedure @<Reference> AND {fhir:link 
    			@<Procedure> ? }?;  # The procedure that collects the 
                                            # specimen 
    fhir:bodySite @<CodeableReference>?;    # Anatomical collection site
    fhir:fastingStatus @<CodeableConcept>  OR 
    			@<Duration>  ?;  # Whether or how long patient 
                                            # abstained from food and/or drink 
}  

# Processing and processing step details
<Specimen.processing> EXTENDS @<BackboneElement> CLOSED {   
    fhir:description @<string>?;            # Textual description of procedure
    fhir:method @<CodeableConcept>?;        # Indicates the treatment step  
                                            # applied to the specimen 
    fhir:additive @<OneOrMore_Reference_Substance>?;  # Material used in the processing 
                                            # step 
    fhir:time @<dateTime>  OR 
    			@<Period>  ?;  # Date and time of specimen 
                                            # processing 
}  

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

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

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

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

<OneOrMore_CodeableConcept> CLOSED {
    rdf:first @<CodeableConcept>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_CodeableConcept> 
}

<OneOrMore_Specimen.feature> CLOSED {
    rdf:first @<Specimen.feature>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Specimen.feature> 
}

<OneOrMore_Specimen.processing> CLOSED {
    rdf:first @<Specimen.processing>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Specimen.processing> 
}

<OneOrMore_Specimen.container> CLOSED {
    rdf:first @<Specimen.container>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Specimen.container> 
}

<OneOrMore_Annotation> CLOSED {
    rdf:first @<Annotation>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Annotation> 
}

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

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

# Codes providing the combined status of a specimen.
fhirvs:specimen-combined ["grouped" "pooled"]

# Codes providing the status/availability of a specimen.
fhirvs:specimen-status ["available" "unavailable" "unsatisfactory" "entered-in-error"]


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.