SQL-on-FHIR

SkillDatabases & data

Work on SQL-on-FHIR, ViewDefinition processing, sof-cli, sof-server, SOF HTTP configuration, output formats, or parquet export. Use for helios-sof changes, ViewDefinitionTrait behavior, transformation tests, and SOF server endpoints.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the SQL-on-FHIR skill

What this skill tells your AI

The instructions your AI receives, as published by heliossoftware/hfs in .agents/skills/work-with-sof/SKILL.md and read by ahel’s review.

Use this when working in helios-sof, sof-cli, sof-server, or ViewDefinition transformation code.

Server Environment

VariableDefaultDescription
SOF_SERVER_PORT8080Server port
SOF_SERVER_HOST127.0.0.1Host to bind
SOF_LOG_LEVELinfoLog level
SOF_MAX_BODY_SIZE10485760Max request body size in bytes, applied after decompression
SOF_REQUEST_TIMEOUT30Request timeout in seconds
SOF_ENABLE_CORStrueEnable CORS
SOF_CORS_ORIGINS*Allowed origins
SOF_TERMINOLOGY_SERVERnoneTerminology server URL for FHIRPath memberOf and subsumes

API Endpoints

  • GET /metadata: return CapabilityStatement.
  • GET /health: health check.
  • POST /$sql-run: execute ViewDefinition transformation.

$sql-run accepts these parameters in the request body or query:

  • _format: csv, ndjson, json, or parquet.
  • header: CSV header control, true or false.
  • subjectResource: ViewDefinition resource.
  • resource: FHIR resources to transform.
  • patient: filter by patient reference.
  • _limit: limit results, 1 to 10000.
  • _since: filter by modification time.

Parameter precedence is request body, then query params, then Accept header.

Parquet Export

# CLI
cargo run --bin sof-cli -- --view view.json --bundle data.json --format parquet

# Server
curl -X POST http://localhost:8080/\$sql-run \
  -H "Content-Type: application/json" \
  -d '{"_format": "parquet", "subjectResource": {...}, "resource": [...]}'

Parquet type mapping follows Pathling conventions:

SOF typeParquet type
booleanBOOLEAN
string, code, uriUTF8
integerINT32
decimalFLOAT64
dateTime, dateUTF8

Arrays map to Arrow List types. All fields are OPTIONAL. Snappy compression is the default.

Testing

  • Unit tests live in src/ files.
  • Integration tests live in tests/.
  • ViewDefinition examples are embedded in test files.
  • For version-independent logic, use enum wrappers such as SofViewDefinition and traits such as ViewDefinitionTrait, BundleTrait, and ResourceTrait.

Signals

GitHub stars
51
Forks
19
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
work-with-sof
Source
github.com/heliossoftware/hfs