Variables and orchestration
Once you can select values, the next step is composing those values into a mapping flow.
This is where FUME authoring starts to feel like a full language: you bind intermediate values, sequence helper calls, combine expressions, and choose the output shape that the mapping should return.
Core expression forms
The expression layer supports the usual value-building patterns:
- string literals and concatenation with
& - numeric literals and operators such as
+,-,*,/, and% - comparisons such as
=,!=,<,<=,>,>=, andin - boolean composition with
andandor
These expressions appear in ordinary transformation flows, on the right-hand side of FLASH assignment rules, and inside orchestration blocks.
Variable bindings
Use JSONata-style bindings to name intermediate values:
$fullName := firstName & " " & lastName
After a variable is bound, later expressions in the same block can reuse it. This is the normal way to share identifiers, normalized values, and reusable computed fragments across a mapping.
Parenthesized orchestration blocks
Parenthesized blocks (...) let you sequence multiple expressions and return the final value.
(
$patientId := $uuid('examplecare-patient-001');
$patientId
)
Inside these blocks, semicolons separate expressions. The final expression becomes the block's result.
This is the main pattern for coordinating variable setup, helper calls, and one or more FLASH blocks.
Returning the shape you need
An orchestration block can return whichever output shape fits the job:
- a direct extracted or transformed value
- a custom JSON object or array
- a FLASH-produced FHIR resource
(
$patientId := $uuid('examplecare-patient-001');
$displayName := firstName & " " & lastName;
{
"id": $patientId,
"display": $displayName
}
)
That flexibility supports several mapping shapes. Some mappings prepare intermediate payloads, emit domain JSON, return a selected value for a larger pipeline, or produce FHIR resources through FLASH.
Working with FLASH
In practice, authors often:
- normalize or compute values in the expression layer
- bind shared identifiers or intermediate values
- return values directly, build JSON structures, or write structured FHIR output with one or more FLASH blocks
Authors usually combine these patterns within the same mapping as needed.
(
$patientId := $uuid('examplecare-patient-001');
$displayName := firstName & " " & lastName;
(
Instance: $patientId
InstanceOf: Patient
* name.text = $displayName
)
)
The expression layer prepares and coordinates the values. FLASH writes them into FHIR-shaped structure when that is the required output.
Continue from here
For the detailed composition patterns, continue to FLASH composition and orchestration.
For function-level detail that often shows up in orchestration, see $uuid(), $merge(), $map(), $reduce(), and Async execution.