openehr-its 0.0.2

openEHR ITS (Implementation Technology Specifications): canonical JSON + XML serialization, ITS-REST OpenAPI contract, ITS-BMM. Mirrors the specifications-ITS-{JSON,XML,REST,BMM} repos.
Documentation
// @generated by openehr-codegen (emit-opt) — DO NOT EDIT.
//! openEHR OPT 1.4 operational-template model + canonical-XML codec.
//!
//! Parse an operational template with [`from_xml`]; the root element is `<template>` (`OPERATIONAL_TEMPLATE`).

mod impls;
mod types;
pub use types::*;

/// Parse an operational template XML document into an [`OperationalTemplate`].
///
/// # Errors
/// Propagates canonical-XML parse errors.
pub fn from_xml(xml: &str) -> Result<OperationalTemplate, crate::xml::runtime::XmlError> {
    crate::xml::runtime::from_xml(xml)
}

/// Serialize an [`OperationalTemplate`] back to OPT 1.4 XML (root `<template>`,
/// `http://schemas.openehr.org/v1`).
///
/// # Errors
/// Propagates canonical-XML serialization errors.
pub fn to_xml(value: &OperationalTemplate) -> Result<String, crate::xml::runtime::XmlError> {
    crate::xml::runtime::to_xml(value, "template", crate::xml::runtime::Namespace::V1)
}