sql-on-fhir

Create SQL on FHIR ViewDefinitions to flatten FHIR resources into tabular formats.

133|23|Updated Mar 23, 2020
One-click install
npx skills add https://github.com/aehrc/pathling --skill sql-on-fhir
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sql-on-fhir
Source: https://github.com/aehrc/pathling/tree/main/.claude/skills/sql-on-fhir
Command: npx skills add https://github.com/aehrc/pathling --skill sql-on-fhir

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the complex task of querying and transforming hierarchical FHIR data into a flat, tabular format suitable for standard data analytics tools and SQL databases.

Core Features & Use Cases

  • FHIR Data Flattening: Create SQL-friendly views from FHIR resources using ViewDefinitions.
  • FHIRPath Extraction: Define columns using FHIRPath expressions for precise data extraction.
  • Complex Data Unnesting: Handle nested structures and arrays using forEach, forEachOrNull, and repeat for recursive traversal.
  • Filtering and Constants: Apply where clauses for filtering and use constants for reusable values.
  • Operations: Execute ViewDefinitions synchronously with $run or asynchronously with $export for bulk data retrieval.
  • Use Case: You need to analyze patient demographics and their associated conditions. This Skill can generate a ViewDefinition to flatten Patient and Condition resources into a single, queryable table.

Quick Start

Use the sql-on-fhir skill to create a ViewDefinition for patient demographics.

Frequently Asked Questions about sql-on-fhir

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

FAQPage Schema
How do I flatten FHIR resources into SQL-friendly tables for analytics?▼

You flatten FHIR resources into SQL-friendly tables by implementing SQL on FHIR v2 ViewDefinitions, which project hierarchical clinical data into portable, analytics-ready formats for standard querying.

What is the best way to extract nested FHIR arrays into a flat table format?▼

Extracting nested FHIR arrays into a flat table is best handled using ViewDefinition patterns like forEach, forEachOrNull, and repeat for recursive traversal and unnesting of complex data structures.

How do I use FHIRPath expressions to define columns in a ViewDefinition?▼

FHIRPath expressions define columns in a ViewDefinition by precisely targeting and extracting specific data elements from FHIR resources for transformation into SQL-friendly tabular formats.

Can I filter FHIR data when creating SQL tabular projections?▼

Yes, you can filter FHIR data when creating SQL tabular projections by applying where clauses within your ViewDefinition to conditionally select resources and refine the analytics-ready output.

Does SQL on FHIR support asynchronous bulk data retrieval operations?▼

SQL on FHIR supports asynchronous bulk data retrieval through the $export operation, while also offering the $run operation for synchronous execution of ViewDefinitions to extract FHIR data.