Skip to content

Operation $expand on ValueSet Feature: TERMINOLOGY_SERVICE Since 0.32

The $expand operation can be used to expand all codes of a ValueSet.

GET [base]/ValueSet/$expand
GET [base]/ValueSet/[id]/$expand

In Parameters

NameCardinalityTypeDocumentation
url0..1uriA canonical reference to a value set. VCL can be used. Otherwise the value set has to be already stored on the server.
valueSet0..1ValueSetThe value set is provided directly as part of the request.
valueSetVersion0..1stringThe business version of the value set. If not given and multiple versions exist, an arbitrary version will be chosen.
filter0..1stringA text filter to restrict the expansion to concepts matching the filter. See Filter Parameter below.
offset0..1integerPaging support - where to start if a subset is desired. Currently only 0 is supported.
count0..1integerPaging support - how many codes should be provided in a partial page view. If count = 0, the client is asking how large the expansion is.
includeDefinition0..1booleanControls whether the value set definition is included or excluded in value set expansions. Defaults to false.
activeOnly0..1booleanControls whether inactive concepts are included or excluded in value set expansions. Defaults to true.
excludeNested0..1booleanControls whether or not the value set expansion may nest codes or not (i.e. ValueSet.expansion.contains.contains).
displayLanguage0..1codeSpecifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display.
property0..*codeA request to return a particular property in the expansion.
system-version0..*canonicalSpecifies 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
tx-resource0..*codeUsed by the Java validator.

Filter Parameter

The filter parameter enables typeahead/autocomplete search over value set concepts. It performs a full-text search against concept display names and designations, returning results ranked by relevance.

Matching Behavior

The filter text is split into individual words. Each word is matched against the indexed text using two strategies:

  • Prefix matching — a word matches if any indexed term starts with it. For example, blood pres matches "Systolic blood pressure" because "blood" is a prefix of "blood" and "pres" is a prefix of "pressure".
  • Fuzzy matching — a word matches if any indexed term is within an edit distance of 2 (insertions, deletions, or substitutions). For example, diabtes matches "diabetes" despite the transposed letters.

All words in the filter must match (AND logic), but each word can match via either strategy.

Examples

FilterMatchesReason
blood presSystolic blood pressurePrefix match on both words
diabtesDiabetes mellitusFuzzy match (transposed letters)
hypertensoinEssential hypertensionFuzzy match (transposed letters)
sugarDiabetes mellitus (with designation "Sugar disease")Match on designation value

Scope

The search covers:

  • Concept display names
  • Concept designations (all languages)

Results are ranked by relevance, with closer matches scored higher.

Resolution of ValueSet and CodeSystem Resources

More on resolution of terminology resources can be found here.

The official documentation can be found here.