1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
//! CarePlan
//!
//! URL: http://hl7.org/fhir/StructureDefinition/CarePlan
//!
//! Version: 5.0.0
//!
//! CarePlan Resource: Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.
//!
//! FHIR: <https://build.fhir.org/>
//!
//! UML: <https://build.fhir.org/uml.html>
// Allow unused crate::r5::types as types;
#![allow(unused_imports)]
use crate::r5::types;
use ::serde::{Deserialize, Serialize};
use fhir_derive_macros::Validate;
/// Describes the intention of how one or more practitioners intend to deliver
/// care for a particular patient, group or community for a period of time,
/// possibly limited to care for a specific condition or set of conditions.
///
/// The CarePlan resource is used across many care settings to coordinate the
/// planned and ongoing activities directed at addressing a patient's health
/// concerns. It links the subject of care to the goals, addressed conditions,
/// care team, and the set of intended or performed activities that make up the
/// plan. A CarePlan may be created by a single practitioner for straightforward
/// needs, or it may be built collaboratively by a multi-disciplinary care team
/// spanning several encounters and organizations, and it can be nested or
/// chained via `part_of` and `replaces` so that plans can be superseded or
/// composed of sub-plans over time. Because it is intentional in nature, a
/// CarePlan records what is planned or has occurred, not the clinical findings
/// themselves, and it is often driven by, or drives, order and workflow
/// resources through its `based_on` and `activity` elements.
///
/// In FHIR R5 it commonly references `Goal`, `CareTeam`, and `Condition`
/// resources to build a comprehensive, longitudinal view of a patient's care.
///
/// # Related resources
///
/// - [`Patient`](crate::r5::resources::patient::Patient) - the typical subject of a care plan.
/// - [`CodeableConcept`](crate::r5::types::CodeableConcept) - used for the plan's category.
/// - `Goal`, `CareTeam`, `Condition`, and `Encounter` - frequently associated resources.
///
/// # Examples
///
/// ```
/// use fhir::r5::resources::care_plan::CarePlan;
///
/// let value = CarePlan::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: CarePlan = ::serde_json::from_value(json).unwrap();
/// assert_eq!(value, back);
/// ```
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
pub struct CarePlan {
/// Logical id of this artifact
pub id: Option<types::String>,
/// Metadata about the resource
pub meta: Option<types::Meta>,
/// A set of rules under which this content was created
pub implicit_rules: Option<types::Uri>,
/// Language of the resource content
pub language: Option<types::Code>,
/// Text summary of the resource, for human interpretation
pub text: Option<types::Narrative>,
/// Contained, inline Resources
pub contained: Option<Vec<::serde_json::Value>>,
/// Additional content defined by implementations
pub extension: Option<Vec<types::Extension>>,
/// Extensions that cannot be ignored
pub modifier_extension: Option<Vec<types::Extension>>,
/// External Ids for this plan
pub identifier: Option<Vec<types::Identifier>>,
/// Instantiates FHIR protocol or definition
pub instantiates_canonical: Option<Vec<types::Canonical>>,
/// Instantiates external protocol or definition
pub instantiates_uri: Option<Vec<types::Uri>>,
/// Fulfills plan, proposal or order
pub based_on: Option<Vec<types::Reference>>,
/// CarePlan replaced by this CarePlan
pub replaces: Option<Vec<types::Reference>>,
/// Part of referenced CarePlan
pub part_of: Option<Vec<types::Reference>>,
/// Indicates whether the plan is currently in effect: draft | active | on-hold | revoked | completed | entered-in-error | unknown
pub status: types::Code,
/// Indicates the level of authority/intentionality behind the plan: proposal | plan | order | option | directive
pub intent: types::Code,
/// Type of plan, such as a disease-specific or discharge-oriented plan of care
pub category: Option<Vec<types::CodeableConcept>>,
/// Human-friendly name for the care plan
pub title: Option<types::String>,
/// Summary of nature of plan
pub description: Option<types::String>,
/// Who the care plan is for, typically a reference to a [`Patient`](crate::r5::resources::patient::Patient) or group
pub subject: types::Reference,
/// The Encounter during which this CarePlan was created
pub encounter: Option<types::Reference>,
/// Time period plan covers
pub period: Option<types::Period>,
/// Date record was first recorded
pub created: Option<types::DateTime>,
/// Who is the designated responsible party
pub custodian: Option<types::Reference>,
/// Who provided the content of the care plan
pub contributor: Option<Vec<types::Reference>>,
/// Who's involved in plan?
pub care_team: Option<Vec<types::Reference>>,
/// Health issues this plan addresses
pub addresses: Option<Vec<types::CodeableReference>>,
/// Information considered as part of plan
pub supporting_info: Option<Vec<types::Reference>>,
/// Desired outcome of plan
pub goal: Option<Vec<types::Reference>>,
/// The individual planned or performed activities that make up the plan of care
pub activity: Option<Vec<CarePlanActivity>>,
/// Comments about the plan
pub note: Option<Vec<types::Annotation>>,
}
/// Action to occur or has occurred as part of plan.
///
/// Identifies an action that has occurred or is a planned action to occur as
/// part of the plan. For example, a medication to be used, lab tests to perform,
/// self-monitoring, or education.
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
pub struct CarePlanActivity {
/// Unique id for inter-element referencing
pub id: Option<types::String>,
/// Additional content defined by implementations
pub extension: Option<Vec<types::Extension>>,
/// Extensions that cannot be ignored even if unrecognized
pub modifier_extension: Option<Vec<types::Extension>>,
/// Results of the activity (concept, or Appointment, Encounter, Procedure, etc.)
pub performed_activity: Option<Vec<types::CodeableReference>>,
/// Comments about the activity status/progress
pub progress: Option<Vec<types::Annotation>>,
/// Activity that is intended to be part of the care plan
pub planned_activity_reference: Option<types::Reference>,
}
#[cfg(test)]
mod tests {
use super::*;
type T = CarePlan;
#[test]
fn test_default() {
let _ = T::default();
}
#[test]
fn test_serde_round_trip() {
let value = T::default();
let json = ::serde_json::to_value(&value).expect("to_value");
let back: T = ::serde_json::from_value(json).expect("from_value");
assert_eq!(value, back);
}
}