pub struct ValueSetManager { /* private fields */ }Expand description
Manages FHIR ValueSets and their conversion to Rust enums
Implementations§
Source§impl ValueSetManager
impl ValueSetManager
pub fn new() -> Self
pub fn new_with_directory<P: AsRef<Path>>(value_set_dir: P) -> Self
Sourcepub fn generate_enum_name(&self, value_set_url: &str) -> String
pub fn generate_enum_name(&self, value_set_url: &str) -> String
Generate a Rust enum name from a ValueSet URL
Sourcepub fn get_enum_name(&self, value_set_url: &str) -> Option<&String>
pub fn get_enum_name(&self, value_set_url: &str) -> Option<&String>
Get the enum name for a cached ValueSet
Sourcepub fn cache_value_set(
&mut self,
value_set_url: String,
enum_name: String,
rust_enum: RustEnum,
)
pub fn cache_value_set( &mut self, value_set_url: String, enum_name: String, rust_enum: RustEnum, )
Cache a ValueSet with its generated enum
Sourcepub fn get_cached_enums(&self) -> &HashMap<String, RustEnum>
pub fn get_cached_enums(&self) -> &HashMap<String, RustEnum>
Get all cached enums
Sourcepub fn get_value_set_codes(
&self,
value_set_url: &str,
version: Option<&str>,
) -> Result<Vec<(String, Option<String>)>, String>
pub fn get_value_set_codes( &self, value_set_url: &str, version: Option<&str>, ) -> Result<Vec<(String, Option<String>)>, String>
Get available codes from a ValueSet for documentation purposes Returns a list of (code, display) tuples
Sourcepub fn generate_enum_from_value_set(
&mut self,
value_set_url: &str,
version: Option<&str>,
) -> Result<String, String>
pub fn generate_enum_from_value_set( &mut self, value_set_url: &str, version: Option<&str>, ) -> Result<String, String>
Generate enum from ValueSet, trying expansion first, then compose
Sourcepub fn generate_placeholder_enum(&mut self, value_set_url: &str) -> String
pub fn generate_placeholder_enum(&mut self, value_set_url: &str) -> String
Generate a basic enum for unknown ValueSets (fallback)
Trait Implementations§
Source§impl Clone for ValueSetManager
impl Clone for ValueSetManager
Source§fn clone(&self) -> ValueSetManager
fn clone(&self) -> ValueSetManager
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 moreSource§impl Debug for ValueSetManager
impl Debug for ValueSetManager
Auto Trait Implementations§
impl Freeze for ValueSetManager
impl RefUnwindSafe for ValueSetManager
impl Send for ValueSetManager
impl Sync for ValueSetManager
impl Unpin for ValueSetManager
impl UnsafeUnpin for ValueSetManager
impl UnwindSafe for ValueSetManager
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