Skip to content

FH07 — More than one iteration construct per select

Group: Structure · Severity: error · Run by: validate and lint

The SQL-on-FHIR v2 sql-expressions invariant allows at most one of forEach, forEachOrNull or repeat on a single select. Combining them is ambiguous and is rejected.

This select uses both forEach and repeat — FH07:

{
"resource": "Patient",
"select": [{
"forEach": "name",
"repeat": ["link"],
"column": [{ "name": "id", "path": "id" }]
}]
}
error [FH07]: a select may use at most one of forEach, forEachOrNull or repeat

Keep one iteration construct per select; nest a child select if you need a second level of iteration.