Skip to main content

$expandValueSet

$expandValueSet(url?, sourcePackage?) -> object
Compact type signature<s-o?:o>

If url is omitted, the current context value is used.

Execution
AsyncCan run in parallel

This helper performs terminology work asynchronously. Independent calls can start together when they wait on terminology resolution. See Parallelism And Async Evaluation and Async And Concurrency.

Source: FUME

Documentation

Expands a ValueSet from the configured FHIR package context and returns the expanded ValueSet resource.

This helper requires the relevant ValueSet to be available in the configured FHIR package context. The optional sourcePackage argument only narrows package resolution when more than one configured package could provide the same ValueSet. The returned object is a ValueSet resource, typically with expansion.contains entries populated; exact expansion content depends on the configured FHIR package context and the function can throw when the ValueSet cannot be resolved or expanded.

Examples

Expand a ValueSet by canonical URL (requires matching FHIR package content)

This example uses the EncounterStatus ValueSet from FHIR R4.

Canonical URL is the FHIR-preferred identifier form for conformance resource (including terminology) references. If your environment has more than one matching package, pass sourcePackage to narrow package resolution.

Expression

$expandValueSet("http://hl7.org/fhir/ValueSet/encounter-status")

The result below is abbreviated to keep the example readable. Actual expansion content depends on the configured FHIR package context.

Result

{
"resourceType": "ValueSet",
"url": "http://hl7.org/fhir/ValueSet/encounter-status",
"expansion": {
"contains": [
{
"system": "http://hl7.org/fhir/encounter-status",
"code": "planned",
"display": "Planned"
},
{
"system": "http://hl7.org/fhir/encounter-status",
"code": "in-progress",
"display": "In Progress"
},
{
"system": "http://hl7.org/fhir/encounter-status",
"code": "finished",
"display": "Finished"
}
]
}
}