Skip to main content

ViewDefinitionSelectTrait

Trait ViewDefinitionSelectTrait 

Source
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 repeat(&self) -> Option<Vec<&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 version
  • Select: 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: forEach and forEachOrNull for processing collections
  • Union Operations: unionAll for 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§

Source

type Column: ViewDefinitionColumnTrait

The column definition type for this FHIR version

Source

type Select: ViewDefinitionSelectTrait

Recursive select type for nested structures

Required Methods§

Source

fn column(&self) -> Option<&[Self::Column]>

Returns the column definitions for this select statement

Source

fn select(&self) -> Option<&[Self::Select]>

Returns nested select statements for hierarchical processing

Source

fn for_each(&self) -> Option<&str>

Returns the FHIRPath expression for forEach iteration (filters out empty collections)

Source

fn for_each_or_null(&self) -> Option<&str>

Returns the FHIRPath expression for forEachOrNull iteration (includes null rows for empty collections)

Source

fn repeat(&self) -> Option<Vec<&str>>

Returns FHIRPath expressions for recursive traversal with the repeat directive

Source

fn union_all(&self) -> Option<&[Self::Select]>

Returns select statements to union with this one (all results combined)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ViewDefinitionSelectTrait for ViewDefinitionSelect

Implementors§