Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/api/api-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ See also:

### SQL-on-FHIR

Healthcare analytics and reporting often require complex queries that go beyond what FHIR search can express - aggregating data across multiple resources, performing statistical analysis, or generating custom reports. Aidbox implements the [SQL-on-FHIR specification](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/), which bridges this gap by allowing you to write SQL queries directly against FHIR data, treating resources as relational tables while maintaining FHIR's semantic structure.
Healthcare analytics and reporting often require complex queries that go beyond what FHIR search can express - aggregating data across multiple resources, performing statistical analysis, or generating custom reports. Aidbox implements the [SQL-on-FHIR specification](https://build.fhir.org/ig/HL7/sql-on-fhir/), which bridges this gap by allowing you to write SQL queries directly against FHIR data, treating resources as relational tables while maintaining FHIR's semantic structure.

```mermaid
graph LR
Expand All @@ -309,12 +309,12 @@ graph LR

The SQL-on-FHIR implementation provides flat views of FHIR resources that can be queried using standard SQL, making it possible to write complex analytical queries using familiar SQL syntax. For example, you can join Patient and Observation resources to analyze lab trends, aggregate medication data across populations, or generate custom reports that combine data from multiple resource types. This approach enables seamless integration with **existing analytical tools** and **BI platforms** that expect SQL interfaces.

Aidbox uses [ViewDefinition](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/StructureDefinition-ViewDefinition.html) resources to define these flat views, automatically creating and maintaining them to ensure they stay synchronized with the underlying FHIR data while providing the performance benefits of PostgreSQL's query optimizer.
Aidbox uses [ViewDefinition](https://build.fhir.org/ig/HL7/sql-on-fhir/StructureDefinition-ViewDefinition.html) resources to define these flat views, automatically creating and maintaining them to ensure they stay synchronized with the underlying FHIR data while providing the performance benefits of PostgreSQL's query optimizer.

See also:

* [SQL-on-FHIR](../modules/sql-on-fhir/)
* [SQL-on-FHIR Specification](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/)
* [SQL-on-FHIR Specification](https://build.fhir.org/ig/HL7/sql-on-fhir/)

### SQL APIs

Expand Down
6 changes: 3 additions & 3 deletions docs/database/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This article explains how Aidbox stores and manages healthcare data using Postgr

* **FHIR resource storage** - How Aidbox uses PostgreSQL's JSONB columns for efficient hierarchical data storage
* **CRUD operations** - Creating, reading, updating, and deleting resources with automatic history tracking
* **Data querying** - Three approaches: [FHIR search](https://www.hl7.org/fhir/search.html), direct SQL, and [SQL on FHIR](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/)
* **Data querying** - Three approaches: [FHIR search](https://www.hl7.org/fhir/search.html), direct SQL, and [SQL on FHIR](https://build.fhir.org/ig/HL7/sql-on-fhir/)
* **PostgreSQL requirements** - Supported versions and deployment options

Whether you're implementing clinical workflows, building analytics dashboards, or optimizing database performance, this guide provides the technical foundation you need to work effectively with Aidbox's database layer.
Expand Down Expand Up @@ -428,7 +428,7 @@ See also:

## How to query data?

Healthcare data analysis requires flexible querying capabilities that can handle both clinical workflows and analytical use cases. Aidbox provides three primary approaches for data access: FHIR search for clinical operations, direct SQL for complex queries, and [SQL on FHIR](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/) for analytics workflows.
Healthcare data analysis requires flexible querying capabilities that can handle both clinical workflows and analytical use cases. Aidbox provides three primary approaches for data access: FHIR search for clinical operations, direct SQL for complex queries, and [SQL on FHIR](https://build.fhir.org/ig/HL7/sql-on-fhir/) for analytics workflows.

This section explains how each approach works, when to use them, and how they leverage PostgreSQL's JSONB capabilities to provide efficient data access across millions of healthcare records.

Expand Down Expand Up @@ -552,7 +552,7 @@ See also:

### SQL on FHIR

[SQL on FHIR](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/) is a FHIR specification that defines how to
[SQL on FHIR](https://build.fhir.org/ig/HL7/sql-on-fhir/) is a FHIR specification that defines how to
transform nested FHIR resources into flat, tabular views optimized for analytics.
Aidbox implements this specification using ViewDefinition resources that create PostgreSQL views.

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/sql-on-fhir/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: Create flat SQL views from FHIR resources using ViewDefinitions for
Starting from version **2604**, SQL on FHIR requires **fhir-schema mode** (`fhir.validation.fhir-schema-validation=true`). ViewDefinitions are stored in the FHIR Artifact Registry (FAR), which is only available in fhir-schema mode. Without it, ViewDefinition CRUD, `$run`, `$sql`, and `$materialize` operations will not work.
{% endhint %}

Performing analysis on FHIR data requires extracting data from deeply nested structures of resources, which may be cumbersome in some cases. To address this problem, Aidbox implements [SQL on FHIR](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/index.html) specification allowing users to create flat views of their resources in a simple, straightforward way
Performing analysis on FHIR data requires extracting data from deeply nested structures of resources, which may be cumbersome in some cases. To address this problem, Aidbox implements [SQL on FHIR](https://build.fhir.org/ig/HL7/sql-on-fhir/index.html) specification allowing users to create flat views of their resources in a simple, straightforward way

## Create View Definitions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ View definitions you've created can be viewed in a menu in the right part of the

You can use the _Run_ button or `Ctrl+Enter` to preview your view. To save a View Definition and materialize it as a view in the database, press _Save_. _The delete_ button deletes both a View Definition and the corresponding view in the database.

Note that a ViewDefinition resource used in Aidbox may differ from [SQL on FHIR specification](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/StructureDefinition-ViewDefinition.html). To see how Aidbox's ViewDefinition is structured, consult the [reference.md](reference.md) page.
Note that a ViewDefinition resource used in Aidbox may differ from [SQL on FHIR specification](https://build.fhir.org/ig/HL7/sql-on-fhir/StructureDefinition-ViewDefinition.html). To see how Aidbox's ViewDefinition is structured, consult the [reference.md](reference.md) page.

### With REST API

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/sql-on-fhir/operation-sqlquery-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This functionality is available in Aidbox versions 2605 and later.

SQL on FHIR provides the `$sqlquery-run` operation to execute a SQLQuery Library synchronously against ViewDefinition tables. The operation resolves dependencies declared in `relatedArtifact` and exposes each one to SQL as a table named after its `label`, binds input parameters to `:name` placeholders in SQL, runs the query, and streams the result in the requested format.

SQL on FHIR specification [defines $sqlquery-run operation](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/OperationDefinition-SQLQueryRun.html).
SQL on FHIR specification [defines $sqlquery-run operation](https://build.fhir.org/ig/HL7/sql-on-fhir/OperationDefinition-SQLQueryRun.html).

## SQLQuery Library

Expand All @@ -23,7 +23,7 @@ SQLQuery is a profile on `Library` that bundles SQL, dependencies, and parameter
- **`type`** — fixed coding `https://sql-on-fhir.org/ig/CodeSystem/LibraryTypesCodes#sql-query`.
- **`parameter`** — declared input parameters. Each parameter has `name`, `use = "in"`, and FHIR `type` (`string`, `integer`, `boolean`, `decimal`, `date`, `dateTime`).
- **`relatedArtifact`** — dependencies of `type = "depends-on"`. The `resource` is a canonical URL pointing to a ViewDefinition or another SQLQuery Library; the `label` becomes the table name used in SQL.
- **`content`** — one or more SQL attachments. `content.contentType` starts with `application/sql`; `content.data` is the base64-encoded SQL. The optional [sql-text](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/StructureDefinition-sql-text.html) extension carries a plain-text copy for human readability. When several attachments are provided, Aidbox prefers `application/sql;dialect=postgresql` and falls back to `application/sql`.
- **`content`** — one or more SQL attachments. `content.contentType` starts with `application/sql`; `content.data` is the base64-encoded SQL. The optional [sql-text](https://build.fhir.org/ig/HL7/sql-on-fhir/StructureDefinition-sql-text.html) extension carries a plain-text copy for human readability. When several attachments are provided, Aidbox prefers `application/sql;dialect=postgresql` and falls back to `application/sql`.

A minimal SQLQuery Library looks like this:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Async bulk export of a ViewDefinition's materialized rows to a back
# $viewdefinition-export operation

{% hint style="info" %}
Available in Aidbox versions **2605** and later. Requires **fhir-schema mode**. Implements [SQL-on-FHIR v2 `$viewdefinition-export`](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/OperationDefinition-ViewDefinitionExport.html).
Available in Aidbox versions **2605** and later. Requires **fhir-schema mode**. Implements [SQL-on-FHIR v2 `$viewdefinition-export`](https://build.fhir.org/ig/HL7/sql-on-fhir/OperationDefinition-ViewDefinitionExport.html).
{% endhint %}

Exports ViewDefinition results to a destination. Use `kind` to choose the Aidbox module backend.
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/sql-on-fhir/query-data-from-flat-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ From here, you can use your flat views however you like. Popular use cases inclu

### Get all patients diagnosed with COVID after a specified date

ViewDefinitions do not directly implement [joins](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/StructureDefinition-ViewDefinition.html#joins-with-resource-and-reference-keys) across resources. Therefore, to find all patients who was born after or in 1970 and who were diagnosed with COVID after or in 2021, you'll need to define 2 views.
ViewDefinitions do not directly implement [joins](https://build.fhir.org/ig/HL7/sql-on-fhir/StructureDefinition-ViewDefinition.html#joins-with-resource-and-reference-keys) across resources. Therefore, to find all patients who was born after or in 1970 and who were diagnosed with COVID after or in 2021, you'll need to define 2 views.

{% tabs %}
{% tab title="Patient View" %}
Expand Down
6 changes: 3 additions & 3 deletions docs/overview/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ Minor updates:
* Introduced dynamic [Topic-based subscriptions](../modules/topic-based-subscriptions/aidbox-topic-based-subscriptions.md) and supported [Kafka (OSS and AWS)](../tutorials/subscriptions-tutorials/kafka-aidboxtopicdestination.md) as delivery channels
* Released a [demo of publishing a completed QuestionnaireResponse to Kafka topic](https://github.com/Aidbox/examples/tree/main/aidbox-features/aidbox-subscriptions-to-kafka)
* Added an option to connect a self-hosted Aidbox instance to the [ViewDefinition builder](https://sqlonfhir.aidbox.app/?utm_source=aidbox-docs\&utm_medium=release-notes)
* Enhanced [SQL on FHIR spec coverage](https://fhir.github.io/sql-on-fhir-v2)
* Enhanced [SQL on FHIR spec coverage](https://sql-on-fhir.org/extra/impls.html)
* Supported [Audit logging](../access-control/audit-and-logging.md) using external identity providers
* [Aidbox Forms](https://www.health-samurai.io/docs/formbox)
* UI builder updates (FHIR Questionnaire-based):
Expand Down Expand Up @@ -722,7 +722,7 @@ Minor updates:
## March 2024 _`2403`_

* SQL on FHIR engine
* Enhanced [SQL on FHIR® (v2.0) spec](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/index.html) test coverage. The SQL on FHIR coverage report is available[ here](https://fhir.github.io/sql-on-fhir-v2).
* Enhanced [SQL on FHIR® (v2.0) spec](https://build.fhir.org/ig/HL7/sql-on-fhir/index.html) test coverage. The SQL on FHIR coverage report is available[ here](https://sql-on-fhir.org/extra/impls.html).
* Validation
* Released [FHIR schema validation engine](../modules/profiling-and-validation/fhir-schema-validator/) (alpha). This validation engine is set to replace the existing [Zen Schema](../deprecated/deprecated/zen-related/profiling-with-zen-lang/) and JSON Schema validation engines.
* Launched FHIR IGs Repository (alpha). Aidbox now lets you introspect and load FHIR IGs directly from a mirrored version of **packages2.fhir.org** into your Aidbox instance, either through the UI or configuration files
Expand Down Expand Up @@ -772,7 +772,7 @@ Minor updates:
## January 2024 _`2401`_

* Data API
* Supported [ViewDefinition resource structure](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/StructureDefinition-ViewDefinition.html) according to the latest [SQL on FHIR specification](https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/index.html). These changes don’t affect existing views. Please check [this guide](../modules/sql-on-fhir/migrate-to-the-spec-compliant-viewdefinition-format.md) to update ViewDefinitions
* Supported [ViewDefinition resource structure](https://build.fhir.org/ig/HL7/sql-on-fhir/StructureDefinition-ViewDefinition.html) according to the latest [SQL on FHIR specification](https://build.fhir.org/ig/HL7/sql-on-fhir/index.html). These changes don’t affect existing views. Please check [this guide](../modules/sql-on-fhir/migrate-to-the-spec-compliant-viewdefinition-format.md) to update ViewDefinitions
* SDK
* Added basic FHIR Profiles support to [Python SDK](https://github.com/Aidbox/aidbox-python)
* Security and access control
Expand Down
Loading