Skip to main content

haste_fhir_model/r4/
mod.rs

1use crate::r4::generated::resources::RUST_TO_FHIR_TYPE_MAP;
2use haste_reflect::MetaValue;
3
4pub mod datetime;
5#[cfg(feature = "sqlx")]
6pub mod sqlx;
7// pub mod terminology;
8pub mod conversion;
9pub mod generated;
10
11/// Helper function to get the FHIR type from a MetaValue
12/// Internally on types we generate hashmap of rust type name to FHIR type, so we can use that to get the FHIR type for a given MetaValue.
13pub fn get_fhir_type(value: &dyn MetaValue) -> Option<&'static str> {
14    RUST_TO_FHIR_TYPE_MAP.get(value.typename()).map(|s| *s)
15}