fhirbolt_model/generated/r5/resources/
medication_request.rs

1// Generated on 2023-05-17 by fhirbolt-codegen v0.10.0
2#[doc = "True if the prescriber allows a different drug to be dispensed from what was prescribed."]
3#[derive(Default, Debug, Clone, PartialEq)]
4pub enum MedicationRequestSubstitutionAllowed {
5    Boolean(super::super::types::Boolean),
6    CodeableConcept(Box<super::super::types::CodeableConcept>),
7    #[default]
8    Invalid,
9}
10#[doc = "Indicates the quantity or duration for the first dispense of the medication."]
11#[derive(Debug, Clone, PartialEq)]
12pub struct MedicationRequestDispenseRequestInitialFill {
13    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
14    pub r#id: Option<std::string::String>,
15    #[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."]
16    pub r#extension: Vec<super::super::types::Extension>,
17    #[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)."]
18    pub r#modifier_extension: Vec<super::super::types::Extension>,
19    #[doc = "The amount or quantity to provide as part of the first dispense."]
20    pub r#quantity: Option<Box<super::super::types::Quantity>>,
21    #[doc = "The length of time that the first dispense is expected to last."]
22    pub r#duration: Option<Box<super::super::types::Duration>>,
23}
24#[allow(clippy::derivable_impls)]
25impl Default for MedicationRequestDispenseRequestInitialFill {
26    fn default() -> Self {
27        Self {
28            r#id: Default::default(),
29            r#extension: Default::default(),
30            r#modifier_extension: Default::default(),
31            r#quantity: Default::default(),
32            r#duration: Default::default(),
33        }
34    }
35}
36#[doc = "Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order).  Note that this information is not always sent with the order.  There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department."]
37#[derive(Debug, Clone, PartialEq)]
38pub struct MedicationRequestDispenseRequest {
39    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
40    pub r#id: Option<std::string::String>,
41    #[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."]
42    pub r#extension: Vec<super::super::types::Extension>,
43    #[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)."]
44    pub r#modifier_extension: Vec<super::super::types::Extension>,
45    #[doc = "Indicates the quantity or duration for the first dispense of the medication."]
46    pub r#initial_fill: Option<MedicationRequestDispenseRequestInitialFill>,
47    #[doc = "The minimum period of time that must occur between dispenses of the medication."]
48    pub r#dispense_interval: Option<Box<super::super::types::Duration>>,
49    #[doc = "This indicates the validity period of a prescription (stale dating the Prescription)."]
50    pub r#validity_period: Option<Box<super::super::types::Period>>,
51    #[doc = "An integer indicating the number of times, in addition to the original dispense, (aka refills or repeats) that the patient can receive the prescribed medication. Usage Notes: This integer does not include the original order dispense. This means that if an order indicates dispense 30 tablets plus \"3 repeats\", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.  A prescriber may explicitly say that zero refills are permitted after the initial dispense."]
52    pub r#number_of_repeats_allowed: Option<super::super::types::UnsignedInt>,
53    #[doc = "The amount that is to be dispensed for one fill."]
54    pub r#quantity: Option<Box<super::super::types::Quantity>>,
55    #[doc = "Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last."]
56    pub r#expected_supply_duration: Option<Box<super::super::types::Duration>>,
57    #[doc = "Indicates the intended performing Organization that will dispense the medication as specified by the prescriber."]
58    pub r#dispenser: Option<Box<super::super::types::Reference>>,
59    #[doc = "Provides additional information to the dispenser, for example, counselling to be provided to the patient."]
60    pub r#dispenser_instruction: Vec<super::super::types::Annotation>,
61    #[doc = "Provides information about the type of adherence packaging to be supplied for the medication dispense."]
62    pub r#dose_administration_aid: Option<Box<super::super::types::CodeableConcept>>,
63}
64#[allow(clippy::derivable_impls)]
65impl Default for MedicationRequestDispenseRequest {
66    fn default() -> Self {
67        Self {
68            r#id: Default::default(),
69            r#extension: Default::default(),
70            r#modifier_extension: Default::default(),
71            r#initial_fill: Default::default(),
72            r#dispense_interval: Default::default(),
73            r#validity_period: Default::default(),
74            r#number_of_repeats_allowed: Default::default(),
75            r#quantity: Default::default(),
76            r#expected_supply_duration: Default::default(),
77            r#dispenser: Default::default(),
78            r#dispenser_instruction: Default::default(),
79            r#dose_administration_aid: Default::default(),
80        }
81    }
82}
83#[doc = "Indicates whether or not substitution can or should be part of the dispense. In some cases, substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done."]
84#[derive(Debug, Clone, PartialEq)]
85pub struct MedicationRequestSubstitution {
86    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
87    pub r#id: Option<std::string::String>,
88    #[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."]
89    pub r#extension: Vec<super::super::types::Extension>,
90    #[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)."]
91    pub r#modifier_extension: Vec<super::super::types::Extension>,
92    #[doc = "True if the prescriber allows a different drug to be dispensed from what was prescribed."]
93    pub r#allowed: MedicationRequestSubstitutionAllowed,
94    #[doc = "Indicates the reason for the substitution, or why substitution must or must not be performed."]
95    pub r#reason: Option<Box<super::super::types::CodeableConcept>>,
96}
97#[allow(clippy::derivable_impls)]
98impl Default for MedicationRequestSubstitution {
99    fn default() -> Self {
100        Self {
101            r#id: Default::default(),
102            r#extension: Default::default(),
103            r#modifier_extension: Default::default(),
104            r#allowed: Default::default(),
105            r#reason: Default::default(),
106        }
107    }
108}
109#[doc = "An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationRequest\" rather than \"MedicationPrescription\" or \"MedicationOrder\" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns."]
110#[derive(Debug, Clone, PartialEq)]
111pub struct MedicationRequest {
112    #[doc = "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes."]
113    pub r#id: Option<super::super::types::Id>,
114    #[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."]
115    pub r#meta: Option<Box<super::super::types::Meta>>,
116    #[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."]
117    pub r#implicit_rules: Option<super::super::types::Uri>,
118    #[doc = "The base language in which the resource is written."]
119    pub r#language: Option<super::super::types::Code>,
120    #[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."]
121    pub r#text: Option<Box<super::super::types::Narrative>>,
122    #[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."]
123    pub r#contained: Vec<super::super::Resource>,
124    #[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."]
125    pub r#extension: Vec<super::super::types::Extension>,
126    #[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)."]
127    pub r#modifier_extension: Vec<super::super::types::Extension>,
128    #[doc = "Identifiers associated with this medication request that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server."]
129    pub r#identifier: Vec<super::super::types::Identifier>,
130    #[doc = "A plan or request that is fulfilled in whole or in part by this medication request."]
131    pub r#based_on: Vec<super::super::types::Reference>,
132    #[doc = "Reference to an order/prescription that is being replaced by this MedicationRequest."]
133    pub r#prior_prescription: Option<Box<super::super::types::Reference>>,
134    #[doc = "A shared identifier common to multiple independent Request instances that were activated/authorized more or less simultaneously by a single author.  The presence of the same identifier on each request ties those requests together and may have business ramifications in terms of reporting of results, billing, etc.  E.g. a requisition number shared by a set of lab tests ordered together, or a prescription number shared by all meds ordered at one time."]
135    pub r#group_identifier: Option<Box<super::super::types::Identifier>>,
136    #[doc = "A code specifying the current state of the order.  Generally, this will be active or completed state."]
137    pub r#status: super::super::types::Code,
138    #[doc = "Captures the reason for the current state of the MedicationRequest."]
139    pub r#status_reason: Option<Box<super::super::types::CodeableConcept>>,
140    #[doc = "The date (and perhaps time) when the status was changed."]
141    pub r#status_changed: Option<super::super::types::DateTime>,
142    #[doc = "Whether the request is a proposal, plan, or an original order."]
143    pub r#intent: super::super::types::Code,
144    #[doc = "An arbitrary categorization or grouping of the medication request.  It could be used for indicating where meds are intended to be administered, eg. in an inpatient setting or in a patient's home, or a legal category of the medication."]
145    pub r#category: Vec<super::super::types::CodeableConcept>,
146    #[doc = "Indicates how quickly the Medication Request should be addressed with respect to other requests."]
147    pub r#priority: Option<super::super::types::Code>,
148    #[doc = "If true, indicates that the provider is asking for the patient to either stop taking or to not start taking the specified medication. For example, the patient is taking an existing medication and the provider is changing their medication. They want to create two seperate requests: one to stop using the current medication and another to start the new medication."]
149    pub r#do_not_perform: Option<super::super::types::Boolean>,
150    #[doc = "Identifies the medication being requested. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications."]
151    pub r#medication: Box<super::super::types::CodeableReference>,
152    #[doc = "The individual or group for whom the medication has been requested."]
153    pub r#subject: Box<super::super::types::Reference>,
154    #[doc = "The person or organization who provided the information about this request, if the source is someone other than the requestor.  This is often used when the MedicationRequest is reported by another person."]
155    pub r#information_source: Vec<super::super::types::Reference>,
156    #[doc = "The Encounter during which this \\[x\\] was created or to which the creation of this record is tightly associated."]
157    pub r#encounter: Option<Box<super::super::types::Reference>>,
158    #[doc = "Information to support fulfilling (i.e. dispensing or administering) of the medication, for example, patient height and weight, a MedicationStatement for the patient)."]
159    pub r#supporting_information: Vec<super::super::types::Reference>,
160    #[doc = "The date (and perhaps time) when the prescription was initially written or authored on."]
161    pub r#authored_on: Option<super::super::types::DateTime>,
162    #[doc = "The individual, organization, or device that initiated the request and has responsibility for its activation."]
163    pub r#requester: Option<Box<super::super::types::Reference>>,
164    #[doc = "Indicates if this record was captured as a secondary 'reported' record rather than as an original primary source-of-truth record.  It may also indicate the source of the report."]
165    pub r#reported: Option<super::super::types::Boolean>,
166    #[doc = "Indicates the type of performer of the administration of the medication."]
167    pub r#performer_type: Option<Box<super::super::types::CodeableConcept>>,
168    #[doc = "The specified desired performer of the medication treatment (e.g. the performer of the medication administration).  For devices, this is the device that is intended to perform the administration of the medication.  An IV Pump would be an example of a device that is performing the administration.  Both the IV Pump and the practitioner that set the rate or bolus on the pump can be listed as performers."]
169    pub r#performer: Vec<super::super::types::Reference>,
170    #[doc = "The intended type of device that is to be used for the administration of the medication (for example, PCA Pump)."]
171    pub r#device: Vec<super::super::types::CodeableReference>,
172    #[doc = "The person who entered the order on behalf of another individual for example in the case of a verbal or a telephone order."]
173    pub r#recorder: Option<Box<super::super::types::Reference>>,
174    #[doc = "The reason or the indication for ordering or not ordering the medication."]
175    pub r#reason: Vec<super::super::types::CodeableReference>,
176    #[doc = "The description of the overall pattern of the administration of the medication to the patient."]
177    pub r#course_of_therapy_type: Option<Box<super::super::types::CodeableConcept>>,
178    #[doc = "Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service."]
179    pub r#insurance: Vec<super::super::types::Reference>,
180    #[doc = "Extra information about the prescription that could not be conveyed by the other attributes."]
181    pub r#note: Vec<super::super::types::Annotation>,
182    #[doc = "The full representation of the dose of the medication included in all dosage instructions.  To be used when multiple dosage instructions are included to represent complex dosing such as increasing or tapering doses."]
183    pub r#rendered_dosage_instruction: Option<super::super::types::Markdown>,
184    #[doc = "The period over which the medication is to be taken.  Where there are multiple dosageInstruction lines (for example, tapering doses), this is the earliest date and the latest end date of the dosageInstructions."]
185    pub r#effective_dose_period: Option<Box<super::super::types::Period>>,
186    #[doc = "Specific instructions for how the medication is to be used by the patient."]
187    pub r#dosage_instruction: Vec<super::super::types::Dosage>,
188    #[doc = "Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order).  Note that this information is not always sent with the order.  There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department."]
189    pub r#dispense_request: Option<MedicationRequestDispenseRequest>,
190    #[doc = "Indicates whether or not substitution can or should be part of the dispense. In some cases, substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done."]
191    pub r#substitution: Option<MedicationRequestSubstitution>,
192    #[doc = "Links to Provenance records for past versions of this resource or fulfilling request or event resources that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource."]
193    pub r#event_history: Vec<super::super::types::Reference>,
194}
195#[allow(clippy::derivable_impls)]
196impl Default for MedicationRequest {
197    fn default() -> Self {
198        Self {
199            r#id: Default::default(),
200            r#meta: Default::default(),
201            r#implicit_rules: Default::default(),
202            r#language: Default::default(),
203            r#text: Default::default(),
204            r#contained: Default::default(),
205            r#extension: Default::default(),
206            r#modifier_extension: Default::default(),
207            r#identifier: Default::default(),
208            r#based_on: Default::default(),
209            r#prior_prescription: Default::default(),
210            r#group_identifier: Default::default(),
211            r#status: super::super::types::Code {
212                id: Some("$invalid".to_string()),
213                ..Default::default()
214            },
215            r#status_reason: Default::default(),
216            r#status_changed: Default::default(),
217            r#intent: super::super::types::Code {
218                id: Some("$invalid".to_string()),
219                ..Default::default()
220            },
221            r#category: Default::default(),
222            r#priority: Default::default(),
223            r#do_not_perform: Default::default(),
224            r#medication: Box::new(super::super::types::CodeableReference {
225                id: Some("$invalid".to_string()),
226                ..Default::default()
227            }),
228            r#subject: Box::new(super::super::types::Reference {
229                id: Some("$invalid".to_string()),
230                ..Default::default()
231            }),
232            r#information_source: Default::default(),
233            r#encounter: Default::default(),
234            r#supporting_information: Default::default(),
235            r#authored_on: Default::default(),
236            r#requester: Default::default(),
237            r#reported: Default::default(),
238            r#performer_type: Default::default(),
239            r#performer: Default::default(),
240            r#device: Default::default(),
241            r#recorder: Default::default(),
242            r#reason: Default::default(),
243            r#course_of_therapy_type: Default::default(),
244            r#insurance: Default::default(),
245            r#note: Default::default(),
246            r#rendered_dosage_instruction: Default::default(),
247            r#effective_dose_period: Default::default(),
248            r#dosage_instruction: Default::default(),
249            r#dispense_request: Default::default(),
250            r#substitution: Default::default(),
251            r#event_history: Default::default(),
252        }
253    }
254}