Build a config modifier schema

Last updated: Apr 29, 2025
DEVELOPER
IMPLEMENTATION

A config modifier is an operation that applies a set of custom instructions for processing incoming or outgoing data. Learn about operations.

Creating a config modifier may sound intimidating. This reference guide breaks down the Redox-specific syntax to build a config modifier schema. Its intended to teach you how to use the coding language. You can also review common use cases to navigate through examples by use case rather than syntax.

You build a config modifier schema with keywords, which specify what action to take on the payload at a given point in time. If keywords exist at the same nesting level in a schema, they execute according to this listed execution order, not the order they appear in the schema itself:

  1. omit
  2. constant
  3. use
  4. get
  5. properties or if or concat
  6. default
  7. plugin

For example, if you add get above use in the schema, use still executes first.

Keywords build on each other, so each one uses the previous keywords output as its input. For example, the output of use is the input of get.

Review the requirements and notes about each keyword below.

1. omit

Denotes an intentionally omitted output from the processed payload. Though it's the first keyword in order of execution, we recommend using it in the context of a conditional if keyword.

Examples for omit

For example, you could specify that a processed payload should omit an observation if its values match the terms you define.

Example: Observations input from initial payload
json
1
"Observations": [
2
{
3
"AbnormalFlag": null,
4
"Code": "93246-7",
5
...
6
"Status": "Final",
7
"Units": null,
8
"Value": "1",
9
"ValueType": "Coded Entry"
10
},
11
{
12
"AbnormalFlag": null,
13
"Code": "93247-5",
14
...
15
"Status": "Final",
16
"Units": null,
17
"Value": "1",
18
"ValueType": "Coded Entry"
19
},
20
{
21
"AbnormalFlag": null,
22
"Code": "NF1570400181",
23
...
24
"Status": "Final",
25
"Units": null,
26
"Value": "High Risk",
27
"ValueType": "String"
28
},
29
{
30
"AbnormalFlag": null,
31
"Code": "93267-3",
32
...
33
"Status": "Final",
34
"Units": null,
35
"Value": "1",
36
"ValueType": "Coded Entry"
37
},
38
{
39
"AbnormalFlag": null,
40
"Code": "93269-9",
41
...
42
"Status": "Final",
43
"Units": null,
44
"Value": "0",
45
"ValueType": "Coded Entry"
46
},
47
{
48
"AbnormalFlag": null,
49
"Code": "NF1570400504",
50
...
51
"Status": "Final",
52
"Units": null,
53
"Value": "Putting my notes here",
54
"ValueType": "String"
55
}
56
],
Example: Observations selector
json
1
$.Observations
Example: Config modifier with omit keyword
yaml
1
items:
2
switch:
3
select:
4
get: Code
5
cases:
6
- terms:
7
- constant: NF1570400504
8
- constant: NF1570400181
9
- constant: 93374-7
10
then:
11
omit: true
12
else:
13
comment: pass observation through

If the observation values match the values defined in your config modifier schema, the then action executes, meaning that the observation is omitted from the processed payload. If the values dont match, the else action executes, meaning the payload passes through with the observation.

Example: Observations output
json
1
"Observations": [
2
{
3
"AbnormalFlag": null,
4
"Code": "93246-7",
5
...
6
"Status": "Final",
7
"Units": null,
8
"Value": "1",
9
"ValueType": "Coded Entry"
10
},
11
{
12
"AbnormalFlag": null,
13
"Code": "93247-5",
14
...
15
"Status": "Final",
16
"Units": null,
17
"Value": "1",
18
"ValueType": "Coded Entry"
19
},
20
{
21
"AbnormalFlag": null,
22
"Code": "93267-3",
23
...
24
"Status": "Final",
25
"Units": null,
26
"Value": "1",
27
"ValueType": "Coded Entry"
28
},
29
{
30
"AbnormalFlag": null,
31
"Code": "93269-9",
32
...
33
"Status": "Final",
34
"Units": null,
35
"Value": "0",
36
"ValueType": "Coded Entry"
37
}
38
],

2. constant

Specifies a value to always return. This value can be a primitive value or an object.

A constant in the config modifier schema means that all work stops at that point, which negates any other keywords at the same nesting level or below it.

Examples for constant

