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_PROCEDURE`) — DO NOT EDIT.

//! The openEHR `BMM_PROCEDURE` 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_status_type::BmmStatusType;
use crate::bmm3::core::feature::bmm_feature_extension::BmmFeatureExtension;
use crate::bmm3::core::feature::bmm_feature_group::BmmFeatureGroup;
use crate::bmm3::core::feature::bmm_parameter::BmmParameter;
use crate::bmm3::core::feature::bmm_routine_definition::BmmRoutineDefinition;
use crate::bmm3::statement::bmm_assertion::BmmAssertion;

/// A formal element with signature of the form: `name ({arg:TArg}*):TStatus`, where `TStatus` is the built-in type `BMM_STATUS_TYPE`..
///
/// A procedure is a computed (rather than data) element, generally assumed to be state-changing, and is usually called in the form `name ({arg:TArg}*)`.
#[doc(alias = "BMM_PROCEDURE")]
#[derive(Debug, Clone, PartialEq)]
pub struct BmmProcedure {
    // 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>>,
    /// Declared or inferred static type of the entity.
    pub r#type: BmmStatusType,

    // inherited: BMM_FORMAL_ELEMENT
    /// 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,

    // inherited: BMM_ROUTINE
    /// Formal parameters of the routine.
    pub parameters: Option<Vec<BmmParameter>>,
    /// Boolean conditions that must evaluate to True for the routine to execute correctly, May be used to generate exceptions if included in run-time build.
    ///
    /// A False pre-condition implies an error in the passed parameters.
    pub pre_conditions: Option<Vec<BmmAssertion>>,
    /// Boolean conditions that will evaluate to True if the routine executed correctly, May be used to generate exceptions if included in run-time build.
    ///
    /// A False post-condition implies an error (i.e. bug) in routine code.
    pub post_conditions: Option<Vec<BmmAssertion>>,
    /// Body of a routine, i.e. executable program.
    pub definition: Option<BmmRoutineDefinition>,
}