Skip to main content

ValueSet

ResourceFoundation · TerminologyNormativeMaturity 5

A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between `CodeSystem` definitions and their use in coded elements.

Tested supportFull test results →
Backends
PostgreSQLElasticsearch
Interactions
CreateReadUpdatePatchDelete
Search
16 of 18 parameters tested

Structure​

ElementCard.TypeDescription
urlΣ
0..1uriCanonical identifier for this value set, represented as a URI (globally unique)
identifierΣ
0..*IdentifierAdditional identifier for the value set (business identifier)
versionΣ
0..1stringBusiness version of the value set
nameΣ
0..1stringName for this value set (computer friendly)
titleΣ
0..1stringName for this value set (human friendly)
statusRequired?!Σ
1..1codedraft | active | retired | unknownBinding (required): publication-status
experimentalΣ
0..1booleanFor testing purposes, not real usage
dateΣ
0..1dateTimeDate last changed
publisherΣ
0..1stringName of the publisher (organization or individual)
contactΣ
0..*ContactDetailContact details for the publisher
description
0..1markdownNatural language description of the value set
useContextΣ
0..*UsageContextThe context that the content is intended to support
jurisdictionΣ
0..*CodeableConceptIntended jurisdiction for value set (if applicable)Binding (extensible): jurisdiction
immutableΣ
0..1booleanIndicates whether or not any change to the content logical definition may occur
purpose
0..1markdownWhy this value set is defined
copyright
0..1markdownUse and/or publishing restrictions
compose
0..1BackboneElementContent logical definition of the value set (CLD)
lockedDateΣ
0..1dateFixed date for references with no specified version (transitive)
inactiveΣ
0..1booleanWhether inactive codes are in the value set
includeRequiredΣ
1..*BackboneElementInclude one or more codes from a code system or other value set(s)
systemΣ
0..1uriThe system the codes come from
versionΣ
0..1stringSpecific version of the code system referred to
concept
0..*BackboneElementA concept defined in the system
codeRequired
1..1codeCode or expression from system
display
0..1stringText to display for this code for this value set in this valueset
designation
0..*BackboneElementAdditional representations for this concept
language
0..1codeHuman language of the designationBinding (preferred): languages
use
0..1CodingTypes of uses of designationsBinding (extensible): designation-use
valueRequired
1..1stringThe text value for this designation
filterΣ
0..*BackboneElementSelect codes/concepts by their properties (including relationships)
propertyRequiredΣ
1..1codeA property/filter defined by the code system
opRequiredΣ
1..1code= | is-a | descendent-of | is-not-a | regex | in | not-in | generalizes | existsBinding (required): filter-operator
valueRequiredΣ
1..1stringCode from the system, or regex criteria, or boolean value for exists
valueSetΣ
0..*canonical(ValueSet)Select the contents included in this value set
exclude
0..*Same as ValueSet.compose.includeExplicitly exclude codes from a code system or other value sets
expansion
0..1BackboneElementUsed when the value set is "expanded"
identifier
0..1uriIdentifies the value set expansion (business identifier)
timestampRequired
1..1dateTimeTime ValueSet expansion happened
total
0..1integerTotal number of codes in the expansion
offset
0..1integerOffset at which this resource starts
parameter
0..*BackboneElementParameter that controlled the expansion process
nameRequired
1..1stringName as assigned by the client or server
value[x]
0..1string | boolean | integer | decimal | uri | code | dateTimeValue of the named parameter
contains
0..*BackboneElementCodes in the value set
system
0..1uriSystem value for the code
abstract
0..1booleanIf user cannot select this entry
inactive
0..1booleanIf concept is inactive in the code system
version
0..1stringVersion in which this code/display is defined
code
0..1codeCode - if blank, this is not a selectable code
display
0..1stringUser display for the concept
designation
0..*Same as ValueSet.compose.include.concept.designationAdditional representations for this item
contains
0..*Same as ValueSet.expansion.containsCodes contained under this entry

