pub trait ViewDefinitionTrait {
type Select: ViewDefinitionSelectTrait;
type Where: ViewDefinitionWhereTrait;
type Constant: ViewDefinitionConstantTrait;
// Required methods
fn resource(&self) -> Option<&str>;
fn select(&self) -> Option<&[Self::Select]>;
fn where_clauses(&self) -> Option<&[Self::Where]>;
fn constants(&self) -> Option<&[Self::Constant]>;
}Expand description
Trait for abstracting ViewDefinition across FHIR versions.
This trait provides version-agnostic access to ViewDefinition components, enabling the core processing logic to work uniformly across R4, R4B, R5, and R6 specifications. Each FHIR version implements this trait to expose its ViewDefinition structure through a common interface.
§Associated Types
Select: The select statement type for this FHIR versionWhere: The where clause type for this FHIR versionConstant: The constant definition type for this FHIR version
§Examples
use helios_sof::traits::ViewDefinitionTrait;
fn process_any_version<T: ViewDefinitionTrait>(vd: &T) {
if let Some(resource_type) = vd.resource() {
println!("Processing {} resources", resource_type);
}
if let Some(selects) = vd.select() {
println!("Found {} select statements", selects.len());
}
}Required Associated Types§
Sourcetype Select: ViewDefinitionSelectTrait
type Select: ViewDefinitionSelectTrait
The select statement type for this FHIR version
Sourcetype Where: ViewDefinitionWhereTrait
type Where: ViewDefinitionWhereTrait
The where clause type for this FHIR version
Sourcetype Constant: ViewDefinitionConstantTrait
type Constant: ViewDefinitionConstantTrait
The constant definition type for this FHIR version
Required Methods§
Sourcefn resource(&self) -> Option<&str>
fn resource(&self) -> Option<&str>
Returns the FHIR resource type this ViewDefinition processes
Sourcefn select(&self) -> Option<&[Self::Select]>
fn select(&self) -> Option<&[Self::Select]>
Returns the select statements that define output columns and structure
Sourcefn where_clauses(&self) -> Option<&[Self::Where]>
fn where_clauses(&self) -> Option<&[Self::Where]>
Returns the where clauses that filter resources before processing