Skip to content

Lint rules

octofhir-sof ships 11 FHIR-level lint rules (FH01–FH11). Each has a dedicated page with what it flags, an example that triggers it, and how to fix or silence it. They are reported by octofhir-sof validate (structural rules) and octofhir-sof lint (schema-driven and shareable rules). Each finding links to its rule page via its help_url.

The rules cite the SQL on FHIR v2 specification where relevant.

CodeSeverityDescription
FH01errorUnknown FHIR element (with a did-you-mean suggestion)
FH02warningChoice element not narrowed with ofType()
FH03warningComplex element selected into a scalar column
FH04warningArray-valued element into a scalar column
FH05warningReference into a scalar without getReferenceKey()

Structural rules (run by validate and lint)

Section titled “Structural rules (run by validate and lint)”
CodeSeverityDescription
FH06errorInvalid SQL name (column / constant / view name)
FH07errorMore than one of forEach / forEachOrNull / repeat per select
FH08errorDuplicate output column name
FH09errorunionAll branches with mismatched shape
FH10errorMissing resource, or a view that produces no columns

Portability rule (opt-in with lint --shareable)

Section titled “Portability rule (opt-in with lint --shareable)”
CodeSeverityDescription
FH11error / warningFHIRPath outside the ShareableViewDefinition required subset

See the linting guide for how to run them.