Σ in _summary results · ?! modifier element · 1.. required · inherited elements in grey

Search parameters​

Query with GET [base]/ValueSet?[parameter]=[value]. Type decides which modifiers and prefixes apply, see search features.

ParameterTypeDescriptionPGES
codetoken

This special parameter searches for codes in the value set. See additional notes on the ValueSet resource

ValueSet.expansion.contains.code | ValueSet.compose.include.concept.code
contexttoken

A use context assigned to the value set

(ValueSet.useContext.value.ofType(CodeableConcept))
context-quantityquantity

A quantity- or range-valued use context assigned to the value set

(ValueSet.useContext.value.ofType(Quantity)) | (ValueSet.useContext.value.ofType(Range))
context-typetoken

A type of use context assigned to the value set

ValueSet.useContext.code
context-type-quantitycomposite

A use context type and quantity- or range-based value assigned to the value set

ValueSet.useContext
context-type-valuecomposite

A use context type and value assigned to the value set

ValueSet.useContext
datedate

The value set publication date

ValueSet.date
descriptionstring

The description of the value set

ValueSet.description
expansionuri

Identifies the value set expansion (business identifier)

ValueSet.expansion.identifier
identifiertoken

External identifier for the value set

ValueSet.identifier
jurisdictiontoken

Intended jurisdiction for the value set

ValueSet.jurisdiction
namestring

Computationally friendly name of the value set

ValueSet.name
publisherstring

Name of the publisher of the value set

ValueSet.publisher
referenceuri

A code system included or excluded in the value set or an imported value set

ValueSet.compose.include.system
statustoken

The current status of the value set

ValueSet.status
titlestring

The human-friendly name of the value set

ValueSet.title
urluri

The uri that identifies the value set

ValueSet.url
versiontoken

The business version of the value set

ValueSet.version

PG: PostgreSQL, ES: Elasticsearch. passes its TestScript checks, fails, not tested yet.

Common parameters on every resource (8)
_haste-health-authorreference

The author of the resource

_idtoken

Logical id of this artifact

_lastUpdateddate

When the resource version last changed

_profileuri

Profiles this resource claims to conform to

_securitytoken

Security Labels applied to this resource

_sourceuri

Identifies where the resource comes from

_tagtoken

Tags applied to this resource

_typetoken

Derived from the R4B Definition

Operations​

Invoke with POST [base]/ValueSet/$[name] on the type, or POST [base]/ValueSet/[id]/$[name] on one resource, sending a Parameters resource as the body. See invoke-type and invoke-instance.

$expand

TypeInstance

Value Set Expansion

The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation.

If the operation is not called at the instance level, one of the in parameters url, context or valueSet must be provided. An expanded value set will be returned, or an OperationOutcome with an error message.

POST [base]/ValueSet/$expandPOST [base]/ValueSet/[id]/$expand
Parameters: 21 in, 1 out
NameCard.TypeDescription
In
url0..1uri

