pub enum SofBundle {
R4(Bundle),
}Expand description
Multi-version Bundle container supporting version-agnostic operations.
This enum provides a unified interface for working with FHIR Bundle resources across different FHIR specification versions. Bundles contain the actual FHIR resources that will be processed by ViewDefinitions.
§Supported Versions
- R4: FHIR 4.0.1 Bundle (normative)
- R4B: FHIR 4.3.0 Bundle (ballot)
- R5: FHIR 5.0.0 Bundle (ballot)
- R6: FHIR 6.0.0 Bundle (draft)
§Examples
use helios_sof::SofBundle;
use helios_fhir::r4::Bundle;
// Parse from JSON
let json = r#"{
"resourceType": "Bundle",
"type": "collection",
"entry": [{
"resource": {
"resourceType": "Patient",
"id": "example"
}
}]
}"#;
let bundle: Bundle = serde_json::from_str(json)?;
let sof_bundle = SofBundle::R4(bundle);
// Check version compatibility
assert_eq!(sof_bundle.version(), helios_fhir::FhirVersion::R4);Variants§
Implementations§
Source§impl SofBundle
impl SofBundle
Sourcepub fn version(&self) -> FhirVersion
pub fn version(&self) -> FhirVersion
Returns the FHIR specification version of this Bundle.
This method provides version detection for multi-version applications, ensuring that ViewDefinitions and Bundles use compatible FHIR versions.
§Returns
The FhirVersion enum variant corresponding to this Bundle’s specification.
§Examples
use helios_sof::SofBundle;
use helios_fhir::FhirVersion;
let sof_bundle = SofBundle::R4(bundle);
assert_eq!(sof_bundle.version(), helios_fhir::FhirVersion::R4);Trait Implementations§
Auto Trait Implementations§
impl Freeze for SofBundle
impl RefUnwindSafe for SofBundle
impl Send for SofBundle
impl Sync for SofBundle
impl Unpin for SofBundle
impl UnwindSafe for SofBundle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more