work-with-pysof

Develop and test pysof Python bindings for SQL-on-FHIR transformations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on the pysof Python bindings requires specialized knowledge of PyO3, maturin builds, and the fact that pysof is excluded from default workspace cargo builds, which can confuse developers expecting standard Rust workflows. ## Core Features & Use Cases - Development Environment Setup: Guides creation of a Python 3.11 virtual environment with uv and building the bindings via maturin develop. - Testing Workflows: Covers both the Python pytest suite and the Rust cargo test suite for pysof. - API Reference: Documents key functions like run_view_definition, ChunkedProcessor for streaming NDJSON, and process_ndjson_to_file for memory-efficient file-to-file transformation. - Use Case: A developer modifying SQL-on-FHIR Python bindings in crates/pysof uses this Skill to set up the environment, run the correct test suites, and verify changes with the proper API calls. ## Quick Start Set up the pysof development environment in crates/pysof and run the Python and Rust test suites to verify my changes to the SQL-on-FHIR bindings.

Frequently Asked Questions about work-with-pysof

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

FAQPage Schema
How do I set up the pysof development environment?▼

Navigate to crates/pysof, create a Python 3.11 environment with uv venv, install dependencies with uv sync --group dev, then build the bindings using uv run maturin develop --release. Verify by importing pysof and calling get_version().

How do I run pysof tests in Python and Rust?▼

Run the Python suite with uv run pytest python-tests/ -v from the crates/pysof directory, and the Rust suite with cargo test. Check current test counts from the tree rather than relying on historical numbers.

Why doesn't cargo build compile pysof from the workspace root?▼

pysof is excluded from default workspace builds, so running cargo build at the repository root does not compile it. You must build it separately using maturin develop from within the crates/pysof directory.

How do I process large NDJSON files with pysof?▼

Use pysof.ChunkedProcessor with a chunk_size parameter to stream large NDJSON files in batches, or call pysof.process_ndjson_to_file for the most memory-efficient file-to-file transformation to CSV or other formats.

What FHIR versions does pysof support?▼

You can check supported versions programmatically by calling pysof.get_supported_fhir_versions(). The run_view_definition_with_options function also accepts a fhir_version parameter such as R4 to control transformation behavior.