Requesting a ValueSet Hierarchical Expansion

If you would like to request parent-child relationships to be reflected in the response, you can add the includeHierarchy parameter in your request.

Example:

http://<HOST_NAME>:<PORT>/oracle-fhir-server/fhir/ValueSet/$expand?url=my_custom_value_set &includeHierarchy=true

This will return the following response:

{
  "resourceType": "ValueSet",
  "id": "200007",
  "meta": {
    "extension": [ {
      "url": "http://hapifhir.io/fhir/StructureDefinition/valueset-expansion-message",
      "valueString": "ValueSet was expanded using an expansion that was pre-calculated at 2023-08-16T20:14:35.055+05:30 (00:29:44 ago)"
    } ],
    "versionId": "1"
  },
  "url": "http://example.com/my_custom_value_set",
  "status": "active",
  "compose": {
    "include": [ {
      "system": "http://example.com/my_custom_codeSystem",
      "filter": [ {
        "property": "concept",
        "op": "is-a",
        "value": "P"
      } ]
    }, {
      "system": "http://example.com/my_custom_codeSystem",
      "concept": [ {
        "code": "P"
      } ]
    } ]
  },
  "expansion": {
    "identifier": "415a2a3c-02d5-463d-a810-e9d907146234",
    "timestamp": "2023-08-16T20:44:18+05:30",
    "total": 4,
    "offset": 0,
    "parameter": [ {
      "name": "offset",
      "valueInteger": 0
    }, {
      "name": "count",
      "valueInteger": 1000
    } ],
    "contains": [ {
      "system": "http://example.com/my_custom_codeSystem",
      "code": "P",
      "display": "Code P",
      "contains": [ {
        "system": "http://example.com/my_custom_codeSystem",
        "code": "PP",
        "display": "Code PP",
        "contains": [ {
          "system": "http://example.com/my_custom_codeSystem",
          "code": "PPP",
          "display": "Code PPP"
        } ]
      }, {
        "system": "http://example.com/my_custom_codeSystem",
        "code": "PQ",
        "display": "Code PQ"
      } ]
    } ]
  }
}