FHIR CI-Build

This is the Continuous Integration Build of FHIR (will be incorrect/inconsistent at times).
See the Directory of published versions

Valueset.shex

Responsible Owner: Terminology Infrastructure Work GroupStandards Status: InformativeCompartments: No defined compartments

Raw ShEx

ShEx statement for valueset

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#> 

# ShEx Version 2.2
IMPORT <Uri.shex>
IMPORT <Code.shex>
IMPORT <Date.shex>
IMPORT <String.shex>
IMPORT <Coding.shex>
IMPORT <Period.shex>
IMPORT <Boolean.shex>
IMPORT <Integer.shex>
IMPORT <Decimal.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 <RelatedArtifact.shex>
IMPORT <BackboneElement.shex>

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

# A set of codes drawn from one or more code systems
<ValueSet> EXTENDS @<DomainResource> CLOSED {   
    a [fhir:ValueSet]?;fhir:nodeRole [fhir:treeRoot]?;

    fhir:url @<Uri>?;                       # Canonical identifier for this 
                                            # value set, represented as a URI 
                                            # (globally unique) 
    fhir:identifier @<OneOrMore_Identifier>?;  # Additional identifier for the 
                                            # value set (business identifier) 
    fhir:version @<String>?;                # Business version of the value set
    fhir:versionAlgorithm @<String>  OR 
    			@<Coding>  ?;  # How to compare versions
    fhir:name @<String>?;                   # Name for this value set (computer 
                                            # friendly) 
    fhir:title @<String>?;                  # Name for this value set (human 
                                            # friendly) 
    fhir:status @<Code> AND
    	{fhir:v @fhirvs:publication-status};  # draft | active | retired | unknown
    fhir:experimental @<Boolean>?;          # For testing only - never for 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 value set 
    fhir:useContext @<OneOrMore_UsageContext>?;  # The context that the content is 
                                            # intended to support 
    fhir:jurisdiction @<OneOrMore_CodeableConcept>?;  # Jurisdiction of the authority that 
                                            # maintains the  value set (if 
                                            # applicable) 
    fhir:immutable @<Boolean>?;             # Indicates whether or not any 
                                            # change to the content logical 
                                            # definition may occur 
    fhir:purpose @<Markdown>?;              # Why this value set is defined
    fhir:copyright @<Markdown>?;            # Notice about intellectual property 
                                            # ownership, can include 
                                            # restrictions on use 
    fhir:copyrightLabel @<String>?;         # Copyright holder and year(s)
    fhir:approvalDate @<Date>?;             # When the ValueSet was approved by 
                                            # publisher 
    fhir:lastReviewDate @<Date>?;           # When the ValueSet was last 
                                            # reviewed by the publisher 
    fhir:effectivePeriod @<Period>?;        # When the ValueSet is expected to 
                                            # be used 
    fhir:topic @<OneOrMore_CodeableConcept>?;  # E.g. Education, Treatment, 
                                            # Assessment, etc 
    fhir:author @<OneOrMore_ContactDetail>?;  # Who authored the ValueSet
    fhir:editor @<OneOrMore_ContactDetail>?;  # Who edited the ValueSet
    fhir:reviewer @<OneOrMore_ContactDetail>?;  # Who reviewed the ValueSet
    fhir:endorser @<OneOrMore_ContactDetail>?;  # Who endorsed the ValueSet
    fhir:relatedArtifact @<OneOrMore_RelatedArtifact>?;  # Additional documentation, 
                                            # citations, etc 
    fhir:compose @<ValueSet.compose>?;      # Content logical definition of the 
                                            # value set (CLD) 
    fhir:expansion @<ValueSet.expansion>?;  # Used when the value set is 
                                            # "expanded" 
}  

# SubProperty value for the concept
<ValueSet.expansion.contains.property.subProperty> EXTENDS @<BackboneElement> CLOSED {   
    fhir:code @<Code>;                      # Reference to 
                                            # ValueSet.expansion.property.code 
    fhir:value @<Code>  OR 
    			@<Coding>  OR 
    			@<String>  OR 
    			@<Integer>  OR 
    			@<Boolean>  OR 
    			@<DateTime>  OR 
    			@<Decimal>  ;  # Value of the subproperty for this 
                                            # concept 
}  

