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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
//! MedicinalProductDefinition
//!
//! URL: http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition
//!
//! Version: 5.0.0
//!
//! MedicinalProductDefinition Resource: Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use, drug catalogs, to support prescribing, adverse events management etc.).
//!
//! 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;
/// MedicinalProductDefinition
///
/// A detailed definition of a medicinal product, typically for uses other than
/// direct patient care such as regulatory submissions, drug catalogs, prescribing
/// support, and adverse event (pharmacovigilance) management. In FHIR R5 it models
/// a medicine as an administrative and regulatory whole: its business identity
/// (including a Medicinal Product Identifier, or MPID), its regulatory type and
/// domain (human or veterinary), its lifecycle status, its names as registered in
/// different countries and jurisdictions, its classification and marketing status,
/// its ingredients and impurities, and the manufacturing or administrative
/// operations and cross-references that relate it to other products. It is the
/// central node of the FHIR medication-definition module and is usually assembled
/// from, and points to, more granular definitional resources rather than being
/// used to record a specific administration or dispense to a person.
///
/// # Related resources
///
/// This resource composes and references several supporting types and resources.
/// It commonly references `Ingredient`, `PackagedProductDefinition`,
/// `AdministrableProductDefinition`, `ManufacturedItemDefinition`, and
/// `RegulatedAuthorization`. Its contacts and manufacturing organizations are
/// typically references to `Organization`, and many of its coded fields use
/// [`CodeableConcept`](crate::r5::types::CodeableConcept),
/// [`CodeableReference`](crate::r5::types::CodeableReference), and
/// [`Coding`](crate::r5::types::Coding).
///
/// # Examples
///
/// ```
/// use fhir::r5::resources::medicinal_product_definition::MedicinalProductDefinition;
///
/// let value = MedicinalProductDefinition::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: MedicinalProductDefinition = ::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 MedicinalProductDefinition {
/// 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>>,
/// Business identifiers for this product, which may include a regulatory Medicinal Product Identifier (MPID)
pub identifier: Option<Vec<types::Identifier>>,
/// Regulatory type, e.g. Investigational or Authorized
pub r#type: Option<types::CodeableConcept>,
/// If this medicine applies to human or veterinary uses
pub domain: Option<types::CodeableConcept>,
/// A business identifier relating to a specific version of the product
pub version: Option<types::String>,
/// The lifecycle status of this product record, such as active, retired, or pending
pub status: Option<types::CodeableConcept>,
/// The date at which the given status became applicable
pub status_date: Option<types::DateTime>,
/// General description of this product
pub description: Option<types::Markdown>,
/// The dose form for a single part product, or combined form of a multiple part product
pub combined_pharmaceutical_dose_form: Option<types::CodeableConcept>,
/// The path by which the product is taken into or makes contact with the body
pub route: Option<Vec<types::CodeableConcept>>,
/// Description of indication(s) for this product, used when structured indications are not required
pub indication: Option<types::Markdown>,
/// The legal status of supply of the medicinal product as classified by the regulator
pub legal_status_of_supply: Option<types::CodeableConcept>,
/// Whether the Medicinal Product is subject to additional monitoring for regulatory reasons
pub additional_monitoring_indicator: Option<types::CodeableConcept>,
/// Whether the Medicinal Product is subject to special measures for regulatory reasons
pub special_measures: Option<Vec<types::CodeableConcept>>,
/// If authorised for use in children
pub pediatric_use_indicator: Option<types::CodeableConcept>,
/// Allows the product to be classified by various systems
pub classification: Option<Vec<types::CodeableConcept>>,
/// Marketing status of the medicinal product, in contrast to marketing authorization
pub marketing_status: Option<Vec<types::MarketingStatus>>,
/// Package type for the product
pub packaged_medicinal_product: Option<Vec<types::CodeableConcept>>,
/// Types of medicinal manufactured items and/or devices that this product consists of, such as tablets, capsule, or syringes
pub comprised_of: Option<Vec<types::Reference>>,
/// The ingredients of this medicinal product - when not detailed in other resources
pub ingredient: Option<Vec<types::CodeableConcept>>,
/// Any component of the drug product which is not the chemical entity defined as the drug substance, or an excipient in the drug product
pub impurity: Option<Vec<types::CodeableReference>>,
/// Additional documentation about the medicinal product
pub attached_document: Option<Vec<types::Reference>>,
/// A master file for the medicinal product (e.g. Pharmacovigilance System Master File)
pub master_file: Option<Vec<types::Reference>>,
/// A product specific contact, person (in a role), or an organization
pub contact: Option<Vec<MedicinalProductDefinitionContact>>,
/// Clinical trials or studies that this product is involved in
pub clinical_trial: Option<Vec<types::Reference>>,
/// A code that this product is known by, within some formal terminology
pub code: Option<Vec<types::Coding>>,
/// The product's registered name or names, including the full name and any coded parts, per country and jurisdiction
pub name: Vec<MedicinalProductDefinitionName>,
/// Reference to another product, e.g. for linking authorised to investigational product
pub cross_reference: Option<Vec<MedicinalProductDefinitionCrossReference>>,
/// A manufacturing or administrative process for the medicinal product
pub operation: Option<Vec<MedicinalProductDefinitionOperation>>,
/// Key product features such as "sugar free", "modified release"
pub characteristic: Option<Vec<MedicinalProductDefinitionCharacteristic>>,
}
/// MedicinalProductDefinition.contact
///
/// A product specific contact, person (in a role), or an organization.
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
pub struct MedicinalProductDefinitionContact {
/// 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>>,
/// Allows the contact to be classified, for example QPPV, Pharmacovigilance Enquiry Information
pub r#type: Option<types::CodeableConcept>,
/// A product specific contact, person (in a role), or an organization
pub contact: types::Reference,
}
/// MedicinalProductDefinition.name
///
/// The product's name, including full name and possibly coded parts.
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
pub struct MedicinalProductDefinitionName {
/// 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>>,
/// The full product name
pub product_name: types::String,
/// Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary
pub r#type: Option<types::CodeableConcept>,
/// Coding words or phrases of the name
pub part: Option<Vec<MedicinalProductDefinitionNamePart>>,
/// Country and jurisdiction where the name applies
pub usage: Option<Vec<MedicinalProductDefinitionNameUsage>>,
}
/// MedicinalProductDefinition.name.part
///
/// Coding words or phrases of the name.
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
pub struct MedicinalProductDefinitionNamePart {
/// 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>>,
/// A fragment of a product name
pub part: types::String,
/// Identifying type for this part of the name (e.g. strength part)
pub r#type: types::CodeableConcept,
}
/// MedicinalProductDefinition.name.usage
///
/// Country and jurisdiction where the name applies.
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
pub struct MedicinalProductDefinitionNameUsage {
/// 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>>,
/// Country code for where this name applies
pub country: types::CodeableConcept,
/// Jurisdiction code for where this name applies
pub jurisdiction: Option<types::CodeableConcept>,
/// Language code for this name
pub language: types::CodeableConcept,
}
/// MedicinalProductDefinition.crossReference
///
/// Reference to another product, e.g. for linking authorised to investigational product.
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
pub struct MedicinalProductDefinitionCrossReference {
/// 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>>,
/// Reference to another product, e.g. for linking authorised to investigational product
pub product: types::CodeableReference,
/// The type of relationship, for instance branded to generic or virtual to actual product
pub r#type: Option<types::CodeableConcept>,
}
/// MedicinalProductDefinition.operation
///
/// A manufacturing or administrative process for the medicinal product.
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
pub struct MedicinalProductDefinitionOperation {
/// 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>>,
/// The type of manufacturing operation e.g. manufacturing itself, re-packaging
pub r#type: Option<types::CodeableReference>,
/// Date range of applicability
pub effective_date: Option<types::Period>,
/// The organization responsible for the particular process, e.g. the manufacturer or importer
pub organization: Option<Vec<types::Reference>>,
/// Specifies whether this process is considered proprietary or confidential
pub confidentiality_indicator: Option<types::CodeableConcept>,
}
/// MedicinalProductDefinition.characteristic
///
/// Key product features such as "sugar free", "modified release".
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
pub struct MedicinalProductDefinitionCharacteristic {
/// 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>>,
/// A code expressing the type of characteristic
pub r#type: types::CodeableConcept,
/// A value for the characteristic
pub value_codeable_concept: Option<types::CodeableConcept>,
/// A value for the characteristic
pub value_markdown: Option<types::Markdown>,
/// A value for the characteristic
pub value_quantity: Option<types::Quantity>,
/// A value for the characteristic
pub value_integer: Option<types::Integer>,
/// A value for the characteristic
pub value_date: Option<types::Date>,
/// A value for the characteristic
pub value_boolean: Option<types::Boolean>,
/// A value for the characteristic
pub value_attachment: Option<types::Attachment>,
}
#[cfg(test)]
mod tests {
use super::*;
type T = MedicinalProductDefinition;
#[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);
}
}