For example, you could define which value to return at a given selector based on certain conditions.

Example: Constant input from initial payload
json
1
{
2
"MSH": {
3
"1": "|",
4
"10": 68625012079,
5
"12": {
6
"1": "2.3"
7
},
8
"2": "^~\\&",
9
"3": {
10
"1": "GENEDX"
11
},
12
"4": {
13
"1": "GDXIP"
14
},
15
"6": {
16
"1": "ZY292"
17
},
18
"7": {
19
"1": "20250428211659"
20
},
21
"9": {
22
"1": "ORU",
23
"2": "R01"
24
}
25
},
Example: Constant selector
json
1
$.MSH.4.1
Example: Config modifier with constant keyword
yaml
1
if:
2
operator: equals
3
terms:
4
- use: initialPayload
5
get: MSH.6.1
6
- constant: ZA310
7
then:
8
constant: GDXIP
9
else:
10
constant: GDXAMB

During processing, the request checks if MSH.6.1 equals ZA310 in the initial payload. If so, the then action executes, meaning that MSH.4.1 is set to GDXIP. If MSH.6.1 doesnt equal ZA310 , the else action executes, meaning that MSH.4.1 is set to GDXAMB.

Example: Constant output
json
1
{
2
"MSH": {
3
"1": "|",
4
"10": 68625012079,
5
"12": {
6
"1": "2.3"
7
},
8
"2": "^~\\&",
9
"3": {
10
"1": "GENEDX"
11
},
12
"4": {
13
"1": "GDXAMB" <-- this value
14
},
15
"6": {
16
"1": "ZY292"
17
},
18
"7": {
19
"1": "20250428211659"
20
},
21
"9": {
22
"1": "ORU",
23
"2": "R01"
24
}
25
},

3. use

Indicates which payload to act upon or grants access to an input payload beyond the selectors initial scope. This is helpful if you want to access values outside the scope provided by the selector. For example, if you want to modify something at the selector path based on the presence or value of another path, youll need to include use.

Available values

Value
Notes
initialPayload
The first payload Redox receives either from the source or as a response from the destination. This is the payload before a Redox base config is applied.
processedPayload
The output payload after applying a Redox base config operation. This payload is either in Redox FHIR® or data model formats, or in an external format, depending on where in log processing the base config is applied. This payload will be updated with either the Delete or Write config modifier flavor.

Examples for use

For example, you could indicate that you always want to use the value at a given selector from the initial payload.

Example: Use input from initial payload
json
1
{
2
"favorites": {
3
"dessert": "Cheesecake"
4
"appetizer": "Buffalo wings"
5
}
6
}
Example: Config modifier with use keyword
yaml
1
use: initialPayload
2
get: favorites.dessert
Example: Use output
json
1
"Cheesecake"

4. get

Retrieves a value at a given path. To retrieve a nested property value, use dot.notation; a prefix . isnt required. Additionally, we support an array[index] notation (e.g., get: someArray[0].someProperty).

This value can either be simply returned or used as a starting point for other keywords at the same level or nested below.

Examples for get

For example, you could indicate which value in an array to return.

Example: Get input from initial payload
json
1
{
2
"favorites": {
3
"dessert": "Cheesecake"
4
"appetizer": "Buffalo wings"
5
}
6
}
Example: Config modifier with get keyword
yaml
1
use: initialPayload
2
get: favorites.dessert
Example: Get output
json
1
"Cheesecake"

5. properties

Defines individual properties to construct an object in the output payload.

Examples for properties

For example, you could define which fields to use to build an object.

Example: Properties selector
json
1
"$.guests"
Example: Config modifier with properties keyword
yaml
1
properties:
2
host:
3
constant: Eva
4
guestOfHonor:
5
constant: Phil
Example: Properties output
json
1
{
2
"guests": {
3
"host": "Eva"
4
"guestOfHonor": "Phil"
5
}
6
}

5. if

Defines a conditional state to run a given action or not.

A conditional allows you to determine how to construct an output value by conditionally executing different keywords, based on the evaluation of a set of values.

You can use one of these sub-keywords to construct a conditional statement:

  • operator
  • terms
  • then
  • else

operator

Determines what action to take based on one of the following operators. The config modifier defines what should happen if a value exists and meets the criteria of any of these operators.

terms

Defines a sequential array of keywords to execute on. All terms are evaluated in sequence, then the related operator performs the appropriate action. You can review the requirements for terms based on the operator used.

then / else

These keywords are used in conjunction with each other to define which action should happen when:

  • Execute the then action when the operator resolves to a true state.
  • Execute the else action when the operator resolves to a false state.

5. concat

Creates an array by linking defined elements together. Each element under the concat keyword can be composed of any other valid config modifier keywords. Essentially, this creates an array list for a property in the output or a list to be checked during processing.

Examples for concat

For example, you could check for items in an array by joining them in one list rather than checking each item individually.

Example: Observations input from initial payload
json
1
"Observations": [
2
{
3
"AbnormalFlag": null,
4
"Code": "93246-7",
5
...
6
"Status": "Final",
7
"Units": null,
8
"Value": "1",
9
"ValueType": "Coded Entry"
10
},
11
{
12
"AbnormalFlag": null,
13
"Code": "93247-5",
14
...
15
"Status": "Final",
16
"Units": null,
17
"Value": "1",
18
"ValueType": "Coded Entry"
19
},
20
{
21
"AbnormalFlag": null,
22
"Code": "NF1570400181",
23
...
24
"Status": "Final",
25
"Units": null,
26
"Value": "High Risk",
27
"ValueType": "String"
28
},
29
{
30
"AbnormalFlag": null,
31
"Code": "93267-3",
32
...
33
"Status": "Final",
34
"Units": null,
35
"Value": "1",
36
"ValueType": "Coded Entry"
37
},
38
{
39
"AbnormalFlag": null,
40
"Code": "93269-9",
41
...
42
"Status": "Final",
43
"Units": null,
44
"Value": "0",
45
"ValueType": "Coded Entry"
46
},
47
{
48
"AbnormalFlag": null,
49
"Code": "NF1570400504",
50
...
51
"Status": "Final",
52
"Units": null,
53
"Value": "Putting my notes here",
54
"ValueType": "String"
55
}
56
],
Example: Observations selector
json
1
$.Observations
Example: Config modifier with concat and include keywords
yaml
1
items:
2
if:
3
operator: includes
4
terms:
5
- concat:
6
- constant: NF1570400504
7
- constant: NF1570400181
8
- constant: 93374-7
9
- get: Code
10
then:
11
omit: true
12
else:
13
comment: do pass observation through
Example: Observations output
json
1
"Observations": [
2
{
3
"AbnormalFlag": null,
4
"Code": "93246-7",
5
...
6
"Status": "Final",
7
"Units": null,
8
"Value": "1",
9
"ValueType": "Coded Entry"
10
},
11
{
12
"AbnormalFlag": null,
13
"Code": "93247-5",
14
...
15
"Status": "Final",
16
"Units": null,
17
"Value": "1",
18
"ValueType": "Coded Entry"
19
},
20
{
21
"AbnormalFlag": null,
22
"Code": "93267-3",
23
...
24
"Status": "Final",
25
"Units": null,
26
"Value": "1",
27
"ValueType": "Coded Entry"
28
},
29
{
30
"AbnormalFlag": null,
31
"Code": "93269-9",
32
...
33
"Status": "Final",
34
"Units": null,
35
"Value": "0",
36
"ValueType": "Coded Entry"
37
}
38
],

6. default

Specifies a value to return if any of the previous keywords result in a non-existent value. This value can be a primitive value or an object.

Examples for default

For example, you could set a default value for a specific value if it doesnt exist in the input.

Example: Default input
json
1
{
2
"favoriteAppetizer": "buffalo wings"
3
"favoriteDessert": "cheesecake"
4
"favoriteBeverage": "soda"
5
}
Example: Config modifier with default keyword
yaml
1
use: initialPayload
2
get: favorites.beverage
3
default: soda
Example: Default output
json
1
"soda"

7. plugin

Defines a bundle of functionality to produce a value. You can use one of these sub-keywords to construct a plugin:

Sub-keyword
Notes
name
Defines the name of the plugin to apply.
action
Specifies the action to perform with this plugin.
parameters
Lists individual operations for a given plugin.action.

Common plugins

Accepted formats

Several of our plugins require you to specify a format. These are valid formats for various plugins.