Skip to content

octofhir-sof

Turn FHIR data into flat tables from a ViewDefinition — with no database required, or by generating PostgreSQL / DuckDB SQL.

Two interchangeable paths

A database-free in-memory evaluator over serde_json, and a SQL generator that lowers FHIRPath to SQL over JSONB — both pass the full official suite.

No database required

Run a ViewDefinition over NDJSON, a Bundle, or a directory of resources and write CSV / NDJSON / JSON / Parquet. No Postgres, no setup.

Multi-dialect SQL

One dialect-parametrized generator emits PostgreSQL JSONB or DuckDB JSON SELECTs, plus CREATE TABLE DDL in ansi / postgres / duckdb.

Offline lint & validate

Rustc-style diagnostics for ViewDefinitions (FH01–FH11), plus JSON and SARIF 2.1.0 output for CI — schema-driven against any FHIR package.

octofhir-sof is a Rust toolkit for SQL on FHIR v2: it parses ViewDefinition resources and turns FHIR data into flat tables. The library is network-free and embeddable; the CLI is a thin shell over it.

  • Database-free in-memory evaluator over serde_json, and a PostgreSQL / DuckDB SQL generator — both pass the full official content-test suite (144/144).
  • Version-agnostic execution: the engine navigates resource JSON directly, so the same view runs unchanged over R4, R4B, R5 or R6.
  • Writers: CSV, NDJSON, JSON, and Parquet (feature-gated).
  • Full v2.1 support: the repeat directive and the %rowIndex environment variable, on both paths.
Terminal window
curl -fsSL https://raw.githubusercontent.com/octofhir/sof/main/install.sh | sh

See Install for cargo install, prebuilt binaries, and building from source.