# Codes in the value set
<ValueSet.expansion.contains> EXTENDS @<BackboneElement> CLOSED {   
    fhir:system @<Uri>?;                    # System value for the code
    fhir:abstract @<Boolean>?;              # If user cannot select this entry
    fhir:inactive @<Boolean>?;              # If concept is inactive in the code 
                                            # system 
    fhir:version @<String>?;                # Version in which this code/display 
                                            # is defined 
    fhir:code @<Code>?;                     # Code - if blank, this is not a 
                                            # selectable code 
    fhir:display @<String>?;                # User display for the concept
    fhir:designation @<OneOrMore_ValueSet.compose.include.concept.designation>?;  # Additional representations for 
                                            # this item 
    fhir:property @<OneOrMore_ValueSet.expansion.contains.property>?;  # Property value for the concept
    fhir:contains @<OneOrMore_ValueSet.expansion.contains>?;  # Codes contained under this entry
}  

# Used when the value set is "expanded"
<ValueSet.expansion> EXTENDS @<BackboneElement> CLOSED {   
    fhir:identifier @<Uri>?;                # Identifies the value set expansion 
                                            # (business identifier) 
    fhir:next @<Uri>?;                      # Opaque urls for paging through 
                                            # expansion results 
    fhir:timestamp @<DateTime>;             # Time ValueSet expansion happened
    fhir:total @<Integer>?;                 # Total number of codes in the 
                                            # expansion 
    fhir:offset @<Integer>?;                # Offset at which this resource 
                                            # starts 
    fhir:parameter @<OneOrMore_ValueSet.expansion.parameter>?;  # Parameter that controlled the 
                                            # expansion process 
    fhir:property @<OneOrMore_ValueSet.expansion.property>?;  # Additional information supplied 
                                            # about each concept 
    fhir:contains @<OneOrMore_ValueSet.expansion.contains>?;  # Codes in the value set
}  

# A concept defined in the system
<ValueSet.compose.include.concept> EXTENDS @<BackboneElement> CLOSED {   
    fhir:code @<Code>;                      # Code or expression from system
    fhir:display @<String>?;                # Text to display for this code for 
                                            # this value set in this valueset 
    fhir:designation @<OneOrMore_ValueSet.compose.include.concept.designation>?;  # Additional representations for 
                                            # this concept 
}  

# Codes contained under this entry
<ValueSet.expansion.contains.containsnull> CLOSED {   
}  

# Additional representations for this concept
<ValueSet.compose.include.concept.designation> EXTENDS @<BackboneElement> CLOSED {   
    fhir:language @<Code> AND
    	{fhir:v @fhirvs:all-languages}?;  # Human language of the designation
    fhir:use @<Coding>?;                    # Types of uses of designations
    fhir:additionalUse @<OneOrMore_Coding>?;  # Additional ways how this 
                                            # designation would be used 
    fhir:value @<String>;                   # The text value for this designation
}  

# Select codes/concepts by their properties (including relationships)
<ValueSet.compose.include.filter> EXTENDS @<BackboneElement> CLOSED {   
    fhir:property @<Code>;                  # A property/filter defined by the 
                                            # code system 
    fhir:op @<Code> AND
    	{fhir:v @fhirvs:filter-operator};  # = | is-a | descendent-of | 
                                            # is-not-a | regex | in | not-in | 
                                            # generalizes | child-of | 
                                            # descendent-leaf | exists 
    fhir:value @<String>;                   # Code from the system, or regex 
                                            # criteria, or boolean value for 
                                            # exists 
}  

# Additional information supplied about each concept
<ValueSet.expansion.property> EXTENDS @<BackboneElement> CLOSED {   
    fhir:code @<Code>;                      # Identifies the property on the 
                                            # concepts, and when referred to in 
                                            # operations 
    fhir:uri @<Uri>?;                       # Formal identifier for the property
}  

# Property value for the concept
<ValueSet.expansion.contains.property> EXTENDS @<BackboneElement> CLOSED {   
    fhir:code @<Code>;                      # Reference to 
                                            # ValueSet.expansion.property.code 
    fhir:value @<Code>  OR 
    			@<Coding>  OR 
    			@<String>  OR 
    			@<Integer>  OR 
    			@<Boolean>  OR 
    			@<DateTime>  OR 
    			@<Decimal>  ;  # Value of the property for this 
                                            # concept 
    fhir:subProperty @<OneOrMore_ValueSet.expansion.contains.property.subProperty>?;  # SubProperty value for the concept
}  

