1#[doc = "The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them."]
3#[derive(Debug, Clone, PartialEq)]
4pub struct EncounterStatusHistory {
5 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
6 pub r#id: Option<std::string::String>,
7 #[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."]
8 pub r#extension: Vec<super::super::types::Extension>,
9 #[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)."]
10 pub r#modifier_extension: Vec<super::super::types::Extension>,
11 #[doc = "planned | arrived | triaged | in-progress | onleave | finished | cancelled +."]
12 pub r#status: super::super::types::Code,
13 #[doc = "The time that the episode was in the specified status."]
14 pub r#period: Box<super::super::types::Period>,
15}
16#[allow(clippy::derivable_impls)]
17impl Default for EncounterStatusHistory {
18 fn default() -> Self {
19 Self {
20 r#id: Default::default(),
21 r#extension: Default::default(),
22 r#modifier_extension: Default::default(),
23 r#status: super::super::types::Code {
24 id: Some("$invalid".to_string()),
25 ..Default::default()
26 },
27 r#period: Box::new(super::super::types::Period {
28 id: Some("$invalid".to_string()),
29 ..Default::default()
30 }),
31 }
32 }
33}
34#[doc = "The class history permits the tracking of the encounters transitions without needing to go through the resource history. This would be used for a case where an admission starts of as an emergency encounter, then transitions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kind of discharge from emergency to inpatient."]
35#[derive(Debug, Clone, PartialEq)]
36pub struct EncounterClassHistory {
37 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
38 pub r#id: Option<std::string::String>,
39 #[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."]
40 pub r#extension: Vec<super::super::types::Extension>,
41 #[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)."]
42 pub r#modifier_extension: Vec<super::super::types::Extension>,
43 #[doc = "inpatient | outpatient | ambulatory | emergency +."]
44 pub r#class: Box<super::super::types::Coding>,
45 #[doc = "The time that the episode was in the specified class."]
46 pub r#period: Box<super::super::types::Period>,
47}
48#[allow(clippy::derivable_impls)]
49impl Default for EncounterClassHistory {
50 fn default() -> Self {
51 Self {
52 r#id: Default::default(),
53 r#extension: Default::default(),
54 r#modifier_extension: Default::default(),
55 r#class: Box::new(super::super::types::Coding {
56 id: Some("$invalid".to_string()),
57 ..Default::default()
58 }),
59 r#period: Box::new(super::super::types::Period {
60 id: Some("$invalid".to_string()),
61 ..Default::default()
62 }),
63 }
64 }
65}
66#[doc = "The list of people responsible for providing the service."]
67#[derive(Debug, Clone, PartialEq)]
68pub struct EncounterParticipant {
69 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
70 pub r#id: Option<std::string::String>,
71 #[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."]
72 pub r#extension: Vec<super::super::types::Extension>,
73 #[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)."]
74 pub r#modifier_extension: Vec<super::super::types::Extension>,
75 #[doc = "Role of participant in encounter."]
76 pub r#type: Vec<super::super::types::CodeableConcept>,
77 #[doc = "The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period."]
78 pub r#period: Option<Box<super::super::types::Period>>,
79 #[doc = "Persons involved in the encounter other than the patient."]
80 pub r#individual: Option<Box<super::super::types::Reference>>,
81}
82#[allow(clippy::derivable_impls)]
83impl Default for EncounterParticipant {
84 fn default() -> Self {
85 Self {
86 r#id: Default::default(),
87 r#extension: Default::default(),
88 r#modifier_extension: Default::default(),
89 r#type: Default::default(),
90 r#period: Default::default(),
91 r#individual: Default::default(),
92 }
93 }
94}
95#[doc = "The list of diagnosis relevant to this encounter."]
96#[derive(Debug, Clone, PartialEq)]
97pub struct EncounterDiagnosis {
98 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
99 pub r#id: Option<std::string::String>,
100 #[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."]
101 pub r#extension: Vec<super::super::types::Extension>,
102 #[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)."]
103 pub r#modifier_extension: Vec<super::super::types::Extension>,
104 #[doc = "Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure."]
105 pub r#condition: Box<super::super::types::Reference>,
106 #[doc = "Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)."]
107 pub r#use: Option<Box<super::super::types::CodeableConcept>>,
108 #[doc = "Ranking of the diagnosis (for each role type)."]
109 pub r#rank: Option<super::super::types::PositiveInt>,
110}
111#[allow(clippy::derivable_impls)]
112impl Default for EncounterDiagnosis {
113 fn default() -> Self {
114 Self {
115 r#id: Default::default(),
116 r#extension: Default::default(),
117 r#modifier_extension: Default::default(),
118 r#condition: Box::new(super::super::types::Reference {
119 id: Some("$invalid".to_string()),
120 ..Default::default()
121 }),
122 r#use: Default::default(),
123 r#rank: Default::default(),
124 }
125 }
126}
127#[doc = "Details about the admission to a healthcare service."]
128#[derive(Debug, Clone, PartialEq)]
129pub struct EncounterHospitalization {
130 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
131 pub r#id: Option<std::string::String>,
132 #[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."]
133 pub r#extension: Vec<super::super::types::Extension>,
134 #[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)."]
135 pub r#modifier_extension: Vec<super::super::types::Extension>,
136 #[doc = "Pre-admission identifier."]
137 pub r#pre_admission_identifier: Option<Box<super::super::types::Identifier>>,
138 #[doc = "The location/organization from which the patient came before admission."]
139 pub r#origin: Option<Box<super::super::types::Reference>>,
140 #[doc = "From where patient was admitted (physician referral, transfer)."]
141 pub r#admit_source: Option<Box<super::super::types::CodeableConcept>>,
142 #[doc = "Whether this hospitalization is a readmission and why if known."]
143 pub r#re_admission: Option<Box<super::super::types::CodeableConcept>>,
144 #[doc = "Diet preferences reported by the patient."]
145 pub r#diet_preference: Vec<super::super::types::CodeableConcept>,
146 #[doc = "Special courtesies (VIP, board member)."]
147 pub r#special_courtesy: Vec<super::super::types::CodeableConcept>,
148 #[doc = "Any special requests that have been made for this hospitalization encounter, such as the provision of specific equipment or other things."]
149 pub r#special_arrangement: Vec<super::super::types::CodeableConcept>,
150 #[doc = "Location/organization to which the patient is discharged."]
151 pub r#destination: Option<Box<super::super::types::Reference>>,
152 #[doc = "Category or kind of location after discharge."]
153 pub r#discharge_disposition: Option<Box<super::super::types::CodeableConcept>>,
154}
155#[allow(clippy::derivable_impls)]
156impl Default for EncounterHospitalization {
157 fn default() -> Self {
158 Self {
159 r#id: Default::default(),
160 r#extension: Default::default(),
161 r#modifier_extension: Default::default(),
162 r#pre_admission_identifier: Default::default(),
163 r#origin: Default::default(),
164 r#admit_source: Default::default(),
165 r#re_admission: Default::default(),
166 r#diet_preference: Default::default(),
167 r#special_courtesy: Default::default(),
168 r#special_arrangement: Default::default(),
169 r#destination: Default::default(),
170 r#discharge_disposition: Default::default(),
171 }
172 }
173}
174#[doc = "List of locations where the patient has been during this encounter."]
175#[derive(Debug, Clone, PartialEq)]
176pub struct EncounterLocation {
177 #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
178 pub r#id: Option<std::string::String>,
179 #[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."]
180 pub r#extension: Vec<super::super::types::Extension>,
181 #[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)."]
182 pub r#modifier_extension: Vec<super::super::types::Extension>,
183 #[doc = "The location where the encounter takes place."]
184 pub r#location: Box<super::super::types::Reference>,
185 #[doc = "The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time."]
186 pub r#status: Option<super::super::types::Code>,
187 #[doc = "This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query."]
188 pub r#physical_type: Option<Box<super::super::types::CodeableConcept>>,
189 #[doc = "Time period during which the patient was present at the location."]
190 pub r#period: Option<Box<super::super::types::Period>>,
191}
192#[allow(clippy::derivable_impls)]
193impl Default for EncounterLocation {
194 fn default() -> Self {
195 Self {
196 r#id: Default::default(),
197 r#extension: Default::default(),
198 r#modifier_extension: Default::default(),
199 r#location: Box::new(super::super::types::Reference {
200 id: Some("$invalid".to_string()),
201 ..Default::default()
202 }),
203 r#status: Default::default(),
204 r#physical_type: Default::default(),
205 r#period: Default::default(),
206 }
207 }
208}
209#[doc = "An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient."]
210#[derive(Debug, Clone, PartialEq)]
211pub struct Encounter {
212 #[doc = "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes."]
213 pub r#id: Option<super::super::types::Id>,
214 #[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."]
215 pub r#meta: Option<Box<super::super::types::Meta>>,
216 #[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."]
217 pub r#implicit_rules: Option<super::super::types::Uri>,
218 #[doc = "The base language in which the resource is written."]
219 pub r#language: Option<super::super::types::Code>,
220 #[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."]
221 pub r#text: Option<Box<super::super::types::Narrative>>,
222 #[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."]
223 pub r#contained: Vec<super::super::Resource>,
224 #[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."]
225 pub r#extension: Vec<super::super::types::Extension>,
226 #[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)."]
227 pub r#modifier_extension: Vec<super::super::types::Extension>,
228 #[doc = "Identifier(s) by which this encounter is known."]
229 pub r#identifier: Vec<super::super::types::Identifier>,
230 #[doc = "planned | arrived | triaged | in-progress | onleave | finished | cancelled +."]
231 pub r#status: super::super::types::Code,
232 #[doc = "The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them."]
233 pub r#status_history: Vec<EncounterStatusHistory>,
234 #[doc = "Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations."]
235 pub r#class: Box<super::super::types::Coding>,
236 #[doc = "The class history permits the tracking of the encounters transitions without needing to go through the resource history. This would be used for a case where an admission starts of as an emergency encounter, then transitions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kind of discharge from emergency to inpatient."]
237 pub r#class_history: Vec<EncounterClassHistory>,
238 #[doc = "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)."]
239 pub r#type: Vec<super::super::types::CodeableConcept>,
240 #[doc = "Broad categorization of the service that is to be provided (e.g. cardiology)."]
241 pub r#service_type: Option<Box<super::super::types::CodeableConcept>>,
242 #[doc = "Indicates the urgency of the encounter."]
243 pub r#priority: Option<Box<super::super::types::CodeableConcept>>,
244 #[doc = "The patient or group present at the encounter."]
245 pub r#subject: Option<Box<super::super::types::Reference>>,
246 #[doc = "Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years)."]
247 pub r#episode_of_care: Vec<super::super::types::Reference>,
248 #[doc = "The request this encounter satisfies (e.g. incoming referral or procedure request)."]
249 pub r#based_on: Vec<super::super::types::Reference>,
250 #[doc = "The list of people responsible for providing the service."]
251 pub r#participant: Vec<EncounterParticipant>,
252 #[doc = "The appointment that scheduled this encounter."]
253 pub r#appointment: Vec<super::super::types::Reference>,
254 #[doc = "The start and end time of the encounter."]
255 pub r#period: Option<Box<super::super::types::Period>>,
256 #[doc = "Quantity of time the encounter lasted. This excludes the time during leaves of absence."]
257 pub r#length: Option<Box<super::super::types::Duration>>,
258 #[doc = "Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis."]
259 pub r#reason_code: Vec<super::super::types::CodeableConcept>,
260 #[doc = "Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis."]
261 pub r#reason_reference: Vec<super::super::types::Reference>,
262 #[doc = "The list of diagnosis relevant to this encounter."]
263 pub r#diagnosis: Vec<EncounterDiagnosis>,
264 #[doc = "The set of accounts that may be used for billing for this Encounter."]
265 pub r#account: Vec<super::super::types::Reference>,
266 #[doc = "Details about the admission to a healthcare service."]
267 pub r#hospitalization: Option<EncounterHospitalization>,
268 #[doc = "List of locations where the patient has been during this encounter."]
269 pub r#location: Vec<EncounterLocation>,
270 #[doc = "The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation. Refer to the example bundle showing an abbreviated set of Encounters for a colonoscopy."]
271 pub r#service_provider: Option<Box<super::super::types::Reference>>,
272 #[doc = "Another Encounter of which this encounter is a part of (administratively or in time)."]
273 pub r#part_of: Option<Box<super::super::types::Reference>>,
274}
275#[allow(clippy::derivable_impls)]
276impl Default for Encounter {
277 fn default() -> Self {
278 Self {
279 r#id: Default::default(),
280 r#meta: Default::default(),
281 r#implicit_rules: Default::default(),
282 r#language: Default::default(),
283 r#text: Default::default(),
284 r#contained: Default::default(),
285 r#extension: Default::default(),
286 r#modifier_extension: Default::default(),
287 r#identifier: Default::default(),
288 r#status: super::super::types::Code {
289 id: Some("$invalid".to_string()),
290 ..Default::default()
291 },
292 r#status_history: Default::default(),
293 r#class: Box::new(super::super::types::Coding {
294 id: Some("$invalid".to_string()),
295 ..Default::default()
296 }),
297 r#class_history: Default::default(),
298 r#type: Default::default(),
299 r#service_type: Default::default(),
300 r#priority: Default::default(),
301 r#subject: Default::default(),
302 r#episode_of_care: Default::default(),
303 r#based_on: Default::default(),
304 r#participant: Default::default(),
305 r#appointment: Default::default(),
306 r#period: Default::default(),
307 r#length: Default::default(),
308 r#reason_code: Default::default(),
309 r#reason_reference: Default::default(),
310 r#diagnosis: Default::default(),
311 r#account: Default::default(),
312 r#hospitalization: Default::default(),
313 r#location: Default::default(),
314 r#service_provider: Default::default(),
315 r#part_of: Default::default(),
316 }
317 }
318}