fhirbolt_model/generated/r4/resources/
consent.rs

1// Generated on 2023-05-17 by fhirbolt-codegen v0.10.0
2#[doc = "The source on which this consent statement is based. The source might be a scanned original paper form, or a reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document."]
3#[derive(Default, Debug, Clone, PartialEq)]
4pub enum ConsentSource {
5    Attachment(Box<super::super::types::Attachment>),
6    Reference(Box<super::super::types::Reference>),
7    #[default]
8    Invalid,
9}
10#[doc = "The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law."]
11#[derive(Debug, Clone, PartialEq)]
12pub struct ConsentPolicy {
13    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
14    pub r#id: Option<std::string::String>,
15    #[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 manageable, 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."]
16    pub r#extension: Vec<super::super::types::Extension>,
17    #[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 manageable, 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)."]
18    pub r#modifier_extension: Vec<super::super::types::Extension>,
19    #[doc = "Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives."]
20    pub r#authority: Option<super::super::types::Uri>,
21    #[doc = "The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law."]
22    pub r#uri: Option<super::super::types::Uri>,
23}
24#[allow(clippy::derivable_impls)]
25impl Default for ConsentPolicy {
26    fn default() -> Self {
27        Self {
28            r#id: Default::default(),
29            r#extension: Default::default(),
30            r#modifier_extension: Default::default(),
31            r#authority: Default::default(),
32            r#uri: Default::default(),
33        }
34    }
35}
36#[doc = "Whether a treatment instruction (e.g. artificial respiration yes or no) was verified with the patient, his/her family or another authorized person."]
37#[derive(Debug, Clone, PartialEq)]
38pub struct ConsentVerification {
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 manageable, 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 manageable, 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 = "Has the instruction been verified."]
46    pub r#verified: super::super::types::Boolean,
47    #[doc = "Who verified the instruction (Patient, Relative or other Authorized Person)."]
48    pub r#verified_with: Option<Box<super::super::types::Reference>>,
49    #[doc = "Date verification was collected."]
50    pub r#verification_date: Option<super::super::types::DateTime>,
51}
52#[allow(clippy::derivable_impls)]
53impl Default for ConsentVerification {
54    fn default() -> Self {
55        Self {
56            r#id: Default::default(),
57            r#extension: Default::default(),
58            r#modifier_extension: Default::default(),
59            r#verified: super::super::types::Boolean {
60                id: Some("$invalid".to_string()),
61                ..Default::default()
62            },
63            r#verified_with: Default::default(),
64            r#verification_date: Default::default(),
65        }
66    }
67}
68#[doc = "Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers')."]
69#[derive(Debug, Clone, PartialEq)]
70pub struct ConsentProvisionActor {
71    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
72    pub r#id: Option<std::string::String>,
73    #[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 manageable, 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."]
74    pub r#extension: Vec<super::super::types::Extension>,
75    #[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 manageable, 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)."]
76    pub r#modifier_extension: Vec<super::super::types::Extension>,
77    #[doc = "How the individual is involved in the resources content that is described in the exception."]
78    pub r#role: Box<super::super::types::CodeableConcept>,
79    #[doc = "The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers')."]
80    pub r#reference: Box<super::super::types::Reference>,
81}
82#[allow(clippy::derivable_impls)]
83impl Default for ConsentProvisionActor {
84    fn default() -> Self {
85        Self {
86            r#id: Default::default(),
87            r#extension: Default::default(),
88            r#modifier_extension: Default::default(),
89            r#role: Box::new(super::super::types::CodeableConcept {
90                id: Some("$invalid".to_string()),
91                ..Default::default()
92            }),
93            r#reference: Box::new(super::super::types::Reference {
94                id: Some("$invalid".to_string()),
95                ..Default::default()
96            }),
97        }
98    }
99}
100#[doc = "The resources controlled by this rule if specific resources are referenced."]
101#[derive(Debug, Clone, PartialEq)]
102pub struct ConsentProvisionData {
103    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
104    pub r#id: Option<std::string::String>,
105    #[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 manageable, 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."]
106    pub r#extension: Vec<super::super::types::Extension>,
107    #[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 manageable, 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)."]
108    pub r#modifier_extension: Vec<super::super::types::Extension>,
109    #[doc = "How the resource reference is interpreted when testing consent restrictions."]
110    pub r#meaning: super::super::types::Code,
111    #[doc = "A reference to a specific resource that defines which resources are covered by this consent."]
112    pub r#reference: Box<super::super::types::Reference>,
113}
114#[allow(clippy::derivable_impls)]
115impl Default for ConsentProvisionData {
116    fn default() -> Self {
117        Self {
118            r#id: Default::default(),
119            r#extension: Default::default(),
120            r#modifier_extension: Default::default(),
121            r#meaning: super::super::types::Code {
122                id: Some("$invalid".to_string()),
123                ..Default::default()
124            },
125            r#reference: Box::new(super::super::types::Reference {
126                id: Some("$invalid".to_string()),
127                ..Default::default()
128            }),
129        }
130    }
131}
132#[doc = "An exception to the base policy of this consent. An exception can be an addition or removal of access permissions."]
133#[derive(Debug, Clone, PartialEq)]
134pub struct ConsentProvision {
135    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
136    pub r#id: Option<std::string::String>,
137    #[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 manageable, 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."]
138    pub r#extension: Vec<super::super::types::Extension>,
139    #[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 manageable, 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)."]
140    pub r#modifier_extension: Vec<super::super::types::Extension>,
141    #[doc = "Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules."]
142    pub r#type: Option<super::super::types::Code>,
143    #[doc = "The timeframe in this rule is valid."]
144    pub r#period: Option<Box<super::super::types::Period>>,
145    #[doc = "Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers')."]
146    pub r#actor: Vec<ConsentProvisionActor>,
147    #[doc = "Actions controlled by this Rule."]
148    pub r#action: Vec<super::super::types::CodeableConcept>,
149    #[doc = "A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception."]
150    pub r#security_label: Vec<super::super::types::Coding>,
151    #[doc = "The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule."]
152    pub r#purpose: Vec<super::super::types::Coding>,
153    #[doc = "The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to."]
154    pub r#class: Vec<super::super::types::Coding>,
155    #[doc = "If this code is found in an instance, then the rule applies."]
156    pub r#code: Vec<super::super::types::CodeableConcept>,
157    #[doc = "Clinical or Operational Relevant period of time that bounds the data controlled by this rule."]
158    pub r#data_period: Option<Box<super::super::types::Period>>,
159    #[doc = "The resources controlled by this rule if specific resources are referenced."]
160    pub r#data: Vec<ConsentProvisionData>,
161    #[doc = "Rules which provide exceptions to the base rule or subrules."]
162    pub r#provision: Vec<ConsentProvision>,
163}
164#[allow(clippy::derivable_impls)]
165impl Default for ConsentProvision {
166    fn default() -> Self {
167        Self {
168            r#id: Default::default(),
169            r#extension: Default::default(),
170            r#modifier_extension: Default::default(),
171            r#type: Default::default(),
172            r#period: Default::default(),
173            r#actor: Default::default(),
174            r#action: Default::default(),
175            r#security_label: Default::default(),
176            r#purpose: Default::default(),
177            r#class: Default::default(),
178            r#code: Default::default(),
179            r#data_period: Default::default(),
180            r#data: Default::default(),
181            r#provision: Default::default(),
182        }
183    }
184}
185#[doc = "A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time."]
186#[derive(Debug, Clone, PartialEq)]
187pub struct Consent {
188    #[doc = "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes."]
189    pub r#id: Option<super::super::types::Id>,
190    #[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."]
191    pub r#meta: Option<Box<super::super::types::Meta>>,
192    #[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."]
193    pub r#implicit_rules: Option<super::super::types::Uri>,
194    #[doc = "The base language in which the resource is written."]
195    pub r#language: Option<super::super::types::Code>,
196    #[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."]
197    pub r#text: Option<Box<super::super::types::Narrative>>,
198    #[doc = "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope."]
199    pub r#contained: Vec<super::super::Resource>,
200    #[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 manageable, 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."]
201    pub r#extension: Vec<super::super::types::Extension>,
202    #[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 manageable, 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)."]
203    pub r#modifier_extension: Vec<super::super::types::Extension>,
204    #[doc = "Unique identifier for this copy of the Consent Statement."]
205    pub r#identifier: Vec<super::super::types::Identifier>,
206    #[doc = "Indicates the current state of this consent."]
207    pub r#status: super::super::types::Code,
208    #[doc = "A selector of the type of consent being presented: ADR, Privacy, Treatment, Research.  This list is now extensible."]
209    pub r#scope: Box<super::super::types::CodeableConcept>,
210    #[doc = "A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements."]
211    pub r#category: Vec<super::super::types::CodeableConcept>,
212    #[doc = "The patient/healthcare consumer to whom this consent applies."]
213    pub r#patient: Option<Box<super::super::types::Reference>>,
214    #[doc = "When this  Consent was issued / created / indexed."]
215    pub r#date_time: Option<super::super::types::DateTime>,
216    #[doc = "Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is the entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions."]
217    pub r#performer: Vec<super::super::types::Reference>,
218    #[doc = "The organization that manages the consent, and the framework within which it is executed."]
219    pub r#organization: Vec<super::super::types::Reference>,
220    #[doc = "The source on which this consent statement is based. The source might be a scanned original paper form, or a reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document."]
221    pub r#source: Option<ConsentSource>,
222    #[doc = "The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law."]
223    pub r#policy: Vec<ConsentPolicy>,
224    #[doc = "A reference to the specific base computable regulation or policy."]
225    pub r#policy_rule: Option<Box<super::super::types::CodeableConcept>>,
226    #[doc = "Whether a treatment instruction (e.g. artificial respiration yes or no) was verified with the patient, his/her family or another authorized person."]
227    pub r#verification: Vec<ConsentVerification>,
228    #[doc = "An exception to the base policy of this consent. An exception can be an addition or removal of access permissions."]
229    pub r#provision: Option<ConsentProvision>,
230}
231#[allow(clippy::derivable_impls)]
232impl Default for Consent {
233    fn default() -> Self {
234        Self {
235            r#id: Default::default(),
236            r#meta: Default::default(),
237            r#implicit_rules: Default::default(),
238            r#language: Default::default(),
239            r#text: Default::default(),
240            r#contained: Default::default(),
241            r#extension: Default::default(),
242            r#modifier_extension: Default::default(),
243            r#identifier: Default::default(),
244            r#status: super::super::types::Code {
245                id: Some("$invalid".to_string()),
246                ..Default::default()
247            },
248            r#scope: Box::new(super::super::types::CodeableConcept {
249                id: Some("$invalid".to_string()),
250                ..Default::default()
251            }),
252            r#category: Default::default(),
253            r#patient: Default::default(),
254            r#date_time: Default::default(),
255            r#performer: Default::default(),
256            r#organization: Default::default(),
257            r#source: Default::default(),
258            r#policy: Default::default(),
259            r#policy_rule: Default::default(),
260            r#verification: Default::default(),
261            r#provision: Default::default(),
262        }
263    }
264}