Release 5

This page is part of the FHIR Specification (v5.0.0: R5 - STU). This is the current published version in it's permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3

Structuredefinition.shex

FHIR Infrastructure Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: No defined compartments

Raw ShEx

ShEx statement for structuredefinition

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 <id.shex>
IMPORT <uri.shex>
IMPORT <code.shex>
IMPORT <string.shex>
IMPORT <Coding.shex>
IMPORT <boolean.shex>
IMPORT <dateTime.shex>
IMPORT <markdown.shex>
IMPORT <canonical.shex>
IMPORT <Identifier.shex>
IMPORT <UsageContext.shex>
IMPORT <ContactDetail.shex>
IMPORT <DomainResource.shex>
IMPORT <CodeableConcept.shex>
IMPORT <BackboneElement.shex>
IMPORT <ElementDefinition.shex>


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

# Structural Definition
<StructureDefinition> EXTENDS @<DomainResource> CLOSED {   

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

    fhir:url @<uri>;                        # Canonical identifier for this 
                                            # structure definition, represented 
                                            # as a URI (globally unique) 
    fhir:identifier @<OneOrMore_Identifier>?;  # Additional identifier for the 
                                            # structure definition 
    fhir:version @<string>?;                # Business version of the structure 
                                            # definition 
    fhir:versionAlgorithm @<string>  OR 
    			@<Coding>  ?;  # How to compare versions
    fhir:name @<string>;                    # Name for this structure definition 
                                            # (computer friendly) 
    fhir:title @<string>?;                  # Name for this structure definition 
                                            # (human friendly) 
    fhir:status @<code> AND
    	{fhir:v @fhirvs:publication-status};  # draft | active | retired | unknown
    fhir:experimental @<boolean>?;          # For testing purposes, not real 
                                            # usage 
    fhir:date @<dateTime>?;                 # Date last changed
    fhir:publisher @<string>?;              # Name of the publisher/steward 
                                            # (organization or individual) 
    fhir:contact @<OneOrMore_ContactDetail>?;  # Contact details for the publisher
    fhir:description @<markdown>?;          # Natural language description of 
                                            # the structure definition 
    fhir:useContext @<OneOrMore_UsageContext>?;  # The context that the content is 
                                            # intended to support 
    fhir:jurisdiction @<OneOrMore_CodeableConcept>?;  # Intended jurisdiction for 
                                            # structure definition (if 
                                            # applicable) 
    fhir:purpose @<markdown>?;              # Why this structure definition is 
                                            # defined 
    fhir:copyright @<markdown>?;            # Use and/or publishing restrictions
    fhir:copyrightLabel @<string>?;         # Copyright holder and year(s)
    fhir:keyword @<OneOrMore_Coding>?;      # Assist with indexing and finding
    fhir:fhirVersion @<code> AND
    	{fhir:v @fhirvs:FHIR-version}?;  # FHIR Version this 
                                            # StructureDefinition targets 
    fhir:mapping @<OneOrMore_StructureDefinition.mapping>?;  # External specification that the 
                                            # content is mapped to 
    fhir:kind @<code> AND
    	{fhir:v @fhirvs:structure-definition-kind};  # primitive-type | complex-type | 
                                            # resource | logical 
    fhir:abstract @<boolean>;               # Whether the structure is abstract
    fhir:context @<OneOrMore_StructureDefinition.context>?;  # If an extension, where it can be 
                                            # used in instances 
    fhir:contextInvariant @<OneOrMore_string>?;  # FHIRPath invariants - when the 
                                            # extension can be used 
    fhir:type @<uri>;                       # Type defined or constrained by 
                                            # this structure 
    fhir:baseDefinition @<canonical>?;      # Definition that this type is 
                                            # constrained/specialized from 
    fhir:derivation @<code> AND
    	{fhir:v @fhirvs:type-derivation-rule}?;  # specialization | constraint - How 
                                            # relates to base definition 
    fhir:snapshot @<StructureDefinition.snapshot>?;  # Snapshot view of the structure
    fhir:differential @<StructureDefinition.differential>?;  # Differential view of the structure
}  

