openehr-lang 0.0.128

openEHR LANG BMM/P_BMM object model, generated from BMM: generations v1_0 (LANG 1.0.0) and v1_1 (LANG 1.1.0, current; the stable BMM v2.x unit beside the paused BMM3 unit), plus hand-written ODIN/BEL/EL readers
Documentation
// @generated by openehr-codegen from BMM (`EL_CONDITION_CHAIN`) — DO NOT EDIT.
// SPDX-FileCopyrightText: Cadasto B.V.
// SPDX-FileCopyrightText: openEHR Foundation
// SPDX-License-Identifier: Apache-2.0

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

use crate::v1_1::bmm3::expression::el_conditional_expression::ElConditionalExpression;

/// Compound expression consisting of a chain of condition-gated expressions, and an ungated `_else_` member that as a whole, represents an if/then/elseif/else chains.
///
/// Evaluated by iterating through `_items_` and for each one, evaluating its `_condition_`, which if True, causes the evaluation result of the chain to be that item's `_result_` evaluation result.
///
/// If no member of `_items_` has a True-returning `_condition_`, the evaluation result is the result of evaluating the `_else_` expression.
#[doc(alias = "EL_CONDITION_CHAIN")]
#[derive(Debug, Clone, PartialEq)]
pub struct ElConditionChain<T> {
    /// Members of the chain, equivalent to branches in an if/then/else chain and cases in a case statement.
    pub items: openehr_base::containers::NonEmptyVec<ElConditionalExpression<T>>,

    // inherited: EL_DECISION_TABLE
    /// Result expression of conditional, if its `_condition_` evaluates to True.
    pub r#else: T,
}