1#[doc = "The reference to a FHIR ObservationDefinition resource that provides the definition that is adhered to in whole or in part by this Observation instance."]
3#[derive(Default, Debug, Clone, PartialEq)]
4pub enum ObservationInstantiates {
5 Canonical(super::super::types::Canonical),
6 Reference(Box<super::super::types::Reference>),
7 #[default]
8 Invalid,
9}
10#[doc = "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself."]
11#[derive(Default, Debug, Clone, PartialEq)]
12pub enum ObservationEffective {
13 DateTime(super::super::types::DateTime),
14 Period(Box<super::super::types::Period>),
15 Timing(Box<super::super::types::Timing>),
16 Instant(super::super::types::Instant),
17 #[default]
18 Invalid,
19}
20#[doc = "The information determined as a result of making the observation, if the information has a simple value."]
21#[derive(Default, Debug, Clone, PartialEq)]
22pub enum ObservationValue {
23 Quantity(Box<super::super::types::Quantity>),
24 CodeableConcept(Box<super::super::types::CodeableConcept>),
25 String(super::super::types::String),
26 Boolean(super::super::types::Boolean),
27 Integer(super::super::types::Integer),
28 Range(Box<super::super::types::Range>),
29 Ratio(Box<super::super::types::Ratio>),
30 SampledData(Box<super::super::types::SampledData>),
31 Time(super::super::types::Time),
32 DateTime(super::super::types::DateTime),
33 Period(Box<super::super::types::Period>),
34 Attachment(Box<super::super::types::Attachment>),
35 Reference(Box<super::super::types::Reference>),
36 #[default]
37 Invalid,
38}
39#[doc = "The information determined as a result of making the observation, if the information has a simple value."]
40#[derive(Default, Debug, Clone, PartialEq)]
41pub enum ObservationComponentValue {
42 Quantity(Box<super::super::types::Quantity>),
43 CodeableConcept(Box<super::super::types::CodeableConcept>),
44 String(super::super::types::String),
45 Boolean(super::super::types::Boolean),
46 Integer(super::super::types::Integer),
47 Range(Box<super::super::types::Range>),
48 Ratio(Box<super::super::types::Ratio>),
49 SampledData(Box<super::super::types::SampledData>),
50 Time(super::super::types::Time),
51 DateTime(super::super::types::DateTime),
52 Period(Box<super::super::types::Period>),
53 Attachment(Box<super::super::types::Attachment>),
54 Reference(Box<super::super::types::Reference>),
55 #[default]
56 Invalid,
57}
58#[doc = "Identifies the observation(s) that triggered the performance of this observation."]
59#[derive(Debug, Clone, PartialEq)]
60pub struct ObservationTriggeredBy {
61 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
62 pub r#id: Option<std::string::String>,
63 #[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."]
64 pub r#extension: Vec<super::super::types::Extension>,
65 #[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)."]
66 pub r#modifier_extension: Vec<super::super::types::Extension>,
67 #[doc = "Reference to the triggering observation."]
68 pub r#observation: Box<super::super::types::Reference>,
69 #[doc = "The type of trigger.\nReflex | Repeat | Re-run."]
70 pub r#type: super::super::types::Code,
71 #[doc = "Provides the reason why this observation was performed as a result of the observation(s) referenced."]
72 pub r#reason: Option<super::super::types::String>,
73}
74#[allow(clippy::derivable_impls)]
75impl Default for ObservationTriggeredBy {
76 fn default() -> Self {
77 Self {
78 r#id: Default::default(),
79 r#extension: Default::default(),
80 r#modifier_extension: Default::default(),
81 r#observation: Box::new(super::super::types::Reference {
82 id: Some("$invalid".to_string()),
83 ..Default::default()
84 }),
85 r#type: super::super::types::Code {
86 id: Some("$invalid".to_string()),
87 ..Default::default()
88 },
89 r#reason: Default::default(),
90 }
91 }
92}
93#[doc = "Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an \"OR\". In other words, to represent two distinct target populations, two `referenceRange` elements would be used."]
94#[derive(Debug, Clone, PartialEq)]
95pub struct ObservationReferenceRange {
96 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
97 pub r#id: Option<std::string::String>,
98 #[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."]
99 pub r#extension: Vec<super::super::types::Extension>,
100 #[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)."]
101 pub r#modifier_extension: Vec<super::super::types::Extension>,
102 #[doc = "The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3)."]
103 pub r#low: Option<Box<super::super::types::Quantity>>,
104 #[doc = "The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3)."]
105 pub r#high: Option<Box<super::super::types::Quantity>>,
106 #[doc = "The value of the normal value of the reference range."]
107 pub r#normal_value: Option<Box<super::super::types::CodeableConcept>>,
108 #[doc = "Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range."]
109 pub r#type: Option<Box<super::super::types::CodeableConcept>>,
110 #[doc = "Codes to indicate the target population this reference range applies to. For example, a reference range may be based on the normal population or a particular sex or race. Multiple `appliesTo` are interpreted as an \"AND\" of the target populations. For example, to represent a target population of African American females, both a code of female and a code for African American would be used."]
111 pub r#applies_to: Vec<super::super::types::CodeableConcept>,
112 #[doc = "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so."]
113 pub r#age: Option<Box<super::super::types::Range>>,
114 #[doc = "Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of \"Negative\" or a list or table of \"normals\"."]
115 pub r#text: Option<super::super::types::Markdown>,
116}
117#[allow(clippy::derivable_impls)]
118impl Default for ObservationReferenceRange {
119 fn default() -> Self {
120 Self {
121 r#id: Default::default(),
122 r#extension: Default::default(),
123 r#modifier_extension: Default::default(),
124 r#low: Default::default(),
125 r#high: Default::default(),
126 r#normal_value: Default::default(),
127 r#type: Default::default(),
128 r#applies_to: Default::default(),
129 r#age: Default::default(),
130 r#text: Default::default(),
131 }
132 }
133}
134#[doc = "Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations."]
135#[derive(Debug, Clone, PartialEq)]
136pub struct ObservationComponent {
137 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
138 pub r#id: Option<std::string::String>,
139 #[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."]
140 pub r#extension: Vec<super::super::types::Extension>,
141 #[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)."]
142 pub r#modifier_extension: Vec<super::super::types::Extension>,
143 #[doc = "Describes what was observed. Sometimes this is called the observation \"code\"."]
144 pub r#code: Box<super::super::types::CodeableConcept>,
145 #[doc = "The information determined as a result of making the observation, if the information has a simple value."]
146 pub r#value: Option<ObservationComponentValue>,
147 #[doc = "Provides a reason why the expected value in the element Observation.component.value\\[x\\] is missing."]
148 pub r#data_absent_reason: Option<Box<super::super::types::CodeableConcept>>,
149 #[doc = "A categorical assessment of an observation value. For example, high, low, normal."]
150 pub r#interpretation: Vec<super::super::types::CodeableConcept>,
151 #[doc = "Guidance on how to interpret the value by comparison to a normal or recommended range."]
152 pub r#reference_range: Vec<ObservationReferenceRange>,
153}
154#[allow(clippy::derivable_impls)]
155impl Default for ObservationComponent {
156 fn default() -> Self {
157 Self {
158 r#id: Default::default(),
159 r#extension: Default::default(),
160 r#modifier_extension: Default::default(),
161 r#code: Box::new(super::super::types::CodeableConcept {
162 id: Some("$invalid".to_string()),
163 ..Default::default()
164 }),
165 r#value: Default::default(),
166 r#data_absent_reason: Default::default(),
167 r#interpretation: Default::default(),
168 r#reference_range: Default::default(),
169 }
170 }
171}
172#[doc = "Measurements and simple assertions made about a patient, device or other subject.\n\nObservations are a key aspect of healthcare. This resource is used to capture those that do not require more sophisticated mechanisms."]
173#[derive(Debug, Clone, PartialEq)]
174pub struct Observation {
175 #[doc = "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes."]
176 pub r#id: Option<super::super::types::Id>,
177 #[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."]
178 pub r#meta: Option<Box<super::super::types::Meta>>,
179 #[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."]
180 pub r#implicit_rules: Option<super::super::types::Uri>,
181 #[doc = "The base language in which the resource is written."]
182 pub r#language: Option<super::super::types::Code>,
183 #[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."]
184 pub r#text: Option<Box<super::super::types::Narrative>>,
185 #[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."]
186 pub r#contained: Vec<super::super::Resource>,
187 #[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."]
188 pub r#extension: Vec<super::super::types::Extension>,
189 #[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)."]
190 pub r#modifier_extension: Vec<super::super::types::Extension>,
191 #[doc = "A unique identifier assigned to this observation."]
192 pub r#identifier: Vec<super::super::types::Identifier>,
193 #[doc = "The reference to a FHIR ObservationDefinition resource that provides the definition that is adhered to in whole or in part by this Observation instance."]
194 pub r#instantiates: Option<ObservationInstantiates>,
195 #[doc = "A plan, proposal or order that is fulfilled in whole or in part by this event. For example, a MedicationRequest may require a patient to have laboratory test performed before it is dispensed."]
196 pub r#based_on: Vec<super::super::types::Reference>,
197 #[doc = "Identifies the observation(s) that triggered the performance of this observation."]
198 pub r#triggered_by: Vec<ObservationTriggeredBy>,
199 #[doc = "A larger event of which this particular Observation is a component or step. For example, an observation as part of a procedure."]
200 pub r#part_of: Vec<super::super::types::Reference>,
201 #[doc = "The status of the result value."]
202 pub r#status: super::super::types::Code,
203 #[doc = "A code that classifies the general type of observation being made."]
204 pub r#category: Vec<super::super::types::CodeableConcept>,
205 #[doc = "Describes what was observed. Sometimes this is called the observation \"name\"."]
206 pub r#code: Box<super::super::types::CodeableConcept>,
207 #[doc = "The patient, or group of patients, location, device, organization, procedure or practitioner this observation is about and into whose or what record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation."]
208 pub r#subject: Option<Box<super::super::types::Reference>>,
209 #[doc = "The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record. The focus of an observation could also be an existing condition, an intervention, the subject's diet, another observation of the subject, or a body structure such as tumor or implanted device. An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus."]
210 pub r#focus: Vec<super::super::types::Reference>,
211 #[doc = "The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made."]
212 pub r#encounter: Option<Box<super::super::types::Reference>>,
213 #[doc = "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself."]
214 pub r#effective: Option<ObservationEffective>,
215 #[doc = "The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified."]
216 pub r#issued: Option<super::super::types::Instant>,
217 #[doc = "Who was responsible for asserting the observed value as \"true\"."]
218 pub r#performer: Vec<super::super::types::Reference>,
219 #[doc = "The information determined as a result of making the observation, if the information has a simple value."]
220 pub r#value: Option<ObservationValue>,
221 #[doc = "Provides a reason why the expected value in the element Observation.value\\[x\\] is missing."]
222 pub r#data_absent_reason: Option<Box<super::super::types::CodeableConcept>>,
223 #[doc = "A categorical assessment of an observation value. For example, high, low, normal."]
224 pub r#interpretation: Vec<super::super::types::CodeableConcept>,
225 #[doc = "Comments about the observation or the results."]
226 pub r#note: Vec<super::super::types::Annotation>,
227 #[doc = "Indicates the site on the subject's body where the observation was made (i.e. the target site)."]
228 pub r#body_site: Option<Box<super::super::types::CodeableConcept>>,
229 #[doc = "Indicates the body structure on the subject's body where the observation was made (i.e. the target site)."]
230 pub r#body_structure: Option<Box<super::super::types::Reference>>,
231 #[doc = "Indicates the mechanism used to perform the observation."]
232 pub r#method: Option<Box<super::super::types::CodeableConcept>>,
233 #[doc = "The specimen that was used when this observation was made."]
234 pub r#specimen: Option<Box<super::super::types::Reference>>,
235 #[doc = "A reference to the device that generates the measurements or the device settings for the device."]
236 pub r#device: Option<Box<super::super::types::Reference>>,
237 #[doc = "Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an \"OR\". In other words, to represent two distinct target populations, two `referenceRange` elements would be used."]
238 pub r#reference_range: Vec<ObservationReferenceRange>,
239 #[doc = "This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group."]
240 pub r#has_member: Vec<super::super::types::Reference>,
241 #[doc = "The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image."]
242 pub r#derived_from: Vec<super::super::types::Reference>,
243 #[doc = "Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations."]
244 pub r#component: Vec<ObservationComponent>,
245}
246#[allow(clippy::derivable_impls)]
247impl Default for Observation {
248 fn default() -> Self {
249 Self {
250 r#id: Default::default(),
251 r#meta: Default::default(),
252 r#implicit_rules: Default::default(),
253 r#language: Default::default(),
254 r#text: Default::default(),
255 r#contained: Default::default(),
256 r#extension: Default::default(),
257 r#modifier_extension: Default::default(),
258 r#identifier: Default::default(),
259 r#instantiates: Default::default(),
260 r#based_on: Default::default(),
261 r#triggered_by: Default::default(),
262 r#part_of: Default::default(),
263 r#status: super::super::types::Code {
264 id: Some("$invalid".to_string()),
265 ..Default::default()
266 },
267 r#category: Default::default(),
268 r#code: Box::new(super::super::types::CodeableConcept {
269 id: Some("$invalid".to_string()),
270 ..Default::default()
271 }),
272 r#subject: Default::default(),
273 r#focus: Default::default(),
274 r#encounter: Default::default(),
275 r#effective: Default::default(),
276 r#issued: Default::default(),
277 r#performer: Default::default(),
278 r#value: Default::default(),
279 r#data_absent_reason: Default::default(),
280 r#interpretation: Default::default(),
281 r#note: Default::default(),
282 r#body_site: Default::default(),
283 r#body_structure: Default::default(),
284 r#method: Default::default(),
285 r#specimen: Default::default(),
286 r#device: Default::default(),
287 r#reference_range: Default::default(),
288 r#has_member: Default::default(),
289 r#derived_from: Default::default(),
290 r#component: Default::default(),
291 }
292 }
293}