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
//! Naming a FHIR release in generic code.
//!
//! The data model is release-specific — an R4 `Patient` and an R5 `Patient` are
//! different Rust types — but code that merely *moves resources around* (the
//! REST client, for example) is not. [`Release`] lets such code name "the
//! `Bundle` of whichever release the caller chose" without duplicating itself
//! per release.
//!
//! Each enabled release module provides a marker type implementing this trait:
//! [`r4::R4`](crate::r4::R4) and [`r5::R5`](crate::r5::R5).
//!
//! ```
//! use fhir::release::Release;
//! use fhir::r5::R5;
//!
//! assert_eq!(R5::LABEL, "R5");
//! assert_eq!(R5::VERSION, "5.0.0");
//!
//! // The associated types name that release's resources.
//! let bundle = <R5 as Release>::Bundle::default();
//! assert!(bundle.entry.is_empty());
//! ```
use DeserializeOwned;
/// A FHIR release, as a type: a marker naming that release's core resources.
///
/// Implemented by [`r4::R4`](crate::r4::R4) and [`r5::R5`](crate::r5::R5).