Skip to main content

rh_foundation/snapshot/
types.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
4pub struct StructureDefinition {
5    pub url: String,
6    #[serde(default)]
7    pub name: String,
8    #[serde(rename = "type")]
9    pub type_: String,
10    pub base_definition: Option<String>,
11    pub differential: Option<Differential>,
12    pub snapshot: Option<Snapshot>,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct Differential {
17    pub element: Vec<ElementDefinition>,
18}
19
20#[derive(Debug, Clone, Serialize, Deserialize)]
21pub struct Snapshot {
22    pub element: Vec<ElementDefinition>,
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
26pub struct ElementDefinition {
27    pub path: String,
28    pub id: Option<String>,
29    pub min: Option<u32>,
30    pub max: Option<String>,
31    #[serde(rename = "type")]
32    pub type_: Option<Vec<ElementType>>,
33    pub binding: Option<ElementBinding>,
34    pub constraint: Option<Vec<ElementConstraint>>,
35    pub definition: Option<String>,
36    pub short: Option<String>,
37    pub comment: Option<String>,
38    pub requirements: Option<String>,
39    #[serde(rename = "mustSupport")]
40    pub must_support: Option<bool>,
41    #[serde(rename = "isSummary")]
42    pub is_summary: Option<bool>,
43    #[serde(rename = "isModifier")]
44    pub is_modifier: Option<bool>,
45    #[serde(rename = "isModifierReason")]
46    pub is_modifier_reason: Option<String>,
47    pub slicing: Option<ElementSlicing>,
48    #[serde(rename = "sliceName")]
49    pub slice_name: Option<String>,
50}
51
52#[derive(Debug, Clone, Serialize, Deserialize)]
53pub struct ElementSlicing {
54    pub discriminator: Option<Vec<ElementDiscriminator>>,
55    pub rules: Option<String>,
56    pub ordered: Option<bool>,
57    pub description: Option<String>,
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
61pub struct ElementDiscriminator {
62    #[serde(rename = "type")]
63    pub type_: String,
64    pub path: String,
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
68pub struct ElementType {
69    pub code: String,
70    pub profile: Option<Vec<String>>,
71}
72
73#[derive(Debug, Clone, Serialize, Deserialize)]
74pub struct ElementBinding {
75    pub strength: String,
76    #[serde(rename = "valueSet")]
77    pub value_set: Option<String>,
78}
79
80#[derive(Debug, Clone, Serialize, Deserialize)]
81pub struct ElementConstraint {
82    pub key: String,
83    pub severity: String,
84    pub human: String,
85    pub expression: Option<String>,
86}