2. constant

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

Definition

In a config modifier schema, use this keyword to specify that a certain value should always be returned in the processed payload. The value can be a primitive value or an object.

A constant keyword ends the processing of a schema. Any other keywords at the same nesting level or below it are skipped.

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 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
},
26
...
27
}
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 doesn’t 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
},