View raw Markdown
type: fhirpath-operatoroperator: &category: Mathsection: 6.6.7source: fhirpath/operations.json

FHIRPath Operator: & (concatenate)

For strings, will concatenate the strings, where an empty operand is taken to be the empty string. This differs from + on two strings, which will result in an empty collection when one of the operands is empty. This operator is specifically included to simplify treating an empty collection as an empty string, a common use case in string manipulation.

'ABC' + 'DEF' // 'ABCDEF'
'ABC' + { } + 'DEF' // { }
'ABC' & 'DEF' // 'ABCDEF'
'ABC' & { } & 'DEF' // 'ABCDEF'

Summary

Description

String concatenation operator. Concatenates the strings, where an empty operand is taken to be the empty string. This differs from + on strings, which results in empty collection when one operand is empty.

Type Mapping