openehr-am 0.0.128

openEHR AM Archetype Model, generated from BMM: generations v1_4 (AM 1.4.0, ADL 1.4) and v2_4 (AM 2.4.0, ADL 2; current)
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::v2_4::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,
}