Skip to main content

fhir_rs/resource/r5/
message_header.rs

1use crate::prelude::*;
2
3#[derive(Resource, Debug, Clone, Default)]
4#[fhir(base="DomainResource")]
5pub struct MessageHeader {
6    /// Logical id of this artifact
7    #[fhir(name="id", min="0", max="1", summary=true, modifier=false, choice="")]
8    pub id: Option<Id>,
9    /// Metadata about the resource
10    #[fhir(name="meta", min="0", max="1", summary=true, modifier=false, choice="")]
11    pub meta: Option<Meta>,
12    /// A set of rules under which this content was created
13    #[fhir(name="implicitRules", min="0", max="1", summary=true, modifier=true)]
14    pub implicit_rules: Option<UriDt>,
15    /// Language of the resource content
16    #[fhir(name="language", min="0", max="1", summary=false, modifier=false, choice="")]
17    pub language: Option<CodeDt>,
18    /// Text summary of the resource, for human interpretation
19    #[fhir(name="text", min="0", max="1", summary=false, modifier=false, choice="")]
20    pub text: Option<Narrative>,
21    /// Contained, inline Resources
22    #[fhir(name="contained", min="0", max="*", summary=false, modifier=false, choice="")]
23    pub contained: Option<Vec<AnyResource>>,
24    /// Additional content defined by implementations
25    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
26    pub extension: Option<Vec<Extension>>,
27    /// Extensions that cannot be ignored
28    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
29    pub modifier_extension: Option<Vec<Extension>>,
30    /// Event code or link to EventDefinition
31    #[fhir(name="event", min="1", max="1", summary=true, modifier=false, choice="")]
32    pub event: Option<CanonicalDt>,
33    /// Message destination application(s)
34    #[fhir(name="destination", min="0", max="*", summary=true, modifier=false, choice="")]
35    pub destination: Option<Vec<MessageHeaderDestinationBackboneElement>>,
36    /// Real world sender of the message
37    #[fhir(name="sender", min="0", max="1", summary=true, modifier=false, choice="")]
38    pub sender: Option<Reference>,
39    /// The source of the decision
40    #[fhir(name="author", min="0", max="1", summary=true, modifier=false, choice="")]
41    pub author: Option<Reference>,
42    /// Message source application
43    #[fhir(name="source", min="1", max="1", summary=true, modifier=false, choice="")]
44    pub source: Option<MessageHeaderSourceBackboneElement>,
45    /// Final responsibility for event
46    #[fhir(name="responsible", min="0", max="1", summary=true, modifier=false, choice="")]
47    pub responsible: Option<Reference>,
48    /// Cause of event
49    #[fhir(name="reason", min="0", max="1", summary=true, modifier=false, choice="")]
50    pub reason: Option<CodeableConcept>,
51    /// If this is a reply to prior message
52    #[fhir(name="response", min="0", max="1", summary=true, modifier=false, choice="")]
53    pub response: Option<MessageHeaderResponseBackboneElement>,
54    /// The actual content of the message
55    #[fhir(name="focus", min="0", max="*", summary=true, modifier=false, choice="")]
56    pub focus: Option<Vec<Reference>>,
57    /// Link to the definition for this message
58    #[fhir(name="definition", min="0", max="1", summary=true, modifier=false, choice="")]
59    pub definition: Option<CanonicalDt>,
60}
61
62#[derive(Element, BackboneElement, Debug, Clone, Default)]
63pub struct MessageHeaderResponseBackboneElement {
64    /// Unique id for inter-element referencing
65    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
66    pub id: Option<String>,
67    /// Additional content defined by implementations
68    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
69    pub extension: Option<Vec<Extension>>,
70    /// Extensions that cannot be ignored even if unrecognized
71    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
72    pub modifier_extension: Option<Vec<Extension>>,
73    /// Bundle.identifier of original message
74    #[fhir(name="identifier", min="1", max="1", summary=true, modifier=false, choice="")]
75    pub identifier: Option<Identifier>,
76    /// ok | transient-error | fatal-error
77    #[fhir(name="code", min="1", max="1", summary=true, modifier=false, choice="")]
78    pub code: Option<CodeDt>,
79    /// Specific list of hints/warnings/errors
80    #[fhir(name="details", min="0", max="1", summary=true, modifier=false, choice="")]
81    pub details: Option<Reference>,
82}
83
84#[derive(Element, BackboneElement, Debug, Clone, Default)]
85pub struct MessageHeaderSourceBackboneElement {
86    /// Unique id for inter-element referencing
87    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
88    pub id: Option<String>,
89    /// Additional content defined by implementations
90    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
91    pub extension: Option<Vec<Extension>>,
92    /// Extensions that cannot be ignored even if unrecognized
93    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
94    pub modifier_extension: Option<Vec<Extension>>,
95    /// Actual source address or Endpoint resource
96    #[fhir(name="endpoint", min="0", max="1", summary=true, modifier=false, choice="")]
97    pub endpoint: Option<Reference>,
98    /// Name of system
99    #[fhir(name="name", min="0", max="1", summary=true, modifier=false, choice="")]
100    pub name: Option<StringDt>,
101    /// Name of software running the system
102    #[fhir(name="software", min="0", max="1", summary=true, modifier=false, choice="")]
103    pub software: Option<StringDt>,
104    /// Version of software running
105    #[fhir(name="version", min="0", max="1", summary=true, modifier=false, choice="")]
106    pub version: Option<StringDt>,
107    /// Human contact for problems
108    #[fhir(name="contact", min="0", max="1", summary=true, modifier=false, choice="")]
109    pub contact: Option<ContactPoint>,
110}
111
112#[derive(Element, BackboneElement, Debug, Clone, Default)]
113pub struct MessageHeaderDestinationBackboneElement {
114    /// Unique id for inter-element referencing
115    #[fhir(name="id", min="0", max="1", summary=false, modifier=false, choice="")]
116    pub id: Option<String>,
117    /// Additional content defined by implementations
118    #[fhir(name="extension", min="0", max="*", summary=false, modifier=false, choice="")]
119    pub extension: Option<Vec<Extension>>,
120    /// Extensions that cannot be ignored even if unrecognized
121    #[fhir(name="modifierExtension", min="0", max="*", summary=true, modifier=true)]
122    pub modifier_extension: Option<Vec<Extension>>,
123    /// Actual destination address or Endpoint resource
124    #[fhir(name="endpoint", min="0", max="1", summary=true, modifier=false, choice="")]
125    pub endpoint: Option<Reference>,
126    /// Name of system
127    #[fhir(name="name", min="0", max="1", summary=true, modifier=false, choice="")]
128    pub name: Option<StringDt>,
129    /// Particular delivery destination within the destination
130    #[fhir(name="target", min="0", max="1", summary=true, modifier=false, choice="")]
131    pub target: Option<Reference>,
132    /// Intended "real-world" recipient for the data
133    #[fhir(name="receiver", min="0", max="1", summary=true, modifier=false, choice="")]
134    pub receiver: Option<Reference>,
135}
136