fhirbolt_model/generated/r5/resources/
audit_event.rs

1// Generated on 2023-05-17 by fhirbolt-codegen v0.10.0
2#[doc = "The time or period during which the activity occurred."]
3#[derive(Default, Debug, Clone, PartialEq)]
4pub enum AuditEventOccurred {
5    Period(Box<super::super::types::Period>),
6    DateTime(super::super::types::DateTime),
7    #[default]
8    Invalid,
9}
10#[doc = "When the event utilizes a network there should be an agent describing the local system, and an agent describing remote system, with the network interface details."]
11#[derive(Default, Debug, Clone, PartialEq)]
12pub enum AuditEventAgentNetwork {
13    Reference(Box<super::super::types::Reference>),
14    Uri(super::super::types::Uri),
15    String(super::super::types::String),
16    #[default]
17    Invalid,
18}
19#[doc = "The  value of the extra detail."]
20#[derive(Default, Debug, Clone, PartialEq)]
21pub enum AuditEventEntityDetailValue {
22    Quantity(Box<super::super::types::Quantity>),
23    CodeableConcept(Box<super::super::types::CodeableConcept>),
24    String(super::super::types::String),
25    Boolean(super::super::types::Boolean),
26    Integer(super::super::types::Integer),
27    Range(Box<super::super::types::Range>),
28    Ratio(Box<super::super::types::Ratio>),
29    Time(super::super::types::Time),
30    DateTime(super::super::types::DateTime),
31    Period(Box<super::super::types::Period>),
32    Base64Binary(super::super::types::Base64Binary),
33    #[default]
34    Invalid,
35}
36#[doc = "Indicates whether the event succeeded or failed. A free text descripiton can be given in outcome.text."]
37#[derive(Debug, Clone, PartialEq)]
38pub struct AuditEventOutcome {
39    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
40    pub r#id: Option<std::string::String>,
41    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
42    pub r#extension: Vec<super::super::types::Extension>,
43    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
44    pub r#modifier_extension: Vec<super::super::types::Extension>,
45    #[doc = "Indicates whether the event succeeded or failed."]
46    pub r#code: Box<super::super::types::Coding>,
47    #[doc = "Additional details about the error. This may be a text description of the error or a system code that identifies the error."]
48    pub r#detail: Vec<super::super::types::CodeableConcept>,
49}
50#[allow(clippy::derivable_impls)]
51impl Default for AuditEventOutcome {
52    fn default() -> Self {
53        Self {
54            r#id: Default::default(),
55            r#extension: Default::default(),
56            r#modifier_extension: Default::default(),
57            r#code: Box::new(super::super::types::Coding {
58                id: Some("$invalid".to_string()),
59                ..Default::default()
60            }),
61            r#detail: Default::default(),
62        }
63    }
64}
65#[doc = "An actor taking an active role in the event or activity that is logged."]
66#[derive(Debug, Clone, PartialEq)]
67pub struct AuditEventAgent {
68    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
69    pub r#id: Option<std::string::String>,
70    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
71    pub r#extension: Vec<super::super::types::Extension>,
72    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
73    pub r#modifier_extension: Vec<super::super::types::Extension>,
74    #[doc = "The Functional Role of the user when performing the event."]
75    pub r#type: Option<Box<super::super::types::CodeableConcept>>,
76    #[doc = "The structural roles of the agent indicating the agent's competency. The security role enabling the agent with respect to the activity."]
77    pub r#role: Vec<super::super::types::CodeableConcept>,
78    #[doc = "Reference to who this agent is that was involved in the event."]
79    pub r#who: Box<super::super::types::Reference>,
80    #[doc = "Indicator that the user is or is not the requestor, or initiator, for the event being audited."]
81    pub r#requestor: Option<super::super::types::Boolean>,
82    #[doc = "Where the agent location is known, the agent location when the event occurred."]
83    pub r#location: Option<Box<super::super::types::Reference>>,
84    #[doc = "Where the policy(ies) are known that authorized the agent participation in the event. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used."]
85    pub r#policy: Vec<super::super::types::Uri>,
86    #[doc = "When the event utilizes a network there should be an agent describing the local system, and an agent describing remote system, with the network interface details."]
87    pub r#network: Option<AuditEventAgentNetwork>,
88    #[doc = "The authorization (e.g., PurposeOfUse) that was used during the event being recorded."]
89    pub r#authorization: Vec<super::super::types::CodeableConcept>,
90}
91#[allow(clippy::derivable_impls)]
92impl Default for AuditEventAgent {
93    fn default() -> Self {
94        Self {
95            r#id: Default::default(),
96            r#extension: Default::default(),
97            r#modifier_extension: Default::default(),
98            r#type: Default::default(),
99            r#role: Default::default(),
100            r#who: Box::new(super::super::types::Reference {
101                id: Some("$invalid".to_string()),
102                ..Default::default()
103            }),
104            r#requestor: Default::default(),
105            r#location: Default::default(),
106            r#policy: Default::default(),
107            r#network: Default::default(),
108            r#authorization: Default::default(),
109        }
110    }
111}
112#[doc = "The actor that is reporting the event."]
113#[derive(Debug, Clone, PartialEq)]
114pub struct AuditEventSource {
115    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
116    pub r#id: Option<std::string::String>,
117    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
118    pub r#extension: Vec<super::super::types::Extension>,
119    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
120    pub r#modifier_extension: Vec<super::super::types::Extension>,
121    #[doc = "Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group."]
122    pub r#site: Option<Box<super::super::types::Reference>>,
123    #[doc = "Identifier of the source where the event was detected."]
124    pub r#observer: Box<super::super::types::Reference>,
125    #[doc = "Code specifying the type of source where event originated."]
126    pub r#type: Vec<super::super::types::CodeableConcept>,
127}
128#[allow(clippy::derivable_impls)]
129impl Default for AuditEventSource {
130    fn default() -> Self {
131        Self {
132            r#id: Default::default(),
133            r#extension: Default::default(),
134            r#modifier_extension: Default::default(),
135            r#site: Default::default(),
136            r#observer: Box::new(super::super::types::Reference {
137                id: Some("$invalid".to_string()),
138                ..Default::default()
139            }),
140            r#type: Default::default(),
141        }
142    }
143}
144#[doc = "Tagged value pairs for conveying additional information about the entity."]
145#[derive(Debug, Clone, PartialEq)]
146pub struct AuditEventEntityDetail {
147    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
148    pub r#id: Option<std::string::String>,
149    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
150    pub r#extension: Vec<super::super::types::Extension>,
151    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
152    pub r#modifier_extension: Vec<super::super::types::Extension>,
153    #[doc = "The type of extra detail provided in the value."]
154    pub r#type: Box<super::super::types::CodeableConcept>,
155    #[doc = "The  value of the extra detail."]
156    pub r#value: AuditEventEntityDetailValue,
157}
158#[allow(clippy::derivable_impls)]
159impl Default for AuditEventEntityDetail {
160    fn default() -> Self {
161        Self {
162            r#id: Default::default(),
163            r#extension: Default::default(),
164            r#modifier_extension: Default::default(),
165            r#type: Box::new(super::super::types::CodeableConcept {
166                id: Some("$invalid".to_string()),
167                ..Default::default()
168            }),
169            r#value: Default::default(),
170        }
171    }
172}
173#[doc = "Specific instances of data or objects that have been accessed."]
174#[derive(Debug, Clone, PartialEq)]
175pub struct AuditEventEntity {
176    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
177    pub r#id: Option<std::string::String>,
178    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
179    pub r#extension: Vec<super::super::types::Extension>,
180    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
181    pub r#modifier_extension: Vec<super::super::types::Extension>,
182    #[doc = "Identifies a specific instance of the entity. The reference should be version specific. This is allowed to be a Parameters resource."]
183    pub r#what: Option<Box<super::super::types::Reference>>,
184    #[doc = "Code representing the role the entity played in the event being audited."]
185    pub r#role: Option<Box<super::super::types::CodeableConcept>>,
186    #[doc = "Security labels for the identified entity."]
187    pub r#security_label: Vec<super::super::types::CodeableConcept>,
188    #[doc = "The query parameters for a query-type entities."]
189    pub r#query: Option<super::super::types::Base64Binary>,
190    #[doc = "Tagged value pairs for conveying additional information about the entity."]
191    pub r#detail: Vec<AuditEventEntityDetail>,
192    #[doc = "The entity is attributed to an agent to express the agent's responsibility for that entity in the activity. This is most used to indicate when persistence media (the entity) are used by an agent. For example when importing data from a device, the device would be described in an entity, and the user importing data from that media would be indicated as the entity.agent."]
193    pub r#agent: Vec<AuditEventAgent>,
194}
195#[allow(clippy::derivable_impls)]
196impl Default for AuditEventEntity {
197    fn default() -> Self {
198        Self {
199            r#id: Default::default(),
200            r#extension: Default::default(),
201            r#modifier_extension: Default::default(),
202            r#what: Default::default(),
203            r#role: Default::default(),
204            r#security_label: Default::default(),
205            r#query: Default::default(),
206            r#detail: Default::default(),
207            r#agent: Default::default(),
208        }
209    }
210}
211#[doc = "A record of an event relevant for purposes such as operations, privacy, security, maintenance, and performance analysis."]
212#[derive(Debug, Clone, PartialEq)]
213pub struct AuditEvent {
214    #[doc = "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes."]
215    pub r#id: Option<super::super::types::Id>,
216    #[doc = "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource."]
217    pub r#meta: Option<Box<super::super::types::Meta>>,
218    #[doc = "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc."]
219    pub r#implicit_rules: Option<super::super::types::Uri>,
220    #[doc = "The base language in which the resource is written."]
221    pub r#language: Option<super::super::types::Code>,
222    #[doc = "A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety."]
223    pub r#text: Option<Box<super::super::types::Narrative>>,
224    #[doc = "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning."]
225    pub r#contained: Vec<super::super::Resource>,
226    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
227    pub r#extension: Vec<super::super::types::Extension>,
228    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
229    pub r#modifier_extension: Vec<super::super::types::Extension>,
230    #[doc = "Classification of the type of event."]
231    pub r#category: Vec<super::super::types::CodeableConcept>,
232    #[doc = "Describes what happened. The most specific code for the event."]
233    pub r#code: Box<super::super::types::CodeableConcept>,
234    #[doc = "Indicator for type of action performed during the event that generated the audit."]
235    pub r#action: Option<super::super::types::Code>,
236    #[doc = "Indicates and enables segmentation of various severity including debugging from critical."]
237    pub r#severity: Option<super::super::types::Code>,
238    #[doc = "The time or period during which the activity occurred."]
239    pub r#occurred: Option<AuditEventOccurred>,
240    #[doc = "The time when the event was recorded."]
241    pub r#recorded: super::super::types::Instant,
242    #[doc = "Indicates whether the event succeeded or failed. A free text descripiton can be given in outcome.text."]
243    pub r#outcome: Option<AuditEventOutcome>,
244    #[doc = "The authorization (e.g., PurposeOfUse) that was used during the event being recorded."]
245    pub r#authorization: Vec<super::super::types::CodeableConcept>,
246    #[doc = "Allows tracing of authorizatino for the events and tracking whether proposals/recommendations were acted upon."]
247    pub r#based_on: Vec<super::super::types::Reference>,
248    #[doc = "The patient element is available to enable deterministic tracking of activities that involve the patient as the subject of the data used in an activity."]
249    pub r#patient: Option<Box<super::super::types::Reference>>,
250    #[doc = "This will typically be the encounter the event occurred, but some events may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter (e.g. pre-admission lab tests)."]
251    pub r#encounter: Option<Box<super::super::types::Reference>>,
252    #[doc = "An actor taking an active role in the event or activity that is logged."]
253    pub r#agent: Vec<AuditEventAgent>,
254    #[doc = "The actor that is reporting the event."]
255    pub r#source: AuditEventSource,
256    #[doc = "Specific instances of data or objects that have been accessed."]
257    pub r#entity: Vec<AuditEventEntity>,
258}
259#[allow(clippy::derivable_impls)]
260impl Default for AuditEvent {
261    fn default() -> Self {
262        Self {
263            r#id: Default::default(),
264            r#meta: Default::default(),
265            r#implicit_rules: Default::default(),
266            r#language: Default::default(),
267            r#text: Default::default(),
268            r#contained: Default::default(),
269            r#extension: Default::default(),
270            r#modifier_extension: Default::default(),
271            r#category: Default::default(),
272            r#code: Box::new(super::super::types::CodeableConcept {
273                id: Some("$invalid".to_string()),
274                ..Default::default()
275            }),
276            r#action: Default::default(),
277            r#severity: Default::default(),
278            r#occurred: Default::default(),
279            r#recorded: super::super::types::Instant {
280                id: Some("$invalid".to_string()),
281                ..Default::default()
282            },
283            r#outcome: Default::default(),
284            r#authorization: Default::default(),
285            r#based_on: Default::default(),
286            r#patient: Default::default(),
287            r#encounter: Default::default(),
288            r#agent: Default::default(),
289            r#source: AuditEventSource {
290                id: Some("$invalid".to_string()),
291                ..Default::default()
292            },
293            r#entity: Default::default(),
294        }
295    }
296}