fhirbolt_model/generated/r5/resources/
questionnaire.rs

1// Generated on 2023-05-17 by fhirbolt-codegen v0.10.0
2#[doc = "Indicates the mechanism used to compare versions to determine which is more current."]
3#[derive(Default, Debug, Clone, PartialEq)]
4pub enum QuestionnaireVersionAlgorithm {
5    String(super::super::types::String),
6    Coding(Box<super::super::types::Coding>),
7    #[default]
8    Invalid,
9}
10#[doc = "A value that the referenced question is tested using the specified operator in order for the item to be enabled.  If there are multiple answers, a match on any of the answers suffices.  If different behavior is desired (all must match, at least 2 must match, etc.), consider using the enableWhenExpression extension."]
11#[derive(Default, Debug, Clone, PartialEq)]
12pub enum QuestionnaireItemEnableWhenAnswer {
13    Boolean(super::super::types::Boolean),
14    Decimal(super::super::types::Decimal),
15    Integer(super::super::types::Integer),
16    Date(super::super::types::Date),
17    DateTime(super::super::types::DateTime),
18    Time(super::super::types::Time),
19    String(super::super::types::String),
20    Coding(Box<super::super::types::Coding>),
21    Quantity(Box<super::super::types::Quantity>),
22    Reference(Box<super::super::types::Reference>),
23    #[default]
24    Invalid,
25}
26#[doc = "A potential answer that's allowed as the answer to this question."]
27#[derive(Default, Debug, Clone, PartialEq)]
28pub enum QuestionnaireItemAnswerOptionValue {
29    Integer(super::super::types::Integer),
30    Date(super::super::types::Date),
31    Time(super::super::types::Time),
32    String(super::super::types::String),
33    Coding(Box<super::super::types::Coding>),
34    Reference(Box<super::super::types::Reference>),
35    #[default]
36    Invalid,
37}
38#[doc = "The actual value to for an initial answer."]
39#[derive(Default, Debug, Clone, PartialEq)]
40pub enum QuestionnaireItemInitialValue {
41    Boolean(super::super::types::Boolean),
42    Decimal(super::super::types::Decimal),
43    Integer(super::super::types::Integer),
44    Date(super::super::types::Date),
45    DateTime(super::super::types::DateTime),
46    Time(super::super::types::Time),
47    String(super::super::types::String),
48    Uri(super::super::types::Uri),
49    Attachment(Box<super::super::types::Attachment>),
50    Coding(Box<super::super::types::Coding>),
51    Quantity(Box<super::super::types::Quantity>),
52    Reference(Box<super::super::types::Reference>),
53    #[default]
54    Invalid,
55}
56#[doc = "A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true."]
57#[derive(Debug, Clone, PartialEq)]
58pub struct QuestionnaireItemEnableWhen {
59    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
60    pub r#id: Option<std::string::String>,
61    #[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."]
62    pub r#extension: Vec<super::super::types::Extension>,
63    #[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)."]
64    pub r#modifier_extension: Vec<super::super::types::Extension>,
65    #[doc = "The linkId for the question whose answer (or lack of answer) governs whether this item is enabled."]
66    pub r#question: super::super::types::String,
67    #[doc = "Specifies the criteria by which the question is enabled."]
68    pub r#operator: super::super::types::Code,
69    #[doc = "A value that the referenced question is tested using the specified operator in order for the item to be enabled.  If there are multiple answers, a match on any of the answers suffices.  If different behavior is desired (all must match, at least 2 must match, etc.), consider using the enableWhenExpression extension."]
70    pub r#answer: QuestionnaireItemEnableWhenAnswer,
71}
72#[allow(clippy::derivable_impls)]
73impl Default for QuestionnaireItemEnableWhen {
74    fn default() -> Self {
75        Self {
76            r#id: Default::default(),
77            r#extension: Default::default(),
78            r#modifier_extension: Default::default(),
79            r#question: super::super::types::String {
80                id: Some("$invalid".to_string()),
81                ..Default::default()
82            },
83            r#operator: super::super::types::Code {
84                id: Some("$invalid".to_string()),
85                ..Default::default()
86            },
87            r#answer: Default::default(),
88        }
89    }
90}
91#[doc = "One of the permitted answers for the question."]
92#[derive(Debug, Clone, PartialEq)]
93pub struct QuestionnaireItemAnswerOption {
94    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
95    pub r#id: Option<std::string::String>,
96    #[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."]
97    pub r#extension: Vec<super::super::types::Extension>,
98    #[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)."]
99    pub r#modifier_extension: Vec<super::super::types::Extension>,
100    #[doc = "A potential answer that's allowed as the answer to this question."]
101    pub r#value: QuestionnaireItemAnswerOptionValue,
102    #[doc = "Indicates whether the answer value is selected when the list of possible answers is initially shown."]
103    pub r#initial_selected: Option<super::super::types::Boolean>,
104}
105#[allow(clippy::derivable_impls)]
106impl Default for QuestionnaireItemAnswerOption {
107    fn default() -> Self {
108        Self {
109            r#id: Default::default(),
110            r#extension: Default::default(),
111            r#modifier_extension: Default::default(),
112            r#value: Default::default(),
113            r#initial_selected: Default::default(),
114        }
115    }
116}
117#[doc = "One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input."]
118#[derive(Debug, Clone, PartialEq)]
119pub struct QuestionnaireItemInitial {
120    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
121    pub r#id: Option<std::string::String>,
122    #[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."]
123    pub r#extension: Vec<super::super::types::Extension>,
124    #[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)."]
125    pub r#modifier_extension: Vec<super::super::types::Extension>,
126    #[doc = "The actual value to for an initial answer."]
127    pub r#value: QuestionnaireItemInitialValue,
128}
129#[allow(clippy::derivable_impls)]
130impl Default for QuestionnaireItemInitial {
131    fn default() -> Self {
132        Self {
133            r#id: Default::default(),
134            r#extension: Default::default(),
135            r#modifier_extension: Default::default(),
136            r#value: Default::default(),
137        }
138    }
139}
140#[doc = "A particular question, question grouping or display text that is part of the questionnaire."]
141#[derive(Debug, Clone, PartialEq)]
142pub struct QuestionnaireItem {
143    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
144    pub r#id: Option<std::string::String>,
145    #[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."]
146    pub r#extension: Vec<super::super::types::Extension>,
147    #[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)."]
148    pub r#modifier_extension: Vec<super::super::types::Extension>,
149    #[doc = "An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource."]
150    pub r#link_id: super::super::types::String,
151    #[doc = "This element is a URI that refers to an [ElementDefinition](https://hl7.org/FHIR/elementdefinition.html)) or to an [ObservationDefinition](https://hl7.org/FHIR/observationdefinition.html)) that provides information about this item, including information that might otherwise be included in the instance of the Questionnaire resource. A detailed description of the construction of the URI is shown in [Comments](questionnaire.html#definition), below."]
152    pub r#definition: Option<super::super::types::Uri>,
153    #[doc = "A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers)."]
154    pub r#code: Vec<super::super::types::Coding>,
155    #[doc = "A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire."]
156    pub r#prefix: Option<super::super::types::String>,
157    #[doc = "The name of a section, the text of a question or text content for a display item."]
158    pub r#text: Option<super::super::types::String>,
159    #[doc = "The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, Coding, etc.)."]
160    pub r#type: super::super::types::Code,
161    #[doc = "A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true."]
162    pub r#enable_when: Vec<QuestionnaireItemEnableWhen>,
163    #[doc = "Controls how multiple enableWhen values are interpreted -  whether all or any must be true."]
164    pub r#enable_behavior: Option<super::super::types::Code>,
165    #[doc = "Indicates if and how items that are disabled (because enableWhen evaluates to 'false') should be displayed."]
166    pub r#disabled_display: Option<super::super::types::Code>,
167    #[doc = "An indication, if true, that the item must be present in a \"completed\" QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire."]
168    pub r#required: Option<super::super::types::Boolean>,
169    #[doc = "An indication, if true, that a QuestionnaireResponse for this item may include multiple answers associated with a single instance of this item (for question-type items) or multiple repetitions of the item (for group-type items)."]
170    pub r#repeats: Option<super::super::types::Boolean>,
171    #[doc = "An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire."]
172    pub r#read_only: Option<super::super::types::Boolean>,
173    #[doc = "The maximum number of characters that are permitted in the answer to be considered a \"valid\" QuestionnaireResponse."]
174    pub r#max_length: Option<super::super::types::Integer>,
175    #[doc = "For items that have a defined set of allowed answers (via answerOption or answerValueSet), indicates whether values *other* than those specified can be selected."]
176    pub r#answer_constraint: Option<super::super::types::Code>,
177    #[doc = "A reference to a value set containing a list of values representing permitted answers for a question."]
178    pub r#answer_value_set: Option<super::super::types::Canonical>,
179    #[doc = "One of the permitted answers for the question."]
180    pub r#answer_option: Vec<QuestionnaireItemAnswerOption>,
181    #[doc = "One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input."]
182    pub r#initial: Vec<QuestionnaireItemInitial>,
183    #[doc = "Text, questions and other groups to be nested beneath a question or group."]
184    pub r#item: Vec<QuestionnaireItem>,
185}
186#[allow(clippy::derivable_impls)]
187impl Default for QuestionnaireItem {
188    fn default() -> Self {
189        Self {
190            r#id: Default::default(),
191            r#extension: Default::default(),
192            r#modifier_extension: Default::default(),
193            r#link_id: super::super::types::String {
194                id: Some("$invalid".to_string()),
195                ..Default::default()
196            },
197            r#definition: Default::default(),
198            r#code: Default::default(),
199            r#prefix: Default::default(),
200            r#text: Default::default(),
201            r#type: super::super::types::Code {
202                id: Some("$invalid".to_string()),
203                ..Default::default()
204            },
205            r#enable_when: Default::default(),
206            r#enable_behavior: Default::default(),
207            r#disabled_display: Default::default(),
208            r#required: Default::default(),
209            r#repeats: Default::default(),
210            r#read_only: Default::default(),
211            r#max_length: Default::default(),
212            r#answer_constraint: Default::default(),
213            r#answer_value_set: Default::default(),
214            r#answer_option: Default::default(),
215            r#initial: Default::default(),
216            r#item: Default::default(),
217        }
218    }
219}
220#[doc = "A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.\n\nTo support structured, hierarchical registration of data gathered using digital forms and other questionnaires.  Questionnaires provide greater control over presentation and allow capture of data in a domain-independent way (i.e. capturing information that would otherwise require multiple distinct types of resources)."]
221#[derive(Debug, Clone, PartialEq)]
222pub struct Questionnaire {
223    #[doc = "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes."]
224    pub r#id: Option<super::super::types::Id>,
225    #[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."]
226    pub r#meta: Option<Box<super::super::types::Meta>>,
227    #[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."]
228    pub r#implicit_rules: Option<super::super::types::Uri>,
229    #[doc = "The base language in which the resource is written."]
230    pub r#language: Option<super::super::types::Code>,
231    #[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."]
232    pub r#text: Option<Box<super::super::types::Narrative>>,
233    #[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."]
234    pub r#contained: Vec<super::super::Resource>,
235    #[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."]
236    pub r#extension: Vec<super::super::types::Extension>,
237    #[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)."]
238    pub r#modifier_extension: Vec<super::super::types::Extension>,
239    #[doc = "An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which an authoritative instance of this questionnaire is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the questionnaire is stored on different servers."]
240    pub r#url: Option<super::super::types::Uri>,
241    #[doc = "A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance."]
242    pub r#identifier: Vec<super::super::types::Identifier>,
243    #[doc = "The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence."]
244    pub r#version: Option<super::super::types::String>,
245    #[doc = "Indicates the mechanism used to compare versions to determine which is more current."]
246    pub r#version_algorithm: Option<QuestionnaireVersionAlgorithm>,
247    #[doc = "A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation."]
248    pub r#name: Option<super::super::types::String>,
249    #[doc = "A short, descriptive, user-friendly title for the questionnaire."]
250    pub r#title: Option<super::super::types::String>,
251    #[doc = "The URL of a Questionnaire that this Questionnaire is based on."]
252    pub r#derived_from: Vec<super::super::types::Canonical>,
253    #[doc = "The current state of this questionnaire."]
254    pub r#status: super::super::types::Code,
255    #[doc = "A Boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing) and is not intended for genuine usage."]
256    pub r#experimental: Option<super::super::types::Boolean>,
257    #[doc = "The types of subjects that can be the subject of responses created for the questionnaire."]
258    pub r#subject_type: Vec<super::super::types::Code>,
259    #[doc = "The date  (and optionally time) when the questionnaire was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes."]
260    pub r#date: Option<super::super::types::DateTime>,
261    #[doc = "The name of the organization or individual responsible for the release and ongoing maintenance of the questionnaire."]
262    pub r#publisher: Option<super::super::types::String>,
263    #[doc = "Contact details to assist a user in finding and communicating with the publisher."]
264    pub r#contact: Vec<super::super::types::ContactDetail>,
265    #[doc = "A free text natural language description of the questionnaire from a consumer's perspective."]
266    pub r#description: Option<super::super::types::Markdown>,
267    #[doc = "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate questionnaires."]
268    pub r#use_context: Vec<super::super::types::UsageContext>,
269    #[doc = "A legal or geographic region in which the questionnaire is intended to be used."]
270    pub r#jurisdiction: Vec<super::super::types::CodeableConcept>,
271    #[doc = "Explanation of why this questionnaire is needed and why it has been designed as it has."]
272    pub r#purpose: Option<super::super::types::Markdown>,
273    #[doc = "A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire."]
274    pub r#copyright: Option<super::super::types::Markdown>,
275    #[doc = "A short string (<50 characters), suitable for inclusion in a page footer that identifies the copyright holder, effective period, and optionally whether rights are resctricted. (e.g. 'All rights reserved', 'Some rights reserved')."]
276    pub r#copyright_label: Option<super::super::types::String>,
277    #[doc = "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage."]
278    pub r#approval_date: Option<super::super::types::Date>,
279    #[doc = "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date."]
280    pub r#last_review_date: Option<super::super::types::Date>,
281    #[doc = "The period during which the questionnaire content was or is planned to be in active use."]
282    pub r#effective_period: Option<Box<super::super::types::Period>>,
283    #[doc = "An identifier for this collection of questions in a particular terminology such as LOINC."]
284    pub r#code: Vec<super::super::types::Coding>,
285    #[doc = "A particular question, question grouping or display text that is part of the questionnaire."]
286    pub r#item: Vec<QuestionnaireItem>,
287}
288#[allow(clippy::derivable_impls)]
289impl Default for Questionnaire {
290    fn default() -> Self {
291        Self {
292            r#id: Default::default(),
293            r#meta: Default::default(),
294            r#implicit_rules: Default::default(),
295            r#language: Default::default(),
296            r#text: Default::default(),
297            r#contained: Default::default(),
298            r#extension: Default::default(),
299            r#modifier_extension: Default::default(),
300            r#url: Default::default(),
301            r#identifier: Default::default(),
302            r#version: Default::default(),
303            r#version_algorithm: Default::default(),
304            r#name: Default::default(),
305            r#title: Default::default(),
306            r#derived_from: Default::default(),
307            r#status: super::super::types::Code {
308                id: Some("$invalid".to_string()),
309                ..Default::default()
310            },
311            r#experimental: Default::default(),
312            r#subject_type: Default::default(),
313            r#date: Default::default(),
314            r#publisher: Default::default(),
315            r#contact: Default::default(),
316            r#description: Default::default(),
317            r#use_context: Default::default(),
318            r#jurisdiction: Default::default(),
319            r#purpose: Default::default(),
320            r#copyright: Default::default(),
321            r#copyright_label: Default::default(),
322            r#approval_date: Default::default(),
323            r#last_review_date: Default::default(),
324            r#effective_period: Default::default(),
325            r#code: Default::default(),
326            r#item: Default::default(),
327        }
328    }
329}