This is a closed beta feature for a limited pilot group. We're not currently accepting additional participants, but we'll let you know when it's available to everyone.
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 you should use to build a config modifier schema.
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:
omit
constant
use
get
properties or if or concat
default
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 keyword's output as its input. For example, the output of use is the input of get.
Comment keyword
You can also use a comment keyword at any point in the schema. This is a free text field to add context for anyone reading the config modifier. The comment keyword isn't used when actually processing the config modifier.
Comments may be placed anywhere in the schema.
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 a particular field if its value doesn't equal the term you define.
Example: Omit input
json
1
{
2
"favoriteAppetizer":"Buffalo wings",
3
"favoriteDessert":"Cheesecake"
4
}
If the term value matches what you define, the output returns the then constant value. If the value doesn't match, the field is omitted altogether.
Example: Config modifier with omit keyword
yaml
1
if:
2
operator: equals
3
terms:
4
-get: favoriteAppetizer
5
-constant: veggies & dip
6
then:
7
constant: yum
8
else:
9
omit:true
Example: Omit output
json
1
{
2
"favoriteDessert":"Cheesecake"
3
}
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 the value to always return at a given selector.
Example: Constant selector
json
1
"$.greeting"
Example: Constant value
yaml
1
constant: Hello world
Example: Constant output
json
1
{
2
"greeting":"Hello world"
3
}
3. use
Indicates which payload to act upon.
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 . isn't 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.
Exclusive keywords
If both properties and if are present at the same nesting level, only the first keyword listed will run. We recommend not listing properties and if together in the same nesting level.
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.
Exclusive keywords
If both properties and if are present at the same nesting level, only the first keyword listed will run. We recommend not listing properties and if together in 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
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.
Definition of existence
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.
Example: Equals input
json
1
{
2
"favoriteAppetizer":"Onion rings",
3
"favoriteBeverage":"Lemonade"
4
}
Example: Config modifier with equals operator
yaml
1
if:
2
operator: equals
3
terms:
4
-get: favoriteAppetizer
5
-get: favoriteBeverage
6
then:
7
constant: You can't drive your appetizer!
8
else:
9
constant: Looks good
Based on this example config modifier, the output would be:
Example: Equals output
json
1
"Looks good"
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.
Example: All input
json
1
{
2
"favoriteAppetizer":"Buffalo wings"
3
}
Example: Config modifier with all operator
yaml
1
if:
2
operator: all
3
terms:
4
-get: favoriteAppetizer
5
-get: favoriteBeverage
6
then:
7
constant: Both food and drink selected
8
else:
9
constant: Food and drink not selected
Based on this example config modifier, the output would be:
Example: All output
json
1
"Food and drink not selected"
Specifies that at least one of the defined terms exist.
If at least one of the terms is present, the then action occurs. If none aren't present, the else action occurs.
Example: Some input
json
1
{
2
"favoriteAppetizer":"Buffalo wings"
3
}
Example: Config modifier with some operator
yaml
1
if:
2
operator: some
3
terms:
4
-get: favoriteAppetizer
5
-get: favoriteBeverage
6
then:
7
constant: At least one menu item selected
8
else:
9
constant: No menu items selected
Based on this example config modifier, the output would be:
Example: Some output
json
1
"At least one menu item selected"
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.
Example: None input
json
1
{
2
"favoriteAppetizer":"Buffalo wings"
3
}
Example: Config modifier with none operator
yaml
1
if:
2
operator: none
3
terms:
4
-get: favoriteAppetizer
5
-get: favoriteBeverage
6
then:
7
constant: No menu items selected
8
else:
9
constant: At least one menu item selected
Based on this example config modifier, the output would be:
Example: None output
json
1
"At least one menu item selected"
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.
Array example
Example: Includes array input
json
1
{
2
"desserts":{
3
"cheesecake",
4
"brownies",
5
"chocolate chip cookies",
6
"lemon squares"
7
}
8
}
Example: Config modifier with includes operator
yaml
1
if:
2
operator: includes
3
terms:
4
-get: desserts
5
-constant: brownies
6
then:
7
constant: The menu selections include brownies
8
else:
9
constant: The menu selections don't include brownies
Based on this example config modifier, the output would be:
Example: Includes array output
json
1
"The menu selections include brownies"
String example
Example: Includes string input
json
1
{
2
"partyType":"picnic"
3
}
Example: Config modifier with includes operator for string
yaml
1
if:
2
operator: includes
3
terms:
4
-get: partyType
5
-constant: picnic
6
then:
7
constant: Party is a picnic
8
else:
9
constant: Party isn't a picnic
Based on this example config modifier, the output would be:
Example: Output string for includes operator
json
1
"Party is a picnic"
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
Defines the keyword(s) to execute when the operator resolves to a true state.
else
Defines the keyword(s) to execute 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.
Exclusive keywords
If both properties and if are present at the same nesting level, only the first keyword listed will run. We recommend not listing properties and if together in the same nesting level.
Useful expressions for concat
There are a couple of expressions that you should know about when using concat.
- : Indicates one independent value that should be present in an array. Each element in the array should be designated with a - before the key-value pair.
{}: Refers to a current value in an array within the initial payload. Use this to retain an original value rather than deleting or overwriting it. To make sure the value appears in a processed payload as-is, add this expression on its own line in the concat object as - {}.
Examples for concat
For example, you could create an array list for a property in the output.
Example: Concat input from initial payload
json
1
{
2
"guests":{
3
"host":"Eva"
4
"guestOfHonor":"Phil"
5
"otherGuests":"Robby"
6
}
7
}
Example: Concat selector
json
1
"$.guests.otherGuests"
Example: Config modifier with concat keyword
yaml
1
concat:
2
-{}
3
-constant: Aisha
4
-constant: Dominic
5
-constant: Jin
6
-constant: Monique
Example: Concat output
json
1
{
2
"guests":{
3
"host":"Eva"
4
"guestOfHonor":"Phil"
5
"otherGuests":[
6
Robby,
7
Aisha,
8
Dominic,
9
Jin,
10
Monique
11
]
12
}
13
}
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.
Definition of existence
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)
Examples for default
For example, you could set a default value for a specific value if it doesn't 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
Bundles functionality for handling date values with time. This is referenced as name: date-time.
parse
Identifies how to read an incoming date-time value; outputs an ISO-8601 string.
Optional parameters
Parameter
Notes
standard: string
(mutually exclusive with custom)
A named identifier for the format of the input. The default is ISO.
Learn about accepted formats.
custom: string
(mutually exclusive with standard)
A custom-defined format for how to parse the input (ex: yyyy MM/dd HH:mm:ss).
If the input already includes an offset or time zone information then this parameter is unused.
Example
Example: Now input
yaml
1
n/a
Example: Now in config modifier for date-time plugin
yaml
1
schema:
2
plugin:
3
name: date-time
4
action: now
5
parameters:
6
standard: RFC2822
Example: Now output for date-time plugin
yaml
1
Tue, 06 Sep 2022 15:19:42 +0000
Bundles functionality for handling date values. This is referenced as name: date.
parse
Identifies how to read an incoming date value.
Optional parameters
Parameter
Notes
standard: string
(mutually exclusive with custom)
A named identifier for the format of the input. The default is ISO.
Learn about accepted formats.
custom: string
(mutually exclusive with standard)
A custom-defined format for how to parse the input (ex: yyyy MM/dd).
Learn about accepted formats.
Example
Example: Parse input for date plugin
yaml
1
"20220729"
Example: Parse in config modifier for date plugin
yaml
1
plugin:
2
name: date
3
action: parse
4
parameters:
5
standard: HL7
Example: Parse output for date plugin
yaml
1
"2022-07-29"
render
Identifies how to create an output date value.
Required parameters
Parameter
Notes
standard: string
(mutually exclusive with custom)
A named identifier for the format of the input.
Learn about accepted formats.
custom: string
(mutually exclusive with standard)
A custom-defined format for how to render the input (ex: yyyy MM/dd).
Learn about accepted formats.
Example
Example: Render input for date plugin
yaml
1
"2022-07-29"
Example: Render in config modifier for date plugin
yaml
1
plugin:
2
name: date
3
action: render
4
parameters:
5
standard: HL7
Example: Render output for date plugin
yaml
1
20160525
now
Generates the current date and then renders the output.
Required parameters
Parameter
Notes
standard: string
(mutually exclusive with custom)
A named identifier for the format of the input.
Learn about accepted formats.
custom: string
(mutually exclusive with standard)
A custom-defined format for how to parse the input (ex: yyyy MM/dd).
Learn about accepted formats.
Example
Example: Now input
yaml
1
n/a
Example: Now in config modifier for date plugin
yaml
1
plugin:
2
name: date
3
action: now
4
parameters:
5
standard: HL7
Example: Now output for date plugin
yaml
1
"20220729"
Bundles functionality for handling Social Security number values. This is referenced as name: ssn.
format
Formats a string into a Social Security number in either of these formats: xxx-xx-xxxx and xxxxxxxxx. Any leading or trailing whitespace are trimmed and non-numeric characters are removed.
No validation
Validation of a “correct” Social Security number isn't performed. A valid shape but invalid content (ex: 000-12-3456) won't be rejected.
Optional parameters
Parameter
Notes
dashes: boolean
Controls if the output is rendered with or without dashes. If not specified, the default is true.
Example
Example: Format input for ssn plugin
yaml
1
"000123456"
Example: Format in config modifier for ssn plugin
yaml
1
plugin:
2
name: ssn
3
action: format
Example: Format output for ssn plugin
yaml
1
"000-12-3456"
Bundles functionality for handling phone number values. This is referenced as name: phone-number.
format
Parses a string into a valid phone number format. This action returns undefined if unable to parse the input.
Learn about accepted formats.
Optional parameters
Parameter
Notes
renderFormat: string
Specifies the output to render. If not specified, the default is e164.
Learn about accepted formats.
Example
Example: Format input for phone-number plugin
yaml
1
"800-123-4567"
Example: Format in config modifier for phone-number plugin
yaml
1
plugin:
2
name: phone-number
3
action: format
4
parameters:
5
renderFormat: international
Example: Format output for phone-number plugin
yaml
1
+1 800-123-4567
Bundles functionality for manipulating text values. This is referenced as name: text.
upper-case
Converts an input string to upper case.
There aren't any required or optional parameters for upper-case.
Example
Example: Upper-case input for text plugin
yaml
1
"hello world"
Example: Upper-case in config modifier for text plugin
yaml
1
plugin:
2
name: text
3
action: upper-case
Example: Upper-case output for text plugin
yaml
1
"HELLO WORLD"
lower-case
Converts an input string to lower case.
There aren't any required or optional parameters for lower-case.
Example
Example: Lower-case input for text plugin
yaml
1
"HELLO WORLD"
Example: Lower-case in config modifier for text plugin
yaml
1
plugin:
2
name: text
3
action: lower-case
Example: Lower-case output for text plugin
yaml
1
"hello world"
trim
Removes leading and trailing whitespace from the input string.
Optional parameters
Parameter
Notes
normalizeWhitespace: boolean
Indicates whether whitespace is converted.
The default is true, which converts any whitespace within the input string to one character whitespace. For example, Bob Smith becomes Bob Smith.
The false value doesn't convert whitespace within the input string. For example, Bob Smith stays the same.
Example
Example: Trim input for text plugin
yaml
1
" a b c "
Example: Trim in config modifier for text plugin
yaml
1
plugin:
2
name: text
3
action: trim
Example: Trim output for text plugin
yaml
1
"a b c"
split
Splits a string value on a supplied separator and returns the resulting string array. This optionally allows retrieving a specific value by index, returning only the string.
Required parameters
Parameter
Notes
separator: string
A string value used to split the input string.
Optional parameters
Parameter
Notes
getIndex: number
A number that'll be used to retrieve a specific value using a zero-based index.
fromEnd: boolean
If true, the start index begins from the end of the array and retrieves the last value first.
If specified, getIndex is required. If not specified, the default is false.
Example
Example: Split input for text plugin
yaml
1
"a,b,c"
Example: Split in config modifier for text plugin
yaml
1
plugin:
2
name: text
3
action: split
4
parameters:
5
separator:','
Example: Split output for text plugin
yaml
1
[
2
"a",
3
"b",
4
"c"
5
]
replace
Identifies an input string value and replaces occurrences of a given search value with a new value.
Global replace
This is a global replace operation. All occurrences of the search value are replaced with the new value.
There's no attempt to trim or normalize whitespace. If you require that functionality, you'll first need to sanitize your input value with the trim operator.
Required parameters
Parameter
Notes
newValue: string
A string value that serves as the replacement value. If not specified, the plugin returns an undefined value.
Optional parameters
Parameter
Notes
searchValue: string
The value that newValue replaces. If not specified, this defaults to a single whitespace.
Example
Example: Replace input for text plugin
yaml
1
"hello world"
Example: Replace in config modifier for text plugin
yaml
1
plugin:
2
name: text
3
action: replace
4
parameters:
5
searchValue:'l'
6
newValue:'<replaced>'
Example: Replace output for text plugin
yaml
1
"he<replaced><replaced>o wor<replaced>d"
Bundles functionality for handling array values. This is referenced as name: array.
join
Creates a string from the contents of the array and the separator.
Required parameters
Parameter
Notes
separator: string
A string value that'll be inserted immediately after each element in the array, excepting the final value in the array.
Example
Example: Join input for array plugin
yaml
1
[
2
"a",
3
"b",
4
"c"
5
]
Example: Join in config modifier for array plugin
yaml
1
plugin:
2
name: array
3
action: join
4
parameters:
5
separator:','
Example: Join output for array plugin
yaml
1
"a,b,c"
unique
Returns an array of distinct values.
Optional parameters
Parameter
Notes
match: string
A string value that'll be used as the de-duplication key for a non-primitive array.
If a primitive array, the value of match is ignored.
If an object array, the value of match uses that object property value as the de-duplication key.
Example
Example: Unique input for array plugin
yaml
1
[
2
"a",
3
"b",
4
"c",
5
"a"
6
]
Example: Unique in config modifier for array plugin
yaml
1
plugin:
2
name: array
3
action: unique
Example: Unique output for array plugin
yaml
1
[
2
"a",
3
"b",
4
"c"
5
]
sort
Sorts the array as indicated.
This operator can sort both primitive and object arrays.
Optional parameters
Parameter
Notes
order: Array of Objects
Directs how to sort the input array.
If not specified, a primitive array is sorted in asc order. An object array isn't sorted.
If direction isn't specified, the array is sorted in asc order. If multiple directions are specified, they're evaluated in order. For example, it might sort an array first by age, then by last name. If you specify any direction other than asc or desc, the order parameter is ignored and not applied. If any other directions are defined, they are also ignored.
If by isn't specified, a primitive array is sorted according to direction. An object array isn't sorted.
Example
Example: Sort input for array plugin
yaml
1
[
2
{
3
"name":"John",
4
"age":30
5
},
6
{
7
"name":"Jane",
8
"age":35
9
}
10
]
Example: Sort in config modifier for array plugin
yaml
1
plugin:
2
name: array
3
action: sort
4
parameters:
5
order:
6
-by: age
7
direction: desc
Example: Sort output for array plugin
yaml
1
[
2
{
3
"name":"Jane",
4
"age":35
5
},
6
{
7
"name":"John",
8
"age":30
9
}
10
]
filter
Returns an array of values that match the specified value.
Required parameters
Parameter
Notes
match: string
A string value used to compare to other values within an input array.
Optional parameters
Parameter
Notes
partial: boolean
The default value is false. Indicates that a partial match won't be performed.
If set to true, performs a case-sensitive partial match for the specified value(s).
Some array actions accept a boolean partial parameter. When this is set to true the following rules are enacted:
1) The value of parameters.match can be a string value or an object (as makes sense for your input value). Non-string values will use exact matching.
2) If multiple key/value pairs are provided in parameters.match and logic is used, each key/value pair must partially match.
Example
Example: Filter input for array plugin
yaml
1
[
2
1,
3
2,
4
3,
5
1
6
]
Example: Filter in config modifier for array plugin
yaml
1
plugin:
2
name: array
3
action: filter
4
parameters:
5
match:1
Example: Filter output for array plugin
yaml
1
[
2
1,
3
1
4
]
without
Returns an array of values that don't match the specified value.
Required parameters
Parameter
Notes
match: string
A string value used to compare to other values within an input array.
Optional parameters
Parameter
Notes
partial: boolean
The default value is false. Indicates that a partial match won't be performed.
If set to true, performs a case-sensitive partial match for the specified value(s).
Some array actions accept a boolean partial parameter. When this is set to true the following rules are enacted:
1) The value of parameters.match can be a string value or an object (as makes sense for your input value). Non-string values will use exact matching.
2) If multiple key/value pairs are provided in parameters.match and logic is used, each key/value pair must partially match.
Example
Example: Without input for array plugin
yaml
1
[
2
1,
3
2,
4
3,
5
1
6
]
Example: Without in config modifier for array plugin
yaml
1
plugin:
2
name: array
3
action: without
4
parameters:
5
match:1
Example: Without output for array plugin
yaml
1
[
2
2,
3
3
4
]
find
Returns the first value that matches the specified value; otherwise, returns undefined if no match is found.
Required parameters
Parameter
Notes
match: string
A string value used to compare to other values within an input array.
Optional parameters
Parameter
Notes
partial: boolean
The default value is false. Indicates that a partial match won't be performed.
If set to true, performs a case-sensitive partial match for the specified value(s).
Some array actions accept a boolean partial parameter. When this is set to true the following rules are enacted:
1) The value of parameters.match can be a string value or an object (as makes sense for your input value). Non-string values will use exact matching.
2) If multiple key/value pairs are provided in parameters.match and logic is used, each key/value pair must partially match.
Example 1
Example: Find input for array plugin
yaml
1
[
2
1,
3
2,
4
3,
5
1
6
]
Example: Find in config modifier for array plugin
yaml
1
plugin:
2
name: array
3
action: find
4
parameters:
5
match:1
Example: Find output for array plugin
yaml
1
1
Example 2
Example: Find and partial input for array plugin
yaml
1
[
2
{
3
"firstName":"Joseph",
4
"lastName":"Wilson"
5
},
6
{
7
"firstName":"John",
8
"lastName":"Doe"
9
}
10
]
Example: Find and partial in config modifier
yaml
1
plugin:
2
name: array
3
action: find
4
parameters:
5
match:
6
firstName:'Jo'
7
lastName:'Do'
8
partial:true
Example: Find and partial output for array plugin
yaml
1
{
2
"firstName":"John",
3
"lastName":"Doe"
4
}
last
Retrieves the last element in an array.
There aren't any required or optional parameters for last.
Example: Last input for array plugin
yaml
1
[
2
1,
3
2,
4
3
5
]
Example: Last in config modifier for array plugin
yaml
1
plugin:
2
name: array
3
action: last
Example: Last output for array plugin
yaml
1
3
Bundles functionality for handling URI values. This is referenced as name: uri.
encode
Encodes a uri or uriComponent.
Optional parameters
Parameter
Notes
isComponent: boolean
Indicates whether the underlying value should be interpreted as a full URI or just a URI component.
There aren't any required or optional parameters for generate.
Example
No input is needed for the UUID plugin.
Example: Generate in config modifier for uuid plugin
yaml
1
plugin:
2
name: uuid
3
action: generate
Example: Generate output for uuid plugin
yaml
1
"793d6d8b-40a8-41b9-8e39-dd40e73df748"
Bundles functionality for converting from one value type to another. This is referenced as name: convert.
string-to-boolean
Converts a set of string values to their boolean equivalent.
Supported conversions
'true' to true
'yes' to true
'no' to false
'false' to false
'null' to null
If the input value isn't a string or any of the values listed above, then the response returns undefined.
Also note that either single or double quotes are supported for any of the string values.
There aren't any required or optional parameters for string-to-boolean.
Example
Example: String-to-boolean input
yaml
1
"yes"
Example: String-to-boolean in config modifier
yaml
1
plugin:
2
name: convert
3
action: string-to-boolean
Example: String-to-boolean output
yaml
1
true
boolean-to-string
Converts a boolean value to its string equivalent.
Supported conversions
true to 'true'
false to 'false'
If the input value isn't a boolean, then the response returns undefined.
Also note that either single or double quotes are supported for either of the string values.
There aren't any required or optional parameters for boolean-to-string.
Example
Example: Boolean-to-string input
yaml
1
true
Example: Boolean-to-string in config modifier
yaml
1
plugin:
2
name: convert
3
action: boolean-to-string
Example: Boolean-to-string output
yaml
1
"true"
number-to-string
Converts a numeric value to its string equivalent.
Supported conversions
123 to '123'
-100 to '-100'
123.1 to '123.1'
9007199254740992 to '9007199254740992'
If the input value isn't numeric, then the response returns undefined.
Also note that either single or double quotes are supported for either of the string values.
There aren't any required or optional parameters for number-to-string.
Example
Example: Number-to-string input
yaml
1
1
Example: Number-to-string in config modifier
yaml
1
plugin:
2
name: convert
3
action: number-to-string
Example: Number-to-string output
yaml
1
"1"
string-to-number
Converts a string value to a numeric value.
Supported conversions
'123' to 123
'-100' to -100
'123.1' to 123.1
'9007199254740992' to 9007199254740992
If the input value isn't a string, then the response returns undefined.
Also note that either single or double quotes are supported for either of the string values.
There aren't any required or optional parameters for string-to-number.
Example
Example: String-to-number input
yaml
1
"1"
Example: String-to-number in config modifier
yaml
1
plugin:
2
name: convert
3
action: string-to-number
Example: String-to-number output
yaml
1
1
Accepted formats
Several of our plugins require you to specify a format. These are valid formats for various plugins.
Valid input formats
Identifier
Output as E.164
+18001234567
+18001234567 (stays the same)
800.123.4567
+18001234567
800-123-4567
+18001234567
800 123 4567
+18001234567
tel:+1-800-123-4567
+18001234567
8001234567
+18001234567
(800) 123-4567
+18001234567
18001234567
+18001234567
(800) 123-4567ext987
+18001234567
Explicit render formats
Identifier
Example
e164
+18001234567
international
+1 800-123-4567
national
(800) 123-4567
rfc3966
tel:+1-800-123-4567
significant
8001234567
Standard
Identifier
Example(s)
HL7
20220729114900
20220729114900.123
20220729114900-0600
ISO
2016-05-25T09:08:34.123
2016-05-25T09:08:34.123-06:00
HTTP
Sun, 06 Nov 1994 08:49:37 GMT
Sunday, 06-Nov-94 08:49:37 GMT
Sun Nov 6 08:49:37 1994
SQL
We currently only render with offsets, not timezones
2017-05-15 09:12:34
2017-05-15 09:12:34.342-06:00
2017-05-15 09:12:34.342 America/Los_Angeles
milliseconds
Number of milliseconds since January 1, 1979 at midnight UTC/GMT
1659095340000
seconds
Number of seconds since January 1, 1979 at midnight UTC/GMT
1659095340
RFC2822
We currently only render date-times that look like Fri, 29 Jul 2022 11:49:00 +0000
25 Nov 2016 13:23:12 GMT
Fri, 25 Nov 2016 13:23:12 +0600
25 Nov 2016 13:23 Z
Custom
Custom formats
A custom format is a build-your-own format. You can use commonly used tokens to build a format that suits your needs. These formats aren't recognized as industry-regulated, but the tokens are well known, all the same.
You can use either a custom or standard format, not both.
Token
Description
Example output
S
millisecond, no padding
54
SSS
millisecond, padded to three
05
s
second, no padding
4
ss
second, padded to two padding
04
m
minute, no padding
7
mm
minute, padded to two
07
h
hour in 12-hour time, no padding
1
hh
hour in 12-hour time, padded to two
01
H
hour in 24-hour time, no padding
13
HH
hour in 24-hour time, padded to two
13
Z
narrow offset
+5
ZZ
short offset
+05:00
techie offset
+0500
z
IANA zone
America/New_York
a
meridiem
AM
d
day of the month, no padding
6
dd
day of the month, padded to two
06
EEE
day of the week, as an abbreviated localized string
Wed
EEEE
day of the week, as an unabbreviated localized string
Wednesday
M
month as an unpadded number
8
MM
month as a padded number
08
MMM
month as an abbreviated localized string
Aug
MMMM
month as an unabbreviated localized string
August
yy
two-digit year, interpreted as >1960
14
yyyy
four-digit year
2014
D
localized numeric date
9/6/2014
DD
localized date with abbreviated month
Aug 6, 2014
DDD
localized date with full month
August 6, 2014
DDDD
localized date with full month and weekday
Wednesday, August 6, 2014
Standard
Identifier
Example(s)
HL7
20220729
ISO
2016-05-25
SQL
2017-05-15
Custom
Custom formats
A custom format is a build-your-own format. You can use commonly used tokens to build a format that suits your needs. These formats aren't recognized as industry-regulated, but the tokens are well known, all the same.
You can use either a custom or standard format, not both.
Token
Description
Example output
d
day of the month, no padding
6
dd
day of the month, padded to two
06
EEE
day of the week, as an abbreviated localized string
Wed
EEEE
day of the week, as an unabbreviated localized string
Wednesday
M
month as an unpadded number
8
MM
month as a padded number
08
MMM
month as an abbreviated localized string
Aug
MMMM
month as an unabbreviated localized string
August
yy
two-digit year, interpreted as >1960
14
yyyy
four-digit year
2014
D
localized numeric date
9/6/2014
DD
localized date with abbreviated month
Aug 6, 2014
DDD
localized date with full month
August 6, 2014
DDDD
localized date with full month and weekday
Wednesday, August 6, 2014
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®.