Skip to main content

Module sqlquery

Module sqlquery 

Source
Expand description

SQL-on-FHIR v2 $sqlquery-run engine.

Pure execution logic: parse a SQLQuery Library, materialize its depends-on ViewDefinitions into an in-memory SQLite database, bind Library.parameter values to the SQL, run the user query, and format the rows.

The REST handler in helios-rest wires this to storage (resolving Library / ViewDefinition resources and supplying RowStreams from the wired SofRunner); this module contains no storage or HTTP concerns.

Re-exports§

pub use bind::BoundParam;
pub use bind::bind_supplied_params;
pub use engine::ColumnFhirType;
pub use engine::InMemorySqlEngine;
pub use engine::QueryResult;
pub use engine::TableSchema;
pub use library::DependsOnView;
pub use library::LibraryParameter;
pub use library::SqlQueryLibrary;
pub use library::parse_sqlquery_library;
pub use output::format_fhir_parameters;
pub use params::SqlQueryRunParams;
pub use params::extract_sqlquery_params_from_json;

Modules§

bind
Bind values from a supplied Parameters resource to Library.parameter declarations, using FHIR type codes to choose the right rusqlite value.
engine
In-memory SQLite engine used by $sqlquery-run.
library
Parse a SQLQuery Library (FHIR Library profile) into the parts the engine needs: the SQL string, parameter declarations, and depends-on ViewDefinitions.
output
Output formatting for $sqlquery-run.
params
Parse the FHIR Parameters body for $sqlquery-run.

Enums§

SqlQueryError
Errors produced by the $sqlquery-run pipeline.