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 (`SCHEMA_DESCRIPTOR`) — 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 `SCHEMA_DESCRIPTOR` spec class, generated from the vendored BMM
//! meta-model.

use crate::v1_1::bmm::core::bmm_model::BmmModel;
use crate::v1_1::bmm_persistence::p_bmm_schema::PBmmSchema;
use crate::v1_1::bmm_persistence::p_bmm_schema_descriptor::PBmmSchemaDescriptor;

/// Descriptor for a BMM schema. Contains a meta-data table of attributes obtained from a mini-ODIN parse of the schema file.
#[doc(alias = "SCHEMA_DESCRIPTOR")]
#[derive(Debug, Clone, PartialEq)]
pub struct SchemaDescriptorData {
    /// Persistent form of model.
    pub p_schema: Option<PBmmSchema>,
    /// Computable form of model.
    pub schema: Option<BmmModel>,
    /// Schema id, formed from meta_data model_publisher '_' schema_name '_' model_release, e.g. openehr_rm_1.0.3.
    pub schema_id: String,
    /// Table of {key, value} pairs of schema meta-data (bmm_version, model_publisher, schema_name, model_release, schema_revision, schema_lifecycle_state, schema_description, schema_path).
    pub meta_data: std::collections::BTreeMap<String, String>,
    /// Schema_ids of schemas included by this schema.
    pub includes: Option<Vec<String>>,
}

/// Polymorphic slot of `SCHEMA_DESCRIPTOR`, dispatched on each payload's `_type`.
///
/// Descriptor for a BMM schema. Contains a meta-data table of attributes obtained from a mini-ODIN parse of the schema file.
#[doc(alias = "SCHEMA_DESCRIPTOR")]
#[derive(Debug, Clone, PartialEq)]
pub enum SchemaDescriptor {
    /// The `P_BMM_SCHEMA_DESCRIPTOR` subtype of `SCHEMA_DESCRIPTOR`.
    PBmmSchemaDescriptor(PBmmSchemaDescriptor),
    /// An instance of `SCHEMA_DESCRIPTOR` itself (its own, least-rich form).
    SchemaDescriptor(SchemaDescriptorData),
}