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_CASE_TABLE`) — DO NOT EDIT.
// SPDX-FileCopyrightText: Cadasto B.V.
// SPDX-FileCopyrightText: openEHR Foundation
// SPDX-License-Identifier: Apache-2.0

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

use crate::v1_1::bmm3::expression::el_case::ElCase;
use crate::v1_1::bmm3::expression::el_value_generator::ElValueGenerator;

/// Compound expression consisting of a list of value-range / expression pairs, and an  `_else_` member that as a whole, represents a case statement flavour of decision table.
///
/// Evaluated by iterating through `_items_` and for each one, comparing `_input_` to the item `_value_range_`. If the `_input_` is in the range, the evaluation result of the table is 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_CASE_TABLE")]
#[derive(Debug, Clone, PartialEq)]
pub struct ElCaseTable<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<ElCase<T>>,

    // inherited: EL_DECISION_TABLE
    /// Result expression of conditional, if its `_condition_` evaluates to True.
    pub r#else: T,
    /// Expressing generating the input value for the case table.
    pub test_value: ElValueGenerator,
}