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

//! The openEHR `BMM_MODEL` 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::v2_4::bmm::core::bmm_class::BmmClass;
use crate::v2_4::bmm::core::bmm_package::BmmPackage;
use crate::v2_4::bmm3::core::entity::bmm_module::BmmModule;

/// Definition of the root of a BMM model (along with what is inherited from `BMM_SCHEMA_CORE`).
#[doc(alias = "BMM_MODEL")]
#[derive(Debug, Clone, PartialEq)]
pub struct BmmModel {
    // inherited: BMM_MODEL_ELEMENT
    /// Name of this model element.
    pub name: String,
    /// Optional documentation of this element, as a keyed list.
    ///
    /// It is strongly recommended to use the following key /type combinations for the relevant purposes:
    ///
    /// * `"purpose": String`
    /// * `"keywords": List<String>`
    /// * `"use": String`
    /// * `"misuse": String`
    /// * `"references": String`
    ///
    /// Other keys and value types may be freely added.
    pub documentation: Option<std::collections::BTreeMap<String, serde_json::Value>>,
    // NOTE: `scope` (BMM-mandatory back-reference) omitted — LANG BMM3 bmm_package_container (scope: BMM_PACKAGE_CONTAINER — redefinition of BMM_MODEL_ELEMENT.scope). A back-reference is not forward-owned data and never appears on the canonical wire; emitting it as an owning field would make this type non-constructible.
    /// Optional meta-data of this element, as a keyed list. May be used to extend the meta-model.
    pub extensions: Option<std::collections::BTreeMap<String, serde_json::Value>>,

    // inherited: BMM_PACKAGE_CONTAINER
    /// Child packages; keys all in upper case for guaranteed matching.
    pub packages: Option<std::collections::BTreeMap<String, BmmPackage>>,

    // inherited: BMM_MODEL_METADATA
    /// Publisher of model expressed in the schema.
    pub rm_publisher: String,
    /// Release of model expressed in the schema as a 3-part numeric, e.g. "3.1.0" .
    pub rm_release: String,
    /// All classes in this model, keyed by type name.
    pub class_definitions: Option<std::collections::BTreeMap<String, BmmClass>>,
    /// List of other models 'used' (i.e. 'imported' by this model). Classes in the current model may refer to classes in a used model by specifying the other class's `_scope_` meta-attribute.
    pub used_models: Option<Vec<BmmModel>>,
    /// All classes in this model, keyed by type name.
    pub modules: Option<std::collections::BTreeMap<String, BmmModule>>,
}