# Differential view of the structure
<StructureDefinition.differential> EXTENDS @<BackboneElement> CLOSED {   
    fhir:element @<OneOrMore_ElementDefinition>;  # Definition of elements in the 
                                            # resource (if no 
                                            # StructureDefinition) 
}  

# External specification that the content is mapped to
<StructureDefinition.mapping> EXTENDS @<BackboneElement> CLOSED {   
    fhir:identity @<id>;                    # Internal id when this mapping is 
                                            # used 
    fhir:uri @<uri>?;                       # Identifies what this mapping 
                                            # refers to 
    fhir:name @<string>?;                   # Names what this mapping refers to
    fhir:comment @<string>?;                # Versions, Issues, Scope 
                                            # limitations etc 
}  

# Snapshot view of the structure
<StructureDefinition.snapshot> EXTENDS @<BackboneElement> CLOSED {   
    fhir:element @<OneOrMore_ElementDefinition>;  # Definition of elements in the 
                                            # resource (if no 
                                            # StructureDefinition) 
}  

# If an extension, where it can be used in instances
<StructureDefinition.context> EXTENDS @<BackboneElement> CLOSED {   
    fhir:type @<code> AND
    	{fhir:v @fhirvs:extension-context-type};  # fhirpath | element | extension
    fhir:expression @<string>;              # Where the extension can be used in 
                                            # instances 
}  

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

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

<OneOrMore_ContactDetail> CLOSED {
    rdf:first @<ContactDetail>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ContactDetail> 
}

<OneOrMore_UsageContext> CLOSED {
    rdf:first @<UsageContext>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_UsageContext> 
}

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

<OneOrMore_Coding> CLOSED {
    rdf:first @<Coding>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Coding> 
}

<OneOrMore_StructureDefinition.mapping> CLOSED {
    rdf:first @<StructureDefinition.mapping>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_StructureDefinition.mapping> 
}

<OneOrMore_StructureDefinition.context> CLOSED {
    rdf:first @<StructureDefinition.context>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_StructureDefinition.context> 
}

<OneOrMore_string> CLOSED {
    rdf:first @<string>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_string> 
}

<OneOrMore_ElementDefinition> CLOSED {
    rdf:first @<ElementDefinition>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ElementDefinition> 
}

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

# All published FHIR Versions.
fhirvs:FHIR-version ["0.01" "0.05" "0.06" "0.11" "0.0" "0.0.80" "0.0.81" "0.0.82" "0.4" "0.4.0" "0.5" "0.5.0" "1.0" "1.0.0" "1.0.1" "1.0.2" "1.1" "1.1.0" "1.4" "1.4.0" "1.6" "1.6.0" "1.8" "1.8.0" "3.0" "3.0.0" "3.0.1" "3.0.2" "3.3" "3.3.0" "3.5" "3.5.0" "4.0" "4.0.0" "4.0.1" "4.1" "4.1.0" "4.2" "4.2.0" "4.3" "4.3.0" "4.3.0-cibuild" "4.3.0-snapshot1" "4.4" "4.4.0" "4.5" "4.5.0" "4.6" "4.6.0" "5.0" "5.0.0" "5.0.0-cibuild" "5.0.0-snapshot1" "5.0.0-snapshot2" "5.0.0-ballot" "5.0.0-snapshot3" "5.0.0-draft-final"]

# How an extension context is interpreted.
fhirvs:extension-context-type ["fhirpath" "element" "extension"]

# The lifecycle status of an artifact.
fhirvs:publication-status ["draft" "active" "retired" "unknown"]

# Defines the type of structure that a definition is describing.
fhirvs:structure-definition-kind ["primitive-type" "complex-type" "resource" "logical"]

# How a type relates to its baseDefinition.
fhirvs:type-derivation-rule ["specialization" "constraint"]


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.