1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! RM/BASE class-invariant contract (hand-written spec behaviour).
//!
//! Hand-written; preserved across `openehr-codegen` regeneration (it is not a
//! `// @generated` file, so `write_crate` keeps it and `lib.rs` auto-declares
//! `pub mod validate;`). Concrete invariant bodies live in sibling `*_impl.rs`
//! files next to each generated type and `impl Validate for <Type>`.
//!
//! The instance-validation *algorithm* is spec-underdetermined (openEHR's AOM2
//! `validation` spec covers archetype validation, not RM-instance validation);
//! these are the openEHR **Reference Model class invariants** — the checks a
//! value must satisfy independent of any archetype — mirroring the reference
//! implementation's invariant set. See `// NOTE:` markers in the impls for
//! spec-underdetermined choices.
/// An RM class-invariant violation: a human-readable message plus the RM
/// sub-path (relative to the value being checked) it applies to.
///
/// An empty path means the value itself; the composition validator prefixes
/// the absolute RM path.
/// The RM class invariants of a spec type. Implemented in `*_impl.rs` siblings.