openehr_sdt/lib.rs
1// SPDX-FileCopyrightText: Cadasto B.V.
2// SPDX-License-Identifier: BUSL-1.1
3
4//! openEHR **Simplified Data Template** formats and the engines written over
5#![allow(
6 clippy::doc_markdown,
7 reason = "module docs are prose with many proper nouns"
8)]
9//!
10//! the ITS wire layer of `openehr_its`. Everything here is hand-written: the
11//! specifications it implements are prose sub-specifications of ITS-REST with
12//! no machine-readable model to generate from.
13//!
14//! - [`flat`] — **ITS-REST Formats**: openEHR Simplified Formats (FLAT /
15//! STRUCTURED data instances, the Web Template model). The
16//! *Formats* specification is a STABLE ITS-REST 1.1.0 sub-specification
17//! (`docs/specs/openehr/ITS-REST/docs/simplified_formats/`) over the
18//! Simplified Data Template (`simplified_data_template/`).
19//! - [`rm_instance`] — the template-independent validation of a whole RM
20//! instance tree: the RM-invariant and terminology passes, the
21//! [`rm_instance::ValidationMessage`] report shape, and the composed
22//! [`rm_instance::validate_composition`] entry point. It composes the
23//! template pass of `flat::validation` over the RM pass, and
24//! `flat::validation` reads its report shape back, so the two are one layer.
25//!
26//! # Features
27//!
28//! `flat` is the content layer: it pulls `openehr_its` with its `opt14`
29//! feature (canonical JSON, canonical XML and the OPT 1.4 reader) and the five
30//! generated spec crates. `cache` adds the `moka` WebTemplate cache. The default
31//! `full` is both. A `wasm32-unknown-unknown` consumer takes
32//! `default-features = false, features = ["flat"]`.
33//!
34//! The SMART on openEHR scope grammar is `ferrohealth_smart::openehr::smart_scopes`,
35//! in the family's authorization crate.
36
37// Doctests are copy-paste templates: they must use `?`, never unwrap
38// (C-QUESTION-MARK, https://rust-lang.github.io/api-guidelines/documentation.html#c-question-mark).
39#![doc(test(attr(deny(warnings))))]
40#[cfg(feature = "flat")]
41pub mod flat;
42#[cfg(feature = "flat")]
43pub mod rm_instance;
44
45/// The openEHR specification version this crate implements.
46///
47/// The ITS-REST release the Simplified Formats sub-specification belongs to. The pin is deliberately independent of the
48/// crates.io package version, which is the crate's own `SemVer` line and moves
49/// only with this implementation's code.
50pub const SPEC_VERSION: &str = "1.1.0";