Skip to main content

ViewDefinitionColumnTrait

Trait ViewDefinitionColumnTrait 

Source
pub trait ViewDefinitionColumnTrait {
    // Required methods
    fn name(&self) -> Option<&str>;
    fn path(&self) -> Option<&str>;
    fn collection(&self) -> Option<bool>;
}
Expand description

Trait for abstracting ViewDefinitionColumn across FHIR versions.

This trait provides version-agnostic access to column definitions, which specify how to extract data from FHIR resources and map it to output table columns. Columns are the fundamental building blocks of ViewDefinition output structure.

§Key Properties

  • Name: The output column name in the result table
  • Path: The FHIRPath expression to extract the value
  • Collection: Whether this column contains array/collection values

§Examples

use helios_sof::traits::ViewDefinitionColumnTrait;

fn describe_column<T: ViewDefinitionColumnTrait>(col: &T) {
    if let Some(name) = col.name() {
        print!("Column '{}'", name);
         
        if let Some(path) = col.path() {
            print!(" from path '{}'", path);
        }
         
        if col.collection() == Some(true) {
            print!(" (collection)");
        }
         
        println!();
    }
}

Required Methods§

Source

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

Returns the name of this column in the output table

Source

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

Returns the FHIRPath expression to extract the column value

Source

fn collection(&self) -> Option<bool>

Returns whether this column should contain collection/array values

Implementations on Foreign Types§

Source§

impl ViewDefinitionColumnTrait for ViewDefinitionSelectColumn

Source§

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

Source§

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

Source§

fn collection(&self) -> Option<bool>

Implementors§