# Content logical definition of the value set (CLD)
<ValueSet.compose> EXTENDS @<BackboneElement> CLOSED {   
    fhir:lockedDate @<Date>?;               # Fixed date for references with no 
                                            # specified version (transitive) 
    fhir:inactive @<Boolean>?;              # Whether inactive codes are in the 
                                            # value set 
    fhir:include @<OneOrMore_ValueSet.compose.include>;  # Include one or more codes from a 
                                            # code system or other value set(s) 
    fhir:exclude @<OneOrMore_ValueSet.compose.include>?;  # Explicitly exclude codes from a 
                                            # code system or other value sets 
    fhir:property @<OneOrMore_String>?;     # Property to return if client 
                                            # doesn't override 
}  

# Parameter that controlled the expansion process
<ValueSet.expansion.parameter> EXTENDS @<BackboneElement> CLOSED {   
    fhir:name @<String>;                    # Name as assigned by the client or 
                                            # server 
    fhir:value @<String>  OR 
    			@<Boolean>  OR 
    			@<Integer>  OR 
    			@<Decimal>  OR 
    			@<Uri>  OR 
    			@<Code>  OR 
    			@<DateTime>  ?;  # Value of the named parameter
}  

# Include one or more codes from a code system or other value set(s)
<ValueSet.compose.include> EXTENDS @<BackboneElement> CLOSED {   
    fhir:system @<Uri>?;                    # The system the codes come from
    fhir:version @<String>?;                # Specific version of the code 
                                            # system referred to 
    fhir:concept @<OneOrMore_ValueSet.compose.include.concept>?;  # A concept defined in the system
    fhir:filter @<OneOrMore_ValueSet.compose.include.filter>?;  # Select codes/concepts by their 
                                            # properties (including 
                                            # relationships) 
    fhir:valueSet @<OneOrMore_Canonical>?;  # Select the contents included in 
                                            # this value set 
    fhir:copyright @<Markdown>?;            # A copyright statement for the 
                                            # specific code system included in 
                                            # the value set 
}  

#---------------------- 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_RelatedArtifact> CLOSED {
    rdf:first @<RelatedArtifact>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_RelatedArtifact> 
}
<OneOrMore_ValueSet.compose.include.concept.designation> CLOSED {
    rdf:first @<ValueSet.compose.include.concept.designation>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ValueSet.compose.include.concept.designation> 
}
<OneOrMore_ValueSet.expansion.contains.property> CLOSED {
    rdf:first @<ValueSet.expansion.contains.property>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ValueSet.expansion.contains.property> 
}
<OneOrMore_ValueSet.expansion.contains> CLOSED {
    rdf:first @<ValueSet.expansion.contains>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ValueSet.expansion.contains> 
}
<OneOrMore_ValueSet.expansion.parameter> CLOSED {
    rdf:first @<ValueSet.expansion.parameter>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ValueSet.expansion.parameter> 
}
<OneOrMore_ValueSet.expansion.property> CLOSED {
    rdf:first @<ValueSet.expansion.property>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ValueSet.expansion.property> 
}
<OneOrMore_Coding> CLOSED {
    rdf:first @<Coding>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Coding> 
}
<OneOrMore_ValueSet.expansion.contains.property.subProperty> CLOSED {
    rdf:first @<ValueSet.expansion.contains.property.subProperty>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ValueSet.expansion.contains.property.subProperty> 
}
<OneOrMore_ValueSet.compose.include> CLOSED {
    rdf:first @<ValueSet.compose.include>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ValueSet.compose.include> 
}
<OneOrMore_String> CLOSED {
    rdf:first @<String>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_String> 
}
<OneOrMore_ValueSet.compose.include.concept> CLOSED {
    rdf:first @<ValueSet.compose.include.concept>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ValueSet.compose.include.concept> 
}
<OneOrMore_ValueSet.compose.include.filter> CLOSED {
    rdf:first @<ValueSet.compose.include.filter>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_ValueSet.compose.include.filter> 
}
<OneOrMore_Canonical> CLOSED {
    rdf:first @<Canonical>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Canonical> 
}

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

# This value set includes all possible codes from BCP-47 (see http://tools.ietf.org/html/bcp47)
fhirvs:all-languages xsd:string #EXTERNAL

# The kind of operation to perform as a part of a property based filter.
fhirvs:filter-operator ["=" "is-a" "descendent-of" "is-not-a" "regex" "in" "not-in" "generalizes" "child-of" "descendent-leaf" "exists"]

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


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.