ValueSet $expand

get/ValueSet/$expand
Page View

This resource contains a set of codes from one or more code systems that are intended for use in a particular context.

Value sets define which codes are allowed for a specific field. For example, a value set might list the allowed codes for a document type, an encounter type, or a lab test category. Codes may come from standard code systems (e.g., SNOMED CT or LOINC) or from organization-specific code systems.

Each health system may support a different set of codes for the same field. Instead of asking each health system for its code lists, you can expand a value set to find out which codes your connection’s system supports.

Supported fields and schema examples

We support any valid FHIR® field. However, we only display fields we’ve defined in our schema, which are usually based on what’s included in the U.S. Core profile. We recommend relying on U.S. Core requirements.

Our schema examples show the shape and possibility of each FHIR® resource; they aren’t code for real-time API calls. We don’t currently recommend copying and pasting these schema examples for your API calls. Consider reviewing FHIR® API actions for realistic examples for particular use cases.

$expand

Retrieve the codes that your connection’s system supports for a specific element of a FHIR® resource.

For example, you might expand the value set for DocumentReference.type to find out which document types a health system sends and accepts before you exchange documents with them.

The response lists each supported code with its code system and display name.

Request parameters

cURL request example

bash
1
curl 'https://api.redoxengine.com/fhir/R4/{destinationSlug}/{environmentFlag}/ValueSet/$expand?context={context}&contextDirection={contextDirection}&filter={filter}' \
2
--request GET \
3
--header 'Authorization: Bearer $API_TOKEN'

Query Parameters

  • context
    required, string

    The resource element to get the codes for, in the format <ResourceType>.<element path>, such as DocumentReference.type or Encounter.type.

  • contextDirection
    required, string

    Which codes to get: outgoing for the codes the system sends in responses and accepts in search parameters, or incoming for the codes it accepts in a create or update.

  • filter
    string

    Narrows the codes that are returned. In FHIR, this is a text filter on the codes. Some systems, such as Epic, use it to select a category instead, such as category:clinical-note.

Response fields and example

Clinical note document types
json
1
{}

    A ValueSet expansion that lists the codes the connection's system supports.

  • resourceType
    required, string

    Identifies the type of the resource

    Value: ValueSet
  • status
    required, string

    The status of this value set. Enables tracking the life-cycle of the content. The status of the value set applies to the value set definition (ValueSet.compose) and the associated ValueSet metadata. Expansions do not have a state.

    Possible Values: draft, active, retired, unknown
  • id
    string

    The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.

  • expansion
    object

    A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.

    • timestamp
      required, string

      The time at which the expansion was produced by the expanding system.

    • total
      number

      The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.

    • parameter
      Array of object

      A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.

      • name
        required, string

        Name of the input parameter to the $expand operation; may be a server-assigned name for additional default or other server-supplied parameters used to control the expansion process.

      • valueString
        string

        The value of the parameter.

        Only one of valueString, valueUri, valueCode may be present.

      • valueUri
        string

        The value of the parameter.

        Only one of valueString, valueUri, valueCode may be present.

      • valueCode
        string

        The value of the parameter.

        Only one of valueString, valueUri, valueCode may be present.

    • contains
      Array of object

      The codes that are contained in the value set expansion.

      • system
        string

        An absolute URI which is the code system in which the code for this item in the expansion is defined.

      • code
        string

        The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.

      • display
        string

        The recommended display for this item in the expansion.

FHIR® is a registered trademark of Health Level Seven International (HL7) and is used with the permission of HL7. Use of this trademark does not constitute an endorsement of products/services by HL7®.