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
// @generated by openehr-codegen from BMM (`C_ATTRIBUTE`) — DO NOT EDIT.
// SPDX-FileCopyrightText: Cadasto B.V.
// SPDX-FileCopyrightText: openEHR Foundation
// SPDX-License-Identifier: Apache-2.0
// Hand-written spec functions/invariants live in the sibling `*_impl.rs`.
//! The openEHR `C_ATTRIBUTE` spec class, generated from the vendored BMM
//! meta-model.
use crate::v2_4::aom2::constraint_model::archetype_constraint::ArchetypeConstraint;
use crate::v2_4::aom2::constraint_model::c_object::CObject;
use crate::v2_4::aom2::constraint_model::c_second_order::CSecondOrder;
use openehr_base::v1_3::foundation_types::interval::cardinality::Cardinality;
use openehr_base::v1_3::foundation_types::interval::multiplicity_interval::MultiplicityInterval;
/// Abstract model of constraint on any kind of attribute in a class model.
#[doc(alias = "C_ATTRIBUTE")]
#[derive(Debug, Clone, PartialEq)]
pub struct CAttribute {
// inherited: ARCHETYPE_CONSTRAINT
/// Parent node, except in the case of the top of a tree, i.e. root `C_COMPLEX_OBJECT` of an archetype definition.
pub parent: Option<Box<ArchetypeConstraint>>,
/// The `soc_parent` attribute of openEHR `ARCHETYPE_CONSTRAINT` (the vendored BMM carries no documentation for it).
pub soc_parent: Option<CSecondOrder>,
/// Reference model attribute within the enclosing type represented by a `C_OBJECT`.
pub rm_attribute_name: String,
/// Constraint settable on every attribute, regardless of whether it is singular or of a container type, which indicates whether its target object exists or not (i.e. is mandatory or not).
///
/// Only set if it overrides the underlying reference model or parent archetype in the case of specialised archetypes.
pub existence: Option<MultiplicityInterval>,
/// Child `C_OBJECT` nodes.
///
/// Each such node represents a constraint on the type of this attribute in its reference model. Multiples occur both for multiple items in the case of container attributes, and alternatives in the case of singular attributes.
pub children: Option<Vec<CObject>>,
/// Path to the parent object of this attribute (i.e. doesn’t include the name of this attribute).
///
/// Used only for attributes in differential form, specialised archetypes. Enables only the re-defined parts of a specialised archetype to be expressed, at the path where they occur.
pub differential_path: Option<String>,
/// Cardinality constraint of attribute, if a container attribute.
pub cardinality: Option<Cardinality>,
/// Flag indicating whether this attribute constraint is on a container (i.e. multiply-valued) attribute.
pub is_multiple: bool,
}