openehr-rm 0.0.128

openEHR RM Reference Model, generated from BMM: generations v1_1 (RM 1.1.0) and v1_2 (RM 1.2.0, current)
Documentation
// @generated by openehr-codegen from BMM (`VERSIONED_OBJECT`) — DO NOT EDIT.
// SPDX-FileCopyrightText: Cadasto B.V.
// SPDX-FileCopyrightText: openEHR Foundation
// SPDX-License-Identifier: Apache-2.0

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

use crate::v1_1::common::directory::versioned_folder::VersionedFolder;
use crate::v1_1::data_types::quantity::date_time::dv_date_time::DvDateTime;
use crate::v1_1::demographic::versioned_party::VersionedParty;
use crate::v1_1::ehr::versioned_composition::VersionedComposition;
use crate::v1_1::ehr::versioned_ehr_access::VersionedEhrAccess;
use crate::v1_1::ehr::versioned_ehr_status::VersionedEhrStatus;
use openehr_base::v1_2::base_types::identification::hier_object_id::HierObjectId;
use openehr_base::v1_2::base_types::identification::object_ref::ObjectRef;

/// Version control abstraction, defining semantics for versioning one complex object.
#[doc(alias = "VERSIONED_OBJECT")]
#[derive(Debug, Clone, PartialEq)]
pub struct VersionedObjectData {
    /// Unique identifier of this version container in the form of a UID with no extension.
    ///
    /// This id will be the same in all instances of the same container in a distributed environment, meaning that it can be understood as the uid of the  virtual version tree.
    pub uid: HierObjectId,
    /// Reference to object to which this version container belongs, e.g. the id of the containing EHR or other relevant owning entity.
    pub owner_id: ObjectRef,
    /// Time of initial creation of this versioned object.
    pub time_created: DvDateTime,
}

/// Polymorphic slot of `VERSIONED_OBJECT`, dispatched on each payload's `_type`.
///
/// Version control abstraction, defining semantics for versioning one complex object.
#[doc(alias = "VERSIONED_OBJECT")]
#[derive(Debug, Clone, PartialEq)]
pub enum VersionedObject {
    /// The `VERSIONED_COMPOSITION` subtype of `VERSIONED_OBJECT`.
    VersionedComposition(VersionedComposition),
    /// The `VERSIONED_EHR_ACCESS` subtype of `VERSIONED_OBJECT`.
    VersionedEhrAccess(VersionedEhrAccess),
    /// The `VERSIONED_EHR_STATUS` subtype of `VERSIONED_OBJECT`.
    VersionedEhrStatus(VersionedEhrStatus),
    /// The `VERSIONED_FOLDER` subtype of `VERSIONED_OBJECT`.
    VersionedFolder(VersionedFolder),
    /// The `VERSIONED_PARTY` subtype of `VERSIONED_OBJECT`.
    VersionedParty(VersionedParty),
    /// An instance of `VERSIONED_OBJECT` itself (its own, least-rich form).
    VersionedObject(VersionedObjectData),
}