openehr-lang 0.0.2

openEHR LANG 1.0.0: BMM/P_BMM object model (generated from BMM) plus a hand-written ODIN instance parser (the `odin` module — deliberately off the codegen path).
Documentation
// @generated by openehr-codegen from BMM (`BMM_CONSTANT`) — DO NOT EDIT.

//! The openEHR `BMM_CONSTANT` spec class, generated from the vendored BMM
//! meta-model.

#![expect(
    clippy::disallowed_types,
    reason = "adjudicated free-form JSON slots: serde_json::Value is workspace-banned (#1694); a generated carrier exists only where the spec leaves the slot open, and each adjudicated field's NOTE names its citation"
)]
use crate::bmm3::core::entity::bmm_type::BmmType;
use crate::bmm3::core::feature::bmm_feature_extension::BmmFeatureExtension;
use crate::bmm3::core::feature::bmm_feature_group::BmmFeatureGroup;
use crate::bmm3::core::literal_value::bmm_literal_value::BmmLiteralValue;

/// An immutable, static value-returning element scoped to a class.
///
/// The `_value_` is the result of the evaluation of the `_generator_`, which may be as simple as a literal value, or may be any expression, including a function call.
#[doc(alias = "BMM_CONSTANT")]
#[derive(Debug, Clone, PartialEq)]
pub struct BmmConstant {
    // inherited: BMM_MODEL_ELEMENT
    /// Name of this model element.
    pub name: String,
    /// Optional documentation of this element, as a keyed list.
    ///
    /// It is strongly recommended to use the following key /type combinations for the relevant purposes:
    ///
    /// * `"purpose": String`
    /// * `"keywords": List<String>`
    /// * `"use": String`
    /// * `"misuse": String`
    /// * `"references": String`
    ///
    /// Other keys and value types may be freely added.
    pub documentation: Option<std::collections::BTreeMap<String, serde_json::Value>>,
    // NOTE: `scope` (BMM-mandatory back-reference) omitted — LANG BMM3 bmm_feature (scope: BMM_CLASS — redefinition of BMM_MODEL_ELEMENT.scope). A back-reference is not forward-owned data and never appears on the canonical wire; emitting it as an owning field would make this type non-constructible.
    /// Optional meta-data of this element, as a keyed list. May be used to extend the meta-model.
    pub extensions: Option<std::collections::BTreeMap<String, serde_json::Value>>,

    // inherited: BMM_FORMAL_ELEMENT
    /// Declared or inferred static type of the entity.
    pub r#type: BmmType,
    /// True if this element can be null (Void) at execution time. May be interpreted as optionality in subtypes..
    pub is_nullable: Option<bool>,

    // inherited: BMM_FEATURE
    /// True if this feature was synthesised due to generic substitution in an inherited type, or further constraining of a formal generic parameter.
    pub is_synthesised_generic: Option<bool>,
    /// Extensions to feature-level meta-types.
    pub feature_extensions: Option<Vec<BmmFeatureExtension>>,
    /// Group containing this feature.
    pub group: BmmFeatureGroup,
    /// Literal value of the constant.
    pub generator: BmmLiteralValue,
}