default

Last updated: Feb 20, 2026
DEVELOPER
IMPLEMENTATION
HEALTH TECH VENDOR

Definition

In a config modifier schema, use default to specify 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)

Order of execution

This keyword executes in the following order:

  1. omit
  2. constant
  3. references
  4. use
  5. get
  6. Mutually exclusive keywords at this level:
    • properties
    • if
    • concat
    • switch
    • pipe
    • merge
    • prefer
    • items
  7. default
  8. plugin

Example

You could set a default value for a specific value if it doesn’t exist in the input.

For example, if SCH.25.1 is missing from the initialPayload (an HL7v2 message in the scenario below), you can set the Visit.Status property to a default value of “Scheduled” in the Scheduling data model message.

Example: Default input
json
1
{
2
"SCH": {
3
"2": {
4
"1": "123456",
5
"2": "HST"
6
},
7
"3": "1",
8
"7": {
9
"1": "",
10
"2": "**Comment Notes here***"
11
},
12
"9": "0001",
13
"10": {
14
"1": "s"
15
},
16
"11": [
17
{
18
"1": {
19
"1": ""
20
},
21
"2": {
22
"1": ""
23
},
24
"3": "",
25
"4": {
26
"1": "20250924111500"
27
},
28
"5": {
29
"1": "20250924121500"
30
}
31
}
32
],
33
"16": [
34
{
35
"1": "",
36
"2": {
37
"1": "Mouse"
38
},
39
"3": "Mickey"
40
}
41
],
42
"20": [
43
{
44
"1": "",
45
"2": {
46
"1": "Mouse, Mickey"
47
}
48
}
49
]
50
},
51
}
Example: Default selector
json
1
$.Visit.Status
Example: Config modifier with default keyword
yaml
1
use: initialPayload
2
get: SCH.25.1
3
default: Scheduled
Example: Default output
json
1
{
2
"Visit": {
3
...
4
"Status": "Scheduled",
5
...
6
}
7
}

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®.