pub enum FhirVersion {
R4,
}Expand description
Enumeration of supported FHIR specification versions.
This enum represents the different versions of the FHIR (Fast Healthcare Interoperability Resources) specification that this library supports. Each version represents a specific release of the FHIR standard with its own set of features, resources, and compatibility requirements.
§Version Status
- R4 (4.0.1): Normative version, widely adopted in production
- R4B (4.3.0): Ballot version with additional features
- R5 (5.0.0): Ballot version with significant enhancements
- R6 (6.0.0): Draft version under active development
§Feature Flags
Each version is controlled by a corresponding Cargo feature flag:
R4: Enables FHIR R4 supportR4B: Enables FHIR R4B supportR5: Enables FHIR R5 supportR6: Enables FHIR R6 support
§Examples
use helios_fhir::FhirVersion;
// Version comparison
assert_ne!(FhirVersion::R4, FhirVersion::R5);
// String representation
let version = FhirVersion::R4;
assert_eq!(version.as_str(), "R4");
assert_eq!(version.to_string(), "R4");§CLI Integration
This enum implements clap::ValueEnum for command-line argument parsing:
use clap::Parser;
use helios_fhir::FhirVersion;
#[derive(Parser)]
struct Args {
#[arg(value_enum)]
version: FhirVersion,
}Variants§
R4
FHIR 4.0.1 (normative) - The current normative version
Implementations§
Source§impl FhirVersion
impl FhirVersion
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Returns the string representation of the FHIR version.
This method provides the standard version identifier as used in FHIR documentation, URLs, and configuration files.
§Returns
A static string slice representing the version (e.g., “R4”, “R5”).
§Examples
use helios_fhir::FhirVersion;
assert_eq!(FhirVersion::R4.as_str(), "R4");
assert_eq!(FhirVersion::R5.as_str(), "R5");§Usage
This method is commonly used for:
- Logging and debugging output
- Configuration file parsing
- API endpoint construction
- Version-specific resource loading
Trait Implementations§
Source§impl Clone for FhirVersion
impl Clone for FhirVersion
Source§fn clone(&self) -> FhirVersion
fn clone(&self) -> FhirVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FhirVersion
impl Debug for FhirVersion
Source§impl Default for FhirVersion
Provides a default FHIR version when R4 feature is enabled.
impl Default for FhirVersion
Provides a default FHIR version when R4 feature is enabled.
R4 is chosen as the default because it is the current normative version of the FHIR specification and is widely adopted in production systems.
§Examples
use helios_fhir::FhirVersion;
let default_version = FhirVersion::default();
assert_eq!(default_version, FhirVersion::R4);Source§fn default() -> FhirVersion
fn default() -> FhirVersion
Source§impl Display for FhirVersion
Implements Display trait for user-friendly output formatting.
impl Display for FhirVersion
Implements Display trait for user-friendly output formatting.
This enables FhirVersion to be used in string formatting operations
and provides consistent output across different contexts.
§Examples
use helios_fhir::FhirVersion;
let version = FhirVersion::R5;
println!("Using FHIR version: {}", version); // Prints: "Using FHIR version: R5"
let formatted = format!("fhir-{}.json", version);
assert_eq!(formatted, "fhir-R5.json");Source§impl Hash for FhirVersion
impl Hash for FhirVersion
Source§impl PartialEq for FhirVersion
impl PartialEq for FhirVersion
Source§impl ValueEnum for FhirVersion
Implements clap::ValueEnum for command-line argument parsing.
impl ValueEnum for FhirVersion
Implements clap::ValueEnum for command-line argument parsing.
This implementation enables FhirVersion to be used directly as a command-line
argument type with clap, providing automatic parsing, validation, and help text
generation.
§Examples
use clap::Parser;
use helios_fhir::FhirVersion;
#[derive(Parser)]
struct Args {
/// FHIR specification version to use
#[arg(value_enum, default_value_t = FhirVersion::default())]
version: FhirVersion,
}
// Command line: my-app --version R5
let args = Args::parse();
println!("Using FHIR version: {}", args.version);§Generated Help Text
When using this enum with clap, the help text will automatically include all available FHIR versions based on enabled feature flags.
Source§fn value_variants<'a>() -> &'a [FhirVersion]
fn value_variants<'a>() -> &'a [FhirVersion]
Source§fn to_possible_value(&self) -> Option<PossibleValue>
fn to_possible_value(&self) -> Option<PossibleValue>
impl Copy for FhirVersion
impl Eq for FhirVersion
impl StructuralPartialEq for FhirVersion
Auto Trait Implementations§
impl Freeze for FhirVersion
impl RefUnwindSafe for FhirVersion
impl Send for FhirVersion
impl Sync for FhirVersion
impl Unpin for FhirVersion
impl UnwindSafe for FhirVersion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.