A canonical reference to a value set. The server must know the value set (e.g. it is defined explicitly in the server's value sets, or it is defined implicitly by some code system known to the server

valueSet0..1ValueSet

The value set is provided directly as part of the request. Servers may choose not to accept value sets in this fashion

valueSetVersion0..1string

The identifier that is used to identify a specific version of the value set to be used when generating the expansion. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available.

context0..1uri

The context of the value set, so that the server can resolve this to a value set to expand. The recommended format for this URI is [Structure Definition URL]#[name or path into structure definition] e.g. <http://hl7.org/fhir/StructureDefinition/observation-hspc-height-hspcheight#Observation.interpretation>. Other forms may be used but are not defined. This form is only usable if the terminology server also has access to the conformance registry that the server is using, but can be used to delegate the mapping from an application context to a binding at run-time

contextDirection0..1code

If a context is provided, a context direction may also be provided. Valid values are:

  • 'incoming': the codes a client can use for PUT/POST operations, and
  • 'outgoing', the codes a client might receive from the server.

The purpose is to inform the server whether to use the value set associated with the context for reading or writing purposes (note: for most elements, this is the same value set, but there are a few elements where the reading and writing value sets are different)

filter0..1string

A text filter that is applied to restrict the codes that are returned (this is useful in a UI context). The interpretation of this is delegated to the server in order to allow to determine the most optimal search approach for the context. The server can document the way this parameter works in `TerminologyCapabilities`..expansion.textFilter. Typical usage of this parameter includes functionality like:

  • using left matching e.g. "acut ast"
  • allowing for wild cards such as %, &, ?
  • searching on definition as well as display(s)
  • allowing for search conditions (and / or / exclusions)

Text Search engines such as Lucene or Solr, long with their considerable functionality, might also be used. The optional text search might also be code system specific, and servers might have different implementations for different code systems

date0..1dateTime

The date for which the expansion should be generated. if a date is provided, it means that the server should use the value set / code system definitions as they were on the given date, or return an error if this is not possible. Normally, the date is the current conditions (which is the default value) but under some circumstances, systems need to generate an expansion as it would have been in the past. A typical example of this would be where code selection is constrained to the set of codes that were available when the patient was treated, not when the record is being edited. Note that which date is appropriate is a matter for implementation policy.

offset0..1integer

Paging support - where to start if a subset is desired (default = 0). Offset is number of records (not number of pages)

count0..1integer

Paging support - how many codes should be provided in a partial page view. Paging only applies to flat expansions - servers ignore paging if the expansion is not flat. If count = 0, the client is asking how large the expansion is. Servers SHOULD honor this request for hierarchical expansions as well, and simply return the overall count

includeDesignations0..1boolean

Controls whether concept designations are to be included or excluded in value set expansions

designation0..*string

A token that specifies a system+code that is either a use or a language. Designations that match by language or use are included in the expansion. If no designation is specified, it is at the server discretion which designations to return

includeDefinition0..1boolean

Controls whether the value set definition is included or excluded in value set expansions

activeOnly0..1boolean

Controls whether inactive concepts are included or excluded in value set expansions. Note that if the value set explicitly specifies that inactive codes are included, this parameter can still remove them from a specific expansion, but this parameter cannot include them if the value set excludes them

excludeNested0..1boolean

Controls whether or not the value set expansion nests codes or not (i.e. ValueSet.expansion.contains.contains)

excludeNotForUI0..1boolean

Controls whether or not the value set expansion is assembled for a user interface use or not. Value sets intended for User Interface might include 'abstract' codes or have nested contains with items with no code or abstract = true, with the sole purpose of helping a user navigate through the list efficiently, where as a value set not generated for UI use might be flat, and only contain the selectable codes in the value set. The exact implications of 'for UI' depend on the code system, and what properties it exposes for a terminology server to use. In the FHIR Specification itself, the value set expansions are generated with excludeNotForUI = false, and the expansions used when generated schema / code etc, or performing validation, are all excludeNotForUI = true.

excludePostCoordinated0..1boolean

Controls whether or not the value set expansion includes post coordinated codes

displayLanguage0..1code

Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display

exclude-system0..*canonical

Code system, or a particular version of a code system to be excluded from the value set expansion. The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56

system-version0..*canonical

Specifies a version to use for a system, if the value set does not specify which one to use. The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56

check-system-version0..*canonical

Edge Case: Specifies a version to use for a system. If a value set specifies a different version, an error is returned instead of the expansion. The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56

force-system-version0..*canonical

Edge Case: Specifies a version to use for a system. This parameter overrides any specified version in the value set (and any it depends on). The format is the same as a canonical URL: [system]|[version] - e.g. http://loinc.org|2.56. Note that this has obvious safety issues, in that it may result in a value set expansion giving a different list of codes that is both wrong and unsafe, and implementers should only use this capability reluctantly. It primarily exists to deal with situations where specifications have fallen into decay as time passes. If the value is override, the version used SHALL explicitly be represented in the expansion parameters

Out
return1..1ValueSet

The result of the expansion. Servers generating expansions SHOULD ensure that all the parameters that affect the contents of the expansion are recorded in the ValueSet.expansion.parameter list

$validate-code

TypeInstance

Value Set based Validation

Validate that a coded value is in the set of codes allowed by a value set.

If the operation is not called at the instance level, one of the in parameters url, context or valueSet must be provided. One (and only one) of the in parameters code, coding, or codeableConcept must be provided. The operation returns a result (true / false), an error message, and the recommended display for the code

POST [base]/ValueSet/$validate-codePOST [base]/ValueSet/[id]/$validate-code
Parameters: 13 in, 3 out
NameCard.TypeDescription
In
url0..1uri

Value set Canonical URL. The server must know the value set (e.g. it is defined explicitly in the server's value sets, or it is defined implicitly by some code system known to the server

context0..1uri

The context of the value set, so that the server can resolve this to a value set to validate against. The recommended format for this URI is [Structure Definition URL]#[name or path into structure definition] e.g. <http://hl7.org/fhir/StructureDefinition/observation-hspc-height-hspcheight#Observation.interpretation>. Other forms may be used but are not defined. This form is only usable if the terminology server also has access to the conformance registry that the server is using, but can be used to delegate the mapping from an application context to a binding at run-time

valueSet0..1ValueSet

The value set is provided directly as part of the request. Servers may choose not to accept value sets in this fashion. This parameter is used when the client wants the server to expand a value set that is not stored on the server

valueSetVersion0..1string

The identifier that is used to identify a specific version of the value set to be used when validating the code. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available.

code0..1code

The code that is to be validated. If a code is provided, a system or a context must be provided (if a context is provided, then the server SHALL ensure that the code is not ambiguous without a system)

system0..1uri

The system for the code that is to be validated

systemVersion0..1string

The version of the system, if one was provided in the source data

display0..1string

The display associated with the code, if provided. If a display is provided a code must be provided. If no display is provided, the server cannot validate the display value, but may choose to return a recommended display name using the display parameter in the outcome. Whether displays are case sensitive is code system dependent

coding0..1Coding

A coding to validate

codeableConcept0..1CodeableConcept

A full codeableConcept to validate. The server returns true if one of the coding values is in the value set, and may also validate that the codings are not in conflict with each other if more than one is present

date0..1dateTime

The date for which the validation should be checked. Normally, this is the current conditions (which is the default values) but under some circumstances, systems need to validate that a correct code was used at some point in the past. A typical example of this would be where code selection is constrained to the set of codes that were available when the patient was treated, not when the record is being edited. Note that which date is appropriate is a matter for implementation policy.

abstract0..1boolean

If this parameter has a value of true, the client is stating that the validation is being performed in a context where a concept designated as 'abstract' is appropriate/allowed to be used, and the server should regard abstract codes as valid. If this parameter is false, abstract codes are not considered to be valid.

Note that. 'abstract' is a property defined by many HL7 code systems that indicates that the concept is a logical grouping concept that is not intended to be used asa 'concrete' concept to in an actual patient/care/process record. This language is borrowed from Object Orienated theory where 'asbtract' objects are never instantiated. However in the general record and terminology eco-system, there are many contexts where it is appropraite to use these codes e.g. as decision making criterion, or when editing value sets themselves. This parameter allows a client to indicate to the server that it is working in such a context.

displayLanguage0..1code

Specifies the language to be used for description when validating the display property

Out
result1..1boolean

True if the concept details supplied are valid

message0..1string

Error details, if result = false. If this is provided when result = true, the message carries hints and warnings

display0..1string

A valid display for the concept if the system wishes to display this to a user