pub trait ViewDefinitionSelectTrait {
type Column: ViewDefinitionColumnTrait;
type Select: ViewDefinitionSelectTrait;
// Required methods
fn column(&self) -> Option<&[Self::Column]>;
fn select(&self) -> Option<&[Self::Select]>;
fn for_each(&self) -> Option<&str>;
fn for_each_or_null(&self) -> Option<&str>;
fn union_all(&self) -> Option<&[Self::Select]>;
}Expand description
Trait for abstracting ViewDefinitionSelect across FHIR versions.
This trait provides version-agnostic access to select statement components, including columns, nested selects, iteration constructs, and union operations. Select statements define the structure and content of the output table.
§Associated Types
Column: The column definition type for this FHIR versionSelect: Recursive select type for nested structures
§Key Features
- Column Definitions: Direct column mappings from FHIRPath to output
- Nested Selects: Hierarchical select structures for complex transformations
- Iteration:
forEachandforEachOrNullfor processing collections - Union Operations:
unionAllfor combining multiple select results
§Examples
use helios_sof::traits::ViewDefinitionSelectTrait;
fn analyze_select<T: ViewDefinitionSelectTrait>(select: &T) {
if let Some(columns) = select.column() {
println!("Found {} columns", columns.len());
}
if let Some(for_each) = select.for_each() {
println!("Iterating over: {}", for_each);
}
if let Some(union_selects) = select.union_all() {
println!("Union with {} other selects", union_selects.len());
}
}Required Associated Types§
Sourcetype Column: ViewDefinitionColumnTrait
type Column: ViewDefinitionColumnTrait
The column definition type for this FHIR version
Sourcetype Select: ViewDefinitionSelectTrait
type Select: ViewDefinitionSelectTrait
Recursive select type for nested structures
Required Methods§
Sourcefn column(&self) -> Option<&[Self::Column]>
fn column(&self) -> Option<&[Self::Column]>
Returns the column definitions for this select statement
Sourcefn select(&self) -> Option<&[Self::Select]>
fn select(&self) -> Option<&[Self::Select]>
Returns nested select statements for hierarchical processing
Sourcefn for_each(&self) -> Option<&str>
fn for_each(&self) -> Option<&str>
Returns the FHIRPath expression for forEach iteration (filters out empty collections)
Sourcefn for_each_or_null(&self) -> Option<&str>
fn for_each_or_null(&self) -> Option<&str>
Returns the FHIRPath expression for forEachOrNull iteration (includes null rows for empty collections)