work-with-sof

Transforms FHIR resources into CSV, NDJSON, JSON, and parquet using SQL-on-FHIR ViewDefinitions.

51|19|Updated Jan 4, 2025
One-click install
npx skills add https://github.com/HeliosSoftware/hfs --skill work-with-sof-heliossoftware
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: work-with-sof
Source: https://github.com/HeliosSoftware/hfs/tree/main/.agents/skills/work-with-sof
Command: npx skills add https://github.com/HeliosSoftware/hfs --skill work-with-sof-heliossoftware

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with the Helios SQL-on-FHIR components requires knowing the sof-cli and sof-server configuration surface, the $sql-run endpoint parameters, and the ViewDefinition trait abstractions, which are easy to get wrong without a reference. ## Core Features & Use Cases - Server Configuration Reference: Documents SOF_SERVER_PORT, SOF_MAX_BODY_SIZE, SOF_REQUEST_TIMEOUT, CORS, and terminology server environment variables. - API Endpoint Guidance: Covers /metadata, /health, and POST /$sql-run with parameters like _format, header, subjectResource, resource, patient, _limit, and _since, including parameter precedence rules. - Parquet Export: Explains CLI and server-based parquet export with the Pathling-style type mapping (boolean to BOOLEAN, integer to INT32, decimal to FLOAT64) and Snappy compression. - Use Case: A developer modifying ViewDefinitionTrait behavior in helios-sof uses this Skill to run transformation tests, verify version-independent enum wrappers like SofViewDefinition, and validate parquet output from the $sql-run endpoint. ## Quick Start Ask the assistant to run a SQL-on-FHIR transformation by executing sof-cli with a ViewDefinition file and a FHIR Bundle, outputting the result in parquet format.

Frequently Asked Questions about work-with-sof

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I transform FHIR resources to CSV using SQL-on-FHIR?▼

Run sof-cli with a ViewDefinition file and a FHIR Bundle, or POST to the /$sql-run endpoint with _format set to csv. The header parameter controls whether the CSV output includes a header row.

How do I export SQL-on-FHIR results to parquet?▼

Pass --format parquet to sof-cli or set _format to parquet in the $sql-run request body. Types map per Pathling conventions, arrays become Arrow List types, all fields are optional, and Snappy compression is the default.

What parameters does the $sql-run endpoint accept?▼

The endpoint accepts _format, header, subjectResource, resource, patient, _limit (1 to 10000), and _since. Parameter precedence is request body first, then query parameters, then the Accept header.

Does sof-server support terminology server integration?▼

Yes, set the SOF_TERMINOLOGY_SERVER environment variable to a terminology server URL. This enables FHIRPath memberOf and subsumes operations during ViewDefinition evaluation.

How do I handle multiple FHIR versions in SQL-on-FHIR code?▼

Use version-independent enum wrappers such as SofViewDefinition and traits like ViewDefinitionTrait, BundleTrait, and ResourceTrait. These abstractions let transformation logic work across R4, R4B, R5, and R6 resources.