1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// @generated by openehr-codegen from BMM (`P_BMM_ENUMERATION`) — DO NOT EDIT.
// SPDX-FileCopyrightText: Cadasto B.V.
// SPDX-FileCopyrightText: openEHR Foundation
// SPDX-License-Identifier: Apache-2.0
//! The openEHR `P_BMM_ENUMERATION` 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::v1_0::bmm::core::entity::range_constrained::bmm_enumeration::BmmEnumeration;
use crate::v1_0::bmm_persistence::p_bmm_enumeration_integer::PBmmEnumerationInteger;
use crate::v1_0::bmm_persistence::p_bmm_enumeration_string::PBmmEnumerationString;
use crate::v1_0::bmm_persistence::p_bmm_generic_parameter::PBmmGenericParameter;
use crate::v1_0::bmm_persistence::p_bmm_generic_type::PBmmGenericType;
use crate::v1_0::bmm_persistence::p_bmm_property::PBmmProperty;
/// Persistent form of `BMM_ENUMERATION` attributes.
#[doc(alias = "P_BMM_ENUMERATION")]
#[derive(Debug, Clone, PartialEq)]
pub struct PBmmEnumerationData {
// inherited: P_BMM_MODEL_ELEMENT
/// Optional documentation of this element.
pub documentation: Option<String>,
// inherited: P_BMM_CLASS
/// Name of the class. Persisted attribute.
pub name: String,
/// List of immediate inheritance parents. If there are generic ancestors, use `_ancestor_defs_` instead. Persisted attribute.
pub ancestors: Option<Vec<String>>,
/// List of attributes defined in this class. Persistent attribute.
pub properties: Option<std::collections::BTreeMap<String, PBmmProperty>>,
/// True if this is an abstract type. Persisted attribute.
pub is_abstract: Option<bool>,
/// True if this class definition overrides one found in an included schema.
pub is_override: Option<bool>,
/// List of generic parameter definitions. Persisted attribute.
pub generic_parameter_defs: Option<indexmap::IndexMap<String, PBmmGenericParameter>>,
/// Reference to original source schema defining this class.
///
/// Set during `BMM_SCHEMA` materialise. Useful for GUI tools to enable user to edit the schema file containing a given class (i.e. taking into account that a class may be in any of the schemas in a schema inclusion hierarchy).
pub source_schema_id: String,
/// `BMM_CLASS` object build by `_create_bmm_class_definition_` and `_populate_bmm_class_definition_`.
pub bmm_class: Option<BmmEnumeration>,
// inherited: P_BMM_CLASS
/// Unique id generated for later comparison during merging, in order to detect if two classes are the same. Assigned in post-load processing.
pub uid: i32,
/// List of structured inheritance ancestors, used only in the case of generic inheritance. Persisted attribute.
pub ancestor_defs: Option<Vec<PBmmGenericType>>,
/// The `item_names` attribute of openEHR `P_BMM_ENUMERATION` (the vendored BMM carries no documentation for it).
pub item_names: Option<Vec<String>>,
/// The `item_values` attribute of openEHR `P_BMM_ENUMERATION` (the vendored BMM carries no documentation for it).
pub item_values: Option<Vec<serde_json::Value>>,
}
/// Polymorphic slot of `P_BMM_ENUMERATION`, dispatched on each payload's `_type`.
///
/// Persistent form of `BMM_ENUMERATION` attributes.
#[doc(alias = "P_BMM_ENUMERATION")]
#[derive(Debug, Clone, PartialEq)]
pub enum PBmmEnumeration {
/// The `P_BMM_ENUMERATION_INTEGER` subtype of `P_BMM_ENUMERATION`.
PBmmEnumerationInteger(PBmmEnumerationInteger),
/// The `P_BMM_ENUMERATION_STRING` subtype of `P_BMM_ENUMERATION`.
PBmmEnumerationString(PBmmEnumerationString),
/// An instance of `P_BMM_ENUMERATION` itself (its own, least-rich form).
PBmmEnumeration(PBmmEnumerationData),
}