In a config modifier schema, use if to define a conditional state to run a given action or not.
If properties, if, concat, switch, pipe, merge, prefer, or items are present at the same nesting level, only the first keyword listed will run. We recommend not listing these keywords together at the same nesting level.
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
This keyword executes in the following order:
- omit
- constant
- references
- use
- get
- Mutually exclusive keywords at this level:
- properties
- if
- concat
- switch
- pipe
- merge
- prefer
- items
- default
- plugin
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.
We define existence of a value based on some rules. Specifically, these evaluations are defined as does not exist:
- undefined
- null
- ''
- []
- NaN
We specifically treat some Falsy (learn about Falsy) values as exists:
- false
- 0
- ' ' (empty string but padded with a space)
Specifies that all defined terms should be equal to each other.
If the terms match, the then action occurs. If the values don’t match, the else action occurs.
1"identifier": [2{3"system": "urn:redox:1a359110-47eb-40f6-924c-1e67079574a4:wshmrn",4"type": {5"text": "WSHMRN"6},7"value": "050050184"8},9...10]
1$.entry[?(@.resource.resourceType=="Patient")].resource.identifier[*].type.text
1if:2operator: equals3terms:4- {}5- constant: WSHMRN6then:7constant: MR8else:9comment: no match, pass through
Based on this example config modifier, the output would be:
1"identifier": [2{3"system": "urn:redox:1a359110-47eb-40f6-924c-1e67079574a4:wshmrn",4"type": {5"text": "MR"6},7"value": "050050184"8},9...10}11]
Specifies that all defined terms exist.
If all terms are present, the then action occurs. If all terms aren’t present, the else action occurs.
1"identifier": [2{3"system": "urn:redox:1a359110-47eb-40f6-924c-1e67079574a4:wshmrn",4"type": {5"text": "WSHMRN"6},7"value": "050050184"8},9...10]
1$.entry[?(@.resource.resourceType=="Patient")].resource.identifier[*]
1if:2operator: all3terms:4- get: type.text5then:6if:7operator: equals8terms:9- get: type.text10- constant: WSHMRN11then:12merge:13- {}14- properties:15type:16properties:17text:18constant: MR19system:20get: system21plugin:22name: text23action: replace24parameters:25newValue: mr26searchValue: wshmrn27else:28comment: do nothing29else:30comment: type.text does not exist, do nothing
Based on this example config modifier, the output would be:
1"identifier": [2{3"system": "urn:redox:1a359110-47eb-40f6-924c-1e67079574a4:mr",4"type": {5"text": "MR"6},7"value": "050050184"8},9...10],
Specifies that at least one of the defined terms exists.
If at least one of the terms is present, the then action occurs. If none are present, the else action occurs.
Let’s say you have a list of patient contacts that are missing phone number information, which you need for your workflow. You decide to remove contacts that don’t have at least one phone number listed.
1{2"Patient": {3...4"Contacts": [5{6"Address": {7"City": "Speedy",8"Country": null,9"County": null,10"State": "CA",11"StreetAddress": "5559 E. Washington St",12"ZIP": "12345"13},14"EmailAddresses": [15],16"FirstName": "Elizabieth",17"LastName": "Santa",18"MiddleName": null,19"PhoneNumber": {20"Home": "+10000000000",21"Mobile": "+10000000000",22"Office": null23},24"RelationToPatient": "Other",25"Roles": [26"PC"27]28},29{30"Address": {31"City": "Speedy",32"Country": null,33"County": null,34"State": "CA",35"StreetAddress": "5559 E. Washington St",36"ZIP": "12345"37},38"EmailAddresses": [39],40"FirstName": "Joshua",41"LastName": "Santa",42"MiddleName": null,43"PhoneNumber": {44"Home": "+15551231234",45"Mobile": "+15551231234",46"Office": null47},48"RelationToPatient": "Spouse",49"Roles": [50"SC"51]52},53{54"Address": {55"City": null,56"Country": null,57"County": null,58"State": null,59"StreetAddress": null,60"ZIP": null61},62"EmailAddresses": [63],64"FirstName": null,65"LastName": "Disabled",66"MiddleName": null,67"PhoneNumber": {68"Home": null,69"Mobile": null,70"Office": null71},72"RelationToPatient": null,73"Roles": [74"EMP"75]76}77]78}79}
To implement this, you need to rebuild the Patient.Contacts array by checking that there’s at least one phone number listed under PhoneNumber for each contact.
1$.Patient.Contacts
If at least one phone number is present, you want to keep the contact, otherwise it should be removed. This is an ideal scenario to use the operator of some that evaluates a set of terms (phone numbers in this case) where at least one of the values must evaluate to true.
1items:2if:3operator: some4terms:5- get: PhoneNumber.Home6- get: PhoneNumber.Mobile7- get: PhoneNumber.Office8then: {}9else:10omit: true
Based on this example config modifier, the output would be:
1{2"Patient": {3...4"Contacts": [5{6"Address": {7"City": "Speedy",8"Country": null,9"County": null,10"State": "CA",11"StreetAddress": "5559 E. Washington St",12"ZIP": "12345"13},14"EmailAddresses": [15],16"FirstName": "Katie",17"LastName": "Santa",18"MiddleName": null,19"PhoneNumber": {20"Home": "+10000000000",21"Mobile": "+10000000000",22"Office": null23},24"RelationToPatient": "Other",25"Roles": [26"PC"27]28},29{30"Address": {31"City": "Speedy",32"Country": null,33"County": null,34"State": "CA",35"StreetAddress": "5559 E. Washington St",36"ZIP": "12345"37},38"EmailAddresses": [39],40"FirstName": "John",41"LastName": "Santa",42"MiddleName": null,43"PhoneNumber": {44"Home": "+15551231234",45"Mobile": "+155531231234",46"Office": null47},48"RelationToPatient": "Spouse",49"Roles": [50"SC"51]52}53]54}55}
Specifies that none of the defined terms exist.
If none of the terms are present, the then action occurs. If at least one of the terms is present, the else action occurs.
1{2"Meta": {3"DataModel": "Results",4"EventDateTime": "2025-06-10T18:20:25.266744",5...6},7"Orders": [8{9...10"Results": [11{12"AbnormalFlag": null,13"Code": "PTEDEVENT",14"Codeset": "PTEDLRR",15"CompletionDateTime": null,16...17}18],19"ResultsStatus": "In Process",20"Status": "In Process",21"TransactionDateTime": null22}23],24...25}
1if:2operator: none3terms:4- {}5then:6use: initialPayload7get: Meta.EventDateTime8else: comment: do nothing
Based on this example config modifier, the output would be:
1{2"Meta": {3"DataModel": "Results",4"EventDateTime": "2025-06-10T18:20:25.266744",5...6},7"Orders": [8{9...10"Results": [11{12"AbnormalFlag": null,13"Code": "PTEDEVENT",14"Codeset": "PTEDLRR",15"CompletionDateTime": "2025-06-10T18:20:25.266744",16...17}18],19"ResultsStatus": "In Process",20"Status": "In Process",21"TransactionDateTime": null22}23],24...25}
Specifies that the first value in the defined terms contains the second value.
If the second value is included in the first, the then action occurs. If not—or if the first value isn’t an array or a single string—the else action occurs.
If a string, value matching is case-sensitive. The second value must be a single primitive value.
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]
1$.Observations
1items:2if:3operator: includes4terms:5- concat:6- constant: NF15704005047- constant: NF15704001818- constant: 93374-79- get: Code10then:11omit: true12else:13comment: pass observation through
Based on this example config modifier, the output would be:
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],
This example config modifier checks if the string value at FT1.13.1 includes a substring of a dash (-). If the string does include a dash (-), then it should split and place the first part of the string in PV1.3.1 and the second part of the string after the dash (-) in PV1.3.4.1. If it doesn’t include dash (-), then it’ll map from the initial payload’s Financial[0].Department.Code (from a Financials data model message).
1{2...,3"FINANCIAL": [4{5"FT1": {6"1": 1,7"10": "1",8"11": {9"1": {10"1": null11}12},13"13": {14"1": "SVHCROSCAR-MONTICELO",15"2": null,16"3": null17},18...19}20}21],22...,23"PV1": {24"19": {25"1": "2000708548"26},27"3": {28"1": null29},30"44": {31"1": null32}33}34}
1$.PV1.3
1references:2departmentCode:3use: processedPayload4get: FINANCIAL[0].FT1.13.15if:6operator: includes7terms:8- use: departmentCode9plugin:10name: text11action: lower-case12- constant: '-'13then:14pipe:15- use: departmentCode16plugin:17name: text18action: split19parameters:20separator: '-'21- properties:22'1':23get: '0'24'4':25properties:26'1':27get: '1'28else:29use: initialPayload30get: Transactions[0].Department.Code
Based on this example config modifier, the output would be:
1{2...3"FINANCIAL": [4{5"FT1": {6"1": 1,7"10": "1",8"11": {9"1": {10"1": null11}12},13"13": {14"1": "SVHCROSCAR-MONTICELO",15"2": null,16"3": null17},18...19}20],21"PV1": {22"19": {23"1": "2000708548"24},25"3": {26"1": "SVHCROSCAR",27"4": {28"1": "MONTICELO"29}30},31"44": {32"1": null33}34}35}
Specifies what action to take when the value in the defined terms is greater than the specified constant. If the value is greater than the constant, the then action occurs. If not, the else action occurs.
These operators can be used alone or with any of the others in the list to establish a range:
- greaterThan
- greaterThanOrEqual
- lessThan
- lessThanOrEqual
1{2...3"Orders": [4{5...6"Results": [7{8"AbnormalFlag": "Low",9...10"Value": "JVBERi0",11"ValueType": "Encapsulated Data"12},13{14"AbnormalFlag": "Low",15...16"Value": "5.4",17"ValueType": "Value"18}19],20"ResultsStatus": "Final",21"Status": "Resulted",22"TransactionDateTime": "2026-06-03T12:24:36.8253191Z"23}24],25...26}
1$.Orders[*].Results[*].AbnormalFlag
1comment: < 5 is Normal, < 15 is Mild, <= 30 is Moderate, 30+ is Severe2references:3value:4use: '@parent'5get: Value6plugin:7name: convert8action: string-to-number9prefer:10- if:11operator: lessThan12terms:13- use: value14- constant: 515then:16constant: Normal17else:18omit: true19- if:20operator: lessThan21terms:22- use: value23- constant: 1524then:25constant: Mild26else:27omit: true28- if:29operator: lessThanOrEqual30terms:31- use: value32- constant: 3033then:34constant: Moderate35else:36omit: true37- if:38operator: greaterThan39terms:40- use: value41- constant: 3042then:43constant: Severe44else:45omit: true46- comment: passThrough
Based on this example config modifier, the output would be:
1{2...3"Orders": [4{5...6"Results": [7{8"AbnormalFlag": "Low",9...10"Value": "JVBERi0xL",11"ValueType": "Encapsulated Data"12},13{14"AbnormalFlag": "Mild",15...16"Value": "5.4",17"ValueType": "Value"18}19],20"ResultsStatus": "Final",21"Status": "Resulted",22"TransactionDateTime": "2026-06-03T12:24:36.8253191Z"23}24],25...26}
Review our notes below for a deeper dive into the config modifier schema we just built.
1comment: < 5 is Normal, < 15 is Mild, <= 30 is Moderate, 30+ is Severe2references:3value:4use: '@parent'5get: Value6plugin:7name: convert8action: string-to-number
The comparison operator requires the terms be a number type, but the Value is a string type. So, we need to convert the string to a number. To avoid having to apply the convert plugin for each needed comparison, we want to save this as a reference.
Since the selector is $.Orders[*].Results[*].AbnormalFlag, the input is the value of AbnormalFlag of the result of the current order we’re looking at. This makes the parent the current result, which can be retrieved with use: @parent. Then we can grab the Value from the current result and save it to the reference of value.
1prefer:
If the Value falls into a certain range, we want to map it to AbnormalFlag accordingly. If it doesn’t, we want to compare it against the next range of values.
Intuitively, we usually default to if/ else if / else if /else type logic, but prefer is a cleaner way to handle this scenario because prefer picks the first parameter that exists and assigns it to AbnormalFlag.
1- if:2operator: lessThan3terms:4- use: value5- constant: 56then:7constant: Normal8else:9omit: true10- if:11operator: lessThan12terms:13- use: value14- constant: 1515then:16constant: Mild17else:18omit: true19- if:20operator: lessThanOrEqual21terms:22- use: value23- constant: 3024then:25constant: Moderate26else:27omit: true28- if:29operator: greaterThan30terms:31- use: value32- constant: 3033then:34constant: Severe35else:36omit: true37- comment: passThrough
The selector $.Orders[*].Results[*].AbnormalFlag targets AbnormalFlag across every result in every order. In this example, that’s two values:
- Result 1: AbnormalFlag = "Low", Value = "JVBERi0xL" (ValueType: Encapsulated Data)
- Result 2: AbnormalFlag = "Mild", Value = "5.4" (ValueType: Value)
The if/then/else blocks are evaluated per result. Each block checks the result’s Value against a range (i.e., < 5). If it doesn’t evaluate to true, it maps nothing (omit: true). Due to the nature of prefer, the multiple blocks together allow for checking the Value against a range.
The blocks are evaluated in order:
- Is 5.4 less than 4.9?
- No → Nothing maps
- Is 5.4 less than 14.9?
- Yes → maps Mild
- Remaining blocks are still evaluated.
- 5.4 doesn’t match them → Nothing maps
prefer then scans the outputs in order and takes the first non-empty result (in this case, Mild). That becomes the value of AbnormalFlag.
If the value doesn't match any condition, all blocks produce no output. prefer finds nothing.
The comment: passThrough at the end determines that the AbnormalFlag remains unchanged rather than getting cleared.
Specifies what action to take when the value in the defined terms is greater than or equal to the specified constant. If the value is greater than or equal to the constant, the then action occurs. If not, the else action occurs.
These operators can be used alone or with any of the others in the list to establish a range:
- greaterThan
- greaterThanOrEqual
- lessThan
- lessThanOrEqual
1{2...3"Orders": [4{5...6"Results": [7{8"AbnormalFlag": "Low",9...10"Value": "JVBERi0",11"ValueType": "Encapsulated Data"12},13{14"AbnormalFlag": "Low",15...16"Value": "5.4",17"ValueType": "Value"18}19],20"ResultsStatus": "Final",21"Status": "Resulted",22"TransactionDateTime": "2026-06-03T12:24:36.8253191Z"23}24],25...26}
1$.Orders[*].Results[*].AbnormalFlag
1comment: < 5 is Normal, < 15 is Mild, <= 30 is Moderate, 30+ is Severe2references:3value:4use: '@parent'5get: Value6plugin:7name: convert8action: string-to-number9prefer:10- if:11operator: lessThan12terms:13- use: value14- constant: 515then:16constant: Normal17else:18omit: true19- if:20operator: lessThan21terms:22- use: value23- constant: 1524then:25constant: Mild26else:27omit: true28- if:29operator: lessThanOrEqual30terms:31- use: value32- constant: 3033then:34constant: Moderate35else:36omit: true37- if:38operator: greaterThan39terms:40- use: value41- constant: 3042then:43constant: Severe44else:45omit: true46- comment: passThrough
Based on this example config modifier, the output would be:
1{2...3"Orders": [4{5...6"Results": [7{8"AbnormalFlag": "Low",9...10"Value": "JVBERi0xL",11"ValueType": "Encapsulated Data"12},13{14"AbnormalFlag": "Mild",15...16"Value": "5.4",17"ValueType": "Value"18}19],20"ResultsStatus": "Final",21"Status": "Resulted",22"TransactionDateTime": "2026-06-03T12:24:36.8253191Z"23}24],25...26}
Review our notes below for a deeper dive into the config modifier schema we just built.
1comment: < 5 is Normal, < 15 is Mild, <= 30 is Moderate, 30+ is Severe2references:3value:4use: '@parent'5get: Value6plugin:7name: convert8action: string-to-number
The comparison operator requires the terms be a number type, but the Value is a string type. So, we need to convert the string to a number. To avoid having to apply the convert plugin for each needed comparison, we want to save this as a reference.
Since the selector is $.Orders[*].Results[*].AbnormalFlag, the input is the value of AbnormalFlag of the result of the current order we’re looking at. This makes the parent the current result, which can be retrieved with use: @parent. Then we can grab the Value from the current result and save it to the reference of value.
1prefer:
If the Value falls into a certain range, we want to map it to AbnormalFlag accordingly. If it doesn’t, we want to compare it against the next range of values.
Intuitively, we usually default to if/ else if / else if /else type logic, but prefer is a cleaner way to handle this scenario because prefer picks the first parameter that exists and assigns it to AbnormalFlag.
1- if:2operator: lessThan3terms:4- use: value5- constant: 56then:7constant: Normal8else:9omit: true10- if:11operator: lessThan12terms:13- use: value14- constant: 1515then:16constant: Mild17else:18omit: true19- if:20operator: lessThanOrEqual21terms:22- use: value23- constant: 3024then:25constant: Moderate26else:27omit: true28- if:29operator: greaterThan30terms:31- use: value32- constant: 3033then:34constant: Severe35else:36omit: true37- comment: passThrough
The selector $.Orders[*].Results[*].AbnormalFlag targets AbnormalFlag across every result in every order. In this example, that’s two values:
- Result 1: AbnormalFlag = "Low", Value = "JVBERi0xL" (ValueType: Encapsulated Data)
- Result 2: AbnormalFlag = "Mild", Value = "5.4" (ValueType: Value)
The if/then/else blocks are evaluated per result. Each block checks the result’s Value against a range (i.e., < 5). If it doesn’t evaluate to true, it maps nothing (omit: true). Due to the nature of prefer, the multiple blocks together allow for checking the Value against a range.
The blocks are evaluated in order:
- Is 5.4 less than 4.9?
- No → Nothing maps
- Is 5.4 less than 14.9?
- Yes → maps Mild
- Remaining blocks are still evaluated.
- 5.4 doesn’t match them → Nothing maps
prefer then scans the outputs in order and takes the first non-empty result (in this case, Mild). That becomes the value of AbnormalFlag.
If the value doesn't match any condition, all blocks produce no output. prefer finds nothing.
The comment: passThrough at the end determines that the AbnormalFlag remains unchanged rather than getting cleared.
Specifies what action to take when the value in the defined terms is less than the specified constant. If the value is less than the constant, the then action occurs. If not, the else action occurs.
This is one of the comparison operators, which compares values to a defined range. These operators can be used alone or with any of the others in the list to establish the range:
These operators can be used alone or with any of the others in the list to establish a range:
- greaterThan
- greaterThanOrEqual
- lessThan
- lessThanOrEqual
1{2...3"Orders": [4{5...6"Results": [7{8"AbnormalFlag": "Low",9...10"Value": "JVBERi0",11"ValueType": "Encapsulated Data"12},13{14"AbnormalFlag": "Low",15...16"Value": "5.4",17"ValueType": "Value"18}19],20"ResultsStatus": "Final",21"Status": "Resulted",22"TransactionDateTime": "2026-06-03T12:24:36.8253191Z"23}24],25...26}
1$.Orders[*].Results[*].AbnormalFlag
1comment: < 5 is Normal, < 15 is Mild, <= 30 is Moderate, 30+ is Severe2references:3value:4use: '@parent'5get: Value6plugin:7name: convert8action: string-to-number9prefer:10- if:11operator: lessThan12terms:13- use: value14- constant: 515then:16constant: Normal17else:18omit: true19- if:20operator: lessThan21terms:22- use: value23- constant: 1524then:25constant: Mild26else:27omit: true28- if:29operator: lessThanOrEqual30terms:31- use: value32- constant: 3033then:34constant: Moderate35else:36omit: true37- if:38operator: greaterThan39terms:40- use: value41- constant: 3042then:43constant: Severe44else:45omit: true46- comment: passThrough
Based on this example config modifier, the output would be:
1{2...3"Orders": [4{5...6"Results": [7{8"AbnormalFlag": "Low",9...10"Value": "JVBERi0xL",11"ValueType": "Encapsulated Data"12},13{14"AbnormalFlag": "Mild",15...16"Value": "5.4",17"ValueType": "Value"18}19],20"ResultsStatus": "Final",21"Status": "Resulted",22"TransactionDateTime": "2026-06-03T12:24:36.8253191Z"23}24],25...26}
Review our notes below for a deeper dive into the config modifier schema we just built.
1comment: < 5 is Normal, < 15 is Mild, <= 30 is Moderate, 30+ is Severe2references:3value:4use: '@parent'5get: Value6plugin:7name: convert8action: string-to-number
The comparison operator requires the terms be a number type, but the Value is a string type. So, we need to convert the string to a number. To avoid having to apply the convert plugin for each needed comparison, we want to save this as a reference.
Since the selector is $.Orders[*].Results[*].AbnormalFlag, the input is the value of AbnormalFlag of the result of the current order we’re looking at. This makes the parent the current result, which can be retrieved with use: @parent. Then we can grab the Value from the current result and save it to the reference of value.
1prefer:
If the Value falls into a certain range, we want to map it to AbnormalFlag accordingly. If it doesn’t, we want to compare it against the next range of values.
Intuitively, we usually default to if/ else if / else if /else type logic, but prefer is a cleaner way to handle this scenario because prefer picks the first parameter that exists and assigns it to AbnormalFlag.
1- if:2operator: lessThan3terms:4- use: value5- constant: 56then:7constant: Normal8else:9omit: true10- if:11operator: lessThan12terms:13- use: value14- constant: 1515then:16constant: Mild17else:18omit: true19- if:20operator: lessThanOrEqual21terms:22- use: value23- constant: 3024then:25constant: Moderate26else:27omit: true28- if:29operator: greaterThan30terms:31- use: value32- constant: 3033then:34constant: Severe35else:36omit: true37- comment: passThrough
The selector $.Orders[*].Results[*].AbnormalFlag targets AbnormalFlag across every result in every order. In this example, that’s two values:
- Result 1: AbnormalFlag = "Low", Value = "JVBERi0xL" (ValueType: Encapsulated Data)
- Result 2: AbnormalFlag = "Mild", Value = "5.4" (ValueType: Value)
The if/then/else blocks are evaluated per result. Each block checks the result’s Value against a range (i.e., < 5). If it doesn’t evaluate to true, it maps nothing (omit: true). Due to the nature of prefer, the multiple blocks together allow for checking the Value against a range.
The blocks are evaluated in order:
- Is 5.4 less than 4.9?
- No → Nothing maps
- Is 5.4 less than 14.9?
- Yes → maps Mild
- Remaining blocks are still evaluated.
- 5.4 doesn’t match them → Nothing maps
prefer then scans the outputs in order and takes the first non-empty result (in this case, Mild). That becomes the value of AbnormalFlag.
If the value doesn't match any condition, all blocks produce no output. prefer finds nothing.
The comment: passThrough at the end determines that the AbnormalFlag remains unchanged rather than getting cleared.
Specifies what action to take when the value in the defined terms is less than or equal to the specified constant. If the value is less than or equal to the constant, the then action occurs. If not, the else action occurs.
These operators can be used alone or with any of the others in the list to establish a range:
- greaterThan
- greaterThanOrEqual
- lessThan
- lessThanOrEqual
1{2...3"Orders": [4{5...6"Results": [7{8"AbnormalFlag": "Low",9...10"Value": "JVBERi0",11"ValueType": "Encapsulated Data"12},13{14"AbnormalFlag": "Low",15...16"Value": "5.4",17"ValueType": "Value"18}19],20"ResultsStatus": "Final",21"Status": "Resulted",22"TransactionDateTime": "2026-06-03T12:24:36.8253191Z"23}24],25...26}
1$.Orders[*].Results[*].AbnormalFlag
1comment: < 5 is Normal, < 15 is Mild, <= 30 is Moderate, 30+ is Severe2references:3value:4use: '@parent'5get: Value6plugin:7name: convert8action: string-to-number9prefer:10- if:11operator: lessThan12terms:13- use: value14- constant: 515then:16constant: Normal17else:18omit: true19- if:20operator: lessThan21terms:22- use: value23- constant: 1524then:25constant: Mild26else:27omit: true28- if:29operator: lessThanOrEqual30terms:31- use: value32- constant: 3033then:34constant: Moderate35else:36omit: true37- if:38operator: greaterThan39terms:40- use: value41- constant: 3042then:43constant: Severe44else:45omit: true46- comment: passThrough
Based on this example config modifier, the output would be:
1{2...3"Orders": [4{5...6"Results": [7{8"AbnormalFlag": "Low",9...10"Value": "JVBERi0xL",11"ValueType": "Encapsulated Data"12},13{14"AbnormalFlag": "Mild",15...16"Value": "5.4",17"ValueType": "Value"18}19],20"ResultsStatus": "Final",21"Status": "Resulted",22"TransactionDateTime": "2026-06-03T12:24:36.8253191Z"23}24],25...26}
Review our notes below for a deeper dive into the config modifier schema we just built.
1comment: < 5 is Normal, < 15 is Mild, <= 30 is Moderate, 30+ is Severe2references:3value:4use: '@parent'5get: Value6plugin:7name: convert8action: string-to-number
The comparison operator requires the terms be a number type, but the Value is a string type. So, we need to convert the string to a number. To avoid having to apply the convert plugin for each needed comparison, we want to save this as a reference.
Since the selector is $.Orders[*].Results[*].AbnormalFlag, the input is the value of AbnormalFlag of the result of the current order we’re looking at. This makes the parent the current result, which can be retrieved with use: @parent. Then we can grab the Value from the current result and save it to the reference of value.
1prefer:
If the Value falls into a certain range, we want to map it to AbnormalFlag accordingly. If it doesn’t, we want to compare it against the next range of values.
Intuitively, we usually default to if/ else if / else if /else type logic, but prefer is a cleaner way to handle this scenario because prefer picks the first parameter that exists and assigns it to AbnormalFlag.
1- if:2operator: lessThan3terms:4- use: value5- constant: 56then:7constant: Normal8else:9omit: true10- if:11operator: lessThan12terms:13- use: value14- constant: 1515then:16constant: Mild17else:18omit: true19- if:20operator: lessThanOrEqual21terms:22- use: value23- constant: 3024then:25constant: Moderate26else:27omit: true28- if:29operator: greaterThan30terms:31- use: value32- constant: 3033then:34constant: Severe35else:36omit: true37- comment: passThrough
The selector $.Orders[*].Results[*].AbnormalFlag targets AbnormalFlag across every result in every order. In this example, that’s two values:
- Result 1: AbnormalFlag = "Low", Value = "JVBERi0xL" (ValueType: Encapsulated Data)
- Result 2: AbnormalFlag = "Mild", Value = "5.4" (ValueType: Value)
The if/then/else blocks are evaluated per result. Each block checks the result’s Value against a range (i.e., < 5). If it doesn’t evaluate to true, it maps nothing (omit: true). Due to the nature of prefer, the multiple blocks together allow for checking the Value against a range.
The blocks are evaluated in order:
- Is 5.4 less than 4.9?
- No → Nothing maps
- Is 5.4 less than 14.9?
- Yes → maps Mild
- Remaining blocks are still evaluated.
- 5.4 doesn’t match them → Nothing maps
prefer then scans the outputs in order and takes the first non-empty result (in this case, Mild). That becomes the value of AbnormalFlag.
If the value doesn't match any condition, all blocks produce no output. prefer finds nothing.
The comment: passThrough at the end determines that the AbnormalFlag remains unchanged rather than getting cleared.
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.
Within the context of a terms keyword statement, you can use {} to retrieve a value at the already defined selector instead of repeating the same path. Learn about referring to a selector.
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.
For example, you could define which fields to use to build an object.
1{2"Orders": [3{4"ApplicationOrderID": "844",5"ClinicalInfo": [],6"CollectionDateTime": "2025-05-29T14:59:00.000Z",7"Comments": null,8"Diagnoses": [9{10"Code": "Z13.71",11"Codeset": "ICD-10",12"DocumentedDateTime": null,13"Name": "Encounter for nonprocreative screening for genetic disease carrier status",14"Type": "Unknown"15}16],17...18"Procedure": {19"Code": "523",20"Codeset": "GDXEAP",21"Description": "GDX NEURO-NDD"22},23...24"Status": "Update",25"TransactionDateTime": "2025-05-29T14:59:25.000Z"26}27],28}
1$.Orders[*].Procedure.Code
1if:2operator: equals3terms:4- {}5- constant: '523'6then:7constant: '691'8else:9comment: pass original value
During processing, the request checks if the procedure code equals 523 in the initial payload. If so, the then action executes, meaning that the procedure code is set to 691. If the procedure code doesn’t equal 523, the else action executes, meaning that the original procedure code is passed.
1"Orders": [2{3"ApplicationOrderID": "844",4"ClinicalInfo": [],5"CollectionDateTime": "2025-05-29T14:59:00.000Z",6"Comments": null,7"Diagnoses": [8{9"Code": "Z13.71",10"Codeset": "ICD-10",11"DocumentedDateTime": null,12"Name": "Encounter for nonprocreative screening for genetic disease carrier status",13"Type": "Unknown"14}15],16...17"Procedure": {18"Code": "691",19"Codeset": "GDXEAP",20"Description": "GDX NEURO-NDD"21},22...23"Status": "Update",24"TransactionDateTime": "2025-05-29T14:59:25.000Z"25}26],
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®.