1#[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."]
3#[derive(Default, Debug, Clone, PartialEq)]
4pub enum ObservationEffective {
5 DateTime(super::super::types::DateTime),
6 Period(Box<super::super::types::Period>),
7 Timing(Box<super::super::types::Timing>),
8 Instant(super::super::types::Instant),
9 #[default]
10 Invalid,
11}
12#[doc = "The information determined as a result of making the observation, if the information has a simple value."]
13#[derive(Default, Debug, Clone, PartialEq)]
14pub enum ObservationValue {
15 Quantity(Box<super::super::types::Quantity>),
16 CodeableConcept(Box<super::super::types::CodeableConcept>),
17 String(super::super::types::String),
18 Boolean(super::super::types::Boolean),
19 Integer(super::super::types::Integer),
20 Range(Box<super::super::types::Range>),
21 Ratio(Box<super::super::types::Ratio>),
22 SampledData(Box<super::super::types::SampledData>),
23 Time(super::super::types::Time),
24 DateTime(super::super::types::DateTime),
25 Period(Box<super::super::types::Period>),
26 #[default]
27 Invalid,
28}
29#[doc = "The information determined as a result of making the observation, if the information has a simple value."]
30#[derive(Default, Debug, Clone, PartialEq)]
31pub enum ObservationComponentValue {
32 Quantity(Box<super::super::types::Quantity>),
33 CodeableConcept(Box<super::super::types::CodeableConcept>),
34 String(super::super::types::String),
35 Boolean(super::super::types::Boolean),
36 Integer(super::super::types::Integer),
37 Range(Box<super::super::types::Range>),
38 Ratio(Box<super::super::types::Ratio>),
39 SampledData(Box<super::super::types::SampledData>),
40 Time(super::super::types::Time),
41 DateTime(super::super::types::DateTime),
42 Period(Box<super::super::types::Period>),
43 #[default]
44 Invalid,
45}
46#[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."]
47#[derive(Debug, Clone, PartialEq)]
48pub struct ObservationReferenceRange {
49 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
50 pub r#id: Option<std::string::String>,
51 #[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."]
52 pub r#extension: Vec<super::super::types::Extension>,
53 #[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)."]
54 pub r#modifier_extension: Vec<super::super::types::Extension>,
55 #[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)."]
56 pub r#low: Option<Box<super::super::types::Quantity>>,
57 #[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)."]
58 pub r#high: Option<Box<super::super::types::Quantity>>,
59 #[doc = "Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range."]
60 pub r#type: Option<Box<super::super::types::CodeableConcept>>,
61 #[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."]
62 pub r#applies_to: Vec<super::super::types::CodeableConcept>,
63 #[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."]
64 pub r#age: Option<Box<super::super::types::Range>>,
65 #[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\"."]
66 pub r#text: Option<super::super::types::String>,
67}
68#[allow(clippy::derivable_impls)]
69impl Default for ObservationReferenceRange {
70 fn default() -> Self {
71 Self {
72 r#id: Default::default(),
73 r#extension: Default::default(),
74 r#modifier_extension: Default::default(),
75 r#low: Default::default(),
76 r#high: Default::default(),
77 r#type: Default::default(),
78 r#applies_to: Default::default(),
79 r#age: Default::default(),
80 r#text: Default::default(),
81 }
82 }
83}
84#[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."]
85#[derive(Debug, Clone, PartialEq)]
86pub struct ObservationComponent {
87 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
88 pub r#id: Option<std::string::String>,
89 #[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."]
90 pub r#extension: Vec<super::super::types::Extension>,
91 #[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)."]
92 pub r#modifier_extension: Vec<super::super::types::Extension>,
93 #[doc = "Describes what was observed. Sometimes this is called the observation \"code\"."]
94 pub r#code: Box<super::super::types::CodeableConcept>,
95 #[doc = "The information determined as a result of making the observation, if the information has a simple value."]
96 pub r#value: Option<ObservationComponentValue>,
97 #[doc = "Provides a reason why the expected value in the element Observation.component.value\\[x\\] is missing."]
98 pub r#data_absent_reason: Option<Box<super::super::types::CodeableConcept>>,
99 #[doc = "A categorical assessment of an observation value. For example, high, low, normal."]
100 pub r#interpretation: Vec<super::super::types::CodeableConcept>,
101 #[doc = "Guidance on how to interpret the value by comparison to a normal or recommended range."]
102 pub r#reference_range: Vec<ObservationReferenceRange>,
103}
104#[allow(clippy::derivable_impls)]
105impl Default for ObservationComponent {
106 fn default() -> Self {
107 Self {
108 r#id: Default::default(),
109 r#extension: Default::default(),
110 r#modifier_extension: Default::default(),
111 r#code: Box::new(super::super::types::CodeableConcept {
112 id: Some("$invalid".to_string()),
113 ..Default::default()
114 }),
115 r#value: Default::default(),
116 r#data_absent_reason: Default::default(),
117 r#interpretation: Default::default(),
118 r#reference_range: Default::default(),
119 }
120 }
121}
122#[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."]
123#[derive(Debug, Clone, PartialEq)]
124pub struct Observation {
125 #[doc = "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes."]
126 pub r#id: Option<super::super::types::Id>,
127 #[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."]
128 pub r#meta: Option<Box<super::super::types::Meta>>,
129 #[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."]
130 pub r#implicit_rules: Option<super::super::types::Uri>,
131 #[doc = "The base language in which the resource is written."]
132 pub r#language: Option<super::super::types::Code>,
133 #[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."]
134 pub r#text: Option<Box<super::super::types::Narrative>>,
135 #[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."]
136 pub r#contained: Vec<super::super::Resource>,
137 #[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."]
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 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)."]
140 pub r#modifier_extension: Vec<super::super::types::Extension>,
141 #[doc = "A unique identifier assigned to this observation."]
142 pub r#identifier: Vec<super::super::types::Identifier>,
143 #[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."]
144 pub r#based_on: Vec<super::super::types::Reference>,
145 #[doc = "A larger event of which this particular Observation is a component or step. For example, an observation as part of a procedure."]
146 pub r#part_of: Vec<super::super::types::Reference>,
147 #[doc = "The status of the result value."]
148 pub r#status: super::super::types::Code,
149 #[doc = "A code that classifies the general type of observation being made."]
150 pub r#category: Vec<super::super::types::CodeableConcept>,
151 #[doc = "Describes what was observed. Sometimes this is called the observation \"name\"."]
152 pub r#code: Box<super::super::types::CodeableConcept>,
153 #[doc = "The patient, or group of patients, location, or device this observation is about and into whose 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."]
154 pub r#subject: Option<Box<super::super::types::Reference>>,
155 #[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."]
156 pub r#focus: Vec<super::super::types::Reference>,
157 #[doc = "The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made."]
158 pub r#encounter: Option<Box<super::super::types::Reference>>,
159 #[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."]
160 pub r#effective: Option<ObservationEffective>,
161 #[doc = "The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified."]
162 pub r#issued: Option<super::super::types::Instant>,
163 #[doc = "Who was responsible for asserting the observed value as \"true\"."]
164 pub r#performer: Vec<super::super::types::Reference>,
165 #[doc = "The information determined as a result of making the observation, if the information has a simple value."]
166 pub r#value: Option<ObservationValue>,
167 #[doc = "Provides a reason why the expected value in the element Observation.value\\[x\\] is missing."]
168 pub r#data_absent_reason: Option<Box<super::super::types::CodeableConcept>>,
169 #[doc = "A categorical assessment of an observation value. For example, high, low, normal."]
170 pub r#interpretation: Vec<super::super::types::CodeableConcept>,
171 #[doc = "Comments about the observation or the results."]
172 pub r#note: Vec<super::super::types::Annotation>,
173 #[doc = "Indicates the site on the subject's body where the observation was made (i.e. the target site)."]
174 pub r#body_site: Option<Box<super::super::types::CodeableConcept>>,
175 #[doc = "Indicates the mechanism used to perform the observation."]
176 pub r#method: Option<Box<super::super::types::CodeableConcept>>,
177 #[doc = "The specimen that was used when this observation was made."]
178 pub r#specimen: Option<Box<super::super::types::Reference>>,
179 #[doc = "The device used to generate the observation data."]
180 pub r#device: Option<Box<super::super::types::Reference>>,
181 #[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."]
182 pub r#reference_range: Vec<ObservationReferenceRange>,
183 #[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."]
184 pub r#has_member: Vec<super::super::types::Reference>,
185 #[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."]
186 pub r#derived_from: Vec<super::super::types::Reference>,
187 #[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."]
188 pub r#component: Vec<ObservationComponent>,
189}
190#[allow(clippy::derivable_impls)]
191impl Default for Observation {
192 fn default() -> Self {
193 Self {
194 r#id: Default::default(),
195 r#meta: Default::default(),
196 r#implicit_rules: Default::default(),
197 r#language: Default::default(),
198 r#text: Default::default(),
199 r#contained: Default::default(),
200 r#extension: Default::default(),
201 r#modifier_extension: Default::default(),
202 r#identifier: Default::default(),
203 r#based_on: Default::default(),
204 r#part_of: Default::default(),
205 r#status: super::super::types::Code {
206 id: Some("$invalid".to_string()),
207 ..Default::default()
208 },
209 r#category: Default::default(),
210 r#code: Box::new(super::super::types::CodeableConcept {
211 id: Some("$invalid".to_string()),
212 ..Default::default()
213 }),
214 r#subject: Default::default(),
215 r#focus: Default::default(),
216 r#encounter: Default::default(),
217 r#effective: Default::default(),
218 r#issued: Default::default(),
219 r#performer: Default::default(),
220 r#value: Default::default(),
221 r#data_absent_reason: Default::default(),
222 r#interpretation: Default::default(),
223 r#note: Default::default(),
224 r#body_site: Default::default(),
225 r#method: Default::default(),
226 r#specimen: Default::default(),
227 r#device: Default::default(),
228 r#reference_range: Default::default(),
229 r#has_member: Default::default(),
230 r#derived_from: Default::default(),
231 r#component: Default::default(),
232 }
233 }
234}