Skip to main content

Crate helios_fhir

Crate helios_fhir 

Source
Expand description

§FHIR Model Infrastructure

This module provides the foundational types and infrastructure that support the generated FHIR specification implementations. It contains hand-coded types that enable the generated code to handle FHIR’s complex requirements for precision, extensions, and cross-version compatibility.

§Architecture

The FHIR crate is organized as follows:

  • Generated modules (r4.rs, r4b.rs, r5.rs, r6.rs): Complete FHIR type implementations
  • Infrastructure module (lib.rs): Foundational types used by generated code
  • Test modules: Validation against official FHIR examples

§Key Infrastructure Types

§Usage Example

use helios_fhir::r4::{Patient, HumanName};
use helios_fhir::PreciseDecimal;
use rust_decimal::Decimal;

// Create a patient with precise decimal handling
let patient = Patient {
    name: Some(vec![HumanName {
        family: Some("Doe".to_string().into()),
        given: Some(vec!["John".to_string().into()]),
        ..Default::default()
    }]),
    ..Default::default()
};

// Work with precise decimals
let precise = PreciseDecimal::from(Decimal::new(12340, 3)); // 12.340

Re-exports§

pub use parameters::ParameterValueAccessor;
pub use parameters::VersionIndependentParameters;

Modules§

parameters
Version-independent FHIR Parameters resource wrapper
r4
FHIR R4 (4.0.1) - generated type definitions
r5
FHIR R5 (5.0.0) - generated type definitions
r6
FHIR R6 (current) - generated type definitions
r4b
FHIR R4B (4.3.0) - generated type definitions

Structs§

DecimalElement
Specialized element container for FHIR decimal values with precision preservation.
Element
Generic element container supporting FHIR’s extension mechanism.
PreciseDecimal
High-precision decimal type that preserves original string representation.
PrecisionDate
Precision-aware FHIR Date type.
PrecisionDateTime
Precision-aware FHIR DateTime type.
PrecisionInstant
A FHIR instant value that preserves the original string representation and precision.
PrecisionTime
Precision-aware FHIR Time type.

Enums§

DatePrecision
Precision levels for FHIR Date values.
DateTimePrecision
Precision levels for FHIR DateTime values.
FhirVersion
Enumeration of supported FHIR specification versions.
TimePrecision
Precision levels for FHIR Time values.

Traits§

FhirComplexTypeProvider
Trait for providing FHIR complex type information
FhirResourceTypeProvider
Trait for providing FHIR resource type information

Functions§

deserialize_forgiving_option
Custom deserializer that is more forgiving of null values in JSON.