6. merge

Last updated: Sep 10, 2025
DEVELOPER
IMPLEMENTATION
HEALTH TECH VENDOR

Definition

In a config modifier schema, use merge to avoid overwriting all of the properties of an output. This keyword combines all of the existing properties and then updates properties by overwriting the first if they have the same property name.

Nesting level

This keyword executes at the following nesting level:

  1. omit
  2. constant
  3. references
  4. use
  5. get
  6. properties or if or concat or switch or pipe or merge
  7. default
  8. plugin

Example

You could duplicate the Location resource's name to the description field.

Example: Merge input from initial payload
json
1
"resource": {
2
"description": "Point of Care",
3
"mode": "kind",
4
"name": "USC-IS",
5
"partOf": {
6
"reference": "urn:uuid:8041c338-e0d8-4f60-a658-93d89e86f224"
7
},
8
"physicalType": {
9
"coding": [
10
{
11
"code": "wa",
12
"display": "Ward",
13
"system": "<http://terminology.hl7.org/CodeSystem/location-physical-type>"
14
}
15
],
16
"text": "wa"
17
}
Example: Merge selector
json
1
$.entry[?(@.resource.resourceType=="Location")].resource
Example: Config modifier with merge keyword
yaml
1
merge:
2
- {}
3
- properties:
4
description:
5
get: name
Example: Merge output
json
1
"resource": {
2
"description": "USC-IS",
3
"mode": "kind",
4
"name": "USC-IS",
5
"partOf": {
6
"reference": "urn:uuid:8041c338-e0d8-4f60-a658-93d89e86f224"
7
},
8
"physicalType": {
9
"coding": [
10
{
11
"code": "wa",
12
"display": "Ward",
13
"system": "<http://terminology.hl7.org/CodeSystem/location-physical-type>"
14
}
15
],
16
"text": "wa"
17
}

Alternative solution with @parent

To achieve the same outcome with the use keyword and @parent variable, try this selector and config modifier instead:

Example: Alternative selector
json
1
$.entry[?(@.resource.resourceType=="Location")].resource.name
Example: Alternative config modifier
yaml
1
use: '@parent'
2
get: name

Learn more about use and parent.