This
page
is
part
of
the
FHIR
Specification
(v3.0.2:
STU
3).
(v3.5.0:
R4
Ballot
#2).
The
current
version
which
supercedes
this
version
is
5.0.0
.
For
a
full
list
of
available
versions,
see
the
Directory
of
published
versions
.
Page
versions:
R5
R4B
R4
R3
R2
| Vocabulary Work Group | Maturity Level : N/A | Ballot Status : Informative | Compartments : Not linked to any defined compartments |
This
is
the
narrative
for
the
resource.
See
also
the
XML
or
,
JSON
or
Turtle
format.
OPERATION: Value Set Expansion
The official URL for this operation definition is:
http://hl7.org/fhir/OperationDefinition/ValueSet-expand
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
identifier,
url,
context
or
valueset
valueSet
must
be
provided.
An
expanded
value
set
will
be
returned,
or
an
OperationOutcome
with
an
error
message.
URL: [base]/ValueSet/$expand
URL: [base]/ValueSet/[id]/$expand
Parameters
| Use | Name | Cardinality | Type | Binding | Documentation |
| IN | url | 0..1 | uri |
A canonical url for 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 |
|
| IN | valueSet | 0..1 | ValueSet |
The value set is provided directly as part of the request. Servers may choose not to accept value sets in this fashion |
|
| IN | valueSetVersion | 0..1 | string | 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. | |
| IN | context | 0..1 | uri |
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
|
|
| IN |
|
0..1 |
|
|
|
| IN |
|
0..1 |
|
A
Text
Search
engines
such
as
Lucene
or
Solr,
long
with
their
|
|
| IN | date | 0..1 | dateTime |
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. |
|
| IN | offset | 0..1 | integer |
Paging support - where to start if a subset is desired (default = 0). Offset is number of records (not number of pages) |
|
| IN | count | 0..1 | integer |
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 |
|
| IN | includeDesignations | 0..1 | boolean |
Controls
whether
concept
designations
are
to
be
included
or
excluded
in
value
set
| |
| IN | designation | 0..* | 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
|
|
| IN | includeDefinition | 0..1 | boolean |
Controls
whether
the
value
set
definition
is
included
or
excluded
in
value
set
|
|
| IN | activeOnly | 0..1 | boolean |
Controls
whether
inactive
concepts
are
included
or
excluded
in
value
set
expansions.
|
|
| IN | excludeNested | 0..1 | boolean |
Controls
whether
or
not
the
value
set
expansion
nests
codes
or
not
(i.e.
|
|
| IN | excludeNotForUI | 0..1 | boolean |
Controls
whether
or
not
the
value
set
expansion
|
|
| IN | excludePostCoordinated | 0..1 | boolean |
Controls
whether
or
not
the
value
set
expansion
includes
post
coordinated
|
|
| IN | displayLanguage | 0..1 | code |
Specifies
the
language
to
be
used
for
description
in
the
expansions
i.e.
the
language
to
be
used
for
| |
| IN | exclude-system | 0..* | canonical |
Code
system,
or
a
particular
version
of
a
code
system
to
be
excluded
from
the
value
| |
| IN | system-version | 0..* | canonical |
Specifies
a
version
to
use
for
a
system,
if
|
|
| IN |
|
|
|
Edge
Case:
Specifies
a
version
to
use
for
a
system.
If
| |
| IN | force-system-version | 0..* | canonical |
Edge
Case:
Specifies
a
version
to
|
|
| OUT | return | 1..1 | ValueSet |
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 |
The value set expansion returned by this query should be treated as a transient result that will change over time (whether it does or not depends on how the value set is specified), so applications should repeat the operation each time the value set is used.
If
the
expansion
is
too
large
(at
the
discretion
of
the
server),
the
server
will
MAY
return
an
error
(OperationOutcome
with
code
too-costly).
Clients
can
work
through
large
flat
expansions
in
a
set
of
pages
(partial
views
of
the
full
expansion)
instead
of
just
getting
the
full
expansion
in
a
single
exchange
by
using
offset
and
count
parameters.
parameters,
or
use
the
count
parameter
to
request
a
subset
of
the
expansion
for
limited
purposes.
Servers
are
not
obliged
to
support
paging,
but
if
they
do,
SHALL
support
both
the
offset
and
count
parameters.
Hierarchical
expansions
are
not
subject
to
paging
and
servers
simply
return
the
entire
expansion.
Different servers may return different results from expanding a value set for the following reasons:
When a server cannot correctly expand a value set because it does not fully understand the code systems (e.g. it has the wrong version, or incomplete definitions) then it SHALL return an error. If the value set itself is unbounded due to the inclusion of post-coordinated value sets (e.g. SNOMED CT, UCUM), then the extension http://hl7.org/fhir/StructureDefinition/valueset-unclosed can be used to indicate that the expansion is incomplete
Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.