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