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

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

use crate::v1_1::common::generic::attestation::Attestation;
use crate::v1_1::common::generic::party_proxy::PartyProxy;
use crate::v1_1::data_types::quantity::date_time::dv_date_time::DvDateTime;
use crate::v1_1::data_types::text::dv_coded_text::DvCodedText;
use crate::v1_1::data_types::text::dv_text::DvText;

/// The set of attributes required to document the committal of an information item to a repository.
#[doc(alias = "AUDIT_DETAILS")]
#[derive(Debug, Clone, PartialEq)]
pub struct AuditDetailsData {
    /// Identifier of the logical EHR system where the change was committed.
    ///
    /// This is almost always owned by the organisation legally responsible for the EHR, and is distinct from any application, or any hosting infrastructure.
    pub system_id: String,
    /// Time of committal of the item.
    pub time_committed: DvDateTime,
    /// Type of change. Coded using the openEHR Terminology  audit change type  group.
    pub change_type: DvCodedText,
    /// Reason for committal.
    ///
    /// This may be used to qualify the value in the `_change_type_` field. For example, if the change affects only the EHR directory, this field might be used to indicate 'Folder "episode 2018-02-16" added' or similar.
    pub description: Option<DvText>,
    /// Identity and optional reference into identity management service, of user who committed the item.
    pub committer: PartyProxy,
}

/// Polymorphic slot of `AUDIT_DETAILS`, dispatched on each payload's `_type`.
///
/// The set of attributes required to document the committal of an information item to a repository.
#[doc(alias = "AUDIT_DETAILS")]
#[derive(Debug, Clone, PartialEq)]
pub enum AuditDetails {
    /// The `ATTESTATION` subtype of `AUDIT_DETAILS`.
    Attestation(Attestation),
    /// An instance of `AUDIT_DETAILS` itself (its own, least-rich form).
    AuditDetails(AuditDetailsData),
}