pub enum SofViewDefinition {
R4(ViewDefinition),
}Expand description
Multi-version ViewDefinition container supporting version-agnostic operations.
This enum provides a unified interface for working with ViewDefinition resources across different FHIR specification versions. It enables applications to handle multiple FHIR versions simultaneously while maintaining type safety.
§Supported Versions
- R4: FHIR 4.0.1 ViewDefinition (normative)
- R4B: FHIR 4.3.0 ViewDefinition (ballot)
- R5: FHIR 5.0.0 ViewDefinition (ballot)
- R6: FHIR 6.0.0 ViewDefinition (draft)
§Examples
use helios_sof::{SofViewDefinition, ContentType};
use helios_fhir::r4::ViewDefinition;
// Parse from JSON
let json = r#"{
"resourceType": "ViewDefinition",
"resource": "Patient",
"select": [{
"column": [{
"name": "id",
"path": "id"
}]
}]
}"#;
let view_def: ViewDefinition = serde_json::from_str(json)?;
let sof_view = SofViewDefinition::R4(view_def);
// Check version
assert_eq!(sof_view.version(), helios_fhir::FhirVersion::R4);Variants§
R4(ViewDefinition)
Implementations§
Source§impl SofViewDefinition
impl SofViewDefinition
Sourcepub fn version(&self) -> FhirVersion
pub fn version(&self) -> FhirVersion
Returns the FHIR specification version of this ViewDefinition.
This method provides version detection for multi-version applications, enabling version-specific processing logic and compatibility checks.
§Returns
The FhirVersion enum variant corresponding to this ViewDefinition’s specification.
§Examples
use helios_sof::SofViewDefinition;
use helios_fhir::FhirVersion;
let sof_view = SofViewDefinition::R5(view_def);
assert_eq!(sof_view.version(), helios_fhir::FhirVersion::R5);Trait Implementations§
Source§impl Clone for SofViewDefinition
impl Clone for SofViewDefinition
Source§fn clone(&self) -> SofViewDefinition
fn clone(&self) -> SofViewDefinition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SofViewDefinition
impl RefUnwindSafe for SofViewDefinition
impl Send for SofViewDefinition
impl Sync for SofViewDefinition
impl Unpin for SofViewDefinition
impl UnwindSafe for SofViewDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more