FhirVersion

Enum FhirVersion 

Source
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 support
  • R4B: Enables FHIR R4B support
  • R5: Enables FHIR R5 support
  • R6: 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

Source

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

Source§

fn clone(&self) -> FhirVersion

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FhirVersion

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

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

Returns the “default value” for a type. Read more
Source§

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§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Hash for FhirVersion

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FhirVersion

Source§

fn eq(&self, other: &FhirVersion) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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]

All possible argument values, in display order.
Source§

fn to_possible_value(&self) -> Option<PossibleValue>

The canonical argument value. Read more
Source§

fn from_str(input: &str, ignore_case: bool) -> Result<Self, String>

Parse an argument into Self.
Source§

impl Copy for FhirVersion

Source§

impl Eq for FhirVersion

Source§

impl StructuralPartialEq for FhirVersion

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Chain<T> for T

Source§

fn len(&self) -> usize

The number of items that this chain link consists of.
Source§

fn append_to(self, v: &mut Vec<T>)

Append the elements in this link to the chain.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Container<T> for T
where T: Clone,

Source§

type Iter = Once<T>

An iterator over the items within this container, by value.
Source§

fn get_iter(&self) -> <T as Container<T>>::Iter

Iterate over the elements of the container (using internal iteration because GATs are unstable).
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> OrderedContainer<T> for T
where T: Clone,