Skip to content

FH03 — Complex element into a scalar column

Group: Selector (schema-driven) · Severity: warning · Needs: lint --package

A scalar column’s selector lands on a complex element (a backbone/complex type such as HumanName, Address, …) rather than a primitive leaf. The SQL on FHIR v2 spec expects a column to yield a primitive value; emitting a whole complex element into a scalar column is ambiguous.

name.first() resolves to a HumanName (complex) in a scalar column:

{
"resource": "Patient",
"select": [{ "column": [{ "name": "n", "path": "name.first()" }] }]
}
warning [FH03] (n): selects a complex element into a scalar column; navigate to
a primitive leaf, or mark the column collection to emit structured JSON

Navigate to a primitive leaf (name.first().family), or set "collection": true on the column to emit the element as structured JSON.