ValueSet Expansion
Overview
$expand operation expand given ValueSet in to set of concepts. For more information, see the official documentation FHIR Terminology ValueSet Expansion
Api
GET/POST URL: [base]/ValueSet/$expand
GET/POST URL: [base]/ValueSet/[id]/$expand
Example for expand default AdministrativeGender ValueSet. List of default ValueSets.
GET [base]/ValueSet/administrative-gender/$expand
Parameters
url
A canonical url for a value set.
GET [base]/ValueSet/$expand?url=http://hl7.org/fhir/ValueSet/administrative-gender
Or
POST [base]/ValueSet/$expand
content-type: text/yaml
resourceType: Parameters
parameter:
- {name: url, valueUri: 'http://hl7.org/fhir/ValueSet/administrative-gender'}
valueSet
The value set is provided directly as a part of the request.
POST [base]/ValueSet/$expand
content-type: text/yaml
resourceType: Parameters
parameter:
- name: valueSet
resource:
resourceType: ValueSet
url: http://custom/administrative-gender
compose:
include:
- valueSet: ['http://hl7.org/fhir/ValueSet/administrative-gender']
filter
A text filter that is applied to restrict the codes
GET [base]/ValueSet/administrative-gender/$expand?filter=male
Or
POST [base]/ValueSet/administrative-gender/$expand
content-type: text/yaml
resourceType: Parameters
parameter:
- {name: filter, valueString: male}
offset
Paging support - where to start if a subset is desired (default = 0).
GET [base]/ValueSet/administrative-gender/$expand?offset=2
Or
POST [base]/ValueSet/administrative-gender/$expand
content-type: text/yaml
resourceType: Parameters
parameter:
- {name: offset, valueInteger: 2}
count
Paging support - how many codes should be provided in a partial page view.
GET [base]/ValueSet/administrative-gender/$expand?count=1
Or
POST [base]/ValueSet/administrative-gender/$expand
content-type: text/yaml
resourceType: Parameters
parameter:
- {name: count, valueInteger: 1}
activeOnly
Controls whether inactive concepts are included or excluded in value set expansions.
For example, we create a testing ValueSet with one current active concept and one deprecated concept provided directly as a part of the request.
Get all concepts
POST [base]/ValueSet/$expand
content-type: text/yaml
resourceType: Parameters
parameter:
- {name: activeOnly, valueBoolean: false}
- name: valueSet
resource:
resourceType: ValueSet
url: http://custom/testing
compose:
include:
- system: http://testing
concept:
- {code: active}
- {code: inactive, deprecated: true}
Get only active concepts
Get only active concepts
POST [base]/ValueSet/$expand
content-type: text/yaml
resourceType: Parameters
parameter:
- {name: activeOnly, valueBoolean: true}
- name: valueSet
resource:
resourceType: ValueSet
url: http://custom/testing
compose:
include:
- system: http://testing
concept:
- {code: active}
- {code: inactive, deprecated: true}
Last updated
Was this helpful?