fhir_model/r5/types/
generated.rs

1//! Generated code! Take a look at the generator-crate for changing this file!
2#![allow(clippy::too_many_lines, reason = "Generated code")]
3use ::core::num::NonZeroU32;
4use serde::{Serialize, Deserialize};
5#[cfg(feature = "builders")]
6use derive_builder::Builder;
7use super::super::codes;
8#[allow(unused_imports, reason = "Generated code; Integer64 is unused in R4B")]
9use crate::{Base64Binary, Date, DateTime, Instant, Time, Integer64};
10/** Address Type: An address expressed using postal conventions (as opposed to GPS or other location definition formats).  This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery.  There are a variety of postal address formats defined around the world.
11The ISO21090-codedString may be used to provide a coded representation of the contents of strings in an Address.
12
13 **[Address](http://hl7.org/fhir/StructureDefinition/Address) v5.0.0**
14
15 An address expressed using postal conventions (as opposed to GPS or other location definition formats)
16
17 An address expressed using postal conventions (as opposed to GPS or other location definition formats).  This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery.  There are a variety of postal address formats defined around the world.
18The ISO21090-codedString may be used to provide a coded representation of the contents of strings in an Address.
19
20 Note: address is intended to describe postal addresses for administrative purposes, not to describe absolute geographical coordinates.  Postal addresses are often used as proxies for physical locations (also see the [Location](location.html#) resource). */
21#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
22#[serde(transparent)]
23pub struct Address(pub Box<AddressInner>);
24/** Address Type: An address expressed using postal conventions (as opposed to GPS or other location definition formats).  This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery.  There are a variety of postal address formats defined around the world.
25The ISO21090-codedString may be used to provide a coded representation of the contents of strings in an Address.
26
27 **[Address](http://hl7.org/fhir/StructureDefinition/Address) v5.0.0**
28
29 An address expressed using postal conventions (as opposed to GPS or other location definition formats)
30
31 An address expressed using postal conventions (as opposed to GPS or other location definition formats).  This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery.  There are a variety of postal address formats defined around the world.
32The ISO21090-codedString may be used to provide a coded representation of the contents of strings in an Address.
33
34 Note: address is intended to describe postal addresses for administrative purposes, not to describe absolute geographical coordinates.  Postal addresses are often used as proxies for physical locations (also see the [Location](location.html#) resource). */
35#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
36#[cfg_attr(feature = "builders", derive(Builder))]
37#[serde(rename_all = "camelCase")]
38#[cfg_attr(
39    feature = "builders",
40    builder(
41        pattern = "owned",
42        name = "AddressBuilder",
43        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
44    )
45)]
46pub struct AddressInner {
47    /** **Unique id for inter-element referencing**
48
49 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
50
51 */
52    #[serde(default, skip_serializing_if = "Option::is_none")]
53    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
54    #[serde(rename = "id")]
55    pub id: Option<String>,
56    /** **Additional content defined by implementations**
57
58 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.
59
60 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
61    #[serde(default, skip_serializing_if = "Vec::is_empty")]
62    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
63    #[serde(rename = "extension")]
64    pub extension: Vec<Extension>,
65    /** **[AddressUse](http://hl7.org/fhir/ValueSet/address-use); home | work | temp | old | billing - purpose of this address**
66
67 The purpose of this address.
68
69 Applications can assume that an address is current unless it explicitly says that it is temporary or old. */
70    #[serde(default, skip_serializing_if = "Option::is_none")]
71    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
72    #[serde(rename = "use")]
73    pub r#use: Option<codes::AddressUse>,
74    /// Extension field.
75    #[serde(default, skip_serializing_if = "Option::is_none")]
76    #[serde(rename = "_use")]
77    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
78    pub r#use_ext: Option<FieldExtension>,
79    /** **[AddressType](http://hl7.org/fhir/ValueSet/address-type); postal | physical | both**
80
81 Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.
82
83 The definition of Address states that "address is intended to describe postal addresses, not physical locations". However, many applications track whether an address has a dual purpose of being a location that can be visited as well as being a valid delivery destination, and Postal addresses are often used as proxies for physical locations (also see the [Location](location.html#) resource). */
84    #[serde(default, skip_serializing_if = "Option::is_none")]
85    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
86    #[serde(rename = "type")]
87    pub r#type: Option<codes::AddressType>,
88    /// Extension field.
89    #[serde(default, skip_serializing_if = "Option::is_none")]
90    #[serde(rename = "_type")]
91    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
92    pub r#type_ext: Option<FieldExtension>,
93    /** **Text representation of the address**
94
95 Specifies the entire address as it should be displayed e.g. on a postal label. This may be provided instead of or as well as the specific parts.
96
97 Can provide both a text representation and parts. Applications updating an address SHALL ensure that  when both text and parts are present,  no content is included in the text that isn't found in a part. */
98    #[serde(default, skip_serializing_if = "Option::is_none")]
99    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
100    #[serde(rename = "text")]
101    pub text: Option<String>,
102    /// Extension field.
103    #[serde(default, skip_serializing_if = "Option::is_none")]
104    #[serde(rename = "_text")]
105    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
106    pub text_ext: Option<FieldExtension>,
107    /** **Street name, number, direction & P.O. Box etc.**
108
109 This component contains the house number, apartment number, street name, street direction,  P.O. Box number, delivery hints, and similar address information.
110
111 */
112    #[serde(default, skip_serializing_if = "Vec::is_empty")]
113    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
114    #[serde(rename = "line")]
115    pub line: Vec<Option<String>>,
116    /// Extension field.
117    #[serde(default, skip_serializing_if = "Vec::is_empty")]
118    #[serde(rename = "_line")]
119    #[cfg_attr(feature = "builders", builder(default))]
120    pub line_ext: Vec<Option<FieldExtension>>,
121    /** **Name of city, town etc.**
122
123 The name of the city, town, suburb, village or other community or delivery center.
124
125 */
126    #[serde(default, skip_serializing_if = "Option::is_none")]
127    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
128    #[serde(rename = "city")]
129    pub city: Option<String>,
130    /// Extension field.
131    #[serde(default, skip_serializing_if = "Option::is_none")]
132    #[serde(rename = "_city")]
133    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
134    pub city_ext: Option<FieldExtension>,
135    /** **District name (aka county)**
136
137 The name of the administrative area (county).
138
139 District is sometimes known as county, but in some regions 'county' is used in place of city (municipality), so county name should be conveyed in city instead. */
140    #[serde(default, skip_serializing_if = "Option::is_none")]
141    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
142    #[serde(rename = "district")]
143    pub district: Option<String>,
144    /// Extension field.
145    #[serde(default, skip_serializing_if = "Option::is_none")]
146    #[serde(rename = "_district")]
147    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
148    pub district_ext: Option<FieldExtension>,
149    /** **Sub-unit of country (abbreviations ok)**
150
151 Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes).
152
153 */
154    #[serde(default, skip_serializing_if = "Option::is_none")]
155    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
156    #[serde(rename = "state")]
157    pub state: Option<String>,
158    /// Extension field.
159    #[serde(default, skip_serializing_if = "Option::is_none")]
160    #[serde(rename = "_state")]
161    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
162    pub state_ext: Option<FieldExtension>,
163    /** **Postal code for area**
164
165 A postal code designating a region defined by the postal service.
166
167 */
168    #[serde(default, skip_serializing_if = "Option::is_none")]
169    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
170    #[serde(rename = "postalCode")]
171    pub postal_code: Option<String>,
172    /// Extension field.
173    #[serde(default, skip_serializing_if = "Option::is_none")]
174    #[serde(rename = "_postalCode")]
175    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
176    pub postal_code_ext: Option<FieldExtension>,
177    /** **Country (e.g. may be ISO 3166 2 or 3 letter code)**
178
179 Country - a nation as commonly understood or generally accepted.
180
181 ISO 3166 2- or 3- letter codes MAY be used in place of a human readable country name. */
182    #[serde(default, skip_serializing_if = "Option::is_none")]
183    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
184    #[serde(rename = "country")]
185    pub country: Option<String>,
186    /// Extension field.
187    #[serde(default, skip_serializing_if = "Option::is_none")]
188    #[serde(rename = "_country")]
189    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
190    pub country_ext: Option<FieldExtension>,
191    /** **Time period when address was/is in use**
192
193 Time period when address was/is in use.
194
195 */
196    #[serde(default, skip_serializing_if = "Option::is_none")]
197    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
198    #[serde(rename = "period")]
199    pub period: Option<Period>,
200    /// Extension field.
201    #[serde(default, skip_serializing_if = "Option::is_none")]
202    #[serde(rename = "_period")]
203    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
204    pub period_ext: Option<FieldExtension>,
205}
206#[cfg(feature = "builders")]
207impl AddressBuilder {
208    #[doc = concat!("Finalize building ", "Address", ".")]
209    pub fn build(self) -> Result<Address, crate::error::BuilderError> {
210        self.build_inner().map(Into::into)
211    }
212}
213impl From<AddressInner> for Address {
214    fn from(inner: AddressInner) -> Self {
215        Self(Box::new(inner))
216    }
217}
218impl ::core::ops::Deref for Address {
219    type Target = AddressInner;
220    fn deref(&self) -> &Self::Target {
221        &self.0
222    }
223}
224impl ::core::ops::DerefMut for Address {
225    fn deref_mut(&mut self) -> &mut Self::Target {
226        &mut self.0
227    }
228}
229impl Address {
230    /// Start building an instance.
231    #[cfg(feature = "builders")]
232    #[must_use]
233    pub fn builder() -> AddressBuilder {
234        AddressBuilder::default()
235    }
236}
237/** Age Type: A duration of time during which an organism (or a process) has existed.
238
239 **[Age](http://hl7.org/fhir/StructureDefinition/Age) v5.0.0**
240
241 A duration of time during which an organism (or a process) has existed
242
243 A duration of time during which an organism (or a process) has existed.
244
245 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
246#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
247#[serde(transparent)]
248pub struct Age(pub Box<AgeInner>);
249/** Age Type: A duration of time during which an organism (or a process) has existed.
250
251 **[Age](http://hl7.org/fhir/StructureDefinition/Age) v5.0.0**
252
253 A duration of time during which an organism (or a process) has existed
254
255 A duration of time during which an organism (or a process) has existed.
256
257 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
258#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
259#[cfg_attr(feature = "builders", derive(Builder))]
260#[serde(rename_all = "camelCase")]
261#[cfg_attr(
262    feature = "builders",
263    builder(
264        pattern = "owned",
265        name = "AgeBuilder",
266        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
267    )
268)]
269pub struct AgeInner {
270    /** **Unique id for inter-element referencing**
271
272 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
273
274 */
275    #[serde(default, skip_serializing_if = "Option::is_none")]
276    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
277    #[serde(rename = "id")]
278    pub id: Option<String>,
279    /** **Additional content defined by implementations**
280
281 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.
282
283 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
284    #[serde(default, skip_serializing_if = "Vec::is_empty")]
285    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
286    #[serde(rename = "extension")]
287    pub extension: Vec<Extension>,
288    /** **Numerical value (with implicit precision)**
289
290 The value of the measured amount. The value includes an implicit precision in the presentation of the value.
291
292 The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books). */
293    #[serde(default, skip_serializing_if = "Option::is_none")]
294    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
295    #[serde(rename = "value")]
296    pub value: Option<f64>,
297    /** **[QuantityComparator](http://hl7.org/fhir/ValueSet/quantity-comparator); < | <= | >= | > | ad - how to understand the value**
298
299 How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.
300
301 */
302    #[serde(default, skip_serializing_if = "Option::is_none")]
303    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
304    #[serde(rename = "comparator")]
305    pub comparator: Option<codes::QuantityComparator>,
306    /** **Unit representation**
307
308 A human-readable form of the unit.
309
310 */
311    #[serde(default, skip_serializing_if = "Option::is_none")]
312    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
313    #[serde(rename = "unit")]
314    pub unit: Option<String>,
315    /** **System that defines coded unit form**
316
317 The identification of the system that provides the coded form of the unit.
318
319 */
320    #[serde(default, skip_serializing_if = "Option::is_none")]
321    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
322    #[serde(rename = "system")]
323    pub system: Option<String>,
324    /** **Coded form of the unit**
325
326 A computer processable form of the unit in some unit representation system.
327
328 The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency.  The context of use may additionally require a code from a particular system. */
329    #[serde(default, skip_serializing_if = "Option::is_none")]
330    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
331    #[serde(rename = "code")]
332    pub code: Option<String>,
333}
334#[cfg(feature = "builders")]
335impl AgeBuilder {
336    #[doc = concat!("Finalize building ", "Age", ".")]
337    pub fn build(self) -> Result<Age, crate::error::BuilderError> {
338        self.build_inner().map(Into::into)
339    }
340}
341impl From<AgeInner> for Age {
342    fn from(inner: AgeInner) -> Self {
343        Self(Box::new(inner))
344    }
345}
346impl ::core::ops::Deref for Age {
347    type Target = AgeInner;
348    fn deref(&self) -> &Self::Target {
349        &self.0
350    }
351}
352impl ::core::ops::DerefMut for Age {
353    fn deref_mut(&mut self) -> &mut Self::Target {
354        &mut self.0
355    }
356}
357impl Age {
358    /// Start building an instance.
359    #[cfg(feature = "builders")]
360    #[must_use]
361    pub fn builder() -> AgeBuilder {
362        AgeBuilder::default()
363    }
364}
365/** Annotation Type: A  text note which also  contains information about who made the statement and when.
366
367 **[Annotation](http://hl7.org/fhir/StructureDefinition/Annotation) v5.0.0**
368
369 Text node with attribution
370
371 A  text note which also  contains information about who made the statement and when.
372
373 For systems that do not have structured annotations, they can simply communicate a single annotation with no author or time.  This element may need to be included in narrative because of the potential for modifying information.  *Annotations SHOULD NOT* be used to communicate "modifying" information that could be computable. (This is a SHOULD because enforcing user behavior is nearly impossible). */
374#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
375#[serde(transparent)]
376pub struct Annotation(pub Box<AnnotationInner>);
377/** Annotation Type: A  text note which also  contains information about who made the statement and when.
378
379 **[Annotation](http://hl7.org/fhir/StructureDefinition/Annotation) v5.0.0**
380
381 Text node with attribution
382
383 A  text note which also  contains information about who made the statement and when.
384
385 For systems that do not have structured annotations, they can simply communicate a single annotation with no author or time.  This element may need to be included in narrative because of the potential for modifying information.  *Annotations SHOULD NOT* be used to communicate "modifying" information that could be computable. (This is a SHOULD because enforcing user behavior is nearly impossible). */
386#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
387#[cfg_attr(feature = "builders", derive(Builder))]
388#[serde(rename_all = "camelCase")]
389#[cfg_attr(
390    feature = "builders",
391    builder(
392        pattern = "owned",
393        name = "AnnotationBuilder",
394        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
395    )
396)]
397pub struct AnnotationInner {
398    /** **Unique id for inter-element referencing**
399
400 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
401
402 */
403    #[serde(default, skip_serializing_if = "Option::is_none")]
404    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
405    #[serde(rename = "id")]
406    pub id: Option<String>,
407    /** **Additional content defined by implementations**
408
409 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.
410
411 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
412    #[serde(default, skip_serializing_if = "Vec::is_empty")]
413    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
414    #[serde(rename = "extension")]
415    pub extension: Vec<Extension>,
416    /** **Individual responsible for the annotation**
417
418 The individual responsible for making the annotation.
419
420 Organization is used when there's no need for specific attribution as to who made the comment. */
421    #[serde(default, skip_serializing_if = "Option::is_none")]
422    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
423    #[serde(flatten)]
424    pub author: Option<AnnotationAuthor>,
425    /// Extension field.
426    #[serde(default, skip_serializing_if = "Option::is_none")]
427    #[serde(flatten)]
428    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
429    pub author_ext: Option<AnnotationAuthorExtension>,
430    /** **When the annotation was made**
431
432 Indicates when this particular annotation was made.
433
434 */
435    #[serde(default, skip_serializing_if = "Option::is_none")]
436    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
437    #[serde(rename = "time")]
438    pub time: Option<DateTime>,
439    /// Extension field.
440    #[serde(default, skip_serializing_if = "Option::is_none")]
441    #[serde(rename = "_time")]
442    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
443    pub time_ext: Option<FieldExtension>,
444    /** **The annotation  - text content (as markdown)**
445
446 The text of the annotation in markdown format.
447
448 */
449    #[serde(rename = "text")]
450    pub text: String,
451    /// Extension field.
452    #[serde(default, skip_serializing_if = "Option::is_none")]
453    #[serde(rename = "_text")]
454    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
455    pub text_ext: Option<FieldExtension>,
456}
457#[cfg(feature = "builders")]
458impl AnnotationBuilder {
459    #[doc = concat!("Finalize building ", "Annotation", ".")]
460    pub fn build(self) -> Result<Annotation, crate::error::BuilderError> {
461        self.build_inner().map(Into::into)
462    }
463}
464impl From<AnnotationInner> for Annotation {
465    fn from(inner: AnnotationInner) -> Self {
466        Self(Box::new(inner))
467    }
468}
469impl ::core::ops::Deref for Annotation {
470    type Target = AnnotationInner;
471    fn deref(&self) -> &Self::Target {
472        &self.0
473    }
474}
475impl ::core::ops::DerefMut for Annotation {
476    fn deref_mut(&mut self) -> &mut Self::Target {
477        &mut self.0
478    }
479}
480impl Annotation {
481    /// Start building an instance.
482    #[cfg(feature = "builders")]
483    #[must_use]
484    pub fn builder() -> AnnotationBuilder {
485        AnnotationBuilder::default()
486    }
487}
488/// Choice of types for the author[x] field in Annotation
489#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
490#[serde(rename_all = "camelCase")]
491pub enum AnnotationAuthor {
492    /// Variant accepting the Reference type.
493    #[serde(rename = "authorReference")]
494    Reference(Reference),
495    /// Variant accepting the String type.
496    #[serde(rename = "authorString")]
497    String(String),
498}
499/// Extension value for AnnotationAuthor.
500#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
501#[serde(rename_all = "camelCase")]
502pub enum AnnotationAuthorExtension {
503    /// Variant accepting the Reference extension.
504    #[serde(rename = "_authorReference")]
505    Reference(FieldExtension),
506    /// Variant accepting the String extension.
507    #[serde(rename = "_authorString")]
508    String(FieldExtension),
509}
510/** Attachment Type: For referring to data content defined in other formats.
511
512 **[Attachment](http://hl7.org/fhir/StructureDefinition/Attachment) v5.0.0**
513
514 Content in a format defined elsewhere
515
516 For referring to data content defined in other formats.
517
518 When providing a summary view (for example with Observation.value[x]) Attachment should be represented with a brief display text such as "Signed Procedure Consent". */
519#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
520#[serde(transparent)]
521pub struct Attachment(pub Box<AttachmentInner>);
522/** Attachment Type: For referring to data content defined in other formats.
523
524 **[Attachment](http://hl7.org/fhir/StructureDefinition/Attachment) v5.0.0**
525
526 Content in a format defined elsewhere
527
528 For referring to data content defined in other formats.
529
530 When providing a summary view (for example with Observation.value[x]) Attachment should be represented with a brief display text such as "Signed Procedure Consent". */
531#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
532#[cfg_attr(feature = "builders", derive(Builder))]
533#[serde(rename_all = "camelCase")]
534#[cfg_attr(
535    feature = "builders",
536    builder(
537        pattern = "owned",
538        name = "AttachmentBuilder",
539        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
540    )
541)]
542pub struct AttachmentInner {
543    /** **Unique id for inter-element referencing**
544
545 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
546
547 */
548    #[serde(default, skip_serializing_if = "Option::is_none")]
549    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
550    #[serde(rename = "id")]
551    pub id: Option<String>,
552    /** **Additional content defined by implementations**
553
554 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.
555
556 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
557    #[serde(default, skip_serializing_if = "Vec::is_empty")]
558    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
559    #[serde(rename = "extension")]
560    pub extension: Vec<Extension>,
561    /** **[MimeType](http://hl7.org/fhir/ValueSet/mimetypes); Mime type of the content, with charset etc.**
562
563 Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.
564
565 */
566    #[serde(default, skip_serializing_if = "Option::is_none")]
567    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
568    #[serde(rename = "contentType")]
569    pub content_type: Option<String>,
570    /// Extension field.
571    #[serde(default, skip_serializing_if = "Option::is_none")]
572    #[serde(rename = "_contentType")]
573    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
574    pub content_type_ext: Option<FieldExtension>,
575    /** **[Language](http://hl7.org/fhir/ValueSet/all-languages); Human language of the content (BCP-47)**
576
577 The human language of the content. The value can be any valid value according to BCP 47.
578
579 */
580    #[serde(default, skip_serializing_if = "Option::is_none")]
581    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
582    #[serde(rename = "language")]
583    pub language: Option<String>,
584    /// Extension field.
585    #[serde(default, skip_serializing_if = "Option::is_none")]
586    #[serde(rename = "_language")]
587    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
588    pub language_ext: Option<FieldExtension>,
589    /** **Data inline, base64ed**
590
591 The actual data of the attachment - a sequence of bytes, base64 encoded.
592
593 The base64-encoded data SHALL be expressed in the same character set as the base resource XML or JSON. */
594    #[serde(default, skip_serializing_if = "Option::is_none")]
595    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
596    #[serde(rename = "data")]
597    pub data: Option<Base64Binary>,
598    /// Extension field.
599    #[serde(default, skip_serializing_if = "Option::is_none")]
600    #[serde(rename = "_data")]
601    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
602    pub data_ext: Option<FieldExtension>,
603    /** **Uri where the data can be found**
604
605 A location where the data can be accessed.
606
607 If both data and url are provided, the url SHALL point to the same content as the data contains. Urls may be relative references or may reference transient locations such as a wrapping envelope using cid: though this has ramifications for using signatures. Relative URLs are interpreted relative to the service url, like a resource reference, rather than relative to the resource itself. If a URL is provided, it SHALL resolve to actual data. */
608    #[serde(default, skip_serializing_if = "Option::is_none")]
609    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
610    #[serde(rename = "url")]
611    pub url: Option<String>,
612    /// Extension field.
613    #[serde(default, skip_serializing_if = "Option::is_none")]
614    #[serde(rename = "_url")]
615    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
616    pub url_ext: Option<FieldExtension>,
617    /** **Number of bytes of content (if url provided)**
618
619 The number of bytes of data that make up this attachment (before base64 encoding, if that is done).
620
621 The number of bytes is redundant if the data is provided as a base64binary, but is useful if the data is provided as a url reference. */
622    #[serde(default, skip_serializing_if = "Option::is_none")]
623    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
624    #[serde(rename = "size")]
625    pub size: Option<Integer64>,
626    /// Extension field.
627    #[serde(default, skip_serializing_if = "Option::is_none")]
628    #[serde(rename = "_size")]
629    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
630    pub size_ext: Option<FieldExtension>,
631    /** **Hash of the data (sha-1, base64ed)**
632
633 The calculated hash of the data using SHA-1. Represented using base64.
634
635 The hash is calculated on the data prior to base64 encoding, if the data is based64 encoded. The hash is not intended to support digital signatures. Where protection against malicious threats a digital signature should be considered, see [Provenance.signature](provenance-definitions.html#Provenance.signature) for mechanism to protect a resource with a digital signature. */
636    #[serde(default, skip_serializing_if = "Option::is_none")]
637    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
638    #[serde(rename = "hash")]
639    pub hash: Option<Base64Binary>,
640    /// Extension field.
641    #[serde(default, skip_serializing_if = "Option::is_none")]
642    #[serde(rename = "_hash")]
643    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
644    pub hash_ext: Option<FieldExtension>,
645    /** **Label to display in place of the data**
646
647 A label or set of text to display in place of the data.
648
649 May sometimes be derived from the source filename. */
650    #[serde(default, skip_serializing_if = "Option::is_none")]
651    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
652    #[serde(rename = "title")]
653    pub title: Option<String>,
654    /// Extension field.
655    #[serde(default, skip_serializing_if = "Option::is_none")]
656    #[serde(rename = "_title")]
657    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
658    pub title_ext: Option<FieldExtension>,
659    /** **Date attachment was first created**
660
661 The date that the attachment was first created.
662
663 */
664    #[serde(default, skip_serializing_if = "Option::is_none")]
665    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
666    #[serde(rename = "creation")]
667    pub creation: Option<DateTime>,
668    /// Extension field.
669    #[serde(default, skip_serializing_if = "Option::is_none")]
670    #[serde(rename = "_creation")]
671    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
672    pub creation_ext: Option<FieldExtension>,
673    /** **Height of the image in pixels (photo/video)**
674
675 Height of the image in pixels (photo/video).
676
677 */
678    #[serde(default, skip_serializing_if = "Option::is_none")]
679    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
680    #[serde(rename = "height")]
681    pub height: Option<NonZeroU32>,
682    /// Extension field.
683    #[serde(default, skip_serializing_if = "Option::is_none")]
684    #[serde(rename = "_height")]
685    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
686    pub height_ext: Option<FieldExtension>,
687    /** **Width of the image in pixels (photo/video)**
688
689 Width of the image in pixels (photo/video).
690
691 */
692    #[serde(default, skip_serializing_if = "Option::is_none")]
693    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
694    #[serde(rename = "width")]
695    pub width: Option<NonZeroU32>,
696    /// Extension field.
697    #[serde(default, skip_serializing_if = "Option::is_none")]
698    #[serde(rename = "_width")]
699    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
700    pub width_ext: Option<FieldExtension>,
701    /** **Number of frames if > 1 (photo)**
702
703 The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.
704
705 if the number of frames is not supplied, the value may be unknown. Applications should not assume that there is only one frame unless it is explicitly stated. */
706    #[serde(default, skip_serializing_if = "Option::is_none")]
707    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
708    #[serde(rename = "frames")]
709    pub frames: Option<NonZeroU32>,
710    /// Extension field.
711    #[serde(default, skip_serializing_if = "Option::is_none")]
712    #[serde(rename = "_frames")]
713    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
714    pub frames_ext: Option<FieldExtension>,
715    /** **Length in seconds (audio / video)**
716
717 The duration of the recording in seconds - for audio and video.
718
719 The duration might differ from occurrencePeriod if recording was paused. */
720    #[serde(default, skip_serializing_if = "Option::is_none")]
721    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
722    #[serde(rename = "duration")]
723    pub duration: Option<f64>,
724    /// Extension field.
725    #[serde(default, skip_serializing_if = "Option::is_none")]
726    #[serde(rename = "_duration")]
727    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
728    pub duration_ext: Option<FieldExtension>,
729    /** **Number of printed pages**
730
731 The number of pages when printed.
732
733 */
734    #[serde(default, skip_serializing_if = "Option::is_none")]
735    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
736    #[serde(rename = "pages")]
737    pub pages: Option<NonZeroU32>,
738    /// Extension field.
739    #[serde(default, skip_serializing_if = "Option::is_none")]
740    #[serde(rename = "_pages")]
741    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
742    pub pages_ext: Option<FieldExtension>,
743}
744#[cfg(feature = "builders")]
745impl AttachmentBuilder {
746    #[doc = concat!("Finalize building ", "Attachment", ".")]
747    pub fn build(self) -> Result<Attachment, crate::error::BuilderError> {
748        self.build_inner().map(Into::into)
749    }
750}
751impl From<AttachmentInner> for Attachment {
752    fn from(inner: AttachmentInner) -> Self {
753        Self(Box::new(inner))
754    }
755}
756impl ::core::ops::Deref for Attachment {
757    type Target = AttachmentInner;
758    fn deref(&self) -> &Self::Target {
759        &self.0
760    }
761}
762impl ::core::ops::DerefMut for Attachment {
763    fn deref_mut(&mut self) -> &mut Self::Target {
764        &mut self.0
765    }
766}
767impl Attachment {
768    /// Start building an instance.
769    #[cfg(feature = "builders")]
770    #[must_use]
771    pub fn builder() -> AttachmentBuilder {
772        AttachmentBuilder::default()
773    }
774}
775/** Availability Type: Availability data for an {item}.
776
777 **[Availability](http://hl7.org/fhir/StructureDefinition/Availability) v5.0.0**
778
779 Availability data for an {item}
780
781 Availability data for an {item}.
782
783 */
784#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
785#[serde(transparent)]
786pub struct Availability(pub Box<AvailabilityInner>);
787/** Availability Type: Availability data for an {item}.
788
789 **[Availability](http://hl7.org/fhir/StructureDefinition/Availability) v5.0.0**
790
791 Availability data for an {item}
792
793 Availability data for an {item}.
794
795 */
796#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
797#[cfg_attr(feature = "builders", derive(Builder))]
798#[serde(rename_all = "camelCase")]
799#[cfg_attr(
800    feature = "builders",
801    builder(
802        pattern = "owned",
803        name = "AvailabilityBuilder",
804        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
805    )
806)]
807pub struct AvailabilityInner {
808    /** **Unique id for inter-element referencing**
809
810 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
811
812 */
813    #[serde(default, skip_serializing_if = "Option::is_none")]
814    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
815    #[serde(rename = "id")]
816    pub id: Option<String>,
817    /** **Additional content defined by implementations**
818
819 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.
820
821 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
822    #[serde(default, skip_serializing_if = "Vec::is_empty")]
823    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
824    #[serde(rename = "extension")]
825    pub extension: Vec<Extension>,
826    /** **Times the {item} is available**
827
828 Times the {item} is available.
829
830 */
831    #[serde(default, skip_serializing_if = "Vec::is_empty")]
832    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
833    #[serde(rename = "availableTime")]
834    pub available_time: Vec<Option<AvailabilityAvailableTime>>,
835    /// Extension field.
836    #[serde(default, skip_serializing_if = "Vec::is_empty")]
837    #[serde(rename = "_availableTime")]
838    #[cfg_attr(feature = "builders", builder(default))]
839    pub available_time_ext: Vec<Option<FieldExtension>>,
840    /** **Not available during this time due to provided reason**
841
842 Not available during this time due to provided reason.
843
844 */
845    #[serde(default, skip_serializing_if = "Vec::is_empty")]
846    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
847    #[serde(rename = "notAvailableTime")]
848    pub not_available_time: Vec<Option<AvailabilityNotAvailableTime>>,
849    /// Extension field.
850    #[serde(default, skip_serializing_if = "Vec::is_empty")]
851    #[serde(rename = "_notAvailableTime")]
852    #[cfg_attr(feature = "builders", builder(default))]
853    pub not_available_time_ext: Vec<Option<FieldExtension>>,
854}
855#[cfg(feature = "builders")]
856impl AvailabilityBuilder {
857    #[doc = concat!("Finalize building ", "Availability", ".")]
858    pub fn build(self) -> Result<Availability, crate::error::BuilderError> {
859        self.build_inner().map(Into::into)
860    }
861}
862impl From<AvailabilityInner> for Availability {
863    fn from(inner: AvailabilityInner) -> Self {
864        Self(Box::new(inner))
865    }
866}
867impl ::core::ops::Deref for Availability {
868    type Target = AvailabilityInner;
869    fn deref(&self) -> &Self::Target {
870        &self.0
871    }
872}
873impl ::core::ops::DerefMut for Availability {
874    fn deref_mut(&mut self) -> &mut Self::Target {
875        &mut self.0
876    }
877}
878impl Availability {
879    /// Start building an instance.
880    #[cfg(feature = "builders")]
881    #[must_use]
882    pub fn builder() -> AvailabilityBuilder {
883        AvailabilityBuilder::default()
884    }
885}
886/// Sub-fields of the availableTime field in Availability
887#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
888#[cfg_attr(feature = "builders", derive(Builder))]
889#[serde(rename_all = "camelCase")]
890#[cfg_attr(
891    feature = "builders",
892    builder(
893        pattern = "owned",
894        name = "AvailabilityAvailableTimeBuilder",
895        build_fn(error = "crate::error::BuilderError")
896    )
897)]
898pub struct AvailabilityAvailableTime {
899    /** **Unique id for inter-element referencing**
900
901 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
902
903 */
904    #[serde(default, skip_serializing_if = "Option::is_none")]
905    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
906    #[serde(rename = "id")]
907    pub id: Option<String>,
908    /** **Additional content defined by implementations**
909
910 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.
911
912 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
913    #[serde(default, skip_serializing_if = "Vec::is_empty")]
914    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
915    #[serde(rename = "extension")]
916    pub extension: Vec<Extension>,
917    /** **[DaysOfWeek](http://hl7.org/fhir/ValueSet/days-of-week); mon | tue | wed | thu | fri | sat | sun**
918
919 mon | tue | wed | thu | fri | sat | sun.
920
921 */
922    #[serde(default, skip_serializing_if = "Vec::is_empty")]
923    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
924    #[serde(rename = "daysOfWeek")]
925    pub days_of_week: Vec<Option<codes::DaysOfWeek>>,
926    /// Extension field.
927    #[serde(default, skip_serializing_if = "Vec::is_empty")]
928    #[serde(rename = "_daysOfWeek")]
929    #[cfg_attr(feature = "builders", builder(default))]
930    pub days_of_week_ext: Vec<Option<FieldExtension>>,
931    /** **Always available? i.e. 24 hour service**
932
933 Always available? i.e. 24 hour service.
934
935 */
936    #[serde(default, skip_serializing_if = "Option::is_none")]
937    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
938    #[serde(rename = "allDay")]
939    pub all_day: Option<bool>,
940    /// Extension field.
941    #[serde(default, skip_serializing_if = "Option::is_none")]
942    #[serde(rename = "_allDay")]
943    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
944    pub all_day_ext: Option<FieldExtension>,
945    /** **Opening time of day (ignored if allDay = true)**
946
947 Opening time of day (ignored if allDay = true).
948
949 The timezone is expected to be specified or implied by the context this datatype is used. */
950    #[serde(default, skip_serializing_if = "Option::is_none")]
951    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
952    #[serde(rename = "availableStartTime")]
953    pub available_start_time: Option<Time>,
954    /// Extension field.
955    #[serde(default, skip_serializing_if = "Option::is_none")]
956    #[serde(rename = "_availableStartTime")]
957    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
958    pub available_start_time_ext: Option<FieldExtension>,
959    /** **Closing time of day (ignored if allDay = true)**
960
961 Closing time of day (ignored if allDay = true).
962
963 The timezone is expected to be specified or implied by the context this datatype is used. */
964    #[serde(default, skip_serializing_if = "Option::is_none")]
965    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
966    #[serde(rename = "availableEndTime")]
967    pub available_end_time: Option<Time>,
968    /// Extension field.
969    #[serde(default, skip_serializing_if = "Option::is_none")]
970    #[serde(rename = "_availableEndTime")]
971    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
972    pub available_end_time_ext: Option<FieldExtension>,
973}
974#[cfg(feature = "builders")]
975impl AvailabilityAvailableTime {
976    ///Start building a new instance
977    #[must_use]
978    pub fn builder() -> AvailabilityAvailableTimeBuilder {
979        AvailabilityAvailableTimeBuilder::default()
980    }
981}
982/// Sub-fields of the notAvailableTime field in Availability
983#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
984#[cfg_attr(feature = "builders", derive(Builder))]
985#[serde(rename_all = "camelCase")]
986#[cfg_attr(
987    feature = "builders",
988    builder(
989        pattern = "owned",
990        name = "AvailabilityNotAvailableTimeBuilder",
991        build_fn(error = "crate::error::BuilderError")
992    )
993)]
994pub struct AvailabilityNotAvailableTime {
995    /** **Unique id for inter-element referencing**
996
997 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
998
999 */
1000    #[serde(default, skip_serializing_if = "Option::is_none")]
1001    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1002    #[serde(rename = "id")]
1003    pub id: Option<String>,
1004    /** **Additional content defined by implementations**
1005
1006 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.
1007
1008 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
1009    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1010    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1011    #[serde(rename = "extension")]
1012    pub extension: Vec<Extension>,
1013    /** **Reason presented to the user explaining why time not available**
1014
1015 Reason presented to the user explaining why time not available.
1016
1017 The reason will generally be provided to give the textual reason for displaying when the {item} is not available, e.g. 'Closed public holidays' or 'Independence Day'. In cases such as this, the `during` might not be included and local knowledge would be required in such cases (as don't desire to keep updating when the holiday occurs each year).
1018
1019e.g.2: 'Closed for maintenance over the summer' for this example you would want to include the `during` period, unless this was a university hospital and the "summer" period was well known, but would recommend its inclusion anyway. */
1020    #[serde(default, skip_serializing_if = "Option::is_none")]
1021    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1022    #[serde(rename = "description")]
1023    pub description: Option<String>,
1024    /// Extension field.
1025    #[serde(default, skip_serializing_if = "Option::is_none")]
1026    #[serde(rename = "_description")]
1027    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1028    pub description_ext: Option<FieldExtension>,
1029    /** **Service not available during this period**
1030
1031 Service not available during this period.
1032
1033 */
1034    #[serde(default, skip_serializing_if = "Option::is_none")]
1035    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1036    #[serde(rename = "during")]
1037    pub during: Option<Period>,
1038    /// Extension field.
1039    #[serde(default, skip_serializing_if = "Option::is_none")]
1040    #[serde(rename = "_during")]
1041    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1042    pub during_ext: Option<FieldExtension>,
1043}
1044#[cfg(feature = "builders")]
1045impl AvailabilityNotAvailableTime {
1046    ///Start building a new instance
1047    #[must_use]
1048    pub fn builder() -> AvailabilityNotAvailableTimeBuilder {
1049        AvailabilityNotAvailableTimeBuilder::default()
1050    }
1051}
1052/** CodeableConcept Type: A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.
1053
1054 **[CodeableConcept](http://hl7.org/fhir/StructureDefinition/CodeableConcept) v5.0.0**
1055
1056 Concept - reference to a terminology or just  text
1057
1058 A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.
1059
1060 Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination. */
1061#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1062#[serde(transparent)]
1063pub struct CodeableConcept(pub Box<CodeableConceptInner>);
1064/** CodeableConcept Type: A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.
1065
1066 **[CodeableConcept](http://hl7.org/fhir/StructureDefinition/CodeableConcept) v5.0.0**
1067
1068 Concept - reference to a terminology or just  text
1069
1070 A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.
1071
1072 Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination. */
1073#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1074#[cfg_attr(feature = "builders", derive(Builder))]
1075#[serde(rename_all = "camelCase")]
1076#[cfg_attr(
1077    feature = "builders",
1078    builder(
1079        pattern = "owned",
1080        name = "CodeableConceptBuilder",
1081        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
1082    )
1083)]
1084pub struct CodeableConceptInner {
1085    /** **Unique id for inter-element referencing**
1086
1087 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
1088
1089 */
1090    #[serde(default, skip_serializing_if = "Option::is_none")]
1091    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1092    #[serde(rename = "id")]
1093    pub id: Option<String>,
1094    /** **Additional content defined by implementations**
1095
1096 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.
1097
1098 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
1099    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1100    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1101    #[serde(rename = "extension")]
1102    pub extension: Vec<Extension>,
1103    /** **Code defined by a terminology system**
1104
1105 A reference to a code defined by a terminology system.
1106
1107 Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true. */
1108    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1109    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1110    #[serde(rename = "coding")]
1111    pub coding: Vec<Option<Coding>>,
1112    /// Extension field.
1113    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1114    #[serde(rename = "_coding")]
1115    #[cfg_attr(feature = "builders", builder(default))]
1116    pub coding_ext: Vec<Option<FieldExtension>>,
1117    /** **Plain text representation of the concept**
1118
1119 A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.
1120
1121 Very often the text is the same as a displayName of one of the codings. */
1122    #[serde(default, skip_serializing_if = "Option::is_none")]
1123    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1124    #[serde(rename = "text")]
1125    pub text: Option<String>,
1126    /// Extension field.
1127    #[serde(default, skip_serializing_if = "Option::is_none")]
1128    #[serde(rename = "_text")]
1129    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1130    pub text_ext: Option<FieldExtension>,
1131}
1132#[cfg(feature = "builders")]
1133impl CodeableConceptBuilder {
1134    #[doc = concat!("Finalize building ", "CodeableConcept", ".")]
1135    pub fn build(self) -> Result<CodeableConcept, crate::error::BuilderError> {
1136        self.build_inner().map(Into::into)
1137    }
1138}
1139impl From<CodeableConceptInner> for CodeableConcept {
1140    fn from(inner: CodeableConceptInner) -> Self {
1141        Self(Box::new(inner))
1142    }
1143}
1144impl ::core::ops::Deref for CodeableConcept {
1145    type Target = CodeableConceptInner;
1146    fn deref(&self) -> &Self::Target {
1147        &self.0
1148    }
1149}
1150impl ::core::ops::DerefMut for CodeableConcept {
1151    fn deref_mut(&mut self) -> &mut Self::Target {
1152        &mut self.0
1153    }
1154}
1155impl CodeableConcept {
1156    /// Start building an instance.
1157    #[cfg(feature = "builders")]
1158    #[must_use]
1159    pub fn builder() -> CodeableConceptBuilder {
1160        CodeableConceptBuilder::default()
1161    }
1162}
1163/** CodeableReference Type: A reference to a resource (by instance), or instead, a reference to a concept defined in a terminology or ontology (by class).
1164
1165 **[CodeableReference](http://hl7.org/fhir/StructureDefinition/CodeableReference) v5.0.0**
1166
1167 Reference to a resource or a concept
1168
1169 A reference to a resource (by instance), or instead, a reference to a concept defined in a terminology or ontology (by class).
1170
1171 */
1172#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1173#[serde(transparent)]
1174pub struct CodeableReference(pub Box<CodeableReferenceInner>);
1175/** CodeableReference Type: A reference to a resource (by instance), or instead, a reference to a concept defined in a terminology or ontology (by class).
1176
1177 **[CodeableReference](http://hl7.org/fhir/StructureDefinition/CodeableReference) v5.0.0**
1178
1179 Reference to a resource or a concept
1180
1181 A reference to a resource (by instance), or instead, a reference to a concept defined in a terminology or ontology (by class).
1182
1183 */
1184#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1185#[cfg_attr(feature = "builders", derive(Builder))]
1186#[serde(rename_all = "camelCase")]
1187#[cfg_attr(
1188    feature = "builders",
1189    builder(
1190        pattern = "owned",
1191        name = "CodeableReferenceBuilder",
1192        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
1193    )
1194)]
1195pub struct CodeableReferenceInner {
1196    /** **Unique id for inter-element referencing**
1197
1198 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
1199
1200 */
1201    #[serde(default, skip_serializing_if = "Option::is_none")]
1202    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1203    #[serde(rename = "id")]
1204    pub id: Option<String>,
1205    /** **Additional content defined by implementations**
1206
1207 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.
1208
1209 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
1210    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1211    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1212    #[serde(rename = "extension")]
1213    pub extension: Vec<Extension>,
1214    /** **Reference to a concept (by class)**
1215
1216 A reference to a concept - e.g. the information is identified by its general class to the degree of precision found in the terminology.
1217
1218 */
1219    #[serde(default, skip_serializing_if = "Option::is_none")]
1220    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1221    #[serde(rename = "concept")]
1222    pub concept: Option<CodeableConcept>,
1223    /// Extension field.
1224    #[serde(default, skip_serializing_if = "Option::is_none")]
1225    #[serde(rename = "_concept")]
1226    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1227    pub concept_ext: Option<FieldExtension>,
1228    /** **Reference to a resource (by instance)**
1229
1230 A reference to a resource the provides exact details about the information being referenced.
1231
1232 */
1233    #[serde(default, skip_serializing_if = "Option::is_none")]
1234    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1235    #[serde(rename = "reference")]
1236    pub reference: Option<Reference>,
1237    /// Extension field.
1238    #[serde(default, skip_serializing_if = "Option::is_none")]
1239    #[serde(rename = "_reference")]
1240    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1241    pub reference_ext: Option<FieldExtension>,
1242}
1243#[cfg(feature = "builders")]
1244impl CodeableReferenceBuilder {
1245    #[doc = concat!("Finalize building ", "CodeableReference", ".")]
1246    pub fn build(self) -> Result<CodeableReference, crate::error::BuilderError> {
1247        self.build_inner().map(Into::into)
1248    }
1249}
1250impl From<CodeableReferenceInner> for CodeableReference {
1251    fn from(inner: CodeableReferenceInner) -> Self {
1252        Self(Box::new(inner))
1253    }
1254}
1255impl ::core::ops::Deref for CodeableReference {
1256    type Target = CodeableReferenceInner;
1257    fn deref(&self) -> &Self::Target {
1258        &self.0
1259    }
1260}
1261impl ::core::ops::DerefMut for CodeableReference {
1262    fn deref_mut(&mut self) -> &mut Self::Target {
1263        &mut self.0
1264    }
1265}
1266impl CodeableReference {
1267    /// Start building an instance.
1268    #[cfg(feature = "builders")]
1269    #[must_use]
1270    pub fn builder() -> CodeableReferenceBuilder {
1271        CodeableReferenceBuilder::default()
1272    }
1273}
1274/** Coding Type: A reference to a code defined by a terminology system.
1275
1276 **[Coding](http://hl7.org/fhir/StructureDefinition/Coding) v5.0.0**
1277
1278 A reference to a code defined by a terminology system
1279
1280 A reference to a code defined by a terminology system.
1281
1282 Codes may be defined very casually in enumerations or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. */
1283#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1284#[serde(transparent)]
1285pub struct Coding(pub Box<CodingInner>);
1286/** Coding Type: A reference to a code defined by a terminology system.
1287
1288 **[Coding](http://hl7.org/fhir/StructureDefinition/Coding) v5.0.0**
1289
1290 A reference to a code defined by a terminology system
1291
1292 A reference to a code defined by a terminology system.
1293
1294 Codes may be defined very casually in enumerations or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. */
1295#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1296#[cfg_attr(feature = "builders", derive(Builder))]
1297#[serde(rename_all = "camelCase")]
1298#[cfg_attr(
1299    feature = "builders",
1300    builder(
1301        pattern = "owned",
1302        name = "CodingBuilder",
1303        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
1304    )
1305)]
1306pub struct CodingInner {
1307    /** **Unique id for inter-element referencing**
1308
1309 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
1310
1311 */
1312    #[serde(default, skip_serializing_if = "Option::is_none")]
1313    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1314    #[serde(rename = "id")]
1315    pub id: Option<String>,
1316    /** **Additional content defined by implementations**
1317
1318 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.
1319
1320 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
1321    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1322    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1323    #[serde(rename = "extension")]
1324    pub extension: Vec<Extension>,
1325    /** **Identity of the terminology system**
1326
1327 The identification of the code system that defines the meaning of the symbol in the code.
1328
1329 The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should be an absolute reference to some definition that establishes the system clearly and unambiguously. */
1330    #[serde(default, skip_serializing_if = "Option::is_none")]
1331    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1332    #[serde(rename = "system")]
1333    pub system: Option<String>,
1334    /// Extension field.
1335    #[serde(default, skip_serializing_if = "Option::is_none")]
1336    #[serde(rename = "_system")]
1337    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1338    pub system_ext: Option<FieldExtension>,
1339    /** **Version of the system - if relevant**
1340
1341 The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.
1342
1343 Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date. */
1344    #[serde(default, skip_serializing_if = "Option::is_none")]
1345    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1346    #[serde(rename = "version")]
1347    pub version: Option<String>,
1348    /// Extension field.
1349    #[serde(default, skip_serializing_if = "Option::is_none")]
1350    #[serde(rename = "_version")]
1351    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1352    pub version_ext: Option<FieldExtension>,
1353    /** **Symbol in syntax defined by the system**
1354
1355 A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).
1356
1357 */
1358    #[serde(default, skip_serializing_if = "Option::is_none")]
1359    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1360    #[serde(rename = "code")]
1361    pub code: Option<String>,
1362    /// Extension field.
1363    #[serde(default, skip_serializing_if = "Option::is_none")]
1364    #[serde(rename = "_code")]
1365    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1366    pub code_ext: Option<FieldExtension>,
1367    /** **Representation defined by the system**
1368
1369 A representation of the meaning of the code in the system, following the rules of the system.
1370
1371 */
1372    #[serde(default, skip_serializing_if = "Option::is_none")]
1373    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1374    #[serde(rename = "display")]
1375    pub display: Option<String>,
1376    /// Extension field.
1377    #[serde(default, skip_serializing_if = "Option::is_none")]
1378    #[serde(rename = "_display")]
1379    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1380    pub display_ext: Option<FieldExtension>,
1381    /** **If this coding was chosen directly by the user**
1382
1383 Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).
1384
1385 Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely. */
1386    #[serde(default, skip_serializing_if = "Option::is_none")]
1387    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1388    #[serde(rename = "userSelected")]
1389    pub user_selected: Option<bool>,
1390    /// Extension field.
1391    #[serde(default, skip_serializing_if = "Option::is_none")]
1392    #[serde(rename = "_userSelected")]
1393    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1394    pub user_selected_ext: Option<FieldExtension>,
1395}
1396#[cfg(feature = "builders")]
1397impl CodingBuilder {
1398    #[doc = concat!("Finalize building ", "Coding", ".")]
1399    pub fn build(self) -> Result<Coding, crate::error::BuilderError> {
1400        self.build_inner().map(Into::into)
1401    }
1402}
1403impl From<CodingInner> for Coding {
1404    fn from(inner: CodingInner) -> Self {
1405        Self(Box::new(inner))
1406    }
1407}
1408impl ::core::ops::Deref for Coding {
1409    type Target = CodingInner;
1410    fn deref(&self) -> &Self::Target {
1411        &self.0
1412    }
1413}
1414impl ::core::ops::DerefMut for Coding {
1415    fn deref_mut(&mut self) -> &mut Self::Target {
1416        &mut self.0
1417    }
1418}
1419impl Coding {
1420    /// Start building an instance.
1421    #[cfg(feature = "builders")]
1422    #[must_use]
1423    pub fn builder() -> CodingBuilder {
1424        CodingBuilder::default()
1425    }
1426}
1427/** ContactDetail Type: Specifies contact information for a person or organization.
1428
1429 **[ContactDetail](http://hl7.org/fhir/StructureDefinition/ContactDetail) v5.0.0**
1430
1431 Contact information
1432
1433 Specifies contact information for a person or organization.
1434
1435 */
1436#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1437#[serde(transparent)]
1438pub struct ContactDetail(pub Box<ContactDetailInner>);
1439/** ContactDetail Type: Specifies contact information for a person or organization.
1440
1441 **[ContactDetail](http://hl7.org/fhir/StructureDefinition/ContactDetail) v5.0.0**
1442
1443 Contact information
1444
1445 Specifies contact information for a person or organization.
1446
1447 */
1448#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1449#[cfg_attr(feature = "builders", derive(Builder))]
1450#[serde(rename_all = "camelCase")]
1451#[cfg_attr(
1452    feature = "builders",
1453    builder(
1454        pattern = "owned",
1455        name = "ContactDetailBuilder",
1456        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
1457    )
1458)]
1459pub struct ContactDetailInner {
1460    /** **Unique id for inter-element referencing**
1461
1462 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
1463
1464 */
1465    #[serde(default, skip_serializing_if = "Option::is_none")]
1466    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1467    #[serde(rename = "id")]
1468    pub id: Option<String>,
1469    /** **Additional content defined by implementations**
1470
1471 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.
1472
1473 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
1474    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1475    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1476    #[serde(rename = "extension")]
1477    pub extension: Vec<Extension>,
1478    /** **Name of an individual to contact**
1479
1480 The name of an individual to contact.
1481
1482 If there is no named individual, the telecom information is for the organization as a whole. */
1483    #[serde(default, skip_serializing_if = "Option::is_none")]
1484    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1485    #[serde(rename = "name")]
1486    pub name: Option<String>,
1487    /// Extension field.
1488    #[serde(default, skip_serializing_if = "Option::is_none")]
1489    #[serde(rename = "_name")]
1490    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1491    pub name_ext: Option<FieldExtension>,
1492    /** **Contact details for individual or organization**
1493
1494 The contact details for the individual (if a name was provided) or the organization.
1495
1496 */
1497    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1498    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1499    #[serde(rename = "telecom")]
1500    pub telecom: Vec<Option<ContactPoint>>,
1501    /// Extension field.
1502    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1503    #[serde(rename = "_telecom")]
1504    #[cfg_attr(feature = "builders", builder(default))]
1505    pub telecom_ext: Vec<Option<FieldExtension>>,
1506}
1507#[cfg(feature = "builders")]
1508impl ContactDetailBuilder {
1509    #[doc = concat!("Finalize building ", "ContactDetail", ".")]
1510    pub fn build(self) -> Result<ContactDetail, crate::error::BuilderError> {
1511        self.build_inner().map(Into::into)
1512    }
1513}
1514impl From<ContactDetailInner> for ContactDetail {
1515    fn from(inner: ContactDetailInner) -> Self {
1516        Self(Box::new(inner))
1517    }
1518}
1519impl ::core::ops::Deref for ContactDetail {
1520    type Target = ContactDetailInner;
1521    fn deref(&self) -> &Self::Target {
1522        &self.0
1523    }
1524}
1525impl ::core::ops::DerefMut for ContactDetail {
1526    fn deref_mut(&mut self) -> &mut Self::Target {
1527        &mut self.0
1528    }
1529}
1530impl ContactDetail {
1531    /// Start building an instance.
1532    #[cfg(feature = "builders")]
1533    #[must_use]
1534    pub fn builder() -> ContactDetailBuilder {
1535        ContactDetailBuilder::default()
1536    }
1537}
1538/** ContactPoint Type: Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.
1539
1540 **[ContactPoint](http://hl7.org/fhir/StructureDefinition/ContactPoint) v5.0.0**
1541
1542 Details of a Technology mediated contact point (phone, fax, email, etc.)
1543
1544 Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.
1545
1546 */
1547#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1548#[serde(transparent)]
1549pub struct ContactPoint(pub Box<ContactPointInner>);
1550/** ContactPoint Type: Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.
1551
1552 **[ContactPoint](http://hl7.org/fhir/StructureDefinition/ContactPoint) v5.0.0**
1553
1554 Details of a Technology mediated contact point (phone, fax, email, etc.)
1555
1556 Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.
1557
1558 */
1559#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1560#[cfg_attr(feature = "builders", derive(Builder))]
1561#[serde(rename_all = "camelCase")]
1562#[cfg_attr(
1563    feature = "builders",
1564    builder(
1565        pattern = "owned",
1566        name = "ContactPointBuilder",
1567        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
1568    )
1569)]
1570pub struct ContactPointInner {
1571    /** **Unique id for inter-element referencing**
1572
1573 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
1574
1575 */
1576    #[serde(default, skip_serializing_if = "Option::is_none")]
1577    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1578    #[serde(rename = "id")]
1579    pub id: Option<String>,
1580    /** **Additional content defined by implementations**
1581
1582 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.
1583
1584 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
1585    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1586    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1587    #[serde(rename = "extension")]
1588    pub extension: Vec<Extension>,
1589    /** **[ContactPointSystem](http://hl7.org/fhir/ValueSet/contact-point-system); phone | fax | email | pager | url | sms | other**
1590
1591 Telecommunications form for contact point - what communications system is required to make use of the contact.
1592
1593 */
1594    #[serde(default, skip_serializing_if = "Option::is_none")]
1595    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1596    #[serde(rename = "system")]
1597    pub system: Option<codes::ContactPointSystem>,
1598    /// Extension field.
1599    #[serde(default, skip_serializing_if = "Option::is_none")]
1600    #[serde(rename = "_system")]
1601    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1602    pub system_ext: Option<FieldExtension>,
1603    /** **The actual contact point details**
1604
1605 The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).
1606
1607 Additional text data such as phone extension numbers, or notes about use of the contact are sometimes included in the value. */
1608    #[serde(default, skip_serializing_if = "Option::is_none")]
1609    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1610    #[serde(rename = "value")]
1611    pub value: Option<String>,
1612    /// Extension field.
1613    #[serde(default, skip_serializing_if = "Option::is_none")]
1614    #[serde(rename = "_value")]
1615    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1616    pub value_ext: Option<FieldExtension>,
1617    /** **[ContactPointUse](http://hl7.org/fhir/ValueSet/contact-point-use); home | work | temp | old | mobile - purpose of this contact point**
1618
1619 Identifies the purpose for the contact point.
1620
1621 Applications can assume that a contact is current unless it explicitly says that it is temporary or old. */
1622    #[serde(default, skip_serializing_if = "Option::is_none")]
1623    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1624    #[serde(rename = "use")]
1625    pub r#use: Option<codes::ContactPointUse>,
1626    /// Extension field.
1627    #[serde(default, skip_serializing_if = "Option::is_none")]
1628    #[serde(rename = "_use")]
1629    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1630    pub r#use_ext: Option<FieldExtension>,
1631    /** **Specify preferred order of use (1 = highest)**
1632
1633 Specifies a preferred order in which to use a set of contacts. ContactPoints with lower rank values are more preferred than those with higher rank values.
1634
1635 Note that rank does not necessarily follow the order in which the contacts are represented in the instance.
1636
1637Ranks need not be unique.  E.g. it's possible to have multiple contacts with rank=1.  If the ranks have different systems or uses, this would be interpreted to mean "X is my most preferred phone number, Y is my most preferred email address" or "X is my preferred home email and Y is my preferred work email".  If the system and use for equally-ranked contacts are the same, then the level of preference is equivalent for both repetitions.
1638
1639Ranks need not be sequential and not all repetitions must have a rank.  For example, it's possible to have 4 contacts with ranks of 2, 5 and two with no rank specified.  That would be interpreted to mean the first is preferred over the second and no preference stated for the remaining contacts. */
1640    #[serde(default, skip_serializing_if = "Option::is_none")]
1641    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1642    #[serde(rename = "rank")]
1643    pub rank: Option<NonZeroU32>,
1644    /// Extension field.
1645    #[serde(default, skip_serializing_if = "Option::is_none")]
1646    #[serde(rename = "_rank")]
1647    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1648    pub rank_ext: Option<FieldExtension>,
1649    /** **Time period when the contact point was/is in use**
1650
1651 Time period when the contact point was/is in use.
1652
1653 */
1654    #[serde(default, skip_serializing_if = "Option::is_none")]
1655    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1656    #[serde(rename = "period")]
1657    pub period: Option<Period>,
1658    /// Extension field.
1659    #[serde(default, skip_serializing_if = "Option::is_none")]
1660    #[serde(rename = "_period")]
1661    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1662    pub period_ext: Option<FieldExtension>,
1663}
1664#[cfg(feature = "builders")]
1665impl ContactPointBuilder {
1666    #[doc = concat!("Finalize building ", "ContactPoint", ".")]
1667    pub fn build(self) -> Result<ContactPoint, crate::error::BuilderError> {
1668        self.build_inner().map(Into::into)
1669    }
1670}
1671impl From<ContactPointInner> for ContactPoint {
1672    fn from(inner: ContactPointInner) -> Self {
1673        Self(Box::new(inner))
1674    }
1675}
1676impl ::core::ops::Deref for ContactPoint {
1677    type Target = ContactPointInner;
1678    fn deref(&self) -> &Self::Target {
1679        &self.0
1680    }
1681}
1682impl ::core::ops::DerefMut for ContactPoint {
1683    fn deref_mut(&mut self) -> &mut Self::Target {
1684        &mut self.0
1685    }
1686}
1687impl ContactPoint {
1688    /// Start building an instance.
1689    #[cfg(feature = "builders")]
1690    #[must_use]
1691    pub fn builder() -> ContactPointBuilder {
1692        ContactPointBuilder::default()
1693    }
1694}
1695/** Contributor Type: A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.
1696
1697 **[Contributor](http://hl7.org/fhir/StructureDefinition/Contributor) v5.0.0**
1698
1699 Contributor information
1700
1701 A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.
1702
1703 */
1704#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1705#[serde(transparent)]
1706pub struct Contributor(pub Box<ContributorInner>);
1707/** Contributor Type: A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.
1708
1709 **[Contributor](http://hl7.org/fhir/StructureDefinition/Contributor) v5.0.0**
1710
1711 Contributor information
1712
1713 A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.
1714
1715 */
1716#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1717#[cfg_attr(feature = "builders", derive(Builder))]
1718#[serde(rename_all = "camelCase")]
1719#[cfg_attr(
1720    feature = "builders",
1721    builder(
1722        pattern = "owned",
1723        name = "ContributorBuilder",
1724        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
1725    )
1726)]
1727pub struct ContributorInner {
1728    /** **Unique id for inter-element referencing**
1729
1730 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
1731
1732 */
1733    #[serde(default, skip_serializing_if = "Option::is_none")]
1734    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1735    #[serde(rename = "id")]
1736    pub id: Option<String>,
1737    /** **Additional content defined by implementations**
1738
1739 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.
1740
1741 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
1742    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1743    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1744    #[serde(rename = "extension")]
1745    pub extension: Vec<Extension>,
1746    /** **[ContributorType](http://hl7.org/fhir/ValueSet/contributor-type); author | editor | reviewer | endorser**
1747
1748 The type of contributor.
1749
1750 */
1751    #[serde(rename = "type")]
1752    pub r#type: codes::ContributorType,
1753    /// Extension field.
1754    #[serde(default, skip_serializing_if = "Option::is_none")]
1755    #[serde(rename = "_type")]
1756    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1757    pub r#type_ext: Option<FieldExtension>,
1758    /** **Who contributed the content**
1759
1760 The name of the individual or organization responsible for the contribution.
1761
1762 */
1763    #[serde(rename = "name")]
1764    pub name: String,
1765    /// Extension field.
1766    #[serde(default, skip_serializing_if = "Option::is_none")]
1767    #[serde(rename = "_name")]
1768    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1769    pub name_ext: Option<FieldExtension>,
1770    /** **Contact details of the contributor**
1771
1772 Contact details to assist a user in finding and communicating with the contributor.
1773
1774 */
1775    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1776    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1777    #[serde(rename = "contact")]
1778    pub contact: Vec<Option<ContactDetail>>,
1779    /// Extension field.
1780    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1781    #[serde(rename = "_contact")]
1782    #[cfg_attr(feature = "builders", builder(default))]
1783    pub contact_ext: Vec<Option<FieldExtension>>,
1784}
1785#[cfg(feature = "builders")]
1786impl ContributorBuilder {
1787    #[doc = concat!("Finalize building ", "Contributor", ".")]
1788    pub fn build(self) -> Result<Contributor, crate::error::BuilderError> {
1789        self.build_inner().map(Into::into)
1790    }
1791}
1792impl From<ContributorInner> for Contributor {
1793    fn from(inner: ContributorInner) -> Self {
1794        Self(Box::new(inner))
1795    }
1796}
1797impl ::core::ops::Deref for Contributor {
1798    type Target = ContributorInner;
1799    fn deref(&self) -> &Self::Target {
1800        &self.0
1801    }
1802}
1803impl ::core::ops::DerefMut for Contributor {
1804    fn deref_mut(&mut self) -> &mut Self::Target {
1805        &mut self.0
1806    }
1807}
1808impl Contributor {
1809    /// Start building an instance.
1810    #[cfg(feature = "builders")]
1811    #[must_use]
1812    pub fn builder() -> ContributorBuilder {
1813        ContributorBuilder::default()
1814    }
1815}
1816/** Count Type: A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
1817
1818 **[Count](http://hl7.org/fhir/StructureDefinition/Count) v5.0.0**
1819
1820 A measured or measurable amount
1821
1822 A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
1823
1824 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
1825#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1826#[serde(transparent)]
1827pub struct Count(pub Box<CountInner>);
1828/** Count Type: A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
1829
1830 **[Count](http://hl7.org/fhir/StructureDefinition/Count) v5.0.0**
1831
1832 A measured or measurable amount
1833
1834 A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
1835
1836 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
1837#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1838#[cfg_attr(feature = "builders", derive(Builder))]
1839#[serde(rename_all = "camelCase")]
1840#[cfg_attr(
1841    feature = "builders",
1842    builder(
1843        pattern = "owned",
1844        name = "CountBuilder",
1845        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
1846    )
1847)]
1848pub struct CountInner {
1849    /** **Unique id for inter-element referencing**
1850
1851 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
1852
1853 */
1854    #[serde(default, skip_serializing_if = "Option::is_none")]
1855    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1856    #[serde(rename = "id")]
1857    pub id: Option<String>,
1858    /** **Additional content defined by implementations**
1859
1860 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.
1861
1862 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
1863    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1864    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1865    #[serde(rename = "extension")]
1866    pub extension: Vec<Extension>,
1867    /** **Numerical value (with implicit precision)**
1868
1869 The value of the measured amount. The value includes an implicit precision in the presentation of the value.
1870
1871 The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books). */
1872    #[serde(default, skip_serializing_if = "Option::is_none")]
1873    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1874    #[serde(rename = "value")]
1875    pub value: Option<f64>,
1876    /** **[QuantityComparator](http://hl7.org/fhir/ValueSet/quantity-comparator); < | <= | >= | > | ad - how to understand the value**
1877
1878 How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.
1879
1880 */
1881    #[serde(default, skip_serializing_if = "Option::is_none")]
1882    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1883    #[serde(rename = "comparator")]
1884    pub comparator: Option<codes::QuantityComparator>,
1885    /** **Unit representation**
1886
1887 A human-readable form of the unit.
1888
1889 */
1890    #[serde(default, skip_serializing_if = "Option::is_none")]
1891    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1892    #[serde(rename = "unit")]
1893    pub unit: Option<String>,
1894    /** **System that defines coded unit form**
1895
1896 The identification of the system that provides the coded form of the unit.
1897
1898 */
1899    #[serde(default, skip_serializing_if = "Option::is_none")]
1900    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1901    #[serde(rename = "system")]
1902    pub system: Option<String>,
1903    /** **Coded form of the unit**
1904
1905 A computer processable form of the unit in some unit representation system.
1906
1907 The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency.  The context of use may additionally require a code from a particular system. */
1908    #[serde(default, skip_serializing_if = "Option::is_none")]
1909    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1910    #[serde(rename = "code")]
1911    pub code: Option<String>,
1912}
1913#[cfg(feature = "builders")]
1914impl CountBuilder {
1915    #[doc = concat!("Finalize building ", "Count", ".")]
1916    pub fn build(self) -> Result<Count, crate::error::BuilderError> {
1917        self.build_inner().map(Into::into)
1918    }
1919}
1920impl From<CountInner> for Count {
1921    fn from(inner: CountInner) -> Self {
1922        Self(Box::new(inner))
1923    }
1924}
1925impl ::core::ops::Deref for Count {
1926    type Target = CountInner;
1927    fn deref(&self) -> &Self::Target {
1928        &self.0
1929    }
1930}
1931impl ::core::ops::DerefMut for Count {
1932    fn deref_mut(&mut self) -> &mut Self::Target {
1933        &mut self.0
1934    }
1935}
1936impl Count {
1937    /// Start building an instance.
1938    #[cfg(feature = "builders")]
1939    #[must_use]
1940    pub fn builder() -> CountBuilder {
1941        CountBuilder::default()
1942    }
1943}
1944/** DataRequirement Type: Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.
1945
1946 **[DataRequirement](http://hl7.org/fhir/StructureDefinition/DataRequirement) v5.0.0**
1947
1948 Describes a required data item
1949
1950 Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.
1951
1952 */
1953#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1954#[serde(transparent)]
1955pub struct DataRequirement(pub Box<DataRequirementInner>);
1956/** DataRequirement Type: Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.
1957
1958 **[DataRequirement](http://hl7.org/fhir/StructureDefinition/DataRequirement) v5.0.0**
1959
1960 Describes a required data item
1961
1962 Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.
1963
1964 */
1965#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1966#[cfg_attr(feature = "builders", derive(Builder))]
1967#[serde(rename_all = "camelCase")]
1968#[cfg_attr(
1969    feature = "builders",
1970    builder(
1971        pattern = "owned",
1972        name = "DataRequirementBuilder",
1973        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
1974    )
1975)]
1976pub struct DataRequirementInner {
1977    /** **Unique id for inter-element referencing**
1978
1979 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
1980
1981 */
1982    #[serde(default, skip_serializing_if = "Option::is_none")]
1983    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1984    #[serde(rename = "id")]
1985    pub id: Option<String>,
1986    /** **Additional content defined by implementations**
1987
1988 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.
1989
1990 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
1991    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1992    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
1993    #[serde(rename = "extension")]
1994    pub extension: Vec<Extension>,
1995    /** **[FHIRTypes](http://hl7.org/fhir/ValueSet/fhir-types); The type of the required data**
1996
1997 The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.
1998
1999 */
2000    #[serde(rename = "type")]
2001    pub r#type: codes::FHIRTypes,
2002    /// Extension field.
2003    #[serde(default, skip_serializing_if = "Option::is_none")]
2004    #[serde(rename = "_type")]
2005    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2006    pub r#type_ext: Option<FieldExtension>,
2007    /** **The profile of the required data**
2008
2009 The profile of the required data, specified as the uri of the profile definition.
2010
2011 */
2012    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2013    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2014    #[serde(rename = "profile")]
2015    pub profile: Vec<Option<String>>,
2016    /// Extension field.
2017    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2018    #[serde(rename = "_profile")]
2019    #[cfg_attr(feature = "builders", builder(default))]
2020    pub profile_ext: Vec<Option<FieldExtension>>,
2021    /** **E.g. Patient, Practitioner, RelatedPerson, Organization, Location, Device**
2022
2023 The intended subjects of the data requirement. If this element is not provided, a Patient subject is assumed.
2024
2025 The subject of a data requirement is critical, as the data being specified is determined with respect to a particular subject. This corresponds roughly to the notion of a Compartment in that it limits what data is available based on its relationship to the subject. In CQL, this corresponds to the context declaration. */
2026    #[serde(default, skip_serializing_if = "Option::is_none")]
2027    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2028    #[serde(flatten)]
2029    pub subject: Option<DataRequirementSubject>,
2030    /// Extension field.
2031    #[serde(default, skip_serializing_if = "Option::is_none")]
2032    #[serde(flatten)]
2033    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2034    pub subject_ext: Option<DataRequirementSubjectExtension>,
2035    /** **Indicates specific structure elements that are referenced by the knowledge module**
2036
2037 Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.
2038
2039The value of mustSupport SHALL be a FHIRPath resolvable on the type of the DataRequirement. The path SHALL consist only of identifiers, constant indexers, and .resolve() (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).
2040
2041 */
2042    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2043    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2044    #[serde(rename = "mustSupport")]
2045    pub must_support: Vec<Option<String>>,
2046    /// Extension field.
2047    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2048    #[serde(rename = "_mustSupport")]
2049    #[cfg_attr(feature = "builders", builder(default))]
2050    pub must_support_ext: Vec<Option<FieldExtension>>,
2051    /** **What codes are expected**
2052
2053 Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data. Each code filter defines an additional constraint on the data, i.e. code filters are AND'ed, not OR'ed.
2054
2055 */
2056    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2057    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2058    #[serde(rename = "codeFilter")]
2059    pub code_filter: Vec<Option<DataRequirementCodeFilter>>,
2060    /// Extension field.
2061    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2062    #[serde(rename = "_codeFilter")]
2063    #[cfg_attr(feature = "builders", builder(default))]
2064    pub code_filter_ext: Vec<Option<FieldExtension>>,
2065    /** **What dates/date ranges are expected**
2066
2067 Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. Each date filter specifies an additional constraint on the data, i.e. date filters are AND'ed, not OR'ed.
2068
2069 */
2070    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2071    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2072    #[serde(rename = "dateFilter")]
2073    pub date_filter: Vec<Option<DataRequirementDateFilter>>,
2074    /// Extension field.
2075    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2076    #[serde(rename = "_dateFilter")]
2077    #[cfg_attr(feature = "builders", builder(default))]
2078    pub date_filter_ext: Vec<Option<FieldExtension>>,
2079    /** **What values are expected**
2080
2081 Value filters specify additional constraints on the data for elements other than code-valued or date-valued. Each value filter specifies an additional constraint on the data (i.e. valueFilters are AND'ed, not OR'ed).
2082
2083 */
2084    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2085    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2086    #[serde(rename = "valueFilter")]
2087    pub value_filter: Vec<Option<DataRequirementValueFilter>>,
2088    /// Extension field.
2089    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2090    #[serde(rename = "_valueFilter")]
2091    #[cfg_attr(feature = "builders", builder(default))]
2092    pub value_filter_ext: Vec<Option<FieldExtension>>,
2093    /** **Number of results**
2094
2095 Specifies a maximum number of results that are required (uses the _count search parameter).
2096
2097 This element can be used in combination with the sort element to specify quota requirements such as "the most recent 5" or "the highest 5". */
2098    #[serde(default, skip_serializing_if = "Option::is_none")]
2099    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2100    #[serde(rename = "limit")]
2101    pub limit: Option<NonZeroU32>,
2102    /// Extension field.
2103    #[serde(default, skip_serializing_if = "Option::is_none")]
2104    #[serde(rename = "_limit")]
2105    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2106    pub limit_ext: Option<FieldExtension>,
2107    /** **Order of the results**
2108
2109 Specifies the order of the results to be returned.
2110
2111 This element can be used in combination with the sort element to specify quota requirements such as "the most recent 5" or "the highest 5". When multiple sorts are specified, they are applied in the order they appear in the resource. */
2112    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2113    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2114    #[serde(rename = "sort")]
2115    pub sort: Vec<Option<DataRequirementSort>>,
2116    /// Extension field.
2117    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2118    #[serde(rename = "_sort")]
2119    #[cfg_attr(feature = "builders", builder(default))]
2120    pub sort_ext: Vec<Option<FieldExtension>>,
2121}
2122#[cfg(feature = "builders")]
2123impl DataRequirementBuilder {
2124    #[doc = concat!("Finalize building ", "DataRequirement", ".")]
2125    pub fn build(self) -> Result<DataRequirement, crate::error::BuilderError> {
2126        self.build_inner().map(Into::into)
2127    }
2128}
2129impl From<DataRequirementInner> for DataRequirement {
2130    fn from(inner: DataRequirementInner) -> Self {
2131        Self(Box::new(inner))
2132    }
2133}
2134impl ::core::ops::Deref for DataRequirement {
2135    type Target = DataRequirementInner;
2136    fn deref(&self) -> &Self::Target {
2137        &self.0
2138    }
2139}
2140impl ::core::ops::DerefMut for DataRequirement {
2141    fn deref_mut(&mut self) -> &mut Self::Target {
2142        &mut self.0
2143    }
2144}
2145impl DataRequirement {
2146    /// Start building an instance.
2147    #[cfg(feature = "builders")]
2148    #[must_use]
2149    pub fn builder() -> DataRequirementBuilder {
2150        DataRequirementBuilder::default()
2151    }
2152}
2153/// Choice of types for the subject[x] field in DataRequirement
2154#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2155#[serde(rename_all = "camelCase")]
2156pub enum DataRequirementSubject {
2157    /// Variant accepting the CodeableConcept type.
2158    #[serde(rename = "subjectCodeableConcept")]
2159    CodeableConcept(CodeableConcept),
2160    /// Variant accepting the Reference type.
2161    #[serde(rename = "subjectReference")]
2162    Reference(Reference),
2163}
2164/// Extension value for DataRequirementSubject.
2165#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2166#[serde(rename_all = "camelCase")]
2167pub enum DataRequirementSubjectExtension {
2168    /// Variant accepting the CodeableConcept extension.
2169    #[serde(rename = "_subjectCodeableConcept")]
2170    CodeableConcept(FieldExtension),
2171    /// Variant accepting the Reference extension.
2172    #[serde(rename = "_subjectReference")]
2173    Reference(FieldExtension),
2174}
2175/// Sub-fields of the codeFilter field in DataRequirement
2176#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2177#[cfg_attr(feature = "builders", derive(Builder))]
2178#[serde(rename_all = "camelCase")]
2179#[cfg_attr(
2180    feature = "builders",
2181    builder(
2182        pattern = "owned",
2183        name = "DataRequirementCodeFilterBuilder",
2184        build_fn(error = "crate::error::BuilderError")
2185    )
2186)]
2187pub struct DataRequirementCodeFilter {
2188    /** **Unique id for inter-element referencing**
2189
2190 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
2191
2192 */
2193    #[serde(default, skip_serializing_if = "Option::is_none")]
2194    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2195    #[serde(rename = "id")]
2196    pub id: Option<String>,
2197    /** **Additional content defined by implementations**
2198
2199 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.
2200
2201 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
2202    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2203    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2204    #[serde(rename = "extension")]
2205    pub extension: Vec<Extension>,
2206    /** **A code-valued attribute to filter on**
2207
2208 The code-valued attribute of the filter. The specified path SHALL be a FHIRPath resolvable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.
2209
2210 The path attribute contains a [Simple FHIRPath Subset](fhirpath.html#simple) that allows path traversal, but not calculation. */
2211    #[serde(default, skip_serializing_if = "Option::is_none")]
2212    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2213    #[serde(rename = "path")]
2214    pub path: Option<String>,
2215    /// Extension field.
2216    #[serde(default, skip_serializing_if = "Option::is_none")]
2217    #[serde(rename = "_path")]
2218    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2219    pub path_ext: Option<FieldExtension>,
2220    /** **A coded (token) parameter to search on**
2221
2222 A token parameter that refers to a search parameter defined on the specified type of the DataRequirement, and which searches on elements of type code, Coding, or CodeableConcept.
2223
2224 */
2225    #[serde(default, skip_serializing_if = "Option::is_none")]
2226    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2227    #[serde(rename = "searchParam")]
2228    pub search_param: Option<String>,
2229    /// Extension field.
2230    #[serde(default, skip_serializing_if = "Option::is_none")]
2231    #[serde(rename = "_searchParam")]
2232    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2233    pub search_param_ext: Option<FieldExtension>,
2234    /** **ValueSet for the filter**
2235
2236 The valueset for the code filter. The valueSet and code elements are additive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.
2237
2238 */
2239    #[serde(default, skip_serializing_if = "Option::is_none")]
2240    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2241    #[serde(rename = "valueSet")]
2242    pub value_set: Option<String>,
2243    /// Extension field.
2244    #[serde(default, skip_serializing_if = "Option::is_none")]
2245    #[serde(rename = "_valueSet")]
2246    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2247    pub value_set_ext: Option<FieldExtension>,
2248    /** **What code is expected**
2249
2250 The codes for the code filter. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes. If codes are specified in addition to a value set, the filter returns items matching a code in the value set or one of the specified codes.
2251
2252 */
2253    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2254    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2255    #[serde(rename = "code")]
2256    pub code: Vec<Option<Coding>>,
2257    /// Extension field.
2258    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2259    #[serde(rename = "_code")]
2260    #[cfg_attr(feature = "builders", builder(default))]
2261    pub code_ext: Vec<Option<FieldExtension>>,
2262}
2263#[cfg(feature = "builders")]
2264impl DataRequirementCodeFilter {
2265    ///Start building a new instance
2266    #[must_use]
2267    pub fn builder() -> DataRequirementCodeFilterBuilder {
2268        DataRequirementCodeFilterBuilder::default()
2269    }
2270}
2271/// Sub-fields of the dateFilter field in DataRequirement
2272#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2273#[cfg_attr(feature = "builders", derive(Builder))]
2274#[serde(rename_all = "camelCase")]
2275#[cfg_attr(
2276    feature = "builders",
2277    builder(
2278        pattern = "owned",
2279        name = "DataRequirementDateFilterBuilder",
2280        build_fn(error = "crate::error::BuilderError")
2281    )
2282)]
2283pub struct DataRequirementDateFilter {
2284    /** **Unique id for inter-element referencing**
2285
2286 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
2287
2288 */
2289    #[serde(default, skip_serializing_if = "Option::is_none")]
2290    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2291    #[serde(rename = "id")]
2292    pub id: Option<String>,
2293    /** **Additional content defined by implementations**
2294
2295 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.
2296
2297 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
2298    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2299    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2300    #[serde(rename = "extension")]
2301    pub extension: Vec<Extension>,
2302    /** **A date-valued attribute to filter on**
2303
2304 The date-valued attribute of the filter. The specified path SHALL be a FHIRPath resolvable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of type date, dateTime, Period, Schedule, or Timing.
2305
2306 The path attribute contains a [Simple FHIR Subset](fhirpath.html#simple) that allows path traversal, but not calculation. */
2307    #[serde(default, skip_serializing_if = "Option::is_none")]
2308    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2309    #[serde(rename = "path")]
2310    pub path: Option<String>,
2311    /// Extension field.
2312    #[serde(default, skip_serializing_if = "Option::is_none")]
2313    #[serde(rename = "_path")]
2314    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2315    pub path_ext: Option<FieldExtension>,
2316    /** **A date valued parameter to search on**
2317
2318 A date parameter that refers to a search parameter defined on the specified type of the DataRequirement, and which searches on elements of type date, dateTime, Period, Schedule, or Timing.
2319
2320 */
2321    #[serde(default, skip_serializing_if = "Option::is_none")]
2322    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2323    #[serde(rename = "searchParam")]
2324    pub search_param: Option<String>,
2325    /// Extension field.
2326    #[serde(default, skip_serializing_if = "Option::is_none")]
2327    #[serde(rename = "_searchParam")]
2328    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2329    pub search_param_ext: Option<FieldExtension>,
2330    /** **The value of the filter, as a Period, DateTime, or Duration value**
2331
2332 The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime. If a Duration is specified, the filter will return only those data items that fall within Duration before now.
2333
2334 */
2335    #[serde(default, skip_serializing_if = "Option::is_none")]
2336    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2337    #[serde(flatten)]
2338    pub value: Option<DataRequirementDateFilterValue>,
2339    /// Extension field.
2340    #[serde(default, skip_serializing_if = "Option::is_none")]
2341    #[serde(flatten)]
2342    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2343    pub value_ext: Option<DataRequirementDateFilterValueExtension>,
2344}
2345#[cfg(feature = "builders")]
2346impl DataRequirementDateFilter {
2347    ///Start building a new instance
2348    #[must_use]
2349    pub fn builder() -> DataRequirementDateFilterBuilder {
2350        DataRequirementDateFilterBuilder::default()
2351    }
2352}
2353/// Choice of types for the value[x] field in DataRequirementDateFilter
2354#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2355#[serde(rename_all = "camelCase")]
2356pub enum DataRequirementDateFilterValue {
2357    /// Variant accepting the DateTime type.
2358    #[serde(rename = "valueDateTime")]
2359    DateTime(DateTime),
2360    /// Variant accepting the Period type.
2361    #[serde(rename = "valuePeriod")]
2362    Period(Period),
2363    /// Variant accepting the Duration type.
2364    #[serde(rename = "valueDuration")]
2365    Duration(Duration),
2366}
2367/// Extension value for DataRequirementDateFilterValue.
2368#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2369#[serde(rename_all = "camelCase")]
2370pub enum DataRequirementDateFilterValueExtension {
2371    /// Variant accepting the DateTime extension.
2372    #[serde(rename = "_valueDateTime")]
2373    DateTime(FieldExtension),
2374    /// Variant accepting the Period extension.
2375    #[serde(rename = "_valuePeriod")]
2376    Period(FieldExtension),
2377    /// Variant accepting the Duration extension.
2378    #[serde(rename = "_valueDuration")]
2379    Duration(FieldExtension),
2380}
2381/// Sub-fields of the valueFilter field in DataRequirement
2382#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2383#[cfg_attr(feature = "builders", derive(Builder))]
2384#[serde(rename_all = "camelCase")]
2385#[cfg_attr(
2386    feature = "builders",
2387    builder(
2388        pattern = "owned",
2389        name = "DataRequirementValueFilterBuilder",
2390        build_fn(error = "crate::error::BuilderError")
2391    )
2392)]
2393pub struct DataRequirementValueFilter {
2394    /** **Unique id for inter-element referencing**
2395
2396 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
2397
2398 */
2399    #[serde(default, skip_serializing_if = "Option::is_none")]
2400    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2401    #[serde(rename = "id")]
2402    pub id: Option<String>,
2403    /** **Additional content defined by implementations**
2404
2405 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.
2406
2407 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
2408    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2409    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2410    #[serde(rename = "extension")]
2411    pub extension: Vec<Extension>,
2412    /** **An attribute to filter on**
2413
2414 The attribute of the filter. The specified path SHALL be a FHIRPath resolvable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of a type that is comparable to the valueFilter.value[x] element for the filter.
2415
2416 The path attribute contains a [Simple FHIR Subset](fhirpath.html#simple) that allows path traversal, but not calculation. */
2417    #[serde(default, skip_serializing_if = "Option::is_none")]
2418    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2419    #[serde(rename = "path")]
2420    pub path: Option<String>,
2421    /// Extension field.
2422    #[serde(default, skip_serializing_if = "Option::is_none")]
2423    #[serde(rename = "_path")]
2424    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2425    pub path_ext: Option<FieldExtension>,
2426    /** **A parameter to search on**
2427
2428 A search parameter defined on the specified type of the DataRequirement, and which searches on elements of a type compatible with the type of the valueFilter.value[x] for the filter.
2429
2430 */
2431    #[serde(default, skip_serializing_if = "Option::is_none")]
2432    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2433    #[serde(rename = "searchParam")]
2434    pub search_param: Option<String>,
2435    /// Extension field.
2436    #[serde(default, skip_serializing_if = "Option::is_none")]
2437    #[serde(rename = "_searchParam")]
2438    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2439    pub search_param_ext: Option<FieldExtension>,
2440    /** **[ValueFilterComparator](http://hl7.org/fhir/ValueSet/value-filter-comparator); eq | gt | lt | ge | le | sa | eb**
2441
2442 The comparator to be used to determine whether the value is matching.
2443
2444 */
2445    #[serde(default, skip_serializing_if = "Option::is_none")]
2446    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2447    #[serde(rename = "comparator")]
2448    pub comparator: Option<String>,
2449    /// Extension field.
2450    #[serde(default, skip_serializing_if = "Option::is_none")]
2451    #[serde(rename = "_comparator")]
2452    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2453    pub comparator_ext: Option<FieldExtension>,
2454    /** **The value of the filter, as a Period, DateTime, or Duration value**
2455
2456 The value of the filter.
2457
2458 */
2459    #[serde(default, skip_serializing_if = "Option::is_none")]
2460    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2461    #[serde(flatten)]
2462    pub value: Option<DataRequirementValueFilterValue>,
2463    /// Extension field.
2464    #[serde(default, skip_serializing_if = "Option::is_none")]
2465    #[serde(flatten)]
2466    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2467    pub value_ext: Option<DataRequirementValueFilterValueExtension>,
2468}
2469#[cfg(feature = "builders")]
2470impl DataRequirementValueFilter {
2471    ///Start building a new instance
2472    #[must_use]
2473    pub fn builder() -> DataRequirementValueFilterBuilder {
2474        DataRequirementValueFilterBuilder::default()
2475    }
2476}
2477/// Choice of types for the value[x] field in DataRequirementValueFilter
2478#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2479#[serde(rename_all = "camelCase")]
2480pub enum DataRequirementValueFilterValue {
2481    /// Variant accepting the DateTime type.
2482    #[serde(rename = "valueDateTime")]
2483    DateTime(DateTime),
2484    /// Variant accepting the Period type.
2485    #[serde(rename = "valuePeriod")]
2486    Period(Period),
2487    /// Variant accepting the Duration type.
2488    #[serde(rename = "valueDuration")]
2489    Duration(Duration),
2490}
2491/// Extension value for DataRequirementValueFilterValue.
2492#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2493#[serde(rename_all = "camelCase")]
2494pub enum DataRequirementValueFilterValueExtension {
2495    /// Variant accepting the DateTime extension.
2496    #[serde(rename = "_valueDateTime")]
2497    DateTime(FieldExtension),
2498    /// Variant accepting the Period extension.
2499    #[serde(rename = "_valuePeriod")]
2500    Period(FieldExtension),
2501    /// Variant accepting the Duration extension.
2502    #[serde(rename = "_valueDuration")]
2503    Duration(FieldExtension),
2504}
2505/// Sub-fields of the sort field in DataRequirement
2506#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2507#[cfg_attr(feature = "builders", derive(Builder))]
2508#[serde(rename_all = "camelCase")]
2509#[cfg_attr(
2510    feature = "builders",
2511    builder(
2512        pattern = "owned",
2513        name = "DataRequirementSortBuilder",
2514        build_fn(error = "crate::error::BuilderError")
2515    )
2516)]
2517pub struct DataRequirementSort {
2518    /** **Unique id for inter-element referencing**
2519
2520 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
2521
2522 */
2523    #[serde(default, skip_serializing_if = "Option::is_none")]
2524    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2525    #[serde(rename = "id")]
2526    pub id: Option<String>,
2527    /** **Additional content defined by implementations**
2528
2529 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.
2530
2531 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
2532    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2533    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2534    #[serde(rename = "extension")]
2535    pub extension: Vec<Extension>,
2536    /** **The name of the attribute to perform the sort**
2537
2538 The attribute of the sort. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant.
2539
2540 */
2541    #[serde(rename = "path")]
2542    pub path: String,
2543    /// Extension field.
2544    #[serde(default, skip_serializing_if = "Option::is_none")]
2545    #[serde(rename = "_path")]
2546    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2547    pub path_ext: Option<FieldExtension>,
2548    /** **[SortDirection](http://hl7.org/fhir/ValueSet/sort-direction); ascending | descending**
2549
2550 The direction of the sort, ascending or descending.
2551
2552 */
2553    #[serde(rename = "direction")]
2554    pub direction: codes::SortDirection,
2555    /// Extension field.
2556    #[serde(default, skip_serializing_if = "Option::is_none")]
2557    #[serde(rename = "_direction")]
2558    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2559    pub direction_ext: Option<FieldExtension>,
2560}
2561#[cfg(feature = "builders")]
2562impl DataRequirementSort {
2563    ///Start building a new instance
2564    #[must_use]
2565    pub fn builder() -> DataRequirementSortBuilder {
2566        DataRequirementSortBuilder::default()
2567    }
2568}
2569/** Distance Type: A length - a value with a unit that is a physical distance.
2570
2571 **[Distance](http://hl7.org/fhir/StructureDefinition/Distance) v5.0.0**
2572
2573 A length - a value with a unit that is a physical distance
2574
2575 A length - a value with a unit that is a physical distance.
2576
2577 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
2578#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2579#[serde(transparent)]
2580pub struct Distance(pub Box<DistanceInner>);
2581/** Distance Type: A length - a value with a unit that is a physical distance.
2582
2583 **[Distance](http://hl7.org/fhir/StructureDefinition/Distance) v5.0.0**
2584
2585 A length - a value with a unit that is a physical distance
2586
2587 A length - a value with a unit that is a physical distance.
2588
2589 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
2590#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2591#[cfg_attr(feature = "builders", derive(Builder))]
2592#[serde(rename_all = "camelCase")]
2593#[cfg_attr(
2594    feature = "builders",
2595    builder(
2596        pattern = "owned",
2597        name = "DistanceBuilder",
2598        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
2599    )
2600)]
2601pub struct DistanceInner {
2602    /** **Unique id for inter-element referencing**
2603
2604 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
2605
2606 */
2607    #[serde(default, skip_serializing_if = "Option::is_none")]
2608    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2609    #[serde(rename = "id")]
2610    pub id: Option<String>,
2611    /** **Additional content defined by implementations**
2612
2613 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.
2614
2615 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
2616    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2617    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2618    #[serde(rename = "extension")]
2619    pub extension: Vec<Extension>,
2620    /** **Numerical value (with implicit precision)**
2621
2622 The value of the measured amount. The value includes an implicit precision in the presentation of the value.
2623
2624 The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books). */
2625    #[serde(default, skip_serializing_if = "Option::is_none")]
2626    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2627    #[serde(rename = "value")]
2628    pub value: Option<f64>,
2629    /** **[QuantityComparator](http://hl7.org/fhir/ValueSet/quantity-comparator); < | <= | >= | > | ad - how to understand the value**
2630
2631 How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.
2632
2633 */
2634    #[serde(default, skip_serializing_if = "Option::is_none")]
2635    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2636    #[serde(rename = "comparator")]
2637    pub comparator: Option<codes::QuantityComparator>,
2638    /** **Unit representation**
2639
2640 A human-readable form of the unit.
2641
2642 */
2643    #[serde(default, skip_serializing_if = "Option::is_none")]
2644    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2645    #[serde(rename = "unit")]
2646    pub unit: Option<String>,
2647    /** **System that defines coded unit form**
2648
2649 The identification of the system that provides the coded form of the unit.
2650
2651 */
2652    #[serde(default, skip_serializing_if = "Option::is_none")]
2653    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2654    #[serde(rename = "system")]
2655    pub system: Option<String>,
2656    /** **Coded form of the unit**
2657
2658 A computer processable form of the unit in some unit representation system.
2659
2660 The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency.  The context of use may additionally require a code from a particular system. */
2661    #[serde(default, skip_serializing_if = "Option::is_none")]
2662    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2663    #[serde(rename = "code")]
2664    pub code: Option<String>,
2665}
2666#[cfg(feature = "builders")]
2667impl DistanceBuilder {
2668    #[doc = concat!("Finalize building ", "Distance", ".")]
2669    pub fn build(self) -> Result<Distance, crate::error::BuilderError> {
2670        self.build_inner().map(Into::into)
2671    }
2672}
2673impl From<DistanceInner> for Distance {
2674    fn from(inner: DistanceInner) -> Self {
2675        Self(Box::new(inner))
2676    }
2677}
2678impl ::core::ops::Deref for Distance {
2679    type Target = DistanceInner;
2680    fn deref(&self) -> &Self::Target {
2681        &self.0
2682    }
2683}
2684impl ::core::ops::DerefMut for Distance {
2685    fn deref_mut(&mut self) -> &mut Self::Target {
2686        &mut self.0
2687    }
2688}
2689impl Distance {
2690    /// Start building an instance.
2691    #[cfg(feature = "builders")]
2692    #[must_use]
2693    pub fn builder() -> DistanceBuilder {
2694        DistanceBuilder::default()
2695    }
2696}
2697/** Dosage Type: Indicates how the medication is/was taken or should be taken by the patient.
2698
2699 **[Dosage](http://hl7.org/fhir/StructureDefinition/Dosage) v5.0.0**
2700
2701 How the medication is/was taken or should be taken
2702
2703 Indicates how the medication is/was taken or should be taken by the patient.
2704
2705 */
2706#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2707#[serde(transparent)]
2708pub struct Dosage(pub Box<DosageInner>);
2709/** Dosage Type: Indicates how the medication is/was taken or should be taken by the patient.
2710
2711 **[Dosage](http://hl7.org/fhir/StructureDefinition/Dosage) v5.0.0**
2712
2713 How the medication is/was taken or should be taken
2714
2715 Indicates how the medication is/was taken or should be taken by the patient.
2716
2717 */
2718#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2719#[cfg_attr(feature = "builders", derive(Builder))]
2720#[serde(rename_all = "camelCase")]
2721#[cfg_attr(
2722    feature = "builders",
2723    builder(
2724        pattern = "owned",
2725        name = "DosageBuilder",
2726        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
2727    )
2728)]
2729pub struct DosageInner {
2730    /** **Unique id for inter-element referencing**
2731
2732 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
2733
2734 */
2735    #[serde(default, skip_serializing_if = "Option::is_none")]
2736    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2737    #[serde(rename = "id")]
2738    pub id: Option<String>,
2739    /** **Additional content defined by implementations**
2740
2741 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.
2742
2743 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
2744    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2745    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2746    #[serde(rename = "extension")]
2747    pub extension: Vec<Extension>,
2748    /** **Extensions that cannot be ignored even if unrecognized**
2749
2750 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.
2751
2752Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
2753
2754 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
2755    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2756    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2757    #[serde(rename = "modifierExtension")]
2758    pub modifier_extension: Vec<Extension>,
2759    /** **The order of the dosage instructions**
2760
2761 Indicates the order in which the dosage instructions should be applied or interpreted.
2762
2763 */
2764    #[serde(default, skip_serializing_if = "Option::is_none")]
2765    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2766    #[serde(rename = "sequence")]
2767    pub sequence: Option<i32>,
2768    /// Extension field.
2769    #[serde(default, skip_serializing_if = "Option::is_none")]
2770    #[serde(rename = "_sequence")]
2771    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2772    pub sequence_ext: Option<FieldExtension>,
2773    /** **Free text dosage instructions e.g. SIG**
2774
2775 Free text dosage instructions e.g. SIG.
2776
2777 */
2778    #[serde(default, skip_serializing_if = "Option::is_none")]
2779    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2780    #[serde(rename = "text")]
2781    pub text: Option<String>,
2782    /// Extension field.
2783    #[serde(default, skip_serializing_if = "Option::is_none")]
2784    #[serde(rename = "_text")]
2785    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2786    pub text_ext: Option<FieldExtension>,
2787    /** **[AdditionalInstruction](http://hl7.org/fhir/ValueSet/additional-instruction-codes); Supplemental instruction or warnings to the patient - e.g. "with meals", "may cause drowsiness"**
2788
2789 Supplemental instructions to the patient on how to take the medication  (e.g. "with meals" or"take half to one hour before food") or warnings for the patient about the medication (e.g. "may cause drowsiness" or "avoid exposure of skin to direct sunlight or sunlamps").
2790
2791 Information about administration or preparation of the medication (e.g. "infuse as rapidly as possibly via intraperitoneal port" or take "immediately following drug x") should be populated in dosage.text. */
2792    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2793    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2794    #[serde(rename = "additionalInstruction")]
2795    pub additional_instruction: Vec<Option<CodeableConcept>>,
2796    /// Extension field.
2797    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2798    #[serde(rename = "_additionalInstruction")]
2799    #[cfg_attr(feature = "builders", builder(default))]
2800    pub additional_instruction_ext: Vec<Option<FieldExtension>>,
2801    /** **Patient or consumer oriented instructions**
2802
2803 Instructions in terms that are understood by the patient or consumer.
2804
2805 */
2806    #[serde(default, skip_serializing_if = "Option::is_none")]
2807    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2808    #[serde(rename = "patientInstruction")]
2809    pub patient_instruction: Option<String>,
2810    /// Extension field.
2811    #[serde(default, skip_serializing_if = "Option::is_none")]
2812    #[serde(rename = "_patientInstruction")]
2813    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2814    pub patient_instruction_ext: Option<FieldExtension>,
2815    /** **When medication should be administered**
2816
2817 When medication should be administered.
2818
2819 This attribute might not always be populated while the Dosage.text is expected to be populated.  If both are populated, then the Dosage.text should reflect the content of the Dosage.timing. */
2820    #[serde(default, skip_serializing_if = "Option::is_none")]
2821    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2822    #[serde(rename = "timing")]
2823    pub timing: Option<Timing>,
2824    /// Extension field.
2825    #[serde(default, skip_serializing_if = "Option::is_none")]
2826    #[serde(rename = "_timing")]
2827    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2828    pub timing_ext: Option<FieldExtension>,
2829    /** **Take "as needed"**
2830
2831 Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option).
2832
2833 Can express "as needed" without a reason by setting the Boolean = True.  In this case the CodeableConcept is not populated. */
2834    #[serde(default, skip_serializing_if = "Option::is_none")]
2835    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2836    #[serde(rename = "asNeeded")]
2837    pub as_needed: Option<bool>,
2838    /// Extension field.
2839    #[serde(default, skip_serializing_if = "Option::is_none")]
2840    #[serde(rename = "_asNeeded")]
2841    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2842    pub as_needed_ext: Option<FieldExtension>,
2843    /** **[MedicationAsNeededReason](http://hl7.org/fhir/ValueSet/medication-as-needed-reason); Take "as needed" (for x)**
2844
2845 Indicates whether the Medication is only taken based on a precondition for taking the Medication (CodeableConcept).
2846
2847 Can express "as needed" with a reason by including the CodeableConcept.  In this case the Boolean is assumed to be False, then the dose is given according to the schedule and is not "prn" or "as needed". */
2848    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2849    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2850    #[serde(rename = "asNeededFor")]
2851    pub as_needed_for: Vec<Option<CodeableConcept>>,
2852    /// Extension field.
2853    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2854    #[serde(rename = "_asNeededFor")]
2855    #[cfg_attr(feature = "builders", builder(default))]
2856    pub as_needed_for_ext: Vec<Option<FieldExtension>>,
2857    /** **[MedicationAdministrationSite](http://hl7.org/fhir/ValueSet/approach-site-codes); Body site to administer to**
2858
2859 Body site to administer to.
2860
2861 If the use case requires attributes from the BodySite resource (e.g. to identify and track separately) then use the standard extension [http://hl7.org/fhir/StructureDefinition/bodySite](http://hl7.org/fhir/extensions/StructureDefinition-bodySite.html).  May be a summary code, or a reference to a very precise definition of the location, or both. */
2862    #[serde(default, skip_serializing_if = "Option::is_none")]
2863    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2864    #[serde(rename = "site")]
2865    pub site: Option<CodeableConcept>,
2866    /// Extension field.
2867    #[serde(default, skip_serializing_if = "Option::is_none")]
2868    #[serde(rename = "_site")]
2869    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2870    pub site_ext: Option<FieldExtension>,
2871    /** **[RouteOfAdministration](http://hl7.org/fhir/ValueSet/route-codes); How drug should enter body**
2872
2873 How drug should enter body.
2874
2875 */
2876    #[serde(default, skip_serializing_if = "Option::is_none")]
2877    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2878    #[serde(rename = "route")]
2879    pub route: Option<CodeableConcept>,
2880    /// Extension field.
2881    #[serde(default, skip_serializing_if = "Option::is_none")]
2882    #[serde(rename = "_route")]
2883    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2884    pub route_ext: Option<FieldExtension>,
2885    /** **[MedicationAdministrationMethod](http://hl7.org/fhir/ValueSet/administration-method-codes); Technique for administering medication**
2886
2887 Technique for administering medication.
2888
2889 Terminologies used often pre-coordinate this term with the route and or form of administration. */
2890    #[serde(default, skip_serializing_if = "Option::is_none")]
2891    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2892    #[serde(rename = "method")]
2893    pub method: Option<CodeableConcept>,
2894    /// Extension field.
2895    #[serde(default, skip_serializing_if = "Option::is_none")]
2896    #[serde(rename = "_method")]
2897    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2898    pub method_ext: Option<FieldExtension>,
2899    /** **Amount of medication administered, to be administered or typical amount to be administered**
2900
2901 Depending on the resource,this is the amount of medication administered, to  be administered or typical amount to be administered.
2902
2903 */
2904    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2905    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2906    #[serde(rename = "doseAndRate")]
2907    pub dose_and_rate: Vec<Option<DosageDoseAndRate>>,
2908    /// Extension field.
2909    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2910    #[serde(rename = "_doseAndRate")]
2911    #[cfg_attr(feature = "builders", builder(default))]
2912    pub dose_and_rate_ext: Vec<Option<FieldExtension>>,
2913    /** **Upper limit on medication per unit of time**
2914
2915 Upper limit on medication per unit of time.
2916
2917 This is intended for use as an adjunct to the dosage when there is an upper cap.  For example "2 tablets every 4 hours to a maximum of 8/day". */
2918    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2919    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2920    #[serde(rename = "maxDosePerPeriod")]
2921    pub max_dose_per_period: Vec<Option<Ratio>>,
2922    /// Extension field.
2923    #[serde(default, skip_serializing_if = "Vec::is_empty")]
2924    #[serde(rename = "_maxDosePerPeriod")]
2925    #[cfg_attr(feature = "builders", builder(default))]
2926    pub max_dose_per_period_ext: Vec<Option<FieldExtension>>,
2927    /** **Upper limit on medication per administration**
2928
2929 Upper limit on medication per administration.
2930
2931 This is intended for use as an adjunct to the dosage when there is an upper cap.  For example, a body surface area related dose with a maximum amount, such as 1.5 mg/m2 (maximum 2 mg) IV over 5 – 10 minutes would have doseQuantity of 1.5 mg/m2 and maxDosePerAdministration of 2 mg. */
2932    #[serde(default, skip_serializing_if = "Option::is_none")]
2933    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2934    #[serde(rename = "maxDosePerAdministration")]
2935    pub max_dose_per_administration: Option<Quantity>,
2936    /// Extension field.
2937    #[serde(default, skip_serializing_if = "Option::is_none")]
2938    #[serde(rename = "_maxDosePerAdministration")]
2939    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2940    pub max_dose_per_administration_ext: Option<FieldExtension>,
2941    /** **Upper limit on medication per lifetime of the patient**
2942
2943 Upper limit on medication per lifetime of the patient.
2944
2945 */
2946    #[serde(default, skip_serializing_if = "Option::is_none")]
2947    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2948    #[serde(rename = "maxDosePerLifetime")]
2949    pub max_dose_per_lifetime: Option<Quantity>,
2950    /// Extension field.
2951    #[serde(default, skip_serializing_if = "Option::is_none")]
2952    #[serde(rename = "_maxDosePerLifetime")]
2953    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
2954    pub max_dose_per_lifetime_ext: Option<FieldExtension>,
2955}
2956#[cfg(feature = "builders")]
2957impl DosageBuilder {
2958    #[doc = concat!("Finalize building ", "Dosage", ".")]
2959    pub fn build(self) -> Result<Dosage, crate::error::BuilderError> {
2960        self.build_inner().map(Into::into)
2961    }
2962}
2963impl From<DosageInner> for Dosage {
2964    fn from(inner: DosageInner) -> Self {
2965        Self(Box::new(inner))
2966    }
2967}
2968impl ::core::ops::Deref for Dosage {
2969    type Target = DosageInner;
2970    fn deref(&self) -> &Self::Target {
2971        &self.0
2972    }
2973}
2974impl ::core::ops::DerefMut for Dosage {
2975    fn deref_mut(&mut self) -> &mut Self::Target {
2976        &mut self.0
2977    }
2978}
2979impl Dosage {
2980    /// Start building an instance.
2981    #[cfg(feature = "builders")]
2982    #[must_use]
2983    pub fn builder() -> DosageBuilder {
2984        DosageBuilder::default()
2985    }
2986}
2987/// Sub-fields of the doseAndRate field in Dosage
2988#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2989#[cfg_attr(feature = "builders", derive(Builder))]
2990#[serde(rename_all = "camelCase")]
2991#[cfg_attr(
2992    feature = "builders",
2993    builder(
2994        pattern = "owned",
2995        name = "DosageDoseAndRateBuilder",
2996        build_fn(error = "crate::error::BuilderError")
2997    )
2998)]
2999pub struct DosageDoseAndRate {
3000    /** **Unique id for inter-element referencing**
3001
3002 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
3003
3004 */
3005    #[serde(default, skip_serializing_if = "Option::is_none")]
3006    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3007    #[serde(rename = "id")]
3008    pub id: Option<String>,
3009    /** **Additional content defined by implementations**
3010
3011 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.
3012
3013 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
3014    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3015    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3016    #[serde(rename = "extension")]
3017    pub extension: Vec<Extension>,
3018    /** **[DoseAndRateType](http://terminology.hl7.org/ValueSet/dose-rate-type); The kind of dose or rate specified**
3019
3020 The kind of dose or rate specified, for example, ordered or calculated.
3021
3022 */
3023    #[serde(default, skip_serializing_if = "Option::is_none")]
3024    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3025    #[serde(rename = "type")]
3026    pub r#type: Option<CodeableConcept>,
3027    /// Extension field.
3028    #[serde(default, skip_serializing_if = "Option::is_none")]
3029    #[serde(rename = "_type")]
3030    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3031    pub r#type_ext: Option<FieldExtension>,
3032    /** **Amount of medication per dose**
3033
3034 Amount of medication per dose.
3035
3036 Note that this specifies the quantity of the specified medication, not the quantity for each active ingredient(s). Each ingredient amount can be communicated in the Medication resource. For example, if one wants to communicate that a tablet was 375 mg, where the dose was one tablet, you can use the Medication resource to document that the tablet was comprised of 375 mg of drug XYZ. Alternatively if the dose was 375 mg, then you may only need to use the Medication resource to indicate this was a tablet. If the example were an IV such as dopamine and you wanted to communicate that 400mg of dopamine was mixed in 500 ml of some IV solution, then this would all be communicated in the Medication resource. If the administration is not intended to be instantaneous (rate is present or timing has a duration), this can be specified to convey the total amount to be administered over the period of time as indicated by the schedule e.g. 500 ml in dose, with timing used to convey that this should be done over 4 hours. */
3037    #[serde(default, skip_serializing_if = "Option::is_none")]
3038    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3039    #[serde(flatten)]
3040    pub dose: Option<DosageDoseAndRateDose>,
3041    /// Extension field.
3042    #[serde(default, skip_serializing_if = "Option::is_none")]
3043    #[serde(flatten)]
3044    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3045    pub dose_ext: Option<DosageDoseAndRateDoseExtension>,
3046    /** **Amount of medication per unit of time**
3047
3048 Amount of medication per unit of time.
3049
3050 It is possible to supply both a rate and a doseQuantity to provide full details about how the medication is to be administered and supplied. If the rate is intended to change over time, depending on local rules/regulations, each change should be captured as a new version of the MedicationRequest with an updated rate, or captured with a new MedicationRequest with the new rate.
3051
3052It is possible to specify a rate over time (for example, 100 ml/hour) using either the rateRatio and rateQuantity.  The rateQuantity approach requires systems to have the capability to parse UCUM grammar where ml/hour is included rather than a specific ratio where the time is specified as the denominator.  Where a rate such as 500ml over 2 hours is specified, the use of rateRatio may be more semantically correct than specifying using a rateQuantity of 250 mg/hour. */
3053    #[serde(default, skip_serializing_if = "Option::is_none")]
3054    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3055    #[serde(flatten)]
3056    pub rate: Option<DosageDoseAndRateRate>,
3057    /// Extension field.
3058    #[serde(default, skip_serializing_if = "Option::is_none")]
3059    #[serde(flatten)]
3060    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3061    pub rate_ext: Option<DosageDoseAndRateRateExtension>,
3062}
3063#[cfg(feature = "builders")]
3064impl DosageDoseAndRate {
3065    ///Start building a new instance
3066    #[must_use]
3067    pub fn builder() -> DosageDoseAndRateBuilder {
3068        DosageDoseAndRateBuilder::default()
3069    }
3070}
3071/// Choice of types for the dose[x] field in DosageDoseAndRate
3072#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3073#[serde(rename_all = "camelCase")]
3074pub enum DosageDoseAndRateDose {
3075    /// Variant accepting the Range type.
3076    #[serde(rename = "doseRange")]
3077    Range(Range),
3078    /// Variant accepting the Quantity type.
3079    #[serde(rename = "doseQuantity")]
3080    Quantity(Quantity),
3081}
3082/// Extension value for DosageDoseAndRateDose.
3083#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3084#[serde(rename_all = "camelCase")]
3085pub enum DosageDoseAndRateDoseExtension {
3086    /// Variant accepting the Range extension.
3087    #[serde(rename = "_doseRange")]
3088    Range(FieldExtension),
3089    /// Variant accepting the Quantity extension.
3090    #[serde(rename = "_doseQuantity")]
3091    Quantity(FieldExtension),
3092}
3093/// Choice of types for the rate[x] field in DosageDoseAndRate
3094#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3095#[serde(rename_all = "camelCase")]
3096pub enum DosageDoseAndRateRate {
3097    /// Variant accepting the Ratio type.
3098    #[serde(rename = "rateRatio")]
3099    Ratio(Ratio),
3100    /// Variant accepting the Range type.
3101    #[serde(rename = "rateRange")]
3102    Range(Range),
3103    /// Variant accepting the Quantity type.
3104    #[serde(rename = "rateQuantity")]
3105    Quantity(Quantity),
3106}
3107/// Extension value for DosageDoseAndRateRate.
3108#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3109#[serde(rename_all = "camelCase")]
3110pub enum DosageDoseAndRateRateExtension {
3111    /// Variant accepting the Ratio extension.
3112    #[serde(rename = "_rateRatio")]
3113    Ratio(FieldExtension),
3114    /// Variant accepting the Range extension.
3115    #[serde(rename = "_rateRange")]
3116    Range(FieldExtension),
3117    /// Variant accepting the Quantity extension.
3118    #[serde(rename = "_rateQuantity")]
3119    Quantity(FieldExtension),
3120}
3121/** Duration Type: A length of time.
3122
3123 **[Duration](http://hl7.org/fhir/StructureDefinition/Duration) v5.0.0**
3124
3125 A length of time
3126
3127 A length of time.
3128
3129 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
3130#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3131#[serde(transparent)]
3132pub struct Duration(pub Box<DurationInner>);
3133/** Duration Type: A length of time.
3134
3135 **[Duration](http://hl7.org/fhir/StructureDefinition/Duration) v5.0.0**
3136
3137 A length of time
3138
3139 A length of time.
3140
3141 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
3142#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3143#[cfg_attr(feature = "builders", derive(Builder))]
3144#[serde(rename_all = "camelCase")]
3145#[cfg_attr(
3146    feature = "builders",
3147    builder(
3148        pattern = "owned",
3149        name = "DurationBuilder",
3150        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
3151    )
3152)]
3153pub struct DurationInner {
3154    /** **Unique id for inter-element referencing**
3155
3156 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
3157
3158 */
3159    #[serde(default, skip_serializing_if = "Option::is_none")]
3160    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3161    #[serde(rename = "id")]
3162    pub id: Option<String>,
3163    /** **Additional content defined by implementations**
3164
3165 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.
3166
3167 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
3168    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3169    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3170    #[serde(rename = "extension")]
3171    pub extension: Vec<Extension>,
3172    /** **Numerical value (with implicit precision)**
3173
3174 The value of the measured amount. The value includes an implicit precision in the presentation of the value.
3175
3176 The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books). */
3177    #[serde(default, skip_serializing_if = "Option::is_none")]
3178    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3179    #[serde(rename = "value")]
3180    pub value: Option<f64>,
3181    /** **[QuantityComparator](http://hl7.org/fhir/ValueSet/quantity-comparator); < | <= | >= | > | ad - how to understand the value**
3182
3183 How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.
3184
3185 */
3186    #[serde(default, skip_serializing_if = "Option::is_none")]
3187    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3188    #[serde(rename = "comparator")]
3189    pub comparator: Option<codes::QuantityComparator>,
3190    /** **Unit representation**
3191
3192 A human-readable form of the unit.
3193
3194 */
3195    #[serde(default, skip_serializing_if = "Option::is_none")]
3196    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3197    #[serde(rename = "unit")]
3198    pub unit: Option<String>,
3199    /** **System that defines coded unit form**
3200
3201 The identification of the system that provides the coded form of the unit.
3202
3203 */
3204    #[serde(default, skip_serializing_if = "Option::is_none")]
3205    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3206    #[serde(rename = "system")]
3207    pub system: Option<String>,
3208    /** **Coded form of the unit**
3209
3210 A computer processable form of the unit in some unit representation system.
3211
3212 The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency.  The context of use may additionally require a code from a particular system. */
3213    #[serde(default, skip_serializing_if = "Option::is_none")]
3214    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3215    #[serde(rename = "code")]
3216    pub code: Option<String>,
3217}
3218#[cfg(feature = "builders")]
3219impl DurationBuilder {
3220    #[doc = concat!("Finalize building ", "Duration", ".")]
3221    pub fn build(self) -> Result<Duration, crate::error::BuilderError> {
3222        self.build_inner().map(Into::into)
3223    }
3224}
3225impl From<DurationInner> for Duration {
3226    fn from(inner: DurationInner) -> Self {
3227        Self(Box::new(inner))
3228    }
3229}
3230impl ::core::ops::Deref for Duration {
3231    type Target = DurationInner;
3232    fn deref(&self) -> &Self::Target {
3233        &self.0
3234    }
3235}
3236impl ::core::ops::DerefMut for Duration {
3237    fn deref_mut(&mut self) -> &mut Self::Target {
3238        &mut self.0
3239    }
3240}
3241impl Duration {
3242    /// Start building an instance.
3243    #[cfg(feature = "builders")]
3244    #[must_use]
3245    pub fn builder() -> DurationBuilder {
3246        DurationBuilder::default()
3247    }
3248}
3249/** ElementDefinition Type: Captures constraints on each element within the resource, profile, or extension.
3250
3251 **[ElementDefinition](http://hl7.org/fhir/StructureDefinition/ElementDefinition) v5.0.0**
3252
3253 Definition of an element in a resource or extension
3254
3255 Captures constraints on each element within the resource, profile, or extension.
3256
3257 */
3258#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3259#[serde(transparent)]
3260pub struct ElementDefinition(pub Box<ElementDefinitionInner>);
3261/** ElementDefinition Type: Captures constraints on each element within the resource, profile, or extension.
3262
3263 **[ElementDefinition](http://hl7.org/fhir/StructureDefinition/ElementDefinition) v5.0.0**
3264
3265 Definition of an element in a resource or extension
3266
3267 Captures constraints on each element within the resource, profile, or extension.
3268
3269 */
3270#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3271#[cfg_attr(feature = "builders", derive(Builder))]
3272#[serde(rename_all = "camelCase")]
3273#[cfg_attr(
3274    feature = "builders",
3275    builder(
3276        pattern = "owned",
3277        name = "ElementDefinitionBuilder",
3278        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
3279    )
3280)]
3281pub struct ElementDefinitionInner {
3282    /** **Unique id for inter-element referencing**
3283
3284 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
3285
3286 */
3287    #[serde(default, skip_serializing_if = "Option::is_none")]
3288    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3289    #[serde(rename = "id")]
3290    pub id: Option<String>,
3291    /** **Additional content defined by implementations**
3292
3293 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.
3294
3295 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
3296    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3297    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3298    #[serde(rename = "extension")]
3299    pub extension: Vec<Extension>,
3300    /** **Extensions that cannot be ignored even if unrecognized**
3301
3302 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.
3303
3304Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
3305
3306 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
3307    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3308    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3309    #[serde(rename = "modifierExtension")]
3310    pub modifier_extension: Vec<Extension>,
3311    /** **Path of the element in the hierarchy of elements**
3312
3313 The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.
3314
3315 */
3316    #[serde(rename = "path")]
3317    pub path: String,
3318    /// Extension field.
3319    #[serde(default, skip_serializing_if = "Option::is_none")]
3320    #[serde(rename = "_path")]
3321    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3322    pub path_ext: Option<FieldExtension>,
3323    /** **[PropertyRepresentation](http://hl7.org/fhir/ValueSet/property-representation); xmlAttr | xmlText | typeAttr | cdaText | xhtml**
3324
3325 Codes that define how this element is represented in instances, when the deviation varies from the normal case. No extensions are allowed on elements with a representation of 'xmlAttr', no matter what FHIR serialization format is used.
3326
3327 In resources, this is rarely used except for special cases where the representation deviates from the normal, and can only be done in the base standard (and profiles must reproduce what the base standard does). This element is used quite commonly in Logical models when the logical models represent a specific serialization format (e.g. CDA, v2 etc.). */
3328    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3329    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3330    #[serde(rename = "representation")]
3331    pub representation: Vec<Option<codes::PropertyRepresentation>>,
3332    /// Extension field.
3333    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3334    #[serde(rename = "_representation")]
3335    #[cfg_attr(feature = "builders", builder(default))]
3336    pub representation_ext: Vec<Option<FieldExtension>>,
3337    /** **Name for this particular element (in a set of slices)**
3338
3339 The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.
3340
3341 The name SHALL be unique within the structure within the context of the constrained resource element.  (Though to avoid confusion, uniqueness across all elements is recommended.). */
3342    #[serde(default, skip_serializing_if = "Option::is_none")]
3343    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3344    #[serde(rename = "sliceName")]
3345    pub slice_name: Option<String>,
3346    /// Extension field.
3347    #[serde(default, skip_serializing_if = "Option::is_none")]
3348    #[serde(rename = "_sliceName")]
3349    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3350    pub slice_name_ext: Option<FieldExtension>,
3351    /** **If this slice definition constrains an inherited slice definition (or not)**
3352
3353 If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName.
3354
3355 If set to true, an ancestor profile SHALL have a slicing definition with this name.  If set to false, no ancestor profile is permitted to have a slicing definition with this name. */
3356    #[serde(default, skip_serializing_if = "Option::is_none")]
3357    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3358    #[serde(rename = "sliceIsConstraining")]
3359    pub slice_is_constraining: Option<bool>,
3360    /// Extension field.
3361    #[serde(default, skip_serializing_if = "Option::is_none")]
3362    #[serde(rename = "_sliceIsConstraining")]
3363    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3364    pub slice_is_constraining_ext: Option<FieldExtension>,
3365    /** **Name for element to display with or prompt for element**
3366
3367 A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.
3368
3369 See also the extension [http://hl7.org/fhir/StructureDefinition/elementdefinition-question](http://hl7.org/fhir/extensions/StructureDefinition-elementdefinition-question.html). */
3370    #[serde(default, skip_serializing_if = "Option::is_none")]
3371    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3372    #[serde(rename = "label")]
3373    pub label: Option<String>,
3374    /// Extension field.
3375    #[serde(default, skip_serializing_if = "Option::is_none")]
3376    #[serde(rename = "_label")]
3377    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3378    pub label_ext: Option<FieldExtension>,
3379    /** **[ElementDefinitionCode](http://loinc.org/vs); Corresponding codes in terminologies**
3380
3381 A code that has the same meaning as the element in a particular terminology.
3382
3383 The concept SHALL be properly aligned with the data element definition and other constraints, as defined in the code system, including relationships, of any code listed here.  Where multiple codes exist in a terminology that could correspond to the data element, the most granular code(s) should be selected, so long as they are not more restrictive than the data element itself. The mappings may be used to provide more or less granular or structured equivalences in the code system. */
3384    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3385    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3386    #[serde(rename = "code")]
3387    pub code: Vec<Option<Coding>>,
3388    /// Extension field.
3389    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3390    #[serde(rename = "_code")]
3391    #[cfg_attr(feature = "builders", builder(default))]
3392    pub code_ext: Vec<Option<FieldExtension>>,
3393    /** **This element is sliced - slices follow**
3394
3395 Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).
3396
3397 The first element in the sequence, the one that carries the slicing, is the definition that applies to all the slices. This is based on the unconstrained element, but can apply any constraints as appropriate. This may include the common constraints on the children of the element. */
3398    #[serde(default, skip_serializing_if = "Option::is_none")]
3399    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3400    #[serde(rename = "slicing")]
3401    pub slicing: Option<ElementDefinitionSlicing>,
3402    /// Extension field.
3403    #[serde(default, skip_serializing_if = "Option::is_none")]
3404    #[serde(rename = "_slicing")]
3405    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3406    pub slicing_ext: Option<FieldExtension>,
3407    /** **Concise definition for space-constrained presentation**
3408
3409 A concise description of what this element means (e.g. for use in autogenerated summaries).
3410
3411 It is easy for a different short definition to change the meaning of an element and this can have nasty downstream consequences. Please be careful when providing short definitions in a profile. */
3412    #[serde(default, skip_serializing_if = "Option::is_none")]
3413    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3414    #[serde(rename = "short")]
3415    pub short: Option<String>,
3416    /// Extension field.
3417    #[serde(default, skip_serializing_if = "Option::is_none")]
3418    #[serde(rename = "_short")]
3419    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3420    pub short_ext: Option<FieldExtension>,
3421    /** **Full formal definition as narrative text**
3422
3423 Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. (Note: The text you are reading is specified in ElementDefinition.definition).
3424
3425 It is easy for a different definition to change the meaning of an element and this can have nasty downstream consequences. Please be careful when providing definitions in a profile. */
3426    #[serde(default, skip_serializing_if = "Option::is_none")]
3427    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3428    #[serde(rename = "definition")]
3429    pub definition: Option<String>,
3430    /// Extension field.
3431    #[serde(default, skip_serializing_if = "Option::is_none")]
3432    #[serde(rename = "_definition")]
3433    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3434    pub definition_ext: Option<FieldExtension>,
3435    /** **Comments about the use of this element**
3436
3437 Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. (Note: The text you are reading is specified in ElementDefinition.comment).
3438
3439 If it is possible to capture usage rules using constraints, that mechanism should be used in preference to this element. */
3440    #[serde(default, skip_serializing_if = "Option::is_none")]
3441    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3442    #[serde(rename = "comment")]
3443    pub comment: Option<String>,
3444    /// Extension field.
3445    #[serde(default, skip_serializing_if = "Option::is_none")]
3446    #[serde(rename = "_comment")]
3447    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3448    pub comment_ext: Option<FieldExtension>,
3449    /** **Why this resource has been created**
3450
3451 This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.
3452
3453 This element does not describe the usage of the element (that's done in comments), rather it's for traceability of *why* the element is either needed or why the constraints exist as they do.  This may be used to point to source materials or specifications that drove the structure of this data element. */
3454    #[serde(default, skip_serializing_if = "Option::is_none")]
3455    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3456    #[serde(rename = "requirements")]
3457    pub requirements: Option<String>,
3458    /// Extension field.
3459    #[serde(default, skip_serializing_if = "Option::is_none")]
3460    #[serde(rename = "_requirements")]
3461    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3462    pub requirements_ext: Option<FieldExtension>,
3463    /** **Other names**
3464
3465 Identifies additional names by which this element might also be known.
3466
3467 */
3468    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3469    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3470    #[serde(rename = "alias")]
3471    pub alias: Vec<Option<String>>,
3472    /// Extension field.
3473    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3474    #[serde(rename = "_alias")]
3475    #[cfg_attr(feature = "builders", builder(default))]
3476    pub alias_ext: Vec<Option<FieldExtension>>,
3477    /** **Minimum Cardinality**
3478
3479 The minimum number of times this element SHALL appear in the instance.
3480
3481 */
3482    #[serde(default, skip_serializing_if = "Option::is_none")]
3483    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3484    #[serde(rename = "min")]
3485    pub min: Option<u32>,
3486    /// Extension field.
3487    #[serde(default, skip_serializing_if = "Option::is_none")]
3488    #[serde(rename = "_min")]
3489    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3490    pub min_ext: Option<FieldExtension>,
3491    /** **Maximum Cardinality (a number or *)**
3492
3493 The maximum number of times this element is permitted to appear in the instance.
3494
3495 */
3496    #[serde(default, skip_serializing_if = "Option::is_none")]
3497    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3498    #[serde(rename = "max")]
3499    pub max: Option<String>,
3500    /// Extension field.
3501    #[serde(default, skip_serializing_if = "Option::is_none")]
3502    #[serde(rename = "_max")]
3503    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3504    pub max_ext: Option<FieldExtension>,
3505    /** **Base definition information for tools**
3506
3507 Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - e.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same.
3508
3509 The base information does not carry any information that could not be determined from the path and related profiles, but making this determination requires both that the related profiles are available, and that the algorithm to determine them be available. For tooling simplicity, the base information must always be populated in element definitions in snap shots, even if it is the same. */
3510    #[serde(default, skip_serializing_if = "Option::is_none")]
3511    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3512    #[serde(rename = "base")]
3513    pub base: Option<ElementDefinitionBase>,
3514    /// Extension field.
3515    #[serde(default, skip_serializing_if = "Option::is_none")]
3516    #[serde(rename = "_base")]
3517    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3518    pub base_ext: Option<FieldExtension>,
3519    /** **Reference to definition of content for the element**
3520
3521 Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc.
3522
3523 ContentReferences can only be defined in specializations, not constrained types, and they cannot be changed and always reference the non-constrained definition. */
3524    #[serde(default, skip_serializing_if = "Option::is_none")]
3525    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3526    #[serde(rename = "contentReference")]
3527    pub content_reference: Option<String>,
3528    /// Extension field.
3529    #[serde(default, skip_serializing_if = "Option::is_none")]
3530    #[serde(rename = "_contentReference")]
3531    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3532    pub content_reference_ext: Option<FieldExtension>,
3533    /** **Data type and Profile for this element**
3534
3535 The data type or resource that the value of this element is permitted to be.
3536
3537 The Type of the element can be left blank in a differential constraint, in which case the type is inherited from the resource. Abstract types are not permitted to appear as a type when multiple types are listed.  (I.e. Abstract types cannot be part of a choice). */
3538    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3539    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3540    #[serde(rename = "type")]
3541    pub r#type: Vec<Option<ElementDefinitionType>>,
3542    /// Extension field.
3543    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3544    #[serde(rename = "_type")]
3545    #[cfg_attr(feature = "builders", builder(default))]
3546    pub r#type_ext: Vec<Option<FieldExtension>>,
3547    /** **Specified value if missing from instance**
3548
3549 The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').
3550
3551 Specifying a default value means that the property can never been unknown - it must always have a value. Further, the default value can never be changed, or changed in constraints on content models. Defining default values creates many difficulties in implementation (e.g. when is a value missing?). For these reasons, default values are (and should be) used extremely sparingly.
3552
3553No default values are ever defined in the FHIR specification, nor can they be defined in constraints ("profiles") on data types or resources. This element only exists so that default values may be defined in logical models. */
3554    #[serde(default, skip_serializing_if = "Option::is_none")]
3555    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3556    #[serde(flatten)]
3557    pub default_value: Option<ElementDefinitionDefaultValue>,
3558    /// Extension field.
3559    #[serde(default, skip_serializing_if = "Option::is_none")]
3560    #[serde(flatten)]
3561    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3562    pub default_value_ext: Option<ElementDefinitionDefaultValueExtension>,
3563    /** **Implicit meaning when this element is missing**
3564
3565 The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing').
3566
3567 Implicit meanings for missing values can only be specified on a resource, data type, or extension definition, and never in a profile that applies to one of these. An implicit meaning for a missing value can never be changed, and specifying one has the consequence that constraining its use in profiles eliminates use cases as possibilities, not merely moving them out of scope. */
3568    #[serde(default, skip_serializing_if = "Option::is_none")]
3569    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3570    #[serde(rename = "meaningWhenMissing")]
3571    pub meaning_when_missing: Option<String>,
3572    /// Extension field.
3573    #[serde(default, skip_serializing_if = "Option::is_none")]
3574    #[serde(rename = "_meaningWhenMissing")]
3575    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3576    pub meaning_when_missing_ext: Option<FieldExtension>,
3577    /** **What the order of the elements means**
3578
3579 If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.
3580
3581 This element can only be asserted on repeating elements and can only be introduced when defining resources or data types.  It can be further refined profiled elements but if absent in the base type, a profile cannot assert meaning. */
3582    #[serde(default, skip_serializing_if = "Option::is_none")]
3583    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3584    #[serde(rename = "orderMeaning")]
3585    pub order_meaning: Option<String>,
3586    /// Extension field.
3587    #[serde(default, skip_serializing_if = "Option::is_none")]
3588    #[serde(rename = "_orderMeaning")]
3589    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3590    pub order_meaning_ext: Option<FieldExtension>,
3591    /** **Value must be exactly this**
3592
3593 Specifies a value that SHALL be exactly the value  for this element in the instance, if present. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.
3594
3595 This is not recommended for Coding and CodeableConcept since these often have highly contextual properties such as version or display. */
3596    #[serde(default, skip_serializing_if = "Option::is_none")]
3597    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3598    #[serde(flatten)]
3599    pub fixed: Option<ElementDefinitionFixed>,
3600    /// Extension field.
3601    #[serde(default, skip_serializing_if = "Option::is_none")]
3602    #[serde(flatten)]
3603    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3604    pub fixed_ext: Option<ElementDefinitionFixedExtension>,
3605    /** **Value must have at least these property values**
3606
3607 Specifies a value that each occurrence of the element in the instance SHALL follow - that is, any value in the pattern must be found in the instance, if the element has a value. Other additional values may be found too. This is effectively constraint by example.
3608
3609When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
3610
3611When an element within a pattern[x] is used to constrain an array, it means that each element provided in the pattern[x] must (recursively) match at least one element from the instance array.
3612
3613When pattern[x] is used to constrain a complex object, it means that each property in the pattern must be present in the complex object, and its value must recursively match -- i.e.,
3614
36151. If primitive: it must match exactly the pattern value
36162. If a complex object: it must match (recursively) the pattern value
36173. If an array: it must match (recursively) the pattern value
3618
3619If a pattern[x] is declared on a repeating element, the pattern applies to all repetitions.  If the desire is for a pattern to apply to only one element or a subset of elements, slicing must be used. See [Examples of Patterns](elementdefinition-examples.html#pattern-examples) for examples of pattern usage and the effect it will have.
3620
3621 Mostly used for fixing values of CodeableConcept. In general, pattern[x] is not intended for use with primitive types, where is has the same meaning as fixed[x]. */
3622    #[serde(default, skip_serializing_if = "Option::is_none")]
3623    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3624    #[serde(flatten)]
3625    pub pattern: Option<ElementDefinitionPattern>,
3626    /// Extension field.
3627    #[serde(default, skip_serializing_if = "Option::is_none")]
3628    #[serde(flatten)]
3629    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3630    pub pattern_ext: Option<ElementDefinitionPatternExtension>,
3631    /** **Example value (as defined for type)**
3632
3633 A sample value for this element demonstrating the type of information that would typically be found in the element.
3634
3635 Examples will most commonly be present for data where it's not implicitly obvious from either the data type or value set what the values might be.  (I.e. Example values for dates or quantities would generally be unnecessary.)  If the example value is fully populated, the publication tool can generate an instance automatically. */
3636    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3637    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3638    #[serde(rename = "example")]
3639    pub example: Vec<Option<ElementDefinitionExample>>,
3640    /// Extension field.
3641    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3642    #[serde(rename = "_example")]
3643    #[cfg_attr(feature = "builders", builder(default))]
3644    pub example_ext: Vec<Option<FieldExtension>>,
3645    /** **Minimum Allowed Value (for some types)**
3646
3647 The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.
3648
3649 Except for date/date/instant, the type of the minValue[x] SHALL be the same as the specified type of the element. For the date/dateTime/instant values, the type of minValue[x] SHALL be either the same, or a [Duration](datatypes.html#Duration) which specifies a relative time limit to the current time. The duration value is positive, and is subtracted from the current clock to determine the minimum allowable value.   A minimum value for a Quantity is interpreted as a canonical minimum - e.g. you cannot provide 100mg if the minimum value is 10g. */
3650    #[serde(default, skip_serializing_if = "Option::is_none")]
3651    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3652    #[serde(flatten)]
3653    pub min_value: Option<ElementDefinitionMinValue>,
3654    /// Extension field.
3655    #[serde(default, skip_serializing_if = "Option::is_none")]
3656    #[serde(flatten)]
3657    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3658    pub min_value_ext: Option<ElementDefinitionMinValueExtension>,
3659    /** **Maximum Allowed Value (for some types)**
3660
3661 The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.
3662
3663 Except for date/date/instant, the type of the maxValue[x] SHALL be the same as the specified type of the element. For the date/dateTime/instant values, the type of maxValue[x] SHALL be either the same, or a [Duration](datatypes.html#Duration) which specifies a relative time limit to the current time. The duration value is positive, and is added to the current clock to determine the maximum allowable value.   A maximum value for a Quantity is interpreted as a canonical maximum - e.g. you cannot provide 10g if the maximum value is 50mg. */
3664    #[serde(default, skip_serializing_if = "Option::is_none")]
3665    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3666    #[serde(flatten)]
3667    pub max_value: Option<ElementDefinitionMaxValue>,
3668    /// Extension field.
3669    #[serde(default, skip_serializing_if = "Option::is_none")]
3670    #[serde(flatten)]
3671    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3672    pub max_value_ext: Option<ElementDefinitionMaxValueExtension>,
3673    /** **Max length for string type data**
3674
3675 Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. ```textmaxLength``` SHOULD only be used on primitive data types that have a string representation (see [http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics](http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-type-characteristics.html)).
3676
3677 Receivers are not required to reject instances that exceed the maximum length.  The full length could be stored.  In some cases, data might be truncated, though truncation should be undertaken with care and an understanding of the consequences of doing so. If not specified, there is no conformance expectation for length support. */
3678    #[serde(default, skip_serializing_if = "Option::is_none")]
3679    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3680    #[serde(rename = "maxLength")]
3681    pub max_length: Option<i32>,
3682    /// Extension field.
3683    #[serde(default, skip_serializing_if = "Option::is_none")]
3684    #[serde(rename = "_maxLength")]
3685    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3686    pub max_length_ext: Option<FieldExtension>,
3687    /** **Reference to invariant about presence**
3688
3689 A reference to an invariant that may make additional statements about the cardinality or value in the instance.
3690
3691 */
3692    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3693    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3694    #[serde(rename = "condition")]
3695    pub condition: Vec<Option<String>>,
3696    /// Extension field.
3697    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3698    #[serde(rename = "_condition")]
3699    #[cfg_attr(feature = "builders", builder(default))]
3700    pub condition_ext: Vec<Option<FieldExtension>>,
3701    /** **Condition that must evaluate to true**
3702
3703 Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.
3704
3705 Constraints should be declared on the "context" element - the lowest element in the hierarchy that is common to all nodes referenced by the constraint. */
3706    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3707    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3708    #[serde(rename = "constraint")]
3709    pub constraint: Vec<Option<ElementDefinitionConstraint>>,
3710    /// Extension field.
3711    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3712    #[serde(rename = "_constraint")]
3713    #[cfg_attr(feature = "builders", builder(default))]
3714    pub constraint_ext: Vec<Option<FieldExtension>>,
3715    /** **For primitives, that a value must be present - not replaced by an extension**
3716
3717 Specifies for a primitive data type that the value of the data type cannot be replaced by an extension.
3718
3719 Typical extensions that can be provided in place of a the value are [http://hl7.org/fhir/StructureDefinition/data-absent-reason](http://hl7.org/fhir/extensions/StructureDefinition-data-absent-reason.html),  [http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor](http://hl7.org/fhir/extensions/StructureDefinition-iso21090-nullFlavor.html),  [http://hl7.org/fhir/StructureDefinition/originalText](http://hl7.org/fhir/extensions/StructureDefinition-originalText.html), and [http://hl7.org/fhir/StructureDefinition/cqf-expression](http://hl7.org/fhir/extensions/StructureDefinition-cqf-expression.html). Note that this element has no meaning when a value is provided, and extensions can be provided in addition to a value. */
3720    #[serde(default, skip_serializing_if = "Option::is_none")]
3721    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3722    #[serde(rename = "mustHaveValue")]
3723    pub must_have_value: Option<bool>,
3724    /// Extension field.
3725    #[serde(default, skip_serializing_if = "Option::is_none")]
3726    #[serde(rename = "_mustHaveValue")]
3727    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3728    pub must_have_value_ext: Option<FieldExtension>,
3729    /** **Extensions that are allowed to replace a primitive value**
3730
3731 Specifies a list of extensions that can appear in place of a primitive value.
3732
3733 if mustHaveValue is true, then this element should not be present, since no extensions are allowed in place of the value. Note that this element has no impact if the value is present. */
3734    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3735    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3736    #[serde(rename = "valueAlternatives")]
3737    pub value_alternatives: Vec<Option<String>>,
3738    /// Extension field.
3739    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3740    #[serde(rename = "_valueAlternatives")]
3741    #[cfg_attr(feature = "builders", builder(default))]
3742    pub value_alternatives_ext: Vec<Option<FieldExtension>>,
3743    /** **If the element must be supported (discouraged - see obligations)**
3744
3745 If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. Note that this is being phased out and replaced by obligations (see below).  If false, the element may be ignored and not supported. If false, whether to populate or use the data element in any way is at the discretion of the implementation.
3746
3747 "Something meaningful" is context dependent and impossible to describe in the base FHIR specification. For this reason, the mustSupport flag is never set to true by the FHIR specification itself - it is only set to true in profiles.  A profile on a type can always make mustSupport = true if it is false in the base type but cannot make mustSupport = false if it is true in the base type.   This is done in [Resource Profiles](profiling.html#mustsupport), where the profile labels an element as mustSupport=true. When a profile does this, it SHALL also make clear exactly what kind of "support" is required, as this can mean many things.    Note that an element that has the property IsModifier is not necessarily a "key" element (e.g. one of the important elements to make use of the resource), nor is it automatically mustSupport - however both of these things are more likely to be true for IsModifier elements than for other elements. */
3748    #[serde(default, skip_serializing_if = "Option::is_none")]
3749    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3750    #[serde(rename = "mustSupport")]
3751    pub must_support: Option<bool>,
3752    /// Extension field.
3753    #[serde(default, skip_serializing_if = "Option::is_none")]
3754    #[serde(rename = "_mustSupport")]
3755    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3756    pub must_support_ext: Option<FieldExtension>,
3757    /** **If this modifies the meaning of other elements**
3758
3759 If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. When used on the root element in an extension definition, this indicates whether or not the extension is a modifier extension.
3760
3761 Only the definition of an element can set IsModifier true - either the specification itself or where an extension is originally defined. Once set, it cannot be changed in derived profiles (except in the special case of the defining a new extension). An element/extension that has isModifier=true SHOULD also have a minimum cardinality of 1, so that there is no lack of clarity about what to do if it is missing. If it can be missing, the definition SHALL make the meaning of a missing element clear. */
3762    #[serde(default, skip_serializing_if = "Option::is_none")]
3763    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3764    #[serde(rename = "isModifier")]
3765    pub is_modifier: Option<bool>,
3766    /// Extension field.
3767    #[serde(default, skip_serializing_if = "Option::is_none")]
3768    #[serde(rename = "_isModifier")]
3769    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3770    pub is_modifier_ext: Option<FieldExtension>,
3771    /** **Reason that this element is marked as a modifier**
3772
3773 Explains how that element affects the interpretation of the resource or element that contains it.
3774
3775 */
3776    #[serde(default, skip_serializing_if = "Option::is_none")]
3777    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3778    #[serde(rename = "isModifierReason")]
3779    pub is_modifier_reason: Option<String>,
3780    /// Extension field.
3781    #[serde(default, skip_serializing_if = "Option::is_none")]
3782    #[serde(rename = "_isModifierReason")]
3783    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3784    pub is_modifier_reason_ext: Option<FieldExtension>,
3785    /** **Include when _summary = true?**
3786
3787 Whether the element should be included if a client requests a search with the parameter _summary=true.
3788
3789 Some resources include a set of simple metadata, and some very large data. This element is used to reduce the quantity of data returned in searches. Note that servers may pre-cache summarized resources for optimal performance. When a request is made with _summary=true, serializers only include elements marked as 'isSummary = true'. With a few exceptions (listed below), all datatype properties are included in the summary form. In resource and datatype definitions, if an element has a descendant marked as isSummary=true or if it satisfies both of the following conditions, it must be marked as isSummary=true:
3790* is at the root or has a parent that is 'mustSupport'
3791* has a minimum cardinality of 1 or is a modifier element
3792
3793The following datatype properties are exceptions, and are not marked as isSummary:
3794* Attachment.data
3795* Signature.data, Signature.targetFormat, Signature.sigFormat
3796* Narrative.status, Narrative.div
3797* SampledData.data. */
3798    #[serde(default, skip_serializing_if = "Option::is_none")]
3799    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3800    #[serde(rename = "isSummary")]
3801    pub is_summary: Option<bool>,
3802    /// Extension field.
3803    #[serde(default, skip_serializing_if = "Option::is_none")]
3804    #[serde(rename = "_isSummary")]
3805    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3806    pub is_summary_ext: Option<FieldExtension>,
3807    /** **ValueSet details if this is coded**
3808
3809 Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).
3810
3811 For a CodeableConcept, when no codes are allowed - only text, use a binding of strength "required" with a description explaining that no coded values are allowed and what sort of information to put in the "text" element. */
3812    #[serde(default, skip_serializing_if = "Option::is_none")]
3813    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3814    #[serde(rename = "binding")]
3815    pub binding: Option<ElementDefinitionBinding>,
3816    /// Extension field.
3817    #[serde(default, skip_serializing_if = "Option::is_none")]
3818    #[serde(rename = "_binding")]
3819    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3820    pub binding_ext: Option<FieldExtension>,
3821    /** **Map element to another set of definitions**
3822
3823 Identifies a concept from an external specification that roughly corresponds to this element.
3824
3825 Mappings are not necessarily specific enough for safe translation. */
3826    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3827    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3828    #[serde(rename = "mapping")]
3829    pub mapping: Vec<Option<ElementDefinitionMapping>>,
3830    /// Extension field.
3831    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3832    #[serde(rename = "_mapping")]
3833    #[cfg_attr(feature = "builders", builder(default))]
3834    pub mapping_ext: Vec<Option<FieldExtension>>,
3835}
3836#[cfg(feature = "builders")]
3837impl ElementDefinitionBuilder {
3838    #[doc = concat!("Finalize building ", "ElementDefinition", ".")]
3839    pub fn build(self) -> Result<ElementDefinition, crate::error::BuilderError> {
3840        self.build_inner().map(Into::into)
3841    }
3842}
3843impl From<ElementDefinitionInner> for ElementDefinition {
3844    fn from(inner: ElementDefinitionInner) -> Self {
3845        Self(Box::new(inner))
3846    }
3847}
3848impl ::core::ops::Deref for ElementDefinition {
3849    type Target = ElementDefinitionInner;
3850    fn deref(&self) -> &Self::Target {
3851        &self.0
3852    }
3853}
3854impl ::core::ops::DerefMut for ElementDefinition {
3855    fn deref_mut(&mut self) -> &mut Self::Target {
3856        &mut self.0
3857    }
3858}
3859impl ElementDefinition {
3860    /// Start building an instance.
3861    #[cfg(feature = "builders")]
3862    #[must_use]
3863    pub fn builder() -> ElementDefinitionBuilder {
3864        ElementDefinitionBuilder::default()
3865    }
3866}
3867/// Sub-fields of the slicing field in ElementDefinition
3868#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3869#[cfg_attr(feature = "builders", derive(Builder))]
3870#[serde(rename_all = "camelCase")]
3871#[cfg_attr(
3872    feature = "builders",
3873    builder(
3874        pattern = "owned",
3875        name = "ElementDefinitionSlicingBuilder",
3876        build_fn(error = "crate::error::BuilderError")
3877    )
3878)]
3879pub struct ElementDefinitionSlicing {
3880    /** **Unique id for inter-element referencing**
3881
3882 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
3883
3884 */
3885    #[serde(default, skip_serializing_if = "Option::is_none")]
3886    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3887    #[serde(rename = "id")]
3888    pub id: Option<String>,
3889    /** **Additional content defined by implementations**
3890
3891 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.
3892
3893 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
3894    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3895    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3896    #[serde(rename = "extension")]
3897    pub extension: Vec<Extension>,
3898    /** **Element values that are used to distinguish the slices**
3899
3900 Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.
3901
3902 If there is no discriminator, the content is hard to process, so this should be avoided. */
3903    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3904    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3905    #[serde(rename = "discriminator")]
3906    pub discriminator: Vec<Option<ElementDefinitionSlicingDiscriminator>>,
3907    /// Extension field.
3908    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3909    #[serde(rename = "_discriminator")]
3910    #[cfg_attr(feature = "builders", builder(default))]
3911    pub discriminator_ext: Vec<Option<FieldExtension>>,
3912    /** **Text description of how slicing works (or not)**
3913
3914 A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.
3915
3916 If it's really not possible to differentiate them, the design should be re-evaluated to make the content usable. */
3917    #[serde(default, skip_serializing_if = "Option::is_none")]
3918    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3919    #[serde(rename = "description")]
3920    pub description: Option<String>,
3921    /// Extension field.
3922    #[serde(default, skip_serializing_if = "Option::is_none")]
3923    #[serde(rename = "_description")]
3924    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3925    pub description_ext: Option<FieldExtension>,
3926    /** **If elements must be in same order as slices**
3927
3928 If the matching elements have to occur in the same order as defined in the profile.
3929
3930 Order should only be required when it is a pressing concern for presentation. Profile authors should consider making the order a feature of the rules about the narrative, not the rules about the data - requiring ordered data makes the profile much less re-usable. */
3931    #[serde(default, skip_serializing_if = "Option::is_none")]
3932    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3933    #[serde(rename = "ordered")]
3934    pub ordered: Option<bool>,
3935    /// Extension field.
3936    #[serde(default, skip_serializing_if = "Option::is_none")]
3937    #[serde(rename = "_ordered")]
3938    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3939    pub ordered_ext: Option<FieldExtension>,
3940    /** **[SlicingRules](http://hl7.org/fhir/ValueSet/resource-slicing-rules); closed | open | openAtEnd**
3941
3942 Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.
3943
3944 Allowing additional elements makes for a much for flexible template - it's open for use in wider contexts, but also means that the content of the resource is not closed, and applications have to decide how to handle content not described by the profile. */
3945    #[serde(rename = "rules")]
3946    pub rules: codes::SlicingRules,
3947    /// Extension field.
3948    #[serde(default, skip_serializing_if = "Option::is_none")]
3949    #[serde(rename = "_rules")]
3950    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3951    pub rules_ext: Option<FieldExtension>,
3952}
3953#[cfg(feature = "builders")]
3954impl ElementDefinitionSlicing {
3955    ///Start building a new instance
3956    #[must_use]
3957    pub fn builder() -> ElementDefinitionSlicingBuilder {
3958        ElementDefinitionSlicingBuilder::default()
3959    }
3960}
3961/// Sub-fields of the discriminator field in ElementDefinitionSlicing
3962#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3963#[cfg_attr(feature = "builders", derive(Builder))]
3964#[serde(rename_all = "camelCase")]
3965#[cfg_attr(
3966    feature = "builders",
3967    builder(
3968        pattern = "owned",
3969        name = "ElementDefinitionSlicingDiscriminatorBuilder",
3970        build_fn(error = "crate::error::BuilderError")
3971    )
3972)]
3973pub struct ElementDefinitionSlicingDiscriminator {
3974    /** **Unique id for inter-element referencing**
3975
3976 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
3977
3978 */
3979    #[serde(default, skip_serializing_if = "Option::is_none")]
3980    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3981    #[serde(rename = "id")]
3982    pub id: Option<String>,
3983    /** **Additional content defined by implementations**
3984
3985 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.
3986
3987 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
3988    #[serde(default, skip_serializing_if = "Vec::is_empty")]
3989    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
3990    #[serde(rename = "extension")]
3991    pub extension: Vec<Extension>,
3992    /** **[DiscriminatorType](http://hl7.org/fhir/ValueSet/discriminator-type); value | exists | type | profile | position**
3993
3994 How the element value is interpreted when discrimination is evaluated.
3995
3996 'pattern' is deprecated - it works exactly the same as 'value'. */
3997    #[serde(rename = "type")]
3998    pub r#type: codes::DiscriminatorType,
3999    /// Extension field.
4000    #[serde(default, skip_serializing_if = "Option::is_none")]
4001    #[serde(rename = "_type")]
4002    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4003    pub r#type_ext: Option<FieldExtension>,
4004    /** **Path to element value**
4005
4006 A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.
4007
4008 */
4009    #[serde(rename = "path")]
4010    pub path: String,
4011    /// Extension field.
4012    #[serde(default, skip_serializing_if = "Option::is_none")]
4013    #[serde(rename = "_path")]
4014    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4015    pub path_ext: Option<FieldExtension>,
4016}
4017#[cfg(feature = "builders")]
4018impl ElementDefinitionSlicingDiscriminator {
4019    ///Start building a new instance
4020    #[must_use]
4021    pub fn builder() -> ElementDefinitionSlicingDiscriminatorBuilder {
4022        ElementDefinitionSlicingDiscriminatorBuilder::default()
4023    }
4024}
4025/// Sub-fields of the base field in ElementDefinition
4026#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4027#[cfg_attr(feature = "builders", derive(Builder))]
4028#[serde(rename_all = "camelCase")]
4029#[cfg_attr(
4030    feature = "builders",
4031    builder(
4032        pattern = "owned",
4033        name = "ElementDefinitionBaseBuilder",
4034        build_fn(error = "crate::error::BuilderError")
4035    )
4036)]
4037pub struct ElementDefinitionBase {
4038    /** **Unique id for inter-element referencing**
4039
4040 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
4041
4042 */
4043    #[serde(default, skip_serializing_if = "Option::is_none")]
4044    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4045    #[serde(rename = "id")]
4046    pub id: Option<String>,
4047    /** **Additional content defined by implementations**
4048
4049 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.
4050
4051 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
4052    #[serde(default, skip_serializing_if = "Vec::is_empty")]
4053    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4054    #[serde(rename = "extension")]
4055    pub extension: Vec<Extension>,
4056    /** **Path that identifies the base element**
4057
4058 The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [StructureDefinition](structuredefinition.html#) without a StructureDefinition.base.
4059
4060 */
4061    #[serde(rename = "path")]
4062    pub path: String,
4063    /// Extension field.
4064    #[serde(default, skip_serializing_if = "Option::is_none")]
4065    #[serde(rename = "_path")]
4066    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4067    pub path_ext: Option<FieldExtension>,
4068    /** **Min cardinality of the base element**
4069
4070 Minimum cardinality of the base element identified by the path.
4071
4072 This is provided for consistency with max, and may affect code generation of mandatory elements of the base resource are generated differently (some reference implementations have done this). */
4073    #[serde(rename = "min")]
4074    pub min: u32,
4075    /// Extension field.
4076    #[serde(default, skip_serializing_if = "Option::is_none")]
4077    #[serde(rename = "_min")]
4078    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4079    pub min_ext: Option<FieldExtension>,
4080    /** **Max cardinality of the base element**
4081
4082 Maximum cardinality of the base element identified by the path.
4083
4084 This is provided to code generation, since the serialization representation in JSON differs depending on whether the base element has max > 1. Also, some forms of code generation may differ. */
4085    #[serde(rename = "max")]
4086    pub max: String,
4087    /// Extension field.
4088    #[serde(default, skip_serializing_if = "Option::is_none")]
4089    #[serde(rename = "_max")]
4090    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4091    pub max_ext: Option<FieldExtension>,
4092}
4093#[cfg(feature = "builders")]
4094impl ElementDefinitionBase {
4095    ///Start building a new instance
4096    #[must_use]
4097    pub fn builder() -> ElementDefinitionBaseBuilder {
4098        ElementDefinitionBaseBuilder::default()
4099    }
4100}
4101/// Sub-fields of the type field in ElementDefinition
4102#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4103#[cfg_attr(feature = "builders", derive(Builder))]
4104#[serde(rename_all = "camelCase")]
4105#[cfg_attr(
4106    feature = "builders",
4107    builder(
4108        pattern = "owned",
4109        name = "ElementDefinitionTypeBuilder",
4110        build_fn(error = "crate::error::BuilderError")
4111    )
4112)]
4113pub struct ElementDefinitionType {
4114    /** **Unique id for inter-element referencing**
4115
4116 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
4117
4118 */
4119    #[serde(default, skip_serializing_if = "Option::is_none")]
4120    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4121    #[serde(rename = "id")]
4122    pub id: Option<String>,
4123    /** **Additional content defined by implementations**
4124
4125 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.
4126
4127 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
4128    #[serde(default, skip_serializing_if = "Vec::is_empty")]
4129    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4130    #[serde(rename = "extension")]
4131    pub extension: Vec<Extension>,
4132    /** **[ElementDefinitionTypes](http://hl7.org/fhir/ValueSet/elementdefinition-types); Data type or Resource (reference to definition)**
4133
4134 URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.
4135
4136 If the element is a reference to another resource, this element contains "Reference", and the targetProfile element defines what resources can be referenced. The targetProfile may be a reference to the general definition of a resource (e.g. http://hl7.org/fhir/StructureDefinition/Patient). */
4137    #[serde(rename = "code")]
4138    pub code: String,
4139    /// Extension field.
4140    #[serde(default, skip_serializing_if = "Option::is_none")]
4141    #[serde(rename = "_code")]
4142    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4143    pub code_ext: Option<FieldExtension>,
4144    /** **Profiles (StructureDefinition or IG) - one must apply**
4145
4146 Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide.
4147
4148 It is possible to profile  backbone element (e.g. part of a resource), using the [http://hl7.org/fhir/StructureDefinition/elementdefinition-profile-element](http://hl7.org/fhir/extensions/StructureDefinition-elementdefinition-profile-element.html) extension. */
4149    #[serde(default, skip_serializing_if = "Vec::is_empty")]
4150    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4151    #[serde(rename = "profile")]
4152    pub profile: Vec<Option<String>>,
4153    /// Extension field.
4154    #[serde(default, skip_serializing_if = "Vec::is_empty")]
4155    #[serde(rename = "_profile")]
4156    #[cfg_attr(feature = "builders", builder(default))]
4157    pub profile_ext: Vec<Option<FieldExtension>>,
4158    /** **Profile (StructureDefinition or IG) on the Reference/canonical target - one must apply**
4159
4160 Used when the type is "Reference" or "canonical", and identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.
4161
4162 */
4163    #[serde(default, skip_serializing_if = "Vec::is_empty")]
4164    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4165    #[serde(rename = "targetProfile")]
4166    pub target_profile: Vec<Option<String>>,
4167    /// Extension field.
4168    #[serde(default, skip_serializing_if = "Vec::is_empty")]
4169    #[serde(rename = "_targetProfile")]
4170    #[cfg_attr(feature = "builders", builder(default))]
4171    pub target_profile_ext: Vec<Option<FieldExtension>>,
4172    /** **[AggregationMode](http://hl7.org/fhir/ValueSet/resource-aggregation-mode); contained | referenced | bundled - how aggregated**
4173
4174 If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.
4175
4176 See [Aggregation Rules](elementdefinition.html#aggregation) for further clarification. */
4177    #[serde(default, skip_serializing_if = "Vec::is_empty")]
4178    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4179    #[serde(rename = "aggregation")]
4180    pub aggregation: Vec<Option<codes::AggregationMode>>,
4181    /// Extension field.
4182    #[serde(default, skip_serializing_if = "Vec::is_empty")]
4183    #[serde(rename = "_aggregation")]
4184    #[cfg_attr(feature = "builders", builder(default))]
4185    pub aggregation_ext: Vec<Option<FieldExtension>>,
4186    /** **[ReferenceVersionRules](http://hl7.org/fhir/ValueSet/reference-version-rules); either | independent | specific**
4187
4188 Whether this reference needs to be version specific or version independent, or whether either can be used.
4189
4190 The base specification never makes a rule as to which form is allowed, but implementation guides may do this. See [Aggregation Rules](elementdefinition.html#aggregation) for further clarification. */
4191    #[serde(default, skip_serializing_if = "Option::is_none")]
4192    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4193    #[serde(rename = "versioning")]
4194    pub versioning: Option<codes::ReferenceVersionRules>,
4195    /// Extension field.
4196    #[serde(default, skip_serializing_if = "Option::is_none")]
4197    #[serde(rename = "_versioning")]
4198    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
4199    pub versioning_ext: Option<FieldExtension>,
4200}
4201#[cfg(feature = "builders")]
4202impl ElementDefinitionType {
4203    ///Start building a new instance
4204    #[must_use]
4205    pub fn builder() -> ElementDefinitionTypeBuilder {
4206        ElementDefinitionTypeBuilder::default()
4207    }
4208}
4209/// Choice of types for the defaultValue[x] field in ElementDefinition
4210#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4211#[serde(rename_all = "camelCase")]
4212pub enum ElementDefinitionDefaultValue {
4213    /// Variant accepting the Base64Binary type.
4214    #[serde(rename = "defaultValueBase64Binary")]
4215    Base64Binary(Base64Binary),
4216    /// Variant accepting the Boolean type.
4217    #[serde(rename = "defaultValueBoolean")]
4218    Boolean(bool),
4219    /// Variant accepting the Canonical type.
4220    #[serde(rename = "defaultValueCanonical")]
4221    Canonical(String),
4222    /// Variant accepting the Code type.
4223    #[serde(rename = "defaultValueCode")]
4224    Code(String),
4225    /// Variant accepting the Date type.
4226    #[serde(rename = "defaultValueDate")]
4227    Date(Date),
4228    /// Variant accepting the DateTime type.
4229    #[serde(rename = "defaultValueDateTime")]
4230    DateTime(DateTime),
4231    /// Variant accepting the Decimal type.
4232    #[serde(rename = "defaultValueDecimal")]
4233    Decimal(f64),
4234    /// Variant accepting the Id type.
4235    #[serde(rename = "defaultValueId")]
4236    Id(String),
4237    /// Variant accepting the Instant type.
4238    #[serde(rename = "defaultValueInstant")]
4239    Instant(Instant),
4240    /// Variant accepting the Integer type.
4241    #[serde(rename = "defaultValueInteger")]
4242    Integer(i32),
4243    /// Variant accepting the Integer64 type.
4244    #[serde(rename = "defaultValueInteger64")]
4245    Integer64(Integer64),
4246    /// Variant accepting the Markdown type.
4247    #[serde(rename = "defaultValueMarkdown")]
4248    Markdown(String),
4249    /// Variant accepting the Oid type.
4250    #[serde(rename = "defaultValueOid")]
4251    Oid(String),
4252    /// Variant accepting the PositiveInt type.
4253    #[serde(rename = "defaultValuePositiveInt")]
4254    PositiveInt(NonZeroU32),
4255    /// Variant accepting the String type.
4256    #[serde(rename = "defaultValueString")]
4257    String(String),
4258    /// Variant accepting the Time type.
4259    #[serde(rename = "defaultValueTime")]
4260    Time(Time),
4261    /// Variant accepting the UnsignedInt type.
4262    #[serde(rename = "defaultValueUnsignedInt")]
4263    UnsignedInt(u32),
4264    /// Variant accepting the Uri type.
4265    #[serde(rename = "defaultValueUri")]
4266    Uri(String),
4267    /// Variant accepting the Url type.
4268    #[serde(rename = "defaultValueUrl")]
4269    Url(String),
4270    /// Variant accepting the Uuid type.
4271    #[serde(rename = "defaultValueUuid")]
4272    Uuid(String),
4273    /// Variant accepting the Address type.
4274    #[serde(rename = "defaultValueAddress")]
4275    Address(Address),
4276    /// Variant accepting the Age type.
4277    #[serde(rename = "defaultValueAge")]
4278    Age(Age),
4279    /// Variant accepting the Annotation type.
4280    #[serde(rename = "defaultValueAnnotation")]
4281    Annotation(Annotation),
4282    /// Variant accepting the Attachment type.
4283    #[serde(rename = "defaultValueAttachment")]
4284    Attachment(Attachment),
4285    /// Variant accepting the CodeableConcept type.
4286    #[serde(rename = "defaultValueCodeableConcept")]
4287    CodeableConcept(CodeableConcept),
4288    /// Variant accepting the CodeableReference type.
4289    #[serde(rename = "defaultValueCodeableReference")]
4290    CodeableReference(CodeableReference),
4291    /// Variant accepting the Coding type.
4292    #[serde(rename = "defaultValueCoding")]
4293    Coding(Coding),
4294    /// Variant accepting the ContactPoint type.
4295    #[serde(rename = "defaultValueContactPoint")]
4296    ContactPoint(ContactPoint),
4297    /// Variant accepting the Count type.
4298    #[serde(rename = "defaultValueCount")]
4299    Count(Count),
4300    /// Variant accepting the Distance type.
4301    #[serde(rename = "defaultValueDistance")]
4302    Distance(Distance),
4303    /// Variant accepting the Duration type.
4304    #[serde(rename = "defaultValueDuration")]
4305    Duration(Duration),
4306    /// Variant accepting the HumanName type.
4307    #[serde(rename = "defaultValueHumanName")]
4308    HumanName(HumanName),
4309    /// Variant accepting the Identifier type.
4310    #[serde(rename = "defaultValueIdentifier")]
4311    Identifier(Identifier),
4312    /// Variant accepting the Money type.
4313    #[serde(rename = "defaultValueMoney")]
4314    Money(Money),
4315    /// Variant accepting the Period type.
4316    #[serde(rename = "defaultValuePeriod")]
4317    Period(Period),
4318    /// Variant accepting the Quantity type.
4319    #[serde(rename = "defaultValueQuantity")]
4320    Quantity(Quantity),
4321    /// Variant accepting the Range type.
4322    #[serde(rename = "defaultValueRange")]
4323    Range(Range),
4324    /// Variant accepting the Ratio type.
4325    #[serde(rename = "defaultValueRatio")]
4326    Ratio(Ratio),
4327    /// Variant accepting the RatioRange type.
4328    #[serde(rename = "defaultValueRatioRange")]
4329    RatioRange(RatioRange),
4330    /// Variant accepting the Reference type.
4331    #[serde(rename = "defaultValueReference")]
4332    Reference(Reference),
4333    /// Variant accepting the SampledData type.
4334    #[serde(rename = "defaultValueSampledData")]
4335    SampledData(SampledData),
4336    /// Variant accepting the Signature type.
4337    #[serde(rename = "defaultValueSignature")]
4338    Signature(Signature),
4339    /// Variant accepting the Timing type.
4340    #[serde(rename = "defaultValueTiming")]
4341    Timing(Timing),
4342    /// Variant accepting the ContactDetail type.
4343    #[serde(rename = "defaultValueContactDetail")]
4344    ContactDetail(ContactDetail),
4345    /// Variant accepting the DataRequirement type.
4346    #[serde(rename = "defaultValueDataRequirement")]
4347    DataRequirement(DataRequirement),
4348    /// Variant accepting the Expression type.
4349    #[serde(rename = "defaultValueExpression")]
4350    Expression(Expression),
4351    /// Variant accepting the ParameterDefinition type.
4352    #[serde(rename = "defaultValueParameterDefinition")]
4353    ParameterDefinition(ParameterDefinition),
4354    /// Variant accepting the RelatedArtifact type.
4355    #[serde(rename = "defaultValueRelatedArtifact")]
4356    RelatedArtifact(RelatedArtifact),
4357    /// Variant accepting the TriggerDefinition type.
4358    #[serde(rename = "defaultValueTriggerDefinition")]
4359    TriggerDefinition(TriggerDefinition),
4360    /// Variant accepting the UsageContext type.
4361    #[serde(rename = "defaultValueUsageContext")]
4362    UsageContext(UsageContext),
4363    /// Variant accepting the Availability type.
4364    #[serde(rename = "defaultValueAvailability")]
4365    Availability(Availability),
4366    /// Variant accepting the ExtendedContactDetail type.
4367    #[serde(rename = "defaultValueExtendedContactDetail")]
4368    ExtendedContactDetail(ExtendedContactDetail),
4369    /// Variant accepting the Dosage type.
4370    #[serde(rename = "defaultValueDosage")]
4371    Dosage(Dosage),
4372    /// Variant accepting the Meta type.
4373    #[serde(rename = "defaultValueMeta")]
4374    Meta(Meta),
4375}
4376/// Extension value for ElementDefinitionDefaultValue.
4377#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4378#[serde(rename_all = "camelCase")]
4379pub enum ElementDefinitionDefaultValueExtension {
4380    /// Variant accepting the Base64Binary extension.
4381    #[serde(rename = "_defaultValueBase64Binary")]
4382    Base64Binary(FieldExtension),
4383    /// Variant accepting the Boolean extension.
4384    #[serde(rename = "_defaultValueBoolean")]
4385    Boolean(FieldExtension),
4386    /// Variant accepting the Canonical extension.
4387    #[serde(rename = "_defaultValueCanonical")]
4388    Canonical(FieldExtension),
4389    /// Variant accepting the Code extension.
4390    #[serde(rename = "_defaultValueCode")]
4391    Code(FieldExtension),
4392    /// Variant accepting the Date extension.
4393    #[serde(rename = "_defaultValueDate")]
4394    Date(FieldExtension),
4395    /// Variant accepting the DateTime extension.
4396    #[serde(rename = "_defaultValueDateTime")]
4397    DateTime(FieldExtension),
4398    /// Variant accepting the Decimal extension.
4399    #[serde(rename = "_defaultValueDecimal")]
4400    Decimal(FieldExtension),
4401    /// Variant accepting the Id extension.
4402    #[serde(rename = "_defaultValueId")]
4403    Id(FieldExtension),
4404    /// Variant accepting the Instant extension.
4405    #[serde(rename = "_defaultValueInstant")]
4406    Instant(FieldExtension),
4407    /// Variant accepting the Integer extension.
4408    #[serde(rename = "_defaultValueInteger")]
4409    Integer(FieldExtension),
4410    /// Variant accepting the Integer64 extension.
4411    #[serde(rename = "_defaultValueInteger64")]
4412    Integer64(FieldExtension),
4413    /// Variant accepting the Markdown extension.
4414    #[serde(rename = "_defaultValueMarkdown")]
4415    Markdown(FieldExtension),
4416    /// Variant accepting the Oid extension.
4417    #[serde(rename = "_defaultValueOid")]
4418    Oid(FieldExtension),
4419    /// Variant accepting the PositiveInt extension.
4420    #[serde(rename = "_defaultValuePositiveInt")]
4421    PositiveInt(FieldExtension),
4422    /// Variant accepting the String extension.
4423    #[serde(rename = "_defaultValueString")]
4424    String(FieldExtension),
4425    /// Variant accepting the Time extension.
4426    #[serde(rename = "_defaultValueTime")]
4427    Time(FieldExtension),
4428    /// Variant accepting the UnsignedInt extension.
4429    #[serde(rename = "_defaultValueUnsignedInt")]
4430    UnsignedInt(FieldExtension),
4431    /// Variant accepting the Uri extension.
4432    #[serde(rename = "_defaultValueUri")]
4433    Uri(FieldExtension),
4434    /// Variant accepting the Url extension.
4435    #[serde(rename = "_defaultValueUrl")]
4436    Url(FieldExtension),
4437    /// Variant accepting the Uuid extension.
4438    #[serde(rename = "_defaultValueUuid")]
4439    Uuid(FieldExtension),
4440    /// Variant accepting the Address extension.
4441    #[serde(rename = "_defaultValueAddress")]
4442    Address(FieldExtension),
4443    /// Variant accepting the Age extension.
4444    #[serde(rename = "_defaultValueAge")]
4445    Age(FieldExtension),
4446    /// Variant accepting the Annotation extension.
4447    #[serde(rename = "_defaultValueAnnotation")]
4448    Annotation(FieldExtension),
4449    /// Variant accepting the Attachment extension.
4450    #[serde(rename = "_defaultValueAttachment")]
4451    Attachment(FieldExtension),
4452    /// Variant accepting the CodeableConcept extension.
4453    #[serde(rename = "_defaultValueCodeableConcept")]
4454    CodeableConcept(FieldExtension),
4455    /// Variant accepting the CodeableReference extension.
4456    #[serde(rename = "_defaultValueCodeableReference")]
4457    CodeableReference(FieldExtension),
4458    /// Variant accepting the Coding extension.
4459    #[serde(rename = "_defaultValueCoding")]
4460    Coding(FieldExtension),
4461    /// Variant accepting the ContactPoint extension.
4462    #[serde(rename = "_defaultValueContactPoint")]
4463    ContactPoint(FieldExtension),
4464    /// Variant accepting the Count extension.
4465    #[serde(rename = "_defaultValueCount")]
4466    Count(FieldExtension),
4467    /// Variant accepting the Distance extension.
4468    #[serde(rename = "_defaultValueDistance")]
4469    Distance(FieldExtension),
4470    /// Variant accepting the Duration extension.
4471    #[serde(rename = "_defaultValueDuration")]
4472    Duration(FieldExtension),
4473    /// Variant accepting the HumanName extension.
4474    #[serde(rename = "_defaultValueHumanName")]
4475    HumanName(FieldExtension),
4476    /// Variant accepting the Identifier extension.
4477    #[serde(rename = "_defaultValueIdentifier")]
4478    Identifier(FieldExtension),
4479    /// Variant accepting the Money extension.
4480    #[serde(rename = "_defaultValueMoney")]
4481    Money(FieldExtension),
4482    /// Variant accepting the Period extension.
4483    #[serde(rename = "_defaultValuePeriod")]
4484    Period(FieldExtension),
4485    /// Variant accepting the Quantity extension.
4486    #[serde(rename = "_defaultValueQuantity")]
4487    Quantity(FieldExtension),
4488    /// Variant accepting the Range extension.
4489    #[serde(rename = "_defaultValueRange")]
4490    Range(FieldExtension),
4491    /// Variant accepting the Ratio extension.
4492    #[serde(rename = "_defaultValueRatio")]
4493    Ratio(FieldExtension),
4494    /// Variant accepting the RatioRange extension.
4495    #[serde(rename = "_defaultValueRatioRange")]
4496    RatioRange(FieldExtension),
4497    /// Variant accepting the Reference extension.
4498    #[serde(rename = "_defaultValueReference")]
4499    Reference(FieldExtension),
4500    /// Variant accepting the SampledData extension.
4501    #[serde(rename = "_defaultValueSampledData")]
4502    SampledData(FieldExtension),
4503    /// Variant accepting the Signature extension.
4504    #[serde(rename = "_defaultValueSignature")]
4505    Signature(FieldExtension),
4506    /// Variant accepting the Timing extension.
4507    #[serde(rename = "_defaultValueTiming")]
4508    Timing(FieldExtension),
4509    /// Variant accepting the ContactDetail extension.
4510    #[serde(rename = "_defaultValueContactDetail")]
4511    ContactDetail(FieldExtension),
4512    /// Variant accepting the DataRequirement extension.
4513    #[serde(rename = "_defaultValueDataRequirement")]
4514    DataRequirement(FieldExtension),
4515    /// Variant accepting the Expression extension.
4516    #[serde(rename = "_defaultValueExpression")]
4517    Expression(FieldExtension),
4518    /// Variant accepting the ParameterDefinition extension.
4519    #[serde(rename = "_defaultValueParameterDefinition")]
4520    ParameterDefinition(FieldExtension),
4521    /// Variant accepting the RelatedArtifact extension.
4522    #[serde(rename = "_defaultValueRelatedArtifact")]
4523    RelatedArtifact(FieldExtension),
4524    /// Variant accepting the TriggerDefinition extension.
4525    #[serde(rename = "_defaultValueTriggerDefinition")]
4526    TriggerDefinition(FieldExtension),
4527    /// Variant accepting the UsageContext extension.
4528    #[serde(rename = "_defaultValueUsageContext")]
4529    UsageContext(FieldExtension),
4530    /// Variant accepting the Availability extension.
4531    #[serde(rename = "_defaultValueAvailability")]
4532    Availability(FieldExtension),
4533    /// Variant accepting the ExtendedContactDetail extension.
4534    #[serde(rename = "_defaultValueExtendedContactDetail")]
4535    ExtendedContactDetail(FieldExtension),
4536    /// Variant accepting the Dosage extension.
4537    #[serde(rename = "_defaultValueDosage")]
4538    Dosage(FieldExtension),
4539    /// Variant accepting the Meta extension.
4540    #[serde(rename = "_defaultValueMeta")]
4541    Meta(FieldExtension),
4542}
4543/// Choice of types for the fixed[x] field in ElementDefinition
4544#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4545#[serde(rename_all = "camelCase")]
4546pub enum ElementDefinitionFixed {
4547    /// Variant accepting the Base64Binary type.
4548    #[serde(rename = "fixedBase64Binary")]
4549    Base64Binary(Base64Binary),
4550    /// Variant accepting the Boolean type.
4551    #[serde(rename = "fixedBoolean")]
4552    Boolean(bool),
4553    /// Variant accepting the Canonical type.
4554    #[serde(rename = "fixedCanonical")]
4555    Canonical(String),
4556    /// Variant accepting the Code type.
4557    #[serde(rename = "fixedCode")]
4558    Code(String),
4559    /// Variant accepting the Date type.
4560    #[serde(rename = "fixedDate")]
4561    Date(Date),
4562    /// Variant accepting the DateTime type.
4563    #[serde(rename = "fixedDateTime")]
4564    DateTime(DateTime),
4565    /// Variant accepting the Decimal type.
4566    #[serde(rename = "fixedDecimal")]
4567    Decimal(f64),
4568    /// Variant accepting the Id type.
4569    #[serde(rename = "fixedId")]
4570    Id(String),
4571    /// Variant accepting the Instant type.
4572    #[serde(rename = "fixedInstant")]
4573    Instant(Instant),
4574    /// Variant accepting the Integer type.
4575    #[serde(rename = "fixedInteger")]
4576    Integer(i32),
4577    /// Variant accepting the Integer64 type.
4578    #[serde(rename = "fixedInteger64")]
4579    Integer64(Integer64),
4580    /// Variant accepting the Markdown type.
4581    #[serde(rename = "fixedMarkdown")]
4582    Markdown(String),
4583    /// Variant accepting the Oid type.
4584    #[serde(rename = "fixedOid")]
4585    Oid(String),
4586    /// Variant accepting the PositiveInt type.
4587    #[serde(rename = "fixedPositiveInt")]
4588    PositiveInt(NonZeroU32),
4589    /// Variant accepting the String type.
4590    #[serde(rename = "fixedString")]
4591    String(String),
4592    /// Variant accepting the Time type.
4593    #[serde(rename = "fixedTime")]
4594    Time(Time),
4595    /// Variant accepting the UnsignedInt type.
4596    #[serde(rename = "fixedUnsignedInt")]
4597    UnsignedInt(u32),
4598    /// Variant accepting the Uri type.
4599    #[serde(rename = "fixedUri")]
4600    Uri(String),
4601    /// Variant accepting the Url type.
4602    #[serde(rename = "fixedUrl")]
4603    Url(String),
4604    /// Variant accepting the Uuid type.
4605    #[serde(rename = "fixedUuid")]
4606    Uuid(String),
4607    /// Variant accepting the Address type.
4608    #[serde(rename = "fixedAddress")]
4609    Address(Address),
4610    /// Variant accepting the Age type.
4611    #[serde(rename = "fixedAge")]
4612    Age(Age),
4613    /// Variant accepting the Annotation type.
4614    #[serde(rename = "fixedAnnotation")]
4615    Annotation(Annotation),
4616    /// Variant accepting the Attachment type.
4617    #[serde(rename = "fixedAttachment")]
4618    Attachment(Attachment),
4619    /// Variant accepting the CodeableConcept type.
4620    #[serde(rename = "fixedCodeableConcept")]
4621    CodeableConcept(CodeableConcept),
4622    /// Variant accepting the CodeableReference type.
4623    #[serde(rename = "fixedCodeableReference")]
4624    CodeableReference(CodeableReference),
4625    /// Variant accepting the Coding type.
4626    #[serde(rename = "fixedCoding")]
4627    Coding(Coding),
4628    /// Variant accepting the ContactPoint type.
4629    #[serde(rename = "fixedContactPoint")]
4630    ContactPoint(ContactPoint),
4631    /// Variant accepting the Count type.
4632    #[serde(rename = "fixedCount")]
4633    Count(Count),
4634    /// Variant accepting the Distance type.
4635    #[serde(rename = "fixedDistance")]
4636    Distance(Distance),
4637    /// Variant accepting the Duration type.
4638    #[serde(rename = "fixedDuration")]
4639    Duration(Duration),
4640    /// Variant accepting the HumanName type.
4641    #[serde(rename = "fixedHumanName")]
4642    HumanName(HumanName),
4643    /// Variant accepting the Identifier type.
4644    #[serde(rename = "fixedIdentifier")]
4645    Identifier(Identifier),
4646    /// Variant accepting the Money type.
4647    #[serde(rename = "fixedMoney")]
4648    Money(Money),
4649    /// Variant accepting the Period type.
4650    #[serde(rename = "fixedPeriod")]
4651    Period(Period),
4652    /// Variant accepting the Quantity type.
4653    #[serde(rename = "fixedQuantity")]
4654    Quantity(Quantity),
4655    /// Variant accepting the Range type.
4656    #[serde(rename = "fixedRange")]
4657    Range(Range),
4658    /// Variant accepting the Ratio type.
4659    #[serde(rename = "fixedRatio")]
4660    Ratio(Ratio),
4661    /// Variant accepting the RatioRange type.
4662    #[serde(rename = "fixedRatioRange")]
4663    RatioRange(RatioRange),
4664    /// Variant accepting the Reference type.
4665    #[serde(rename = "fixedReference")]
4666    Reference(Reference),
4667    /// Variant accepting the SampledData type.
4668    #[serde(rename = "fixedSampledData")]
4669    SampledData(SampledData),
4670    /// Variant accepting the Signature type.
4671    #[serde(rename = "fixedSignature")]
4672    Signature(Signature),
4673    /// Variant accepting the Timing type.
4674    #[serde(rename = "fixedTiming")]
4675    Timing(Timing),
4676    /// Variant accepting the ContactDetail type.
4677    #[serde(rename = "fixedContactDetail")]
4678    ContactDetail(ContactDetail),
4679    /// Variant accepting the DataRequirement type.
4680    #[serde(rename = "fixedDataRequirement")]
4681    DataRequirement(DataRequirement),
4682    /// Variant accepting the Expression type.
4683    #[serde(rename = "fixedExpression")]
4684    Expression(Expression),
4685    /// Variant accepting the ParameterDefinition type.
4686    #[serde(rename = "fixedParameterDefinition")]
4687    ParameterDefinition(ParameterDefinition),
4688    /// Variant accepting the RelatedArtifact type.
4689    #[serde(rename = "fixedRelatedArtifact")]
4690    RelatedArtifact(RelatedArtifact),
4691    /// Variant accepting the TriggerDefinition type.
4692    #[serde(rename = "fixedTriggerDefinition")]
4693    TriggerDefinition(TriggerDefinition),
4694    /// Variant accepting the UsageContext type.
4695    #[serde(rename = "fixedUsageContext")]
4696    UsageContext(UsageContext),
4697    /// Variant accepting the Availability type.
4698    #[serde(rename = "fixedAvailability")]
4699    Availability(Availability),
4700    /// Variant accepting the ExtendedContactDetail type.
4701    #[serde(rename = "fixedExtendedContactDetail")]
4702    ExtendedContactDetail(ExtendedContactDetail),
4703    /// Variant accepting the Dosage type.
4704    #[serde(rename = "fixedDosage")]
4705    Dosage(Dosage),
4706    /// Variant accepting the Meta type.
4707    #[serde(rename = "fixedMeta")]
4708    Meta(Meta),
4709}
4710/// Extension value for ElementDefinitionFixed.
4711#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4712#[serde(rename_all = "camelCase")]
4713pub enum ElementDefinitionFixedExtension {
4714    /// Variant accepting the Base64Binary extension.
4715    #[serde(rename = "_fixedBase64Binary")]
4716    Base64Binary(FieldExtension),
4717    /// Variant accepting the Boolean extension.
4718    #[serde(rename = "_fixedBoolean")]
4719    Boolean(FieldExtension),
4720    /// Variant accepting the Canonical extension.
4721    #[serde(rename = "_fixedCanonical")]
4722    Canonical(FieldExtension),
4723    /// Variant accepting the Code extension.
4724    #[serde(rename = "_fixedCode")]
4725    Code(FieldExtension),
4726    /// Variant accepting the Date extension.
4727    #[serde(rename = "_fixedDate")]
4728    Date(FieldExtension),
4729    /// Variant accepting the DateTime extension.
4730    #[serde(rename = "_fixedDateTime")]
4731    DateTime(FieldExtension),
4732    /// Variant accepting the Decimal extension.
4733    #[serde(rename = "_fixedDecimal")]
4734    Decimal(FieldExtension),
4735    /// Variant accepting the Id extension.
4736    #[serde(rename = "_fixedId")]
4737    Id(FieldExtension),
4738    /// Variant accepting the Instant extension.
4739    #[serde(rename = "_fixedInstant")]
4740    Instant(FieldExtension),
4741    /// Variant accepting the Integer extension.
4742    #[serde(rename = "_fixedInteger")]
4743    Integer(FieldExtension),
4744    /// Variant accepting the Integer64 extension.
4745    #[serde(rename = "_fixedInteger64")]
4746    Integer64(FieldExtension),
4747    /// Variant accepting the Markdown extension.
4748    #[serde(rename = "_fixedMarkdown")]
4749    Markdown(FieldExtension),
4750    /// Variant accepting the Oid extension.
4751    #[serde(rename = "_fixedOid")]
4752    Oid(FieldExtension),
4753    /// Variant accepting the PositiveInt extension.
4754    #[serde(rename = "_fixedPositiveInt")]
4755    PositiveInt(FieldExtension),
4756    /// Variant accepting the String extension.
4757    #[serde(rename = "_fixedString")]
4758    String(FieldExtension),
4759    /// Variant accepting the Time extension.
4760    #[serde(rename = "_fixedTime")]
4761    Time(FieldExtension),
4762    /// Variant accepting the UnsignedInt extension.
4763    #[serde(rename = "_fixedUnsignedInt")]
4764    UnsignedInt(FieldExtension),
4765    /// Variant accepting the Uri extension.
4766    #[serde(rename = "_fixedUri")]
4767    Uri(FieldExtension),
4768    /// Variant accepting the Url extension.
4769    #[serde(rename = "_fixedUrl")]
4770    Url(FieldExtension),
4771    /// Variant accepting the Uuid extension.
4772    #[serde(rename = "_fixedUuid")]
4773    Uuid(FieldExtension),
4774    /// Variant accepting the Address extension.
4775    #[serde(rename = "_fixedAddress")]
4776    Address(FieldExtension),
4777    /// Variant accepting the Age extension.
4778    #[serde(rename = "_fixedAge")]
4779    Age(FieldExtension),
4780    /// Variant accepting the Annotation extension.
4781    #[serde(rename = "_fixedAnnotation")]
4782    Annotation(FieldExtension),
4783    /// Variant accepting the Attachment extension.
4784    #[serde(rename = "_fixedAttachment")]
4785    Attachment(FieldExtension),
4786    /// Variant accepting the CodeableConcept extension.
4787    #[serde(rename = "_fixedCodeableConcept")]
4788    CodeableConcept(FieldExtension),
4789    /// Variant accepting the CodeableReference extension.
4790    #[serde(rename = "_fixedCodeableReference")]
4791    CodeableReference(FieldExtension),
4792    /// Variant accepting the Coding extension.
4793    #[serde(rename = "_fixedCoding")]
4794    Coding(FieldExtension),
4795    /// Variant accepting the ContactPoint extension.
4796    #[serde(rename = "_fixedContactPoint")]
4797    ContactPoint(FieldExtension),
4798    /// Variant accepting the Count extension.
4799    #[serde(rename = "_fixedCount")]
4800    Count(FieldExtension),
4801    /// Variant accepting the Distance extension.
4802    #[serde(rename = "_fixedDistance")]
4803    Distance(FieldExtension),
4804    /// Variant accepting the Duration extension.
4805    #[serde(rename = "_fixedDuration")]
4806    Duration(FieldExtension),
4807    /// Variant accepting the HumanName extension.
4808    #[serde(rename = "_fixedHumanName")]
4809    HumanName(FieldExtension),
4810    /// Variant accepting the Identifier extension.
4811    #[serde(rename = "_fixedIdentifier")]
4812    Identifier(FieldExtension),
4813    /// Variant accepting the Money extension.
4814    #[serde(rename = "_fixedMoney")]
4815    Money(FieldExtension),
4816    /// Variant accepting the Period extension.
4817    #[serde(rename = "_fixedPeriod")]
4818    Period(FieldExtension),
4819    /// Variant accepting the Quantity extension.
4820    #[serde(rename = "_fixedQuantity")]
4821    Quantity(FieldExtension),
4822    /// Variant accepting the Range extension.
4823    #[serde(rename = "_fixedRange")]
4824    Range(FieldExtension),
4825    /// Variant accepting the Ratio extension.
4826    #[serde(rename = "_fixedRatio")]
4827    Ratio(FieldExtension),
4828    /// Variant accepting the RatioRange extension.
4829    #[serde(rename = "_fixedRatioRange")]
4830    RatioRange(FieldExtension),
4831    /// Variant accepting the Reference extension.
4832    #[serde(rename = "_fixedReference")]
4833    Reference(FieldExtension),
4834    /// Variant accepting the SampledData extension.
4835    #[serde(rename = "_fixedSampledData")]
4836    SampledData(FieldExtension),
4837    /// Variant accepting the Signature extension.
4838    #[serde(rename = "_fixedSignature")]
4839    Signature(FieldExtension),
4840    /// Variant accepting the Timing extension.
4841    #[serde(rename = "_fixedTiming")]
4842    Timing(FieldExtension),
4843    /// Variant accepting the ContactDetail extension.
4844    #[serde(rename = "_fixedContactDetail")]
4845    ContactDetail(FieldExtension),
4846    /// Variant accepting the DataRequirement extension.
4847    #[serde(rename = "_fixedDataRequirement")]
4848    DataRequirement(FieldExtension),
4849    /// Variant accepting the Expression extension.
4850    #[serde(rename = "_fixedExpression")]
4851    Expression(FieldExtension),
4852    /// Variant accepting the ParameterDefinition extension.
4853    #[serde(rename = "_fixedParameterDefinition")]
4854    ParameterDefinition(FieldExtension),
4855    /// Variant accepting the RelatedArtifact extension.
4856    #[serde(rename = "_fixedRelatedArtifact")]
4857    RelatedArtifact(FieldExtension),
4858    /// Variant accepting the TriggerDefinition extension.
4859    #[serde(rename = "_fixedTriggerDefinition")]
4860    TriggerDefinition(FieldExtension),
4861    /// Variant accepting the UsageContext extension.
4862    #[serde(rename = "_fixedUsageContext")]
4863    UsageContext(FieldExtension),
4864    /// Variant accepting the Availability extension.
4865    #[serde(rename = "_fixedAvailability")]
4866    Availability(FieldExtension),
4867    /// Variant accepting the ExtendedContactDetail extension.
4868    #[serde(rename = "_fixedExtendedContactDetail")]
4869    ExtendedContactDetail(FieldExtension),
4870    /// Variant accepting the Dosage extension.
4871    #[serde(rename = "_fixedDosage")]
4872    Dosage(FieldExtension),
4873    /// Variant accepting the Meta extension.
4874    #[serde(rename = "_fixedMeta")]
4875    Meta(FieldExtension),
4876}
4877/// Choice of types for the pattern[x] field in ElementDefinition
4878#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4879#[serde(rename_all = "camelCase")]
4880pub enum ElementDefinitionPattern {
4881    /// Variant accepting the Base64Binary type.
4882    #[serde(rename = "patternBase64Binary")]
4883    Base64Binary(Base64Binary),
4884    /// Variant accepting the Boolean type.
4885    #[serde(rename = "patternBoolean")]
4886    Boolean(bool),
4887    /// Variant accepting the Canonical type.
4888    #[serde(rename = "patternCanonical")]
4889    Canonical(String),
4890    /// Variant accepting the Code type.
4891    #[serde(rename = "patternCode")]
4892    Code(String),
4893    /// Variant accepting the Date type.
4894    #[serde(rename = "patternDate")]
4895    Date(Date),
4896    /// Variant accepting the DateTime type.
4897    #[serde(rename = "patternDateTime")]
4898    DateTime(DateTime),
4899    /// Variant accepting the Decimal type.
4900    #[serde(rename = "patternDecimal")]
4901    Decimal(f64),
4902    /// Variant accepting the Id type.
4903    #[serde(rename = "patternId")]
4904    Id(String),
4905    /// Variant accepting the Instant type.
4906    #[serde(rename = "patternInstant")]
4907    Instant(Instant),
4908    /// Variant accepting the Integer type.
4909    #[serde(rename = "patternInteger")]
4910    Integer(i32),
4911    /// Variant accepting the Integer64 type.
4912    #[serde(rename = "patternInteger64")]
4913    Integer64(Integer64),
4914    /// Variant accepting the Markdown type.
4915    #[serde(rename = "patternMarkdown")]
4916    Markdown(String),
4917    /// Variant accepting the Oid type.
4918    #[serde(rename = "patternOid")]
4919    Oid(String),
4920    /// Variant accepting the PositiveInt type.
4921    #[serde(rename = "patternPositiveInt")]
4922    PositiveInt(NonZeroU32),
4923    /// Variant accepting the String type.
4924    #[serde(rename = "patternString")]
4925    String(String),
4926    /// Variant accepting the Time type.
4927    #[serde(rename = "patternTime")]
4928    Time(Time),
4929    /// Variant accepting the UnsignedInt type.
4930    #[serde(rename = "patternUnsignedInt")]
4931    UnsignedInt(u32),
4932    /// Variant accepting the Uri type.
4933    #[serde(rename = "patternUri")]
4934    Uri(String),
4935    /// Variant accepting the Url type.
4936    #[serde(rename = "patternUrl")]
4937    Url(String),
4938    /// Variant accepting the Uuid type.
4939    #[serde(rename = "patternUuid")]
4940    Uuid(String),
4941    /// Variant accepting the Address type.
4942    #[serde(rename = "patternAddress")]
4943    Address(Address),
4944    /// Variant accepting the Age type.
4945    #[serde(rename = "patternAge")]
4946    Age(Age),
4947    /// Variant accepting the Annotation type.
4948    #[serde(rename = "patternAnnotation")]
4949    Annotation(Annotation),
4950    /// Variant accepting the Attachment type.
4951    #[serde(rename = "patternAttachment")]
4952    Attachment(Attachment),
4953    /// Variant accepting the CodeableConcept type.
4954    #[serde(rename = "patternCodeableConcept")]
4955    CodeableConcept(CodeableConcept),
4956    /// Variant accepting the CodeableReference type.
4957    #[serde(rename = "patternCodeableReference")]
4958    CodeableReference(CodeableReference),
4959    /// Variant accepting the Coding type.
4960    #[serde(rename = "patternCoding")]
4961    Coding(Coding),
4962    /// Variant accepting the ContactPoint type.
4963    #[serde(rename = "patternContactPoint")]
4964    ContactPoint(ContactPoint),
4965    /// Variant accepting the Count type.
4966    #[serde(rename = "patternCount")]
4967    Count(Count),
4968    /// Variant accepting the Distance type.
4969    #[serde(rename = "patternDistance")]
4970    Distance(Distance),
4971    /// Variant accepting the Duration type.
4972    #[serde(rename = "patternDuration")]
4973    Duration(Duration),
4974    /// Variant accepting the HumanName type.
4975    #[serde(rename = "patternHumanName")]
4976    HumanName(HumanName),
4977    /// Variant accepting the Identifier type.
4978    #[serde(rename = "patternIdentifier")]
4979    Identifier(Identifier),
4980    /// Variant accepting the Money type.
4981    #[serde(rename = "patternMoney")]
4982    Money(Money),
4983    /// Variant accepting the Period type.
4984    #[serde(rename = "patternPeriod")]
4985    Period(Period),
4986    /// Variant accepting the Quantity type.
4987    #[serde(rename = "patternQuantity")]
4988    Quantity(Quantity),
4989    /// Variant accepting the Range type.
4990    #[serde(rename = "patternRange")]
4991    Range(Range),
4992    /// Variant accepting the Ratio type.
4993    #[serde(rename = "patternRatio")]
4994    Ratio(Ratio),
4995    /// Variant accepting the RatioRange type.
4996    #[serde(rename = "patternRatioRange")]
4997    RatioRange(RatioRange),
4998    /// Variant accepting the Reference type.
4999    #[serde(rename = "patternReference")]
5000    Reference(Reference),
5001    /// Variant accepting the SampledData type.
5002    #[serde(rename = "patternSampledData")]
5003    SampledData(SampledData),
5004    /// Variant accepting the Signature type.
5005    #[serde(rename = "patternSignature")]
5006    Signature(Signature),
5007    /// Variant accepting the Timing type.
5008    #[serde(rename = "patternTiming")]
5009    Timing(Timing),
5010    /// Variant accepting the ContactDetail type.
5011    #[serde(rename = "patternContactDetail")]
5012    ContactDetail(ContactDetail),
5013    /// Variant accepting the DataRequirement type.
5014    #[serde(rename = "patternDataRequirement")]
5015    DataRequirement(DataRequirement),
5016    /// Variant accepting the Expression type.
5017    #[serde(rename = "patternExpression")]
5018    Expression(Expression),
5019    /// Variant accepting the ParameterDefinition type.
5020    #[serde(rename = "patternParameterDefinition")]
5021    ParameterDefinition(ParameterDefinition),
5022    /// Variant accepting the RelatedArtifact type.
5023    #[serde(rename = "patternRelatedArtifact")]
5024    RelatedArtifact(RelatedArtifact),
5025    /// Variant accepting the TriggerDefinition type.
5026    #[serde(rename = "patternTriggerDefinition")]
5027    TriggerDefinition(TriggerDefinition),
5028    /// Variant accepting the UsageContext type.
5029    #[serde(rename = "patternUsageContext")]
5030    UsageContext(UsageContext),
5031    /// Variant accepting the Availability type.
5032    #[serde(rename = "patternAvailability")]
5033    Availability(Availability),
5034    /// Variant accepting the ExtendedContactDetail type.
5035    #[serde(rename = "patternExtendedContactDetail")]
5036    ExtendedContactDetail(ExtendedContactDetail),
5037    /// Variant accepting the Dosage type.
5038    #[serde(rename = "patternDosage")]
5039    Dosage(Dosage),
5040    /// Variant accepting the Meta type.
5041    #[serde(rename = "patternMeta")]
5042    Meta(Meta),
5043}
5044/// Extension value for ElementDefinitionPattern.
5045#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5046#[serde(rename_all = "camelCase")]
5047pub enum ElementDefinitionPatternExtension {
5048    /// Variant accepting the Base64Binary extension.
5049    #[serde(rename = "_patternBase64Binary")]
5050    Base64Binary(FieldExtension),
5051    /// Variant accepting the Boolean extension.
5052    #[serde(rename = "_patternBoolean")]
5053    Boolean(FieldExtension),
5054    /// Variant accepting the Canonical extension.
5055    #[serde(rename = "_patternCanonical")]
5056    Canonical(FieldExtension),
5057    /// Variant accepting the Code extension.
5058    #[serde(rename = "_patternCode")]
5059    Code(FieldExtension),
5060    /// Variant accepting the Date extension.
5061    #[serde(rename = "_patternDate")]
5062    Date(FieldExtension),
5063    /// Variant accepting the DateTime extension.
5064    #[serde(rename = "_patternDateTime")]
5065    DateTime(FieldExtension),
5066    /// Variant accepting the Decimal extension.
5067    #[serde(rename = "_patternDecimal")]
5068    Decimal(FieldExtension),
5069    /// Variant accepting the Id extension.
5070    #[serde(rename = "_patternId")]
5071    Id(FieldExtension),
5072    /// Variant accepting the Instant extension.
5073    #[serde(rename = "_patternInstant")]
5074    Instant(FieldExtension),
5075    /// Variant accepting the Integer extension.
5076    #[serde(rename = "_patternInteger")]
5077    Integer(FieldExtension),
5078    /// Variant accepting the Integer64 extension.
5079    #[serde(rename = "_patternInteger64")]
5080    Integer64(FieldExtension),
5081    /// Variant accepting the Markdown extension.
5082    #[serde(rename = "_patternMarkdown")]
5083    Markdown(FieldExtension),
5084    /// Variant accepting the Oid extension.
5085    #[serde(rename = "_patternOid")]
5086    Oid(FieldExtension),
5087    /// Variant accepting the PositiveInt extension.
5088    #[serde(rename = "_patternPositiveInt")]
5089    PositiveInt(FieldExtension),
5090    /// Variant accepting the String extension.
5091    #[serde(rename = "_patternString")]
5092    String(FieldExtension),
5093    /// Variant accepting the Time extension.
5094    #[serde(rename = "_patternTime")]
5095    Time(FieldExtension),
5096    /// Variant accepting the UnsignedInt extension.
5097    #[serde(rename = "_patternUnsignedInt")]
5098    UnsignedInt(FieldExtension),
5099    /// Variant accepting the Uri extension.
5100    #[serde(rename = "_patternUri")]
5101    Uri(FieldExtension),
5102    /// Variant accepting the Url extension.
5103    #[serde(rename = "_patternUrl")]
5104    Url(FieldExtension),
5105    /// Variant accepting the Uuid extension.
5106    #[serde(rename = "_patternUuid")]
5107    Uuid(FieldExtension),
5108    /// Variant accepting the Address extension.
5109    #[serde(rename = "_patternAddress")]
5110    Address(FieldExtension),
5111    /// Variant accepting the Age extension.
5112    #[serde(rename = "_patternAge")]
5113    Age(FieldExtension),
5114    /// Variant accepting the Annotation extension.
5115    #[serde(rename = "_patternAnnotation")]
5116    Annotation(FieldExtension),
5117    /// Variant accepting the Attachment extension.
5118    #[serde(rename = "_patternAttachment")]
5119    Attachment(FieldExtension),
5120    /// Variant accepting the CodeableConcept extension.
5121    #[serde(rename = "_patternCodeableConcept")]
5122    CodeableConcept(FieldExtension),
5123    /// Variant accepting the CodeableReference extension.
5124    #[serde(rename = "_patternCodeableReference")]
5125    CodeableReference(FieldExtension),
5126    /// Variant accepting the Coding extension.
5127    #[serde(rename = "_patternCoding")]
5128    Coding(FieldExtension),
5129    /// Variant accepting the ContactPoint extension.
5130    #[serde(rename = "_patternContactPoint")]
5131    ContactPoint(FieldExtension),
5132    /// Variant accepting the Count extension.
5133    #[serde(rename = "_patternCount")]
5134    Count(FieldExtension),
5135    /// Variant accepting the Distance extension.
5136    #[serde(rename = "_patternDistance")]
5137    Distance(FieldExtension),
5138    /// Variant accepting the Duration extension.
5139    #[serde(rename = "_patternDuration")]
5140    Duration(FieldExtension),
5141    /// Variant accepting the HumanName extension.
5142    #[serde(rename = "_patternHumanName")]
5143    HumanName(FieldExtension),
5144    /// Variant accepting the Identifier extension.
5145    #[serde(rename = "_patternIdentifier")]
5146    Identifier(FieldExtension),
5147    /// Variant accepting the Money extension.
5148    #[serde(rename = "_patternMoney")]
5149    Money(FieldExtension),
5150    /// Variant accepting the Period extension.
5151    #[serde(rename = "_patternPeriod")]
5152    Period(FieldExtension),
5153    /// Variant accepting the Quantity extension.
5154    #[serde(rename = "_patternQuantity")]
5155    Quantity(FieldExtension),
5156    /// Variant accepting the Range extension.
5157    #[serde(rename = "_patternRange")]
5158    Range(FieldExtension),
5159    /// Variant accepting the Ratio extension.
5160    #[serde(rename = "_patternRatio")]
5161    Ratio(FieldExtension),
5162    /// Variant accepting the RatioRange extension.
5163    #[serde(rename = "_patternRatioRange")]
5164    RatioRange(FieldExtension),
5165    /// Variant accepting the Reference extension.
5166    #[serde(rename = "_patternReference")]
5167    Reference(FieldExtension),
5168    /// Variant accepting the SampledData extension.
5169    #[serde(rename = "_patternSampledData")]
5170    SampledData(FieldExtension),
5171    /// Variant accepting the Signature extension.
5172    #[serde(rename = "_patternSignature")]
5173    Signature(FieldExtension),
5174    /// Variant accepting the Timing extension.
5175    #[serde(rename = "_patternTiming")]
5176    Timing(FieldExtension),
5177    /// Variant accepting the ContactDetail extension.
5178    #[serde(rename = "_patternContactDetail")]
5179    ContactDetail(FieldExtension),
5180    /// Variant accepting the DataRequirement extension.
5181    #[serde(rename = "_patternDataRequirement")]
5182    DataRequirement(FieldExtension),
5183    /// Variant accepting the Expression extension.
5184    #[serde(rename = "_patternExpression")]
5185    Expression(FieldExtension),
5186    /// Variant accepting the ParameterDefinition extension.
5187    #[serde(rename = "_patternParameterDefinition")]
5188    ParameterDefinition(FieldExtension),
5189    /// Variant accepting the RelatedArtifact extension.
5190    #[serde(rename = "_patternRelatedArtifact")]
5191    RelatedArtifact(FieldExtension),
5192    /// Variant accepting the TriggerDefinition extension.
5193    #[serde(rename = "_patternTriggerDefinition")]
5194    TriggerDefinition(FieldExtension),
5195    /// Variant accepting the UsageContext extension.
5196    #[serde(rename = "_patternUsageContext")]
5197    UsageContext(FieldExtension),
5198    /// Variant accepting the Availability extension.
5199    #[serde(rename = "_patternAvailability")]
5200    Availability(FieldExtension),
5201    /// Variant accepting the ExtendedContactDetail extension.
5202    #[serde(rename = "_patternExtendedContactDetail")]
5203    ExtendedContactDetail(FieldExtension),
5204    /// Variant accepting the Dosage extension.
5205    #[serde(rename = "_patternDosage")]
5206    Dosage(FieldExtension),
5207    /// Variant accepting the Meta extension.
5208    #[serde(rename = "_patternMeta")]
5209    Meta(FieldExtension),
5210}
5211/// Sub-fields of the example field in ElementDefinition
5212#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5213#[cfg_attr(feature = "builders", derive(Builder))]
5214#[serde(rename_all = "camelCase")]
5215#[cfg_attr(
5216    feature = "builders",
5217    builder(
5218        pattern = "owned",
5219        name = "ElementDefinitionExampleBuilder",
5220        build_fn(error = "crate::error::BuilderError")
5221    )
5222)]
5223pub struct ElementDefinitionExample {
5224    /** **Unique id for inter-element referencing**
5225
5226 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
5227
5228 */
5229    #[serde(default, skip_serializing_if = "Option::is_none")]
5230    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5231    #[serde(rename = "id")]
5232    pub id: Option<String>,
5233    /** **Additional content defined by implementations**
5234
5235 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.
5236
5237 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
5238    #[serde(default, skip_serializing_if = "Vec::is_empty")]
5239    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5240    #[serde(rename = "extension")]
5241    pub extension: Vec<Extension>,
5242    /** **Describes the purpose of this example**
5243
5244 Describes the purpose of this example among the set of examples.
5245
5246 */
5247    #[serde(rename = "label")]
5248    pub label: String,
5249    /// Extension field.
5250    #[serde(default, skip_serializing_if = "Option::is_none")]
5251    #[serde(rename = "_label")]
5252    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5253    pub label_ext: Option<FieldExtension>,
5254    /** **Value of Example (one of allowed types)**
5255
5256 The actual value for the element, which must be one of the types allowed for this element.
5257
5258 */
5259    #[serde(flatten)]
5260    pub value: ElementDefinitionExampleValue,
5261    /// Extension field.
5262    #[serde(default, skip_serializing_if = "Option::is_none")]
5263    #[serde(flatten)]
5264    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5265    pub value_ext: Option<ElementDefinitionExampleValueExtension>,
5266}
5267#[cfg(feature = "builders")]
5268impl ElementDefinitionExample {
5269    ///Start building a new instance
5270    #[must_use]
5271    pub fn builder() -> ElementDefinitionExampleBuilder {
5272        ElementDefinitionExampleBuilder::default()
5273    }
5274}
5275/// Choice of types for the value[x] field in ElementDefinitionExample
5276#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5277#[serde(rename_all = "camelCase")]
5278pub enum ElementDefinitionExampleValue {
5279    /// Variant accepting the Base64Binary type.
5280    #[serde(rename = "valueBase64Binary")]
5281    Base64Binary(Base64Binary),
5282    /// Variant accepting the Boolean type.
5283    #[serde(rename = "valueBoolean")]
5284    Boolean(bool),
5285    /// Variant accepting the Canonical type.
5286    #[serde(rename = "valueCanonical")]
5287    Canonical(String),
5288    /// Variant accepting the Code type.
5289    #[serde(rename = "valueCode")]
5290    Code(String),
5291    /// Variant accepting the Date type.
5292    #[serde(rename = "valueDate")]
5293    Date(Date),
5294    /// Variant accepting the DateTime type.
5295    #[serde(rename = "valueDateTime")]
5296    DateTime(DateTime),
5297    /// Variant accepting the Decimal type.
5298    #[serde(rename = "valueDecimal")]
5299    Decimal(f64),
5300    /// Variant accepting the Id type.
5301    #[serde(rename = "valueId")]
5302    Id(String),
5303    /// Variant accepting the Instant type.
5304    #[serde(rename = "valueInstant")]
5305    Instant(Instant),
5306    /// Variant accepting the Integer type.
5307    #[serde(rename = "valueInteger")]
5308    Integer(i32),
5309    /// Variant accepting the Integer64 type.
5310    #[serde(rename = "valueInteger64")]
5311    Integer64(Integer64),
5312    /// Variant accepting the Markdown type.
5313    #[serde(rename = "valueMarkdown")]
5314    Markdown(String),
5315    /// Variant accepting the Oid type.
5316    #[serde(rename = "valueOid")]
5317    Oid(String),
5318    /// Variant accepting the PositiveInt type.
5319    #[serde(rename = "valuePositiveInt")]
5320    PositiveInt(NonZeroU32),
5321    /// Variant accepting the String type.
5322    #[serde(rename = "valueString")]
5323    String(String),
5324    /// Variant accepting the Time type.
5325    #[serde(rename = "valueTime")]
5326    Time(Time),
5327    /// Variant accepting the UnsignedInt type.
5328    #[serde(rename = "valueUnsignedInt")]
5329    UnsignedInt(u32),
5330    /// Variant accepting the Uri type.
5331    #[serde(rename = "valueUri")]
5332    Uri(String),
5333    /// Variant accepting the Url type.
5334    #[serde(rename = "valueUrl")]
5335    Url(String),
5336    /// Variant accepting the Uuid type.
5337    #[serde(rename = "valueUuid")]
5338    Uuid(String),
5339    /// Variant accepting the Address type.
5340    #[serde(rename = "valueAddress")]
5341    Address(Address),
5342    /// Variant accepting the Age type.
5343    #[serde(rename = "valueAge")]
5344    Age(Age),
5345    /// Variant accepting the Annotation type.
5346    #[serde(rename = "valueAnnotation")]
5347    Annotation(Annotation),
5348    /// Variant accepting the Attachment type.
5349    #[serde(rename = "valueAttachment")]
5350    Attachment(Attachment),
5351    /// Variant accepting the CodeableConcept type.
5352    #[serde(rename = "valueCodeableConcept")]
5353    CodeableConcept(CodeableConcept),
5354    /// Variant accepting the CodeableReference type.
5355    #[serde(rename = "valueCodeableReference")]
5356    CodeableReference(CodeableReference),
5357    /// Variant accepting the Coding type.
5358    #[serde(rename = "valueCoding")]
5359    Coding(Coding),
5360    /// Variant accepting the ContactPoint type.
5361    #[serde(rename = "valueContactPoint")]
5362    ContactPoint(ContactPoint),
5363    /// Variant accepting the Count type.
5364    #[serde(rename = "valueCount")]
5365    Count(Count),
5366    /// Variant accepting the Distance type.
5367    #[serde(rename = "valueDistance")]
5368    Distance(Distance),
5369    /// Variant accepting the Duration type.
5370    #[serde(rename = "valueDuration")]
5371    Duration(Duration),
5372    /// Variant accepting the HumanName type.
5373    #[serde(rename = "valueHumanName")]
5374    HumanName(HumanName),
5375    /// Variant accepting the Identifier type.
5376    #[serde(rename = "valueIdentifier")]
5377    Identifier(Identifier),
5378    /// Variant accepting the Money type.
5379    #[serde(rename = "valueMoney")]
5380    Money(Money),
5381    /// Variant accepting the Period type.
5382    #[serde(rename = "valuePeriod")]
5383    Period(Period),
5384    /// Variant accepting the Quantity type.
5385    #[serde(rename = "valueQuantity")]
5386    Quantity(Quantity),
5387    /// Variant accepting the Range type.
5388    #[serde(rename = "valueRange")]
5389    Range(Range),
5390    /// Variant accepting the Ratio type.
5391    #[serde(rename = "valueRatio")]
5392    Ratio(Ratio),
5393    /// Variant accepting the RatioRange type.
5394    #[serde(rename = "valueRatioRange")]
5395    RatioRange(RatioRange),
5396    /// Variant accepting the Reference type.
5397    #[serde(rename = "valueReference")]
5398    Reference(Reference),
5399    /// Variant accepting the SampledData type.
5400    #[serde(rename = "valueSampledData")]
5401    SampledData(SampledData),
5402    /// Variant accepting the Signature type.
5403    #[serde(rename = "valueSignature")]
5404    Signature(Signature),
5405    /// Variant accepting the Timing type.
5406    #[serde(rename = "valueTiming")]
5407    Timing(Timing),
5408    /// Variant accepting the ContactDetail type.
5409    #[serde(rename = "valueContactDetail")]
5410    ContactDetail(ContactDetail),
5411    /// Variant accepting the DataRequirement type.
5412    #[serde(rename = "valueDataRequirement")]
5413    DataRequirement(DataRequirement),
5414    /// Variant accepting the Expression type.
5415    #[serde(rename = "valueExpression")]
5416    Expression(Expression),
5417    /// Variant accepting the ParameterDefinition type.
5418    #[serde(rename = "valueParameterDefinition")]
5419    ParameterDefinition(ParameterDefinition),
5420    /// Variant accepting the RelatedArtifact type.
5421    #[serde(rename = "valueRelatedArtifact")]
5422    RelatedArtifact(RelatedArtifact),
5423    /// Variant accepting the TriggerDefinition type.
5424    #[serde(rename = "valueTriggerDefinition")]
5425    TriggerDefinition(TriggerDefinition),
5426    /// Variant accepting the UsageContext type.
5427    #[serde(rename = "valueUsageContext")]
5428    UsageContext(UsageContext),
5429    /// Variant accepting the Availability type.
5430    #[serde(rename = "valueAvailability")]
5431    Availability(Availability),
5432    /// Variant accepting the ExtendedContactDetail type.
5433    #[serde(rename = "valueExtendedContactDetail")]
5434    ExtendedContactDetail(ExtendedContactDetail),
5435    /// Variant accepting the Dosage type.
5436    #[serde(rename = "valueDosage")]
5437    Dosage(Dosage),
5438    /// Variant accepting the Meta type.
5439    #[serde(rename = "valueMeta")]
5440    Meta(Meta),
5441}
5442/// Extension value for ElementDefinitionExampleValue.
5443#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5444#[serde(rename_all = "camelCase")]
5445pub enum ElementDefinitionExampleValueExtension {
5446    /// Variant accepting the Base64Binary extension.
5447    #[serde(rename = "_valueBase64Binary")]
5448    Base64Binary(FieldExtension),
5449    /// Variant accepting the Boolean extension.
5450    #[serde(rename = "_valueBoolean")]
5451    Boolean(FieldExtension),
5452    /// Variant accepting the Canonical extension.
5453    #[serde(rename = "_valueCanonical")]
5454    Canonical(FieldExtension),
5455    /// Variant accepting the Code extension.
5456    #[serde(rename = "_valueCode")]
5457    Code(FieldExtension),
5458    /// Variant accepting the Date extension.
5459    #[serde(rename = "_valueDate")]
5460    Date(FieldExtension),
5461    /// Variant accepting the DateTime extension.
5462    #[serde(rename = "_valueDateTime")]
5463    DateTime(FieldExtension),
5464    /// Variant accepting the Decimal extension.
5465    #[serde(rename = "_valueDecimal")]
5466    Decimal(FieldExtension),
5467    /// Variant accepting the Id extension.
5468    #[serde(rename = "_valueId")]
5469    Id(FieldExtension),
5470    /// Variant accepting the Instant extension.
5471    #[serde(rename = "_valueInstant")]
5472    Instant(FieldExtension),
5473    /// Variant accepting the Integer extension.
5474    #[serde(rename = "_valueInteger")]
5475    Integer(FieldExtension),
5476    /// Variant accepting the Integer64 extension.
5477    #[serde(rename = "_valueInteger64")]
5478    Integer64(FieldExtension),
5479    /// Variant accepting the Markdown extension.
5480    #[serde(rename = "_valueMarkdown")]
5481    Markdown(FieldExtension),
5482    /// Variant accepting the Oid extension.
5483    #[serde(rename = "_valueOid")]
5484    Oid(FieldExtension),
5485    /// Variant accepting the PositiveInt extension.
5486    #[serde(rename = "_valuePositiveInt")]
5487    PositiveInt(FieldExtension),
5488    /// Variant accepting the String extension.
5489    #[serde(rename = "_valueString")]
5490    String(FieldExtension),
5491    /// Variant accepting the Time extension.
5492    #[serde(rename = "_valueTime")]
5493    Time(FieldExtension),
5494    /// Variant accepting the UnsignedInt extension.
5495    #[serde(rename = "_valueUnsignedInt")]
5496    UnsignedInt(FieldExtension),
5497    /// Variant accepting the Uri extension.
5498    #[serde(rename = "_valueUri")]
5499    Uri(FieldExtension),
5500    /// Variant accepting the Url extension.
5501    #[serde(rename = "_valueUrl")]
5502    Url(FieldExtension),
5503    /// Variant accepting the Uuid extension.
5504    #[serde(rename = "_valueUuid")]
5505    Uuid(FieldExtension),
5506    /// Variant accepting the Address extension.
5507    #[serde(rename = "_valueAddress")]
5508    Address(FieldExtension),
5509    /// Variant accepting the Age extension.
5510    #[serde(rename = "_valueAge")]
5511    Age(FieldExtension),
5512    /// Variant accepting the Annotation extension.
5513    #[serde(rename = "_valueAnnotation")]
5514    Annotation(FieldExtension),
5515    /// Variant accepting the Attachment extension.
5516    #[serde(rename = "_valueAttachment")]
5517    Attachment(FieldExtension),
5518    /// Variant accepting the CodeableConcept extension.
5519    #[serde(rename = "_valueCodeableConcept")]
5520    CodeableConcept(FieldExtension),
5521    /// Variant accepting the CodeableReference extension.
5522    #[serde(rename = "_valueCodeableReference")]
5523    CodeableReference(FieldExtension),
5524    /// Variant accepting the Coding extension.
5525    #[serde(rename = "_valueCoding")]
5526    Coding(FieldExtension),
5527    /// Variant accepting the ContactPoint extension.
5528    #[serde(rename = "_valueContactPoint")]
5529    ContactPoint(FieldExtension),
5530    /// Variant accepting the Count extension.
5531    #[serde(rename = "_valueCount")]
5532    Count(FieldExtension),
5533    /// Variant accepting the Distance extension.
5534    #[serde(rename = "_valueDistance")]
5535    Distance(FieldExtension),
5536    /// Variant accepting the Duration extension.
5537    #[serde(rename = "_valueDuration")]
5538    Duration(FieldExtension),
5539    /// Variant accepting the HumanName extension.
5540    #[serde(rename = "_valueHumanName")]
5541    HumanName(FieldExtension),
5542    /// Variant accepting the Identifier extension.
5543    #[serde(rename = "_valueIdentifier")]
5544    Identifier(FieldExtension),
5545    /// Variant accepting the Money extension.
5546    #[serde(rename = "_valueMoney")]
5547    Money(FieldExtension),
5548    /// Variant accepting the Period extension.
5549    #[serde(rename = "_valuePeriod")]
5550    Period(FieldExtension),
5551    /// Variant accepting the Quantity extension.
5552    #[serde(rename = "_valueQuantity")]
5553    Quantity(FieldExtension),
5554    /// Variant accepting the Range extension.
5555    #[serde(rename = "_valueRange")]
5556    Range(FieldExtension),
5557    /// Variant accepting the Ratio extension.
5558    #[serde(rename = "_valueRatio")]
5559    Ratio(FieldExtension),
5560    /// Variant accepting the RatioRange extension.
5561    #[serde(rename = "_valueRatioRange")]
5562    RatioRange(FieldExtension),
5563    /// Variant accepting the Reference extension.
5564    #[serde(rename = "_valueReference")]
5565    Reference(FieldExtension),
5566    /// Variant accepting the SampledData extension.
5567    #[serde(rename = "_valueSampledData")]
5568    SampledData(FieldExtension),
5569    /// Variant accepting the Signature extension.
5570    #[serde(rename = "_valueSignature")]
5571    Signature(FieldExtension),
5572    /// Variant accepting the Timing extension.
5573    #[serde(rename = "_valueTiming")]
5574    Timing(FieldExtension),
5575    /// Variant accepting the ContactDetail extension.
5576    #[serde(rename = "_valueContactDetail")]
5577    ContactDetail(FieldExtension),
5578    /// Variant accepting the DataRequirement extension.
5579    #[serde(rename = "_valueDataRequirement")]
5580    DataRequirement(FieldExtension),
5581    /// Variant accepting the Expression extension.
5582    #[serde(rename = "_valueExpression")]
5583    Expression(FieldExtension),
5584    /// Variant accepting the ParameterDefinition extension.
5585    #[serde(rename = "_valueParameterDefinition")]
5586    ParameterDefinition(FieldExtension),
5587    /// Variant accepting the RelatedArtifact extension.
5588    #[serde(rename = "_valueRelatedArtifact")]
5589    RelatedArtifact(FieldExtension),
5590    /// Variant accepting the TriggerDefinition extension.
5591    #[serde(rename = "_valueTriggerDefinition")]
5592    TriggerDefinition(FieldExtension),
5593    /// Variant accepting the UsageContext extension.
5594    #[serde(rename = "_valueUsageContext")]
5595    UsageContext(FieldExtension),
5596    /// Variant accepting the Availability extension.
5597    #[serde(rename = "_valueAvailability")]
5598    Availability(FieldExtension),
5599    /// Variant accepting the ExtendedContactDetail extension.
5600    #[serde(rename = "_valueExtendedContactDetail")]
5601    ExtendedContactDetail(FieldExtension),
5602    /// Variant accepting the Dosage extension.
5603    #[serde(rename = "_valueDosage")]
5604    Dosage(FieldExtension),
5605    /// Variant accepting the Meta extension.
5606    #[serde(rename = "_valueMeta")]
5607    Meta(FieldExtension),
5608}
5609/// Choice of types for the minValue[x] field in ElementDefinition
5610#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5611#[serde(rename_all = "camelCase")]
5612pub enum ElementDefinitionMinValue {
5613    /// Variant accepting the Date type.
5614    #[serde(rename = "minValueDate")]
5615    Date(Date),
5616    /// Variant accepting the DateTime type.
5617    #[serde(rename = "minValueDateTime")]
5618    DateTime(DateTime),
5619    /// Variant accepting the Instant type.
5620    #[serde(rename = "minValueInstant")]
5621    Instant(Instant),
5622    /// Variant accepting the Time type.
5623    #[serde(rename = "minValueTime")]
5624    Time(Time),
5625    /// Variant accepting the Decimal type.
5626    #[serde(rename = "minValueDecimal")]
5627    Decimal(f64),
5628    /// Variant accepting the Integer type.
5629    #[serde(rename = "minValueInteger")]
5630    Integer(i32),
5631    /// Variant accepting the Integer64 type.
5632    #[serde(rename = "minValueInteger64")]
5633    Integer64(Integer64),
5634    /// Variant accepting the PositiveInt type.
5635    #[serde(rename = "minValuePositiveInt")]
5636    PositiveInt(NonZeroU32),
5637    /// Variant accepting the UnsignedInt type.
5638    #[serde(rename = "minValueUnsignedInt")]
5639    UnsignedInt(u32),
5640    /// Variant accepting the Quantity type.
5641    #[serde(rename = "minValueQuantity")]
5642    Quantity(Quantity),
5643}
5644/// Extension value for ElementDefinitionMinValue.
5645#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5646#[serde(rename_all = "camelCase")]
5647pub enum ElementDefinitionMinValueExtension {
5648    /// Variant accepting the Date extension.
5649    #[serde(rename = "_minValueDate")]
5650    Date(FieldExtension),
5651    /// Variant accepting the DateTime extension.
5652    #[serde(rename = "_minValueDateTime")]
5653    DateTime(FieldExtension),
5654    /// Variant accepting the Instant extension.
5655    #[serde(rename = "_minValueInstant")]
5656    Instant(FieldExtension),
5657    /// Variant accepting the Time extension.
5658    #[serde(rename = "_minValueTime")]
5659    Time(FieldExtension),
5660    /// Variant accepting the Decimal extension.
5661    #[serde(rename = "_minValueDecimal")]
5662    Decimal(FieldExtension),
5663    /// Variant accepting the Integer extension.
5664    #[serde(rename = "_minValueInteger")]
5665    Integer(FieldExtension),
5666    /// Variant accepting the Integer64 extension.
5667    #[serde(rename = "_minValueInteger64")]
5668    Integer64(FieldExtension),
5669    /// Variant accepting the PositiveInt extension.
5670    #[serde(rename = "_minValuePositiveInt")]
5671    PositiveInt(FieldExtension),
5672    /// Variant accepting the UnsignedInt extension.
5673    #[serde(rename = "_minValueUnsignedInt")]
5674    UnsignedInt(FieldExtension),
5675    /// Variant accepting the Quantity extension.
5676    #[serde(rename = "_minValueQuantity")]
5677    Quantity(FieldExtension),
5678}
5679/// Choice of types for the maxValue[x] field in ElementDefinition
5680#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5681#[serde(rename_all = "camelCase")]
5682pub enum ElementDefinitionMaxValue {
5683    /// Variant accepting the Date type.
5684    #[serde(rename = "maxValueDate")]
5685    Date(Date),
5686    /// Variant accepting the DateTime type.
5687    #[serde(rename = "maxValueDateTime")]
5688    DateTime(DateTime),
5689    /// Variant accepting the Instant type.
5690    #[serde(rename = "maxValueInstant")]
5691    Instant(Instant),
5692    /// Variant accepting the Time type.
5693    #[serde(rename = "maxValueTime")]
5694    Time(Time),
5695    /// Variant accepting the Decimal type.
5696    #[serde(rename = "maxValueDecimal")]
5697    Decimal(f64),
5698    /// Variant accepting the Integer type.
5699    #[serde(rename = "maxValueInteger")]
5700    Integer(i32),
5701    /// Variant accepting the Integer64 type.
5702    #[serde(rename = "maxValueInteger64")]
5703    Integer64(Integer64),
5704    /// Variant accepting the PositiveInt type.
5705    #[serde(rename = "maxValuePositiveInt")]
5706    PositiveInt(NonZeroU32),
5707    /// Variant accepting the UnsignedInt type.
5708    #[serde(rename = "maxValueUnsignedInt")]
5709    UnsignedInt(u32),
5710    /// Variant accepting the Quantity type.
5711    #[serde(rename = "maxValueQuantity")]
5712    Quantity(Quantity),
5713}
5714/// Extension value for ElementDefinitionMaxValue.
5715#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5716#[serde(rename_all = "camelCase")]
5717pub enum ElementDefinitionMaxValueExtension {
5718    /// Variant accepting the Date extension.
5719    #[serde(rename = "_maxValueDate")]
5720    Date(FieldExtension),
5721    /// Variant accepting the DateTime extension.
5722    #[serde(rename = "_maxValueDateTime")]
5723    DateTime(FieldExtension),
5724    /// Variant accepting the Instant extension.
5725    #[serde(rename = "_maxValueInstant")]
5726    Instant(FieldExtension),
5727    /// Variant accepting the Time extension.
5728    #[serde(rename = "_maxValueTime")]
5729    Time(FieldExtension),
5730    /// Variant accepting the Decimal extension.
5731    #[serde(rename = "_maxValueDecimal")]
5732    Decimal(FieldExtension),
5733    /// Variant accepting the Integer extension.
5734    #[serde(rename = "_maxValueInteger")]
5735    Integer(FieldExtension),
5736    /// Variant accepting the Integer64 extension.
5737    #[serde(rename = "_maxValueInteger64")]
5738    Integer64(FieldExtension),
5739    /// Variant accepting the PositiveInt extension.
5740    #[serde(rename = "_maxValuePositiveInt")]
5741    PositiveInt(FieldExtension),
5742    /// Variant accepting the UnsignedInt extension.
5743    #[serde(rename = "_maxValueUnsignedInt")]
5744    UnsignedInt(FieldExtension),
5745    /// Variant accepting the Quantity extension.
5746    #[serde(rename = "_maxValueQuantity")]
5747    Quantity(FieldExtension),
5748}
5749/// Sub-fields of the constraint field in ElementDefinition
5750#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5751#[cfg_attr(feature = "builders", derive(Builder))]
5752#[serde(rename_all = "camelCase")]
5753#[cfg_attr(
5754    feature = "builders",
5755    builder(
5756        pattern = "owned",
5757        name = "ElementDefinitionConstraintBuilder",
5758        build_fn(error = "crate::error::BuilderError")
5759    )
5760)]
5761pub struct ElementDefinitionConstraint {
5762    /** **Unique id for inter-element referencing**
5763
5764 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
5765
5766 */
5767    #[serde(default, skip_serializing_if = "Option::is_none")]
5768    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5769    #[serde(rename = "id")]
5770    pub id: Option<String>,
5771    /** **Additional content defined by implementations**
5772
5773 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.
5774
5775 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
5776    #[serde(default, skip_serializing_if = "Vec::is_empty")]
5777    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5778    #[serde(rename = "extension")]
5779    pub extension: Vec<Extension>,
5780    /** **Target of 'condition' reference above**
5781
5782 Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.
5783
5784 */
5785    #[serde(rename = "key")]
5786    pub key: String,
5787    /// Extension field.
5788    #[serde(default, skip_serializing_if = "Option::is_none")]
5789    #[serde(rename = "_key")]
5790    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5791    pub key_ext: Option<FieldExtension>,
5792    /** **Why this constraint is necessary or appropriate**
5793
5794 Description of why this constraint is necessary or appropriate.
5795
5796 To be used if the reason for the constraint might not be intuitive to all implementers. */
5797    #[serde(default, skip_serializing_if = "Option::is_none")]
5798    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5799    #[serde(rename = "requirements")]
5800    pub requirements: Option<String>,
5801    /// Extension field.
5802    #[serde(default, skip_serializing_if = "Option::is_none")]
5803    #[serde(rename = "_requirements")]
5804    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5805    pub requirements_ext: Option<FieldExtension>,
5806    /** **[ConstraintSeverity](http://hl7.org/fhir/ValueSet/constraint-severity); error | warning**
5807
5808 Identifies the impact constraint violation has on the conformance of the instance.
5809
5810 This allows constraints to be asserted as "shall" (error) and "should" (warning). */
5811    #[serde(rename = "severity")]
5812    pub severity: codes::ConstraintSeverity,
5813    /// Extension field.
5814    #[serde(default, skip_serializing_if = "Option::is_none")]
5815    #[serde(rename = "_severity")]
5816    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5817    pub severity_ext: Option<FieldExtension>,
5818    /** **Suppress warning or hint in profile**
5819
5820 If true, indicates that the warning or best practice guideline should be suppressed.
5821
5822 This element should only be present in a derived profile where a warning or hint has been determined to be spurious/incorrect. E.g. a warning encouraging the inclusion of an element that the profile explicitly prohibits. */
5823    #[serde(default, skip_serializing_if = "Option::is_none")]
5824    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5825    #[serde(rename = "suppress")]
5826    pub suppress: Option<bool>,
5827    /// Extension field.
5828    #[serde(default, skip_serializing_if = "Option::is_none")]
5829    #[serde(rename = "_suppress")]
5830    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5831    pub suppress_ext: Option<FieldExtension>,
5832    /** **Human description of constraint**
5833
5834 Text that can be used to describe the constraint in messages identifying that the constraint has been violated.
5835
5836 Should be expressed in business terms as much as possible. */
5837    #[serde(rename = "human")]
5838    pub human: String,
5839    /// Extension field.
5840    #[serde(default, skip_serializing_if = "Option::is_none")]
5841    #[serde(rename = "_human")]
5842    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5843    pub human_ext: Option<FieldExtension>,
5844    /** **FHIRPath expression of constraint**
5845
5846 A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.
5847
5848 In the absense of an expression, the expression is likely not enforceable by validators, and might be missed by many systems. */
5849    #[serde(default, skip_serializing_if = "Option::is_none")]
5850    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5851    #[serde(rename = "expression")]
5852    pub expression: Option<String>,
5853    /// Extension field.
5854    #[serde(default, skip_serializing_if = "Option::is_none")]
5855    #[serde(rename = "_expression")]
5856    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5857    pub expression_ext: Option<FieldExtension>,
5858    /** **Reference to original source of constraint**
5859
5860 A reference to the original source of the constraint, for traceability purposes.
5861
5862 This is used when, e.g. rendering, where it is not useful to present inherited constraints when rendering the snapshot. */
5863    #[serde(default, skip_serializing_if = "Option::is_none")]
5864    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5865    #[serde(rename = "source")]
5866    pub source: Option<String>,
5867    /// Extension field.
5868    #[serde(default, skip_serializing_if = "Option::is_none")]
5869    #[serde(rename = "_source")]
5870    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5871    pub source_ext: Option<FieldExtension>,
5872}
5873#[cfg(feature = "builders")]
5874impl ElementDefinitionConstraint {
5875    ///Start building a new instance
5876    #[must_use]
5877    pub fn builder() -> ElementDefinitionConstraintBuilder {
5878        ElementDefinitionConstraintBuilder::default()
5879    }
5880}
5881/// Sub-fields of the binding field in ElementDefinition
5882#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5883#[cfg_attr(feature = "builders", derive(Builder))]
5884#[serde(rename_all = "camelCase")]
5885#[cfg_attr(
5886    feature = "builders",
5887    builder(
5888        pattern = "owned",
5889        name = "ElementDefinitionBindingBuilder",
5890        build_fn(error = "crate::error::BuilderError")
5891    )
5892)]
5893pub struct ElementDefinitionBinding {
5894    /** **Unique id for inter-element referencing**
5895
5896 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
5897
5898 */
5899    #[serde(default, skip_serializing_if = "Option::is_none")]
5900    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5901    #[serde(rename = "id")]
5902    pub id: Option<String>,
5903    /** **Additional content defined by implementations**
5904
5905 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.
5906
5907 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
5908    #[serde(default, skip_serializing_if = "Vec::is_empty")]
5909    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5910    #[serde(rename = "extension")]
5911    pub extension: Vec<Extension>,
5912    /** **[BindingStrength](http://hl7.org/fhir/ValueSet/binding-strength); required | extensible | preferred | example**
5913
5914 Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.
5915
5916 For further discussion, see [Using Terminologies](terminologies.html). */
5917    #[serde(rename = "strength")]
5918    pub strength: codes::BindingStrength,
5919    /// Extension field.
5920    #[serde(default, skip_serializing_if = "Option::is_none")]
5921    #[serde(rename = "_strength")]
5922    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5923    pub strength_ext: Option<FieldExtension>,
5924    /** **Intended use of codes in the bound value set**
5925
5926 Describes the intended use of this particular set of codes.
5927
5928 */
5929    #[serde(default, skip_serializing_if = "Option::is_none")]
5930    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5931    #[serde(rename = "description")]
5932    pub description: Option<String>,
5933    /// Extension field.
5934    #[serde(default, skip_serializing_if = "Option::is_none")]
5935    #[serde(rename = "_description")]
5936    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5937    pub description_ext: Option<FieldExtension>,
5938    /** **Source of value set**
5939
5940 Refers to the value set that identifies the set of codes the binding refers to.
5941
5942 The reference may be version-specific or not (e.g. have a |[version] at the end of the canonical URL). */
5943    #[serde(default, skip_serializing_if = "Option::is_none")]
5944    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5945    #[serde(rename = "valueSet")]
5946    pub value_set: Option<String>,
5947    /// Extension field.
5948    #[serde(default, skip_serializing_if = "Option::is_none")]
5949    #[serde(rename = "_valueSet")]
5950    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5951    pub value_set_ext: Option<FieldExtension>,
5952    /** **Additional Bindings - more rules about the binding**
5953
5954 Additional bindings that help applications implementing this element. Additional bindings do not replace the main binding but provide more information and/or context.
5955
5956 */
5957    #[serde(default, skip_serializing_if = "Vec::is_empty")]
5958    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5959    #[serde(rename = "additional")]
5960    pub additional: Vec<Option<ElementDefinitionBindingAdditional>>,
5961    /// Extension field.
5962    #[serde(default, skip_serializing_if = "Vec::is_empty")]
5963    #[serde(rename = "_additional")]
5964    #[cfg_attr(feature = "builders", builder(default))]
5965    pub additional_ext: Vec<Option<FieldExtension>>,
5966}
5967#[cfg(feature = "builders")]
5968impl ElementDefinitionBinding {
5969    ///Start building a new instance
5970    #[must_use]
5971    pub fn builder() -> ElementDefinitionBindingBuilder {
5972        ElementDefinitionBindingBuilder::default()
5973    }
5974}
5975/// Sub-fields of the additional field in ElementDefinitionBinding
5976#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5977#[cfg_attr(feature = "builders", derive(Builder))]
5978#[serde(rename_all = "camelCase")]
5979#[cfg_attr(
5980    feature = "builders",
5981    builder(
5982        pattern = "owned",
5983        name = "ElementDefinitionBindingAdditionalBuilder",
5984        build_fn(error = "crate::error::BuilderError")
5985    )
5986)]
5987pub struct ElementDefinitionBindingAdditional {
5988    /** **Unique id for inter-element referencing**
5989
5990 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
5991
5992 */
5993    #[serde(default, skip_serializing_if = "Option::is_none")]
5994    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
5995    #[serde(rename = "id")]
5996    pub id: Option<String>,
5997    /** **Additional content defined by implementations**
5998
5999 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.
6000
6001 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
6002    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6003    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6004    #[serde(rename = "extension")]
6005    pub extension: Vec<Extension>,
6006    /** **[AdditionalBindingPurpose](http://hl7.org/fhir/ValueSet/additional-binding-purpose); maximum | minimum | required | extensible | candidate | current | preferred | ui | starter | component**
6007
6008 The use of this additional binding.
6009
6010 Conformance bindings are in addition to the base binding, not instead of it. */
6011    #[serde(rename = "purpose")]
6012    pub purpose: codes::AdditionalBindingPurposeCodes,
6013    /// Extension field.
6014    #[serde(default, skip_serializing_if = "Option::is_none")]
6015    #[serde(rename = "_purpose")]
6016    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6017    pub purpose_ext: Option<FieldExtension>,
6018    /** **The value set for the additional binding**
6019
6020 The valueSet that is being bound for the purpose.
6021
6022 */
6023    #[serde(rename = "valueSet")]
6024    pub value_set: String,
6025    /// Extension field.
6026    #[serde(default, skip_serializing_if = "Option::is_none")]
6027    #[serde(rename = "_valueSet")]
6028    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6029    pub value_set_ext: Option<FieldExtension>,
6030    /** **Documentation of the purpose of use of the binding**
6031
6032 Documentation of the purpose of use of the bindingproviding additional information about how it is intended to be used.
6033
6034 */
6035    #[serde(default, skip_serializing_if = "Option::is_none")]
6036    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6037    #[serde(rename = "documentation")]
6038    pub documentation: Option<String>,
6039    /// Extension field.
6040    #[serde(default, skip_serializing_if = "Option::is_none")]
6041    #[serde(rename = "_documentation")]
6042    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6043    pub documentation_ext: Option<FieldExtension>,
6044    /** **Concise documentation - for summary tables**
6045
6046 Concise documentation - for summary tables.
6047
6048 */
6049    #[serde(default, skip_serializing_if = "Option::is_none")]
6050    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6051    #[serde(rename = "shortDoco")]
6052    pub short_doco: Option<String>,
6053    /// Extension field.
6054    #[serde(default, skip_serializing_if = "Option::is_none")]
6055    #[serde(rename = "_shortDoco")]
6056    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6057    pub short_doco_ext: Option<FieldExtension>,
6058    /** **Qualifies the usage - jurisdiction, gender, workflow status etc.**
6059
6060 Qualifies the usage of the binding. Typically bindings are qualified by jurisdiction, but they may also be qualified by gender, workflow status, clinical domain etc. The information to decide whether a usege context applies is usually outside the resource, determined by context, and this might present challenges for validation tooling.
6061
6062 This specification does not define exactly how the context is determined for the usage; typically, this will be described in implementation guides. */
6063    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6064    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6065    #[serde(rename = "usage")]
6066    pub usage: Vec<Option<UsageContext>>,
6067    /// Extension field.
6068    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6069    #[serde(rename = "_usage")]
6070    #[cfg_attr(feature = "builders", builder(default))]
6071    pub usage_ext: Vec<Option<FieldExtension>>,
6072    /** **Whether binding can applies to all repeats, or just one**
6073
6074 Whether the binding applies to all repeats, or just to any one of them. This is only relevant for elements that can repeat.
6075
6076 A common pattern is to make a conformance binding to all repeats, and then make a binding that one of the repeats must conform to. */
6077    #[serde(default, skip_serializing_if = "Option::is_none")]
6078    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6079    #[serde(rename = "any")]
6080    pub any: Option<bool>,
6081    /// Extension field.
6082    #[serde(default, skip_serializing_if = "Option::is_none")]
6083    #[serde(rename = "_any")]
6084    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6085    pub any_ext: Option<FieldExtension>,
6086}
6087#[cfg(feature = "builders")]
6088impl ElementDefinitionBindingAdditional {
6089    ///Start building a new instance
6090    #[must_use]
6091    pub fn builder() -> ElementDefinitionBindingAdditionalBuilder {
6092        ElementDefinitionBindingAdditionalBuilder::default()
6093    }
6094}
6095/// Sub-fields of the mapping field in ElementDefinition
6096#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6097#[cfg_attr(feature = "builders", derive(Builder))]
6098#[serde(rename_all = "camelCase")]
6099#[cfg_attr(
6100    feature = "builders",
6101    builder(
6102        pattern = "owned",
6103        name = "ElementDefinitionMappingBuilder",
6104        build_fn(error = "crate::error::BuilderError")
6105    )
6106)]
6107pub struct ElementDefinitionMapping {
6108    /** **Unique id for inter-element referencing**
6109
6110 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
6111
6112 */
6113    #[serde(default, skip_serializing_if = "Option::is_none")]
6114    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6115    #[serde(rename = "id")]
6116    pub id: Option<String>,
6117    /** **Additional content defined by implementations**
6118
6119 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.
6120
6121 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
6122    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6123    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6124    #[serde(rename = "extension")]
6125    pub extension: Vec<Extension>,
6126    /** **Reference to mapping declaration**
6127
6128 An internal reference to the definition of a mapping.
6129
6130 */
6131    #[serde(rename = "identity")]
6132    pub identity: String,
6133    /// Extension field.
6134    #[serde(default, skip_serializing_if = "Option::is_none")]
6135    #[serde(rename = "_identity")]
6136    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6137    pub identity_ext: Option<FieldExtension>,
6138    /** **[MimeType](http://hl7.org/fhir/ValueSet/mimetypes); Computable language of mapping**
6139
6140 Identifies the computable language in which mapping.map is expressed.
6141
6142 If omitted, then there can be no expectation of computational interpretation of the mapping. */
6143    #[serde(default, skip_serializing_if = "Option::is_none")]
6144    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6145    #[serde(rename = "language")]
6146    pub language: Option<String>,
6147    /// Extension field.
6148    #[serde(default, skip_serializing_if = "Option::is_none")]
6149    #[serde(rename = "_language")]
6150    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6151    pub language_ext: Option<FieldExtension>,
6152    /** **Details of the mapping**
6153
6154 Expresses what part of the target specification corresponds to this element.
6155
6156 For most mappings, the syntax is undefined.  Syntax will be provided for mappings to the RIM.  Multiple mappings may be possible and may include constraints on other resource elements that identify when a particular mapping applies. */
6157    #[serde(rename = "map")]
6158    pub map: String,
6159    /// Extension field.
6160    #[serde(default, skip_serializing_if = "Option::is_none")]
6161    #[serde(rename = "_map")]
6162    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6163    pub map_ext: Option<FieldExtension>,
6164    /** **Comments about the mapping or its use**
6165
6166 Comments that provide information about the mapping or its use.
6167
6168 */
6169    #[serde(default, skip_serializing_if = "Option::is_none")]
6170    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6171    #[serde(rename = "comment")]
6172    pub comment: Option<String>,
6173    /// Extension field.
6174    #[serde(default, skip_serializing_if = "Option::is_none")]
6175    #[serde(rename = "_comment")]
6176    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6177    pub comment_ext: Option<FieldExtension>,
6178}
6179#[cfg(feature = "builders")]
6180impl ElementDefinitionMapping {
6181    ///Start building a new instance
6182    #[must_use]
6183    pub fn builder() -> ElementDefinitionMappingBuilder {
6184        ElementDefinitionMappingBuilder::default()
6185    }
6186}
6187/** Expression Type: A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used.
6188
6189 **[Expression](http://hl7.org/fhir/StructureDefinition/Expression) v5.0.0**
6190
6191 An expression that can be used to generate a value
6192
6193 A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used.
6194
6195 */
6196#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6197#[serde(transparent)]
6198pub struct Expression(pub Box<ExpressionInner>);
6199/** Expression Type: A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used.
6200
6201 **[Expression](http://hl7.org/fhir/StructureDefinition/Expression) v5.0.0**
6202
6203 An expression that can be used to generate a value
6204
6205 A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used.
6206
6207 */
6208#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6209#[cfg_attr(feature = "builders", derive(Builder))]
6210#[serde(rename_all = "camelCase")]
6211#[cfg_attr(
6212    feature = "builders",
6213    builder(
6214        pattern = "owned",
6215        name = "ExpressionBuilder",
6216        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
6217    )
6218)]
6219pub struct ExpressionInner {
6220    /** **Unique id for inter-element referencing**
6221
6222 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
6223
6224 */
6225    #[serde(default, skip_serializing_if = "Option::is_none")]
6226    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6227    #[serde(rename = "id")]
6228    pub id: Option<String>,
6229    /** **Additional content defined by implementations**
6230
6231 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.
6232
6233 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
6234    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6235    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6236    #[serde(rename = "extension")]
6237    pub extension: Vec<Extension>,
6238    /** **Natural language description of the condition**
6239
6240 A brief, natural language description of the condition that effectively communicates the intended semantics.
6241
6242 */
6243    #[serde(default, skip_serializing_if = "Option::is_none")]
6244    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6245    #[serde(rename = "description")]
6246    pub description: Option<String>,
6247    /// Extension field.
6248    #[serde(default, skip_serializing_if = "Option::is_none")]
6249    #[serde(rename = "_description")]
6250    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6251    pub description_ext: Option<FieldExtension>,
6252    /** **Short name assigned to expression for reuse**
6253
6254 A short name assigned to the expression to allow for multiple reuse of the expression in the context where it is defined.
6255
6256 */
6257    #[serde(default, skip_serializing_if = "Option::is_none")]
6258    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6259    #[serde(rename = "name")]
6260    pub name: Option<String>,
6261    /// Extension field.
6262    #[serde(default, skip_serializing_if = "Option::is_none")]
6263    #[serde(rename = "_name")]
6264    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6265    pub name_ext: Option<FieldExtension>,
6266    /** **[ExpressionLanguage](http://hl7.org/fhir/ValueSet/expression-language); text/cql | text/fhirpath | application/x-fhir-query | etc.**
6267
6268 The media type of the language for the expression.
6269
6270 */
6271    #[serde(default, skip_serializing_if = "Option::is_none")]
6272    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6273    #[serde(rename = "language")]
6274    pub language: Option<String>,
6275    /// Extension field.
6276    #[serde(default, skip_serializing_if = "Option::is_none")]
6277    #[serde(rename = "_language")]
6278    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6279    pub language_ext: Option<FieldExtension>,
6280    /** **Expression in specified language**
6281
6282 An expression in the specified language that returns a value.
6283
6284 If Expression.expression and Expression.reference are both present, the Expression.expression might just be a name pointing something within the referenced content. */
6285    #[serde(default, skip_serializing_if = "Option::is_none")]
6286    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6287    #[serde(rename = "expression")]
6288    pub expression: Option<String>,
6289    /// Extension field.
6290    #[serde(default, skip_serializing_if = "Option::is_none")]
6291    #[serde(rename = "_expression")]
6292    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6293    pub expression_ext: Option<FieldExtension>,
6294    /** **Where the expression is found**
6295
6296 A URI that defines where the expression is found.
6297
6298 If both a reference and an expression is found, the reference SHALL point to the same expression. */
6299    #[serde(default, skip_serializing_if = "Option::is_none")]
6300    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6301    #[serde(rename = "reference")]
6302    pub reference: Option<String>,
6303    /// Extension field.
6304    #[serde(default, skip_serializing_if = "Option::is_none")]
6305    #[serde(rename = "_reference")]
6306    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6307    pub reference_ext: Option<FieldExtension>,
6308}
6309#[cfg(feature = "builders")]
6310impl ExpressionBuilder {
6311    #[doc = concat!("Finalize building ", "Expression", ".")]
6312    pub fn build(self) -> Result<Expression, crate::error::BuilderError> {
6313        self.build_inner().map(Into::into)
6314    }
6315}
6316impl From<ExpressionInner> for Expression {
6317    fn from(inner: ExpressionInner) -> Self {
6318        Self(Box::new(inner))
6319    }
6320}
6321impl ::core::ops::Deref for Expression {
6322    type Target = ExpressionInner;
6323    fn deref(&self) -> &Self::Target {
6324        &self.0
6325    }
6326}
6327impl ::core::ops::DerefMut for Expression {
6328    fn deref_mut(&mut self) -> &mut Self::Target {
6329        &mut self.0
6330    }
6331}
6332impl Expression {
6333    /// Start building an instance.
6334    #[cfg(feature = "builders")]
6335    #[must_use]
6336    pub fn builder() -> ExpressionBuilder {
6337        ExpressionBuilder::default()
6338    }
6339}
6340/** ExtendedContactDetail Type: Specifies contact information for a specific purpose over a period of time, might be handled/monitored by a specific named person or organization.
6341
6342 **[ExtendedContactDetail](http://hl7.org/fhir/StructureDefinition/ExtendedContactDetail) v5.0.0**
6343
6344 Contact information
6345
6346 Specifies contact information for a specific purpose over a period of time, might be handled/monitored by a specific named person or organization.
6347
6348 This datatype may be sparsely populated, i.e. only contain a purpose and phone number or address, but other cases could be completed filled out. */
6349#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6350#[serde(transparent)]
6351pub struct ExtendedContactDetail(pub Box<ExtendedContactDetailInner>);
6352/** ExtendedContactDetail Type: Specifies contact information for a specific purpose over a period of time, might be handled/monitored by a specific named person or organization.
6353
6354 **[ExtendedContactDetail](http://hl7.org/fhir/StructureDefinition/ExtendedContactDetail) v5.0.0**
6355
6356 Contact information
6357
6358 Specifies contact information for a specific purpose over a period of time, might be handled/monitored by a specific named person or organization.
6359
6360 This datatype may be sparsely populated, i.e. only contain a purpose and phone number or address, but other cases could be completed filled out. */
6361#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6362#[cfg_attr(feature = "builders", derive(Builder))]
6363#[serde(rename_all = "camelCase")]
6364#[cfg_attr(
6365    feature = "builders",
6366    builder(
6367        pattern = "owned",
6368        name = "ExtendedContactDetailBuilder",
6369        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
6370    )
6371)]
6372pub struct ExtendedContactDetailInner {
6373    /** **Unique id for inter-element referencing**
6374
6375 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
6376
6377 */
6378    #[serde(default, skip_serializing_if = "Option::is_none")]
6379    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6380    #[serde(rename = "id")]
6381    pub id: Option<String>,
6382    /** **Additional content defined by implementations**
6383
6384 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.
6385
6386 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
6387    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6388    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6389    #[serde(rename = "extension")]
6390    pub extension: Vec<Extension>,
6391    /** **[Purpose](http://terminology.hl7.org/ValueSet/contactentity-type); The type of contact**
6392
6393 The purpose/type of contact.
6394
6395 If no purpose is defined, then these contact details may be used for any purpose. */
6396    #[serde(default, skip_serializing_if = "Option::is_none")]
6397    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6398    #[serde(rename = "purpose")]
6399    pub purpose: Option<CodeableConcept>,
6400    /// Extension field.
6401    #[serde(default, skip_serializing_if = "Option::is_none")]
6402    #[serde(rename = "_purpose")]
6403    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6404    pub purpose_ext: Option<FieldExtension>,
6405    /** **Name of an individual to contact**
6406
6407 The name of an individual to contact, some types of contact detail are usually blank.
6408
6409 If there is no named individual, the telecom/address information is not generally monitored by a specific individual. */
6410    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6411    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6412    #[serde(rename = "name")]
6413    pub name: Vec<Option<HumanName>>,
6414    /// Extension field.
6415    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6416    #[serde(rename = "_name")]
6417    #[cfg_attr(feature = "builders", builder(default))]
6418    pub name_ext: Vec<Option<FieldExtension>>,
6419    /** **Contact details (e.g.phone/fax/url)**
6420
6421 The contact details application for the purpose defined.
6422
6423 */
6424    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6425    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6426    #[serde(rename = "telecom")]
6427    pub telecom: Vec<Option<ContactPoint>>,
6428    /// Extension field.
6429    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6430    #[serde(rename = "_telecom")]
6431    #[cfg_attr(feature = "builders", builder(default))]
6432    pub telecom_ext: Vec<Option<FieldExtension>>,
6433    /** **Address for the contact**
6434
6435 Address for the contact.
6436
6437 More than 1 address would be for different purposes, and thus should be entered as a different entry,. */
6438    #[serde(default, skip_serializing_if = "Option::is_none")]
6439    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6440    #[serde(rename = "address")]
6441    pub address: Option<Address>,
6442    /// Extension field.
6443    #[serde(default, skip_serializing_if = "Option::is_none")]
6444    #[serde(rename = "_address")]
6445    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6446    pub address_ext: Option<FieldExtension>,
6447    /** **This contact detail is handled/monitored by a specific organization**
6448
6449 This contact detail is handled/monitored by a specific organization. If the name is provided in the contact, then it is referring to the named individual within this organization.
6450
6451 */
6452    #[serde(default, skip_serializing_if = "Option::is_none")]
6453    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6454    #[serde(rename = "organization")]
6455    pub organization: Option<Reference>,
6456    /// Extension field.
6457    #[serde(default, skip_serializing_if = "Option::is_none")]
6458    #[serde(rename = "_organization")]
6459    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6460    pub organization_ext: Option<FieldExtension>,
6461    /** **Period that this contact was valid for usage**
6462
6463 Period that this contact was valid for usage.
6464
6465 If the details have multiple periods, then enter in a new ExtendedContact with the new period. */
6466    #[serde(default, skip_serializing_if = "Option::is_none")]
6467    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6468    #[serde(rename = "period")]
6469    pub period: Option<Period>,
6470    /// Extension field.
6471    #[serde(default, skip_serializing_if = "Option::is_none")]
6472    #[serde(rename = "_period")]
6473    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6474    pub period_ext: Option<FieldExtension>,
6475}
6476#[cfg(feature = "builders")]
6477impl ExtendedContactDetailBuilder {
6478    #[doc = concat!("Finalize building ", "ExtendedContactDetail", ".")]
6479    pub fn build(self) -> Result<ExtendedContactDetail, crate::error::BuilderError> {
6480        self.build_inner().map(Into::into)
6481    }
6482}
6483impl From<ExtendedContactDetailInner> for ExtendedContactDetail {
6484    fn from(inner: ExtendedContactDetailInner) -> Self {
6485        Self(Box::new(inner))
6486    }
6487}
6488impl ::core::ops::Deref for ExtendedContactDetail {
6489    type Target = ExtendedContactDetailInner;
6490    fn deref(&self) -> &Self::Target {
6491        &self.0
6492    }
6493}
6494impl ::core::ops::DerefMut for ExtendedContactDetail {
6495    fn deref_mut(&mut self) -> &mut Self::Target {
6496        &mut self.0
6497    }
6498}
6499impl ExtendedContactDetail {
6500    /// Start building an instance.
6501    #[cfg(feature = "builders")]
6502    #[must_use]
6503    pub fn builder() -> ExtendedContactDetailBuilder {
6504        ExtendedContactDetailBuilder::default()
6505    }
6506}
6507/** Extension Type: Optional Extension Element - found in all resources.
6508
6509 **[Extension](http://hl7.org/fhir/StructureDefinition/Extension) v5.0.0**
6510
6511 Optional Extensions Element
6512
6513 Optional Extension Element - found in all resources.
6514
6515 */
6516#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6517#[serde(transparent)]
6518pub struct Extension(pub Box<ExtensionInner>);
6519/** Extension Type: Optional Extension Element - found in all resources.
6520
6521 **[Extension](http://hl7.org/fhir/StructureDefinition/Extension) v5.0.0**
6522
6523 Optional Extensions Element
6524
6525 Optional Extension Element - found in all resources.
6526
6527 */
6528#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6529#[cfg_attr(feature = "builders", derive(Builder))]
6530#[serde(rename_all = "camelCase")]
6531#[cfg_attr(
6532    feature = "builders",
6533    builder(
6534        pattern = "owned",
6535        name = "ExtensionBuilder",
6536        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
6537    )
6538)]
6539pub struct ExtensionInner {
6540    /** **Unique id for inter-element referencing**
6541
6542 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
6543
6544 */
6545    #[serde(default, skip_serializing_if = "Option::is_none")]
6546    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6547    #[serde(rename = "id")]
6548    pub id: Option<String>,
6549    /** **Additional content defined by implementations**
6550
6551 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.
6552
6553 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
6554    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6555    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6556    #[serde(rename = "extension")]
6557    pub extension: Vec<Extension>,
6558    /** **identifies the meaning of the extension**
6559
6560 Source of the definition for the extension code - a logical name or a URL.
6561
6562 The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension. */
6563    #[serde(rename = "url")]
6564    pub url: String,
6565    /** **Value of extension**
6566
6567 Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).
6568
6569 */
6570    #[serde(default, skip_serializing_if = "Option::is_none")]
6571    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6572    #[serde(flatten)]
6573    pub value: Option<ExtensionValue>,
6574    /// Extension field.
6575    #[serde(default, skip_serializing_if = "Option::is_none")]
6576    #[serde(flatten)]
6577    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6578    pub value_ext: Option<ExtensionValueExtension>,
6579}
6580#[cfg(feature = "builders")]
6581impl ExtensionBuilder {
6582    #[doc = concat!("Finalize building ", "Extension", ".")]
6583    pub fn build(self) -> Result<Extension, crate::error::BuilderError> {
6584        self.build_inner().map(Into::into)
6585    }
6586}
6587impl From<ExtensionInner> for Extension {
6588    fn from(inner: ExtensionInner) -> Self {
6589        Self(Box::new(inner))
6590    }
6591}
6592impl ::core::ops::Deref for Extension {
6593    type Target = ExtensionInner;
6594    fn deref(&self) -> &Self::Target {
6595        &self.0
6596    }
6597}
6598impl ::core::ops::DerefMut for Extension {
6599    fn deref_mut(&mut self) -> &mut Self::Target {
6600        &mut self.0
6601    }
6602}
6603impl Extension {
6604    /// Start building an instance.
6605    #[cfg(feature = "builders")]
6606    #[must_use]
6607    pub fn builder() -> ExtensionBuilder {
6608        ExtensionBuilder::default()
6609    }
6610}
6611/// Choice of types for the value[x] field in Extension
6612#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6613#[serde(rename_all = "camelCase")]
6614pub enum ExtensionValue {
6615    /// Variant accepting the Base64Binary type.
6616    #[serde(rename = "valueBase64Binary")]
6617    Base64Binary(Base64Binary),
6618    /// Variant accepting the Boolean type.
6619    #[serde(rename = "valueBoolean")]
6620    Boolean(bool),
6621    /// Variant accepting the Canonical type.
6622    #[serde(rename = "valueCanonical")]
6623    Canonical(String),
6624    /// Variant accepting the Code type.
6625    #[serde(rename = "valueCode")]
6626    Code(String),
6627    /// Variant accepting the Date type.
6628    #[serde(rename = "valueDate")]
6629    Date(Date),
6630    /// Variant accepting the DateTime type.
6631    #[serde(rename = "valueDateTime")]
6632    DateTime(DateTime),
6633    /// Variant accepting the Decimal type.
6634    #[serde(rename = "valueDecimal")]
6635    Decimal(f64),
6636    /// Variant accepting the Id type.
6637    #[serde(rename = "valueId")]
6638    Id(String),
6639    /// Variant accepting the Instant type.
6640    #[serde(rename = "valueInstant")]
6641    Instant(Instant),
6642    /// Variant accepting the Integer type.
6643    #[serde(rename = "valueInteger")]
6644    Integer(i32),
6645    /// Variant accepting the Integer64 type.
6646    #[serde(rename = "valueInteger64")]
6647    Integer64(Integer64),
6648    /// Variant accepting the Markdown type.
6649    #[serde(rename = "valueMarkdown")]
6650    Markdown(String),
6651    /// Variant accepting the Oid type.
6652    #[serde(rename = "valueOid")]
6653    Oid(String),
6654    /// Variant accepting the PositiveInt type.
6655    #[serde(rename = "valuePositiveInt")]
6656    PositiveInt(NonZeroU32),
6657    /// Variant accepting the String type.
6658    #[serde(rename = "valueString")]
6659    String(String),
6660    /// Variant accepting the Time type.
6661    #[serde(rename = "valueTime")]
6662    Time(Time),
6663    /// Variant accepting the UnsignedInt type.
6664    #[serde(rename = "valueUnsignedInt")]
6665    UnsignedInt(u32),
6666    /// Variant accepting the Uri type.
6667    #[serde(rename = "valueUri")]
6668    Uri(String),
6669    /// Variant accepting the Url type.
6670    #[serde(rename = "valueUrl")]
6671    Url(String),
6672    /// Variant accepting the Uuid type.
6673    #[serde(rename = "valueUuid")]
6674    Uuid(String),
6675    /// Variant accepting the Address type.
6676    #[serde(rename = "valueAddress")]
6677    Address(Address),
6678    /// Variant accepting the Age type.
6679    #[serde(rename = "valueAge")]
6680    Age(Age),
6681    /// Variant accepting the Annotation type.
6682    #[serde(rename = "valueAnnotation")]
6683    Annotation(Annotation),
6684    /// Variant accepting the Attachment type.
6685    #[serde(rename = "valueAttachment")]
6686    Attachment(Attachment),
6687    /// Variant accepting the CodeableConcept type.
6688    #[serde(rename = "valueCodeableConcept")]
6689    CodeableConcept(CodeableConcept),
6690    /// Variant accepting the CodeableReference type.
6691    #[serde(rename = "valueCodeableReference")]
6692    CodeableReference(CodeableReference),
6693    /// Variant accepting the Coding type.
6694    #[serde(rename = "valueCoding")]
6695    Coding(Coding),
6696    /// Variant accepting the ContactPoint type.
6697    #[serde(rename = "valueContactPoint")]
6698    ContactPoint(ContactPoint),
6699    /// Variant accepting the Count type.
6700    #[serde(rename = "valueCount")]
6701    Count(Count),
6702    /// Variant accepting the Distance type.
6703    #[serde(rename = "valueDistance")]
6704    Distance(Distance),
6705    /// Variant accepting the Duration type.
6706    #[serde(rename = "valueDuration")]
6707    Duration(Duration),
6708    /// Variant accepting the HumanName type.
6709    #[serde(rename = "valueHumanName")]
6710    HumanName(HumanName),
6711    /// Variant accepting the Identifier type.
6712    #[serde(rename = "valueIdentifier")]
6713    Identifier(Identifier),
6714    /// Variant accepting the Money type.
6715    #[serde(rename = "valueMoney")]
6716    Money(Money),
6717    /// Variant accepting the Period type.
6718    #[serde(rename = "valuePeriod")]
6719    Period(Period),
6720    /// Variant accepting the Quantity type.
6721    #[serde(rename = "valueQuantity")]
6722    Quantity(Quantity),
6723    /// Variant accepting the Range type.
6724    #[serde(rename = "valueRange")]
6725    Range(Range),
6726    /// Variant accepting the Ratio type.
6727    #[serde(rename = "valueRatio")]
6728    Ratio(Ratio),
6729    /// Variant accepting the RatioRange type.
6730    #[serde(rename = "valueRatioRange")]
6731    RatioRange(RatioRange),
6732    /// Variant accepting the Reference type.
6733    #[serde(rename = "valueReference")]
6734    Reference(Reference),
6735    /// Variant accepting the SampledData type.
6736    #[serde(rename = "valueSampledData")]
6737    SampledData(SampledData),
6738    /// Variant accepting the Signature type.
6739    #[serde(rename = "valueSignature")]
6740    Signature(Signature),
6741    /// Variant accepting the Timing type.
6742    #[serde(rename = "valueTiming")]
6743    Timing(Timing),
6744    /// Variant accepting the ContactDetail type.
6745    #[serde(rename = "valueContactDetail")]
6746    ContactDetail(ContactDetail),
6747    /// Variant accepting the DataRequirement type.
6748    #[serde(rename = "valueDataRequirement")]
6749    DataRequirement(DataRequirement),
6750    /// Variant accepting the Expression type.
6751    #[serde(rename = "valueExpression")]
6752    Expression(Expression),
6753    /// Variant accepting the ParameterDefinition type.
6754    #[serde(rename = "valueParameterDefinition")]
6755    ParameterDefinition(ParameterDefinition),
6756    /// Variant accepting the RelatedArtifact type.
6757    #[serde(rename = "valueRelatedArtifact")]
6758    RelatedArtifact(RelatedArtifact),
6759    /// Variant accepting the TriggerDefinition type.
6760    #[serde(rename = "valueTriggerDefinition")]
6761    TriggerDefinition(TriggerDefinition),
6762    /// Variant accepting the UsageContext type.
6763    #[serde(rename = "valueUsageContext")]
6764    UsageContext(UsageContext),
6765    /// Variant accepting the Availability type.
6766    #[serde(rename = "valueAvailability")]
6767    Availability(Availability),
6768    /// Variant accepting the ExtendedContactDetail type.
6769    #[serde(rename = "valueExtendedContactDetail")]
6770    ExtendedContactDetail(ExtendedContactDetail),
6771    /// Variant accepting the Dosage type.
6772    #[serde(rename = "valueDosage")]
6773    Dosage(Dosage),
6774    /// Variant accepting the Meta type.
6775    #[serde(rename = "valueMeta")]
6776    Meta(Meta),
6777}
6778/// Extension value for ExtensionValue.
6779#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6780#[serde(rename_all = "camelCase")]
6781pub enum ExtensionValueExtension {
6782    /// Variant accepting the Base64Binary extension.
6783    #[serde(rename = "_valueBase64Binary")]
6784    Base64Binary(FieldExtension),
6785    /// Variant accepting the Boolean extension.
6786    #[serde(rename = "_valueBoolean")]
6787    Boolean(FieldExtension),
6788    /// Variant accepting the Canonical extension.
6789    #[serde(rename = "_valueCanonical")]
6790    Canonical(FieldExtension),
6791    /// Variant accepting the Code extension.
6792    #[serde(rename = "_valueCode")]
6793    Code(FieldExtension),
6794    /// Variant accepting the Date extension.
6795    #[serde(rename = "_valueDate")]
6796    Date(FieldExtension),
6797    /// Variant accepting the DateTime extension.
6798    #[serde(rename = "_valueDateTime")]
6799    DateTime(FieldExtension),
6800    /// Variant accepting the Decimal extension.
6801    #[serde(rename = "_valueDecimal")]
6802    Decimal(FieldExtension),
6803    /// Variant accepting the Id extension.
6804    #[serde(rename = "_valueId")]
6805    Id(FieldExtension),
6806    /// Variant accepting the Instant extension.
6807    #[serde(rename = "_valueInstant")]
6808    Instant(FieldExtension),
6809    /// Variant accepting the Integer extension.
6810    #[serde(rename = "_valueInteger")]
6811    Integer(FieldExtension),
6812    /// Variant accepting the Integer64 extension.
6813    #[serde(rename = "_valueInteger64")]
6814    Integer64(FieldExtension),
6815    /// Variant accepting the Markdown extension.
6816    #[serde(rename = "_valueMarkdown")]
6817    Markdown(FieldExtension),
6818    /// Variant accepting the Oid extension.
6819    #[serde(rename = "_valueOid")]
6820    Oid(FieldExtension),
6821    /// Variant accepting the PositiveInt extension.
6822    #[serde(rename = "_valuePositiveInt")]
6823    PositiveInt(FieldExtension),
6824    /// Variant accepting the String extension.
6825    #[serde(rename = "_valueString")]
6826    String(FieldExtension),
6827    /// Variant accepting the Time extension.
6828    #[serde(rename = "_valueTime")]
6829    Time(FieldExtension),
6830    /// Variant accepting the UnsignedInt extension.
6831    #[serde(rename = "_valueUnsignedInt")]
6832    UnsignedInt(FieldExtension),
6833    /// Variant accepting the Uri extension.
6834    #[serde(rename = "_valueUri")]
6835    Uri(FieldExtension),
6836    /// Variant accepting the Url extension.
6837    #[serde(rename = "_valueUrl")]
6838    Url(FieldExtension),
6839    /// Variant accepting the Uuid extension.
6840    #[serde(rename = "_valueUuid")]
6841    Uuid(FieldExtension),
6842    /// Variant accepting the Address extension.
6843    #[serde(rename = "_valueAddress")]
6844    Address(FieldExtension),
6845    /// Variant accepting the Age extension.
6846    #[serde(rename = "_valueAge")]
6847    Age(FieldExtension),
6848    /// Variant accepting the Annotation extension.
6849    #[serde(rename = "_valueAnnotation")]
6850    Annotation(FieldExtension),
6851    /// Variant accepting the Attachment extension.
6852    #[serde(rename = "_valueAttachment")]
6853    Attachment(FieldExtension),
6854    /// Variant accepting the CodeableConcept extension.
6855    #[serde(rename = "_valueCodeableConcept")]
6856    CodeableConcept(FieldExtension),
6857    /// Variant accepting the CodeableReference extension.
6858    #[serde(rename = "_valueCodeableReference")]
6859    CodeableReference(FieldExtension),
6860    /// Variant accepting the Coding extension.
6861    #[serde(rename = "_valueCoding")]
6862    Coding(FieldExtension),
6863    /// Variant accepting the ContactPoint extension.
6864    #[serde(rename = "_valueContactPoint")]
6865    ContactPoint(FieldExtension),
6866    /// Variant accepting the Count extension.
6867    #[serde(rename = "_valueCount")]
6868    Count(FieldExtension),
6869    /// Variant accepting the Distance extension.
6870    #[serde(rename = "_valueDistance")]
6871    Distance(FieldExtension),
6872    /// Variant accepting the Duration extension.
6873    #[serde(rename = "_valueDuration")]
6874    Duration(FieldExtension),
6875    /// Variant accepting the HumanName extension.
6876    #[serde(rename = "_valueHumanName")]
6877    HumanName(FieldExtension),
6878    /// Variant accepting the Identifier extension.
6879    #[serde(rename = "_valueIdentifier")]
6880    Identifier(FieldExtension),
6881    /// Variant accepting the Money extension.
6882    #[serde(rename = "_valueMoney")]
6883    Money(FieldExtension),
6884    /// Variant accepting the Period extension.
6885    #[serde(rename = "_valuePeriod")]
6886    Period(FieldExtension),
6887    /// Variant accepting the Quantity extension.
6888    #[serde(rename = "_valueQuantity")]
6889    Quantity(FieldExtension),
6890    /// Variant accepting the Range extension.
6891    #[serde(rename = "_valueRange")]
6892    Range(FieldExtension),
6893    /// Variant accepting the Ratio extension.
6894    #[serde(rename = "_valueRatio")]
6895    Ratio(FieldExtension),
6896    /// Variant accepting the RatioRange extension.
6897    #[serde(rename = "_valueRatioRange")]
6898    RatioRange(FieldExtension),
6899    /// Variant accepting the Reference extension.
6900    #[serde(rename = "_valueReference")]
6901    Reference(FieldExtension),
6902    /// Variant accepting the SampledData extension.
6903    #[serde(rename = "_valueSampledData")]
6904    SampledData(FieldExtension),
6905    /// Variant accepting the Signature extension.
6906    #[serde(rename = "_valueSignature")]
6907    Signature(FieldExtension),
6908    /// Variant accepting the Timing extension.
6909    #[serde(rename = "_valueTiming")]
6910    Timing(FieldExtension),
6911    /// Variant accepting the ContactDetail extension.
6912    #[serde(rename = "_valueContactDetail")]
6913    ContactDetail(FieldExtension),
6914    /// Variant accepting the DataRequirement extension.
6915    #[serde(rename = "_valueDataRequirement")]
6916    DataRequirement(FieldExtension),
6917    /// Variant accepting the Expression extension.
6918    #[serde(rename = "_valueExpression")]
6919    Expression(FieldExtension),
6920    /// Variant accepting the ParameterDefinition extension.
6921    #[serde(rename = "_valueParameterDefinition")]
6922    ParameterDefinition(FieldExtension),
6923    /// Variant accepting the RelatedArtifact extension.
6924    #[serde(rename = "_valueRelatedArtifact")]
6925    RelatedArtifact(FieldExtension),
6926    /// Variant accepting the TriggerDefinition extension.
6927    #[serde(rename = "_valueTriggerDefinition")]
6928    TriggerDefinition(FieldExtension),
6929    /// Variant accepting the UsageContext extension.
6930    #[serde(rename = "_valueUsageContext")]
6931    UsageContext(FieldExtension),
6932    /// Variant accepting the Availability extension.
6933    #[serde(rename = "_valueAvailability")]
6934    Availability(FieldExtension),
6935    /// Variant accepting the ExtendedContactDetail extension.
6936    #[serde(rename = "_valueExtendedContactDetail")]
6937    ExtendedContactDetail(FieldExtension),
6938    /// Variant accepting the Dosage extension.
6939    #[serde(rename = "_valueDosage")]
6940    Dosage(FieldExtension),
6941    /// Variant accepting the Meta extension.
6942    #[serde(rename = "_valueMeta")]
6943    Meta(FieldExtension),
6944}
6945/** HumanName Type: A name, normally of a human, that can be used for other living entities (e.g. animals but not organizations) that have been assigned names by a human and may need the use of name parts or the need for usage information.
6946
6947 **[HumanName](http://hl7.org/fhir/StructureDefinition/HumanName) v5.0.0**
6948
6949 Name of a human or other living entity - parts and usage
6950
6951 A name, normally of a human, that can be used for other living entities (e.g. animals but not organizations) that have been assigned names by a human and may need the use of name parts or the need for usage information.
6952
6953 Names may be changed, or repudiated, or people may have different names in different contexts. Names may be divided into parts of different type that have variable significance depending on context, though the division into parts does not always matter. With personal names, the different parts might or might not be imbued with some implicit meaning; various cultures associate different importance with the name parts and the degree to which systems must care about name parts around the world varies widely. */
6954#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6955#[serde(transparent)]
6956pub struct HumanName(pub Box<HumanNameInner>);
6957/** HumanName Type: A name, normally of a human, that can be used for other living entities (e.g. animals but not organizations) that have been assigned names by a human and may need the use of name parts or the need for usage information.
6958
6959 **[HumanName](http://hl7.org/fhir/StructureDefinition/HumanName) v5.0.0**
6960
6961 Name of a human or other living entity - parts and usage
6962
6963 A name, normally of a human, that can be used for other living entities (e.g. animals but not organizations) that have been assigned names by a human and may need the use of name parts or the need for usage information.
6964
6965 Names may be changed, or repudiated, or people may have different names in different contexts. Names may be divided into parts of different type that have variable significance depending on context, though the division into parts does not always matter. With personal names, the different parts might or might not be imbued with some implicit meaning; various cultures associate different importance with the name parts and the degree to which systems must care about name parts around the world varies widely. */
6966#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6967#[cfg_attr(feature = "builders", derive(Builder))]
6968#[serde(rename_all = "camelCase")]
6969#[cfg_attr(
6970    feature = "builders",
6971    builder(
6972        pattern = "owned",
6973        name = "HumanNameBuilder",
6974        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
6975    )
6976)]
6977pub struct HumanNameInner {
6978    /** **Unique id for inter-element referencing**
6979
6980 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
6981
6982 */
6983    #[serde(default, skip_serializing_if = "Option::is_none")]
6984    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6985    #[serde(rename = "id")]
6986    pub id: Option<String>,
6987    /** **Additional content defined by implementations**
6988
6989 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.
6990
6991 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
6992    #[serde(default, skip_serializing_if = "Vec::is_empty")]
6993    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
6994    #[serde(rename = "extension")]
6995    pub extension: Vec<Extension>,
6996    /** **[NameUse](http://hl7.org/fhir/ValueSet/name-use); usual | official | temp | nickname | anonymous | old | maiden**
6997
6998 Identifies the purpose for this name.
6999
7000 Applications can assume that a name is current unless it explicitly says that it is temporary or old. */
7001    #[serde(default, skip_serializing_if = "Option::is_none")]
7002    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7003    #[serde(rename = "use")]
7004    pub r#use: Option<codes::NameUse>,
7005    /// Extension field.
7006    #[serde(default, skip_serializing_if = "Option::is_none")]
7007    #[serde(rename = "_use")]
7008    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7009    pub r#use_ext: Option<FieldExtension>,
7010    /** **Text representation of the full name**
7011
7012 Specifies the entire name as it should be displayed e.g. on an application UI. This may be provided instead of or as well as the specific parts.
7013
7014 Can provide both a text representation and parts. Applications updating a name SHALL ensure that when both text and parts are present,  no content is included in the text that isn't found in a part. */
7015    #[serde(default, skip_serializing_if = "Option::is_none")]
7016    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7017    #[serde(rename = "text")]
7018    pub text: Option<String>,
7019    /// Extension field.
7020    #[serde(default, skip_serializing_if = "Option::is_none")]
7021    #[serde(rename = "_text")]
7022    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7023    pub text_ext: Option<FieldExtension>,
7024    /** **Family name (often called 'Surname')**
7025
7026 The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
7027
7028 Family Name may be decomposed into specific parts using extensions (de, nl, es related cultures). */
7029    #[serde(default, skip_serializing_if = "Option::is_none")]
7030    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7031    #[serde(rename = "family")]
7032    pub family: Option<String>,
7033    /// Extension field.
7034    #[serde(default, skip_serializing_if = "Option::is_none")]
7035    #[serde(rename = "_family")]
7036    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7037    pub family_ext: Option<FieldExtension>,
7038    /** **Given names (not always 'first'). Includes middle names**
7039
7040 Given name.
7041
7042 If only initials are recorded, they may be used in place of the full name parts. Initials may be separated into multiple given names but often aren't due to paractical limitations.  This element is not called "first name" since given names do not always come first. */
7043    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7044    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7045    #[serde(rename = "given")]
7046    pub given: Vec<Option<String>>,
7047    /// Extension field.
7048    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7049    #[serde(rename = "_given")]
7050    #[cfg_attr(feature = "builders", builder(default))]
7051    pub given_ext: Vec<Option<FieldExtension>>,
7052    /** **Parts that come before the name**
7053
7054 Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.
7055
7056 */
7057    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7058    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7059    #[serde(rename = "prefix")]
7060    pub prefix: Vec<Option<String>>,
7061    /// Extension field.
7062    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7063    #[serde(rename = "_prefix")]
7064    #[cfg_attr(feature = "builders", builder(default))]
7065    pub prefix_ext: Vec<Option<FieldExtension>>,
7066    /** **Parts that come after the name**
7067
7068 Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.
7069
7070 */
7071    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7072    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7073    #[serde(rename = "suffix")]
7074    pub suffix: Vec<Option<String>>,
7075    /// Extension field.
7076    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7077    #[serde(rename = "_suffix")]
7078    #[cfg_attr(feature = "builders", builder(default))]
7079    pub suffix_ext: Vec<Option<FieldExtension>>,
7080    /** **Time period when name was/is in use**
7081
7082 Indicates the period of time when this name was valid for the named person.
7083
7084 */
7085    #[serde(default, skip_serializing_if = "Option::is_none")]
7086    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7087    #[serde(rename = "period")]
7088    pub period: Option<Period>,
7089    /// Extension field.
7090    #[serde(default, skip_serializing_if = "Option::is_none")]
7091    #[serde(rename = "_period")]
7092    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7093    pub period_ext: Option<FieldExtension>,
7094}
7095#[cfg(feature = "builders")]
7096impl HumanNameBuilder {
7097    #[doc = concat!("Finalize building ", "HumanName", ".")]
7098    pub fn build(self) -> Result<HumanName, crate::error::BuilderError> {
7099        self.build_inner().map(Into::into)
7100    }
7101}
7102impl From<HumanNameInner> for HumanName {
7103    fn from(inner: HumanNameInner) -> Self {
7104        Self(Box::new(inner))
7105    }
7106}
7107impl ::core::ops::Deref for HumanName {
7108    type Target = HumanNameInner;
7109    fn deref(&self) -> &Self::Target {
7110        &self.0
7111    }
7112}
7113impl ::core::ops::DerefMut for HumanName {
7114    fn deref_mut(&mut self) -> &mut Self::Target {
7115        &mut self.0
7116    }
7117}
7118impl HumanName {
7119    /// Start building an instance.
7120    #[cfg(feature = "builders")]
7121    #[must_use]
7122    pub fn builder() -> HumanNameBuilder {
7123        HumanNameBuilder::default()
7124    }
7125}
7126/** Identifier Type: An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers.
7127
7128 **[Identifier](http://hl7.org/fhir/StructureDefinition/Identifier) v5.0.0**
7129
7130 An identifier intended for computation
7131
7132 An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers.
7133
7134 The rules of the identifier.type  determine if a check digit is part of the ID value or sent separately, such as through the checkDigit extension. */
7135#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7136#[serde(transparent)]
7137pub struct Identifier(pub Box<IdentifierInner>);
7138/** Identifier Type: An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers.
7139
7140 **[Identifier](http://hl7.org/fhir/StructureDefinition/Identifier) v5.0.0**
7141
7142 An identifier intended for computation
7143
7144 An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers.
7145
7146 The rules of the identifier.type  determine if a check digit is part of the ID value or sent separately, such as through the checkDigit extension. */
7147#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7148#[cfg_attr(feature = "builders", derive(Builder))]
7149#[serde(rename_all = "camelCase")]
7150#[cfg_attr(
7151    feature = "builders",
7152    builder(
7153        pattern = "owned",
7154        name = "IdentifierBuilder",
7155        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
7156    )
7157)]
7158pub struct IdentifierInner {
7159    /** **Unique id for inter-element referencing**
7160
7161 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
7162
7163 */
7164    #[serde(default, skip_serializing_if = "Option::is_none")]
7165    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7166    #[serde(rename = "id")]
7167    pub id: Option<String>,
7168    /** **Additional content defined by implementations**
7169
7170 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.
7171
7172 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
7173    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7174    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7175    #[serde(rename = "extension")]
7176    pub extension: Vec<Extension>,
7177    /** **[IdentifierUse](http://hl7.org/fhir/ValueSet/identifier-use); usual | official | temp | secondary | old (If known)**
7178
7179 The purpose of this identifier.
7180
7181 Applications can assume that an identifier is permanent unless it explicitly says that it is temporary. */
7182    #[serde(default, skip_serializing_if = "Option::is_none")]
7183    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7184    #[serde(rename = "use")]
7185    pub r#use: Option<codes::IdentifierUse>,
7186    /// Extension field.
7187    #[serde(default, skip_serializing_if = "Option::is_none")]
7188    #[serde(rename = "_use")]
7189    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7190    pub r#use_ext: Option<FieldExtension>,
7191    /** **[IdentifierType](http://hl7.org/fhir/ValueSet/identifier-type); Description of identifier**
7192
7193 A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.
7194
7195 This element deals only with general categories of identifiers.  It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage.   Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type. */
7196    #[serde(default, skip_serializing_if = "Option::is_none")]
7197    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7198    #[serde(rename = "type")]
7199    pub r#type: Option<CodeableConcept>,
7200    /// Extension field.
7201    #[serde(default, skip_serializing_if = "Option::is_none")]
7202    #[serde(rename = "_type")]
7203    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7204    pub r#type_ext: Option<FieldExtension>,
7205    /** **The namespace for the identifier value**
7206
7207 Establishes the namespace for the value - that is, an absolute URL that describes a set values that are unique.
7208
7209 Identifier.system is always case sensitive. */
7210    #[serde(default, skip_serializing_if = "Option::is_none")]
7211    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7212    #[serde(rename = "system")]
7213    pub system: Option<String>,
7214    /// Extension field.
7215    #[serde(default, skip_serializing_if = "Option::is_none")]
7216    #[serde(rename = "_system")]
7217    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7218    pub system_ext: Option<FieldExtension>,
7219    /** **The value that is unique**
7220
7221 The portion of the identifier typically relevant to the user and which is unique within the context of the system.
7222
7223 If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986.  The value's primary purpose is computational mapping.  As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.)  A value formatted for human display can be conveyed using the [http://hl7.org/fhir/StructureDefinition/rendered-value](http://hl7.org/fhir/extensions/StructureDefinition-rendered-value.html)). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe. */
7224    #[serde(default, skip_serializing_if = "Option::is_none")]
7225    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7226    #[serde(rename = "value")]
7227    pub value: Option<String>,
7228    /// Extension field.
7229    #[serde(default, skip_serializing_if = "Option::is_none")]
7230    #[serde(rename = "_value")]
7231    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7232    pub value_ext: Option<FieldExtension>,
7233    /** **Time period when id is/was valid for use**
7234
7235 Time period during which identifier is/was valid for use.
7236
7237 */
7238    #[serde(default, skip_serializing_if = "Option::is_none")]
7239    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7240    #[serde(rename = "period")]
7241    pub period: Option<Period>,
7242    /// Extension field.
7243    #[serde(default, skip_serializing_if = "Option::is_none")]
7244    #[serde(rename = "_period")]
7245    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7246    pub period_ext: Option<FieldExtension>,
7247    /** **Organization that issued id (may be just text)**
7248
7249 Organization that issued/manages the identifier.
7250
7251 The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization. */
7252    #[serde(default, skip_serializing_if = "Option::is_none")]
7253    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7254    #[serde(rename = "assigner")]
7255    pub assigner: Option<Reference>,
7256    /// Extension field.
7257    #[serde(default, skip_serializing_if = "Option::is_none")]
7258    #[serde(rename = "_assigner")]
7259    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7260    pub assigner_ext: Option<FieldExtension>,
7261}
7262#[cfg(feature = "builders")]
7263impl IdentifierBuilder {
7264    #[doc = concat!("Finalize building ", "Identifier", ".")]
7265    pub fn build(self) -> Result<Identifier, crate::error::BuilderError> {
7266        self.build_inner().map(Into::into)
7267    }
7268}
7269impl From<IdentifierInner> for Identifier {
7270    fn from(inner: IdentifierInner) -> Self {
7271        Self(Box::new(inner))
7272    }
7273}
7274impl ::core::ops::Deref for Identifier {
7275    type Target = IdentifierInner;
7276    fn deref(&self) -> &Self::Target {
7277        &self.0
7278    }
7279}
7280impl ::core::ops::DerefMut for Identifier {
7281    fn deref_mut(&mut self) -> &mut Self::Target {
7282        &mut self.0
7283    }
7284}
7285impl Identifier {
7286    /// Start building an instance.
7287    #[cfg(feature = "builders")]
7288    #[must_use]
7289    pub fn builder() -> IdentifierBuilder {
7290        IdentifierBuilder::default()
7291    }
7292}
7293/** MarketingStatus Type: The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available.
7294
7295 **[MarketingStatus](http://hl7.org/fhir/StructureDefinition/MarketingStatus) v5.0.0**
7296
7297 The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available
7298
7299 The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available.
7300
7301 */
7302#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7303#[serde(transparent)]
7304pub struct MarketingStatus(pub Box<MarketingStatusInner>);
7305/** MarketingStatus Type: The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available.
7306
7307 **[MarketingStatus](http://hl7.org/fhir/StructureDefinition/MarketingStatus) v5.0.0**
7308
7309 The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available
7310
7311 The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available.
7312
7313 */
7314#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7315#[cfg_attr(feature = "builders", derive(Builder))]
7316#[serde(rename_all = "camelCase")]
7317#[cfg_attr(
7318    feature = "builders",
7319    builder(
7320        pattern = "owned",
7321        name = "MarketingStatusBuilder",
7322        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
7323    )
7324)]
7325pub struct MarketingStatusInner {
7326    /** **Unique id for inter-element referencing**
7327
7328 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
7329
7330 */
7331    #[serde(default, skip_serializing_if = "Option::is_none")]
7332    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7333    #[serde(rename = "id")]
7334    pub id: Option<String>,
7335    /** **Additional content defined by implementations**
7336
7337 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.
7338
7339 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
7340    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7341    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7342    #[serde(rename = "extension")]
7343    pub extension: Vec<Extension>,
7344    /** **Extensions that cannot be ignored even if unrecognized**
7345
7346 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.
7347
7348Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
7349
7350 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
7351    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7352    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7353    #[serde(rename = "modifierExtension")]
7354    pub modifier_extension: Vec<Extension>,
7355    /** **The country in which the marketing authorization has been granted shall be specified It should be specified using the ISO 3166 ‑ 1 alpha-2 code elements**
7356
7357 The country in which the marketing authorization has been granted shall be specified It should be specified using the ISO 3166 ‑ 1 alpha-2 code elements.
7358
7359 */
7360    #[serde(default, skip_serializing_if = "Option::is_none")]
7361    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7362    #[serde(rename = "country")]
7363    pub country: Option<CodeableConcept>,
7364    /// Extension field.
7365    #[serde(default, skip_serializing_if = "Option::is_none")]
7366    #[serde(rename = "_country")]
7367    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7368    pub country_ext: Option<FieldExtension>,
7369    /** **Where a Medicines Regulatory Agency has granted a marketing authorization for which specific provisions within a jurisdiction apply, the jurisdiction can be specified using an appropriate controlled terminology The controlled term and the controlled term identifier shall be specified**
7370
7371 Where a Medicines Regulatory Agency has granted a marketing authorization for which specific provisions within a jurisdiction apply, the jurisdiction can be specified using an appropriate controlled terminology The controlled term and the controlled term identifier shall be specified.
7372
7373 */
7374    #[serde(default, skip_serializing_if = "Option::is_none")]
7375    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7376    #[serde(rename = "jurisdiction")]
7377    pub jurisdiction: Option<CodeableConcept>,
7378    /// Extension field.
7379    #[serde(default, skip_serializing_if = "Option::is_none")]
7380    #[serde(rename = "_jurisdiction")]
7381    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7382    pub jurisdiction_ext: Option<FieldExtension>,
7383    /** **This attribute provides information on the status of the marketing of the medicinal product See ISO/TS 20443 for more information and examples**
7384
7385 This attribute provides information on the status of the marketing of the medicinal product See ISO/TS 20443 for more information and examples.
7386
7387 */
7388    #[serde(rename = "status")]
7389    pub status: CodeableConcept,
7390    /// Extension field.
7391    #[serde(default, skip_serializing_if = "Option::is_none")]
7392    #[serde(rename = "_status")]
7393    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7394    pub status_ext: Option<FieldExtension>,
7395    /** **The date when the Medicinal Product is placed on the market by the Marketing Authorization Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain**
7396
7397 The date when the Medicinal Product is placed on the market by the Marketing Authorization Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain.
7398
7399 */
7400    #[serde(default, skip_serializing_if = "Option::is_none")]
7401    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7402    #[serde(rename = "dateRange")]
7403    pub date_range: Option<Period>,
7404    /// Extension field.
7405    #[serde(default, skip_serializing_if = "Option::is_none")]
7406    #[serde(rename = "_dateRange")]
7407    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7408    pub date_range_ext: Option<FieldExtension>,
7409    /** **The date when the Medicinal Product is placed on the market by the Marketing Authorization Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain**
7410
7411 The date when the Medicinal Product is placed on the market by the Marketing Authorization Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain.
7412
7413 */
7414    #[serde(default, skip_serializing_if = "Option::is_none")]
7415    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7416    #[serde(rename = "restoreDate")]
7417    pub restore_date: Option<DateTime>,
7418    /// Extension field.
7419    #[serde(default, skip_serializing_if = "Option::is_none")]
7420    #[serde(rename = "_restoreDate")]
7421    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7422    pub restore_date_ext: Option<FieldExtension>,
7423}
7424#[cfg(feature = "builders")]
7425impl MarketingStatusBuilder {
7426    #[doc = concat!("Finalize building ", "MarketingStatus", ".")]
7427    pub fn build(self) -> Result<MarketingStatus, crate::error::BuilderError> {
7428        self.build_inner().map(Into::into)
7429    }
7430}
7431impl From<MarketingStatusInner> for MarketingStatus {
7432    fn from(inner: MarketingStatusInner) -> Self {
7433        Self(Box::new(inner))
7434    }
7435}
7436impl ::core::ops::Deref for MarketingStatus {
7437    type Target = MarketingStatusInner;
7438    fn deref(&self) -> &Self::Target {
7439        &self.0
7440    }
7441}
7442impl ::core::ops::DerefMut for MarketingStatus {
7443    fn deref_mut(&mut self) -> &mut Self::Target {
7444        &mut self.0
7445    }
7446}
7447impl MarketingStatus {
7448    /// Start building an instance.
7449    #[cfg(feature = "builders")]
7450    #[must_use]
7451    pub fn builder() -> MarketingStatusBuilder {
7452        MarketingStatusBuilder::default()
7453    }
7454}
7455/** Meta Type: The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
7456
7457 **[Meta](http://hl7.org/fhir/StructureDefinition/Meta) v5.0.0**
7458
7459 Metadata about a resource
7460
7461 The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
7462
7463 */
7464#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7465#[serde(transparent)]
7466pub struct Meta(pub Box<MetaInner>);
7467/** Meta Type: The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
7468
7469 **[Meta](http://hl7.org/fhir/StructureDefinition/Meta) v5.0.0**
7470
7471 Metadata about a resource
7472
7473 The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
7474
7475 */
7476#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7477#[cfg_attr(feature = "builders", derive(Builder))]
7478#[serde(rename_all = "camelCase")]
7479#[cfg_attr(
7480    feature = "builders",
7481    builder(
7482        pattern = "owned",
7483        name = "MetaBuilder",
7484        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
7485    )
7486)]
7487pub struct MetaInner {
7488    /** **Unique id for inter-element referencing**
7489
7490 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
7491
7492 */
7493    #[serde(default, skip_serializing_if = "Option::is_none")]
7494    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7495    #[serde(rename = "id")]
7496    pub id: Option<String>,
7497    /** **Additional content defined by implementations**
7498
7499 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.
7500
7501 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
7502    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7503    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7504    #[serde(rename = "extension")]
7505    pub extension: Vec<Extension>,
7506    /** **Version specific identifier**
7507
7508 The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.
7509
7510 The server assigns this value, and ignores what the client specifies, except in the case that the server is imposing version integrity on updates/deletes. */
7511    #[serde(default, skip_serializing_if = "Option::is_none")]
7512    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7513    #[serde(rename = "versionId")]
7514    pub version_id: Option<String>,
7515    /// Extension field.
7516    #[serde(default, skip_serializing_if = "Option::is_none")]
7517    #[serde(rename = "_versionId")]
7518    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7519    pub version_id_ext: Option<FieldExtension>,
7520    /** **When the resource version last changed**
7521
7522 When the resource last changed - e.g. when the version changed.
7523
7524 This element is generally omitted in instances submitted in a PUT or POST. Instead, it is populated in the response instance and when retrieving information using a GET. The server / resource manager sets this value; what a client provides is irrelevant. This is equivalent to the HTTP Last-Modified and SHOULD have the same value on a [read](http.html#read) interaction. */
7525    #[serde(default, skip_serializing_if = "Option::is_none")]
7526    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7527    #[serde(rename = "lastUpdated")]
7528    pub last_updated: Option<Instant>,
7529    /// Extension field.
7530    #[serde(default, skip_serializing_if = "Option::is_none")]
7531    #[serde(rename = "_lastUpdated")]
7532    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7533    pub last_updated_ext: Option<FieldExtension>,
7534    /** **Identifies where the resource comes from**
7535
7536 A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.
7537
7538 The exact use of the source (and the possible implied Provenance.entity.role and agent.role) is left to implementer discretion. Only one nominated source is allowed; for additional provenance details, a full Provenance resource should be used. The source may correspond to Provenance.entity.what[x] or Provenance.agent.who[x], though it may be a more general or abstract reference.
7539
7540This element can be used to indicate where the current master source of a resource that has a canonical URL if the resource is no longer hosted at the canonical URL. */
7541    #[serde(default, skip_serializing_if = "Option::is_none")]
7542    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7543    #[serde(rename = "source")]
7544    pub source: Option<String>,
7545    /// Extension field.
7546    #[serde(default, skip_serializing_if = "Option::is_none")]
7547    #[serde(rename = "_source")]
7548    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7549    pub source_ext: Option<FieldExtension>,
7550    /** **Profiles this resource claims to conform to**
7551
7552 A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition-definitions.html#StructureDefinition.url).
7553
7554 It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time.  The list of profile URLs is a set. */
7555    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7556    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7557    #[serde(rename = "profile")]
7558    pub profile: Vec<Option<String>>,
7559    /// Extension field.
7560    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7561    #[serde(rename = "_profile")]
7562    #[cfg_attr(feature = "builders", builder(default))]
7563    pub profile_ext: Vec<Option<FieldExtension>>,
7564    /** **[SecurityLabels](http://hl7.org/fhir/ValueSet/security-labels); Security Labels applied to this resource**
7565
7566 Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.
7567
7568 The security labels can be updated without changing the stated version of the resource. The list of security labels is a set. Uniqueness is based the system/code, and version and display are ignored. */
7569    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7570    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7571    #[serde(rename = "security")]
7572    pub security: Vec<Option<Coding>>,
7573    /// Extension field.
7574    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7575    #[serde(rename = "_security")]
7576    #[cfg_attr(feature = "builders", builder(default))]
7577    pub security_ext: Vec<Option<FieldExtension>>,
7578    /** **[Tags](http://hl7.org/fhir/ValueSet/common-tags); Tags applied to this resource**
7579
7580 Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.
7581
7582 The tags can be updated without changing the stated version of the resource. The list of tags is a set. Uniqueness is based the system/code, and version and display are ignored. */
7583    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7584    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7585    #[serde(rename = "tag")]
7586    pub tag: Vec<Option<Coding>>,
7587    /// Extension field.
7588    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7589    #[serde(rename = "_tag")]
7590    #[cfg_attr(feature = "builders", builder(default))]
7591    pub tag_ext: Vec<Option<FieldExtension>>,
7592}
7593#[cfg(feature = "builders")]
7594impl MetaBuilder {
7595    #[doc = concat!("Finalize building ", "Meta", ".")]
7596    pub fn build(self) -> Result<Meta, crate::error::BuilderError> {
7597        self.build_inner().map(Into::into)
7598    }
7599}
7600impl From<MetaInner> for Meta {
7601    fn from(inner: MetaInner) -> Self {
7602        Self(Box::new(inner))
7603    }
7604}
7605impl ::core::ops::Deref for Meta {
7606    type Target = MetaInner;
7607    fn deref(&self) -> &Self::Target {
7608        &self.0
7609    }
7610}
7611impl ::core::ops::DerefMut for Meta {
7612    fn deref_mut(&mut self) -> &mut Self::Target {
7613        &mut self.0
7614    }
7615}
7616impl Meta {
7617    /// Start building an instance.
7618    #[cfg(feature = "builders")]
7619    #[must_use]
7620    pub fn builder() -> MetaBuilder {
7621        MetaBuilder::default()
7622    }
7623}
7624/** MonetaryComponent Type: Availability data for an {item}.
7625
7626 **[MonetaryComponent](http://hl7.org/fhir/StructureDefinition/MonetaryComponent) v5.0.0**
7627
7628 Availability data for an {item}
7629
7630 Availability data for an {item}.
7631
7632 */
7633#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7634#[serde(transparent)]
7635pub struct MonetaryComponent(pub Box<MonetaryComponentInner>);
7636/** MonetaryComponent Type: Availability data for an {item}.
7637
7638 **[MonetaryComponent](http://hl7.org/fhir/StructureDefinition/MonetaryComponent) v5.0.0**
7639
7640 Availability data for an {item}
7641
7642 Availability data for an {item}.
7643
7644 */
7645#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7646#[cfg_attr(feature = "builders", derive(Builder))]
7647#[serde(rename_all = "camelCase")]
7648#[cfg_attr(
7649    feature = "builders",
7650    builder(
7651        pattern = "owned",
7652        name = "MonetaryComponentBuilder",
7653        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
7654    )
7655)]
7656pub struct MonetaryComponentInner {
7657    /** **Unique id for inter-element referencing**
7658
7659 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
7660
7661 */
7662    #[serde(default, skip_serializing_if = "Option::is_none")]
7663    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7664    #[serde(rename = "id")]
7665    pub id: Option<String>,
7666    /** **Additional content defined by implementations**
7667
7668 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.
7669
7670 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
7671    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7672    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7673    #[serde(rename = "extension")]
7674    pub extension: Vec<Extension>,
7675    /** **[PriceComponentType](http://hl7.org/fhir/ValueSet/price-component-type); base | surcharge | deduction | discount | tax | informational**
7676
7677 base | surcharge | deduction | discount | tax | informational.
7678
7679 */
7680    #[serde(rename = "type")]
7681    pub r#type: codes::PriceComponentType,
7682    /// Extension field.
7683    #[serde(default, skip_serializing_if = "Option::is_none")]
7684    #[serde(rename = "_type")]
7685    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7686    pub r#type_ext: Option<FieldExtension>,
7687    /** **[PriceComponentCode](); Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc.**
7688
7689 Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc.
7690
7691 */
7692    #[serde(default, skip_serializing_if = "Option::is_none")]
7693    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7694    #[serde(rename = "code")]
7695    pub code: Option<CodeableConcept>,
7696    /// Extension field.
7697    #[serde(default, skip_serializing_if = "Option::is_none")]
7698    #[serde(rename = "_code")]
7699    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7700    pub code_ext: Option<FieldExtension>,
7701    /** **Factor used for calculating this component**
7702
7703 Factor used for calculating this component.
7704
7705 */
7706    #[serde(default, skip_serializing_if = "Option::is_none")]
7707    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7708    #[serde(rename = "factor")]
7709    pub factor: Option<f64>,
7710    /// Extension field.
7711    #[serde(default, skip_serializing_if = "Option::is_none")]
7712    #[serde(rename = "_factor")]
7713    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7714    pub factor_ext: Option<FieldExtension>,
7715    /** **Explicit value amount to be used**
7716
7717 Explicit value amount to be used.
7718
7719 */
7720    #[serde(default, skip_serializing_if = "Option::is_none")]
7721    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7722    #[serde(rename = "amount")]
7723    pub amount: Option<Money>,
7724    /// Extension field.
7725    #[serde(default, skip_serializing_if = "Option::is_none")]
7726    #[serde(rename = "_amount")]
7727    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7728    pub amount_ext: Option<FieldExtension>,
7729}
7730#[cfg(feature = "builders")]
7731impl MonetaryComponentBuilder {
7732    #[doc = concat!("Finalize building ", "MonetaryComponent", ".")]
7733    pub fn build(self) -> Result<MonetaryComponent, crate::error::BuilderError> {
7734        self.build_inner().map(Into::into)
7735    }
7736}
7737impl From<MonetaryComponentInner> for MonetaryComponent {
7738    fn from(inner: MonetaryComponentInner) -> Self {
7739        Self(Box::new(inner))
7740    }
7741}
7742impl ::core::ops::Deref for MonetaryComponent {
7743    type Target = MonetaryComponentInner;
7744    fn deref(&self) -> &Self::Target {
7745        &self.0
7746    }
7747}
7748impl ::core::ops::DerefMut for MonetaryComponent {
7749    fn deref_mut(&mut self) -> &mut Self::Target {
7750        &mut self.0
7751    }
7752}
7753impl MonetaryComponent {
7754    /// Start building an instance.
7755    #[cfg(feature = "builders")]
7756    #[must_use]
7757    pub fn builder() -> MonetaryComponentBuilder {
7758        MonetaryComponentBuilder::default()
7759    }
7760}
7761/** Money Type: An amount of economic utility in some recognized currency.
7762
7763 **[Money](http://hl7.org/fhir/StructureDefinition/Money) v5.0.0**
7764
7765 An amount of economic utility in some recognized currency
7766
7767 An amount of economic utility in some recognized currency.
7768
7769 */
7770#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7771#[serde(transparent)]
7772pub struct Money(pub Box<MoneyInner>);
7773/** Money Type: An amount of economic utility in some recognized currency.
7774
7775 **[Money](http://hl7.org/fhir/StructureDefinition/Money) v5.0.0**
7776
7777 An amount of economic utility in some recognized currency
7778
7779 An amount of economic utility in some recognized currency.
7780
7781 */
7782#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7783#[cfg_attr(feature = "builders", derive(Builder))]
7784#[serde(rename_all = "camelCase")]
7785#[cfg_attr(
7786    feature = "builders",
7787    builder(
7788        pattern = "owned",
7789        name = "MoneyBuilder",
7790        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
7791    )
7792)]
7793pub struct MoneyInner {
7794    /** **Unique id for inter-element referencing**
7795
7796 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
7797
7798 */
7799    #[serde(default, skip_serializing_if = "Option::is_none")]
7800    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7801    #[serde(rename = "id")]
7802    pub id: Option<String>,
7803    /** **Additional content defined by implementations**
7804
7805 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.
7806
7807 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
7808    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7809    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7810    #[serde(rename = "extension")]
7811    pub extension: Vec<Extension>,
7812    /** **Numerical value (with implicit precision)**
7813
7814 Numerical value (with implicit precision).
7815
7816 Monetary values have their own rules for handling precision (refer to standard accounting text books). */
7817    #[serde(default, skip_serializing_if = "Option::is_none")]
7818    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7819    #[serde(rename = "value")]
7820    pub value: Option<f64>,
7821    /// Extension field.
7822    #[serde(default, skip_serializing_if = "Option::is_none")]
7823    #[serde(rename = "_value")]
7824    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7825    pub value_ext: Option<FieldExtension>,
7826    /** **[CurrencyCode](http://hl7.org/fhir/ValueSet/currencies); ISO 4217 Currency Code**
7827
7828 ISO 4217 Currency Code.
7829
7830 */
7831    #[serde(default, skip_serializing_if = "Option::is_none")]
7832    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7833    #[serde(rename = "currency")]
7834    pub currency: Option<String>,
7835    /// Extension field.
7836    #[serde(default, skip_serializing_if = "Option::is_none")]
7837    #[serde(rename = "_currency")]
7838    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7839    pub currency_ext: Option<FieldExtension>,
7840}
7841#[cfg(feature = "builders")]
7842impl MoneyBuilder {
7843    #[doc = concat!("Finalize building ", "Money", ".")]
7844    pub fn build(self) -> Result<Money, crate::error::BuilderError> {
7845        self.build_inner().map(Into::into)
7846    }
7847}
7848impl From<MoneyInner> for Money {
7849    fn from(inner: MoneyInner) -> Self {
7850        Self(Box::new(inner))
7851    }
7852}
7853impl ::core::ops::Deref for Money {
7854    type Target = MoneyInner;
7855    fn deref(&self) -> &Self::Target {
7856        &self.0
7857    }
7858}
7859impl ::core::ops::DerefMut for Money {
7860    fn deref_mut(&mut self) -> &mut Self::Target {
7861        &mut self.0
7862    }
7863}
7864impl Money {
7865    /// Start building an instance.
7866    #[cfg(feature = "builders")]
7867    #[must_use]
7868    pub fn builder() -> MoneyBuilder {
7869        MoneyBuilder::default()
7870    }
7871}
7872/** Narrative Type: A human-readable summary of the resource conveying the essential clinical and business information for the resource.
7873
7874 **[Narrative](http://hl7.org/fhir/StructureDefinition/Narrative) v5.0.0**
7875
7876 Human-readable summary of the resource (essential clinical and business information)
7877
7878 A human-readable summary of the resource conveying the essential clinical and business information for the resource.
7879
7880 */
7881#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7882#[serde(transparent)]
7883pub struct Narrative(pub Box<NarrativeInner>);
7884/** Narrative Type: A human-readable summary of the resource conveying the essential clinical and business information for the resource.
7885
7886 **[Narrative](http://hl7.org/fhir/StructureDefinition/Narrative) v5.0.0**
7887
7888 Human-readable summary of the resource (essential clinical and business information)
7889
7890 A human-readable summary of the resource conveying the essential clinical and business information for the resource.
7891
7892 */
7893#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7894#[cfg_attr(feature = "builders", derive(Builder))]
7895#[serde(rename_all = "camelCase")]
7896#[cfg_attr(
7897    feature = "builders",
7898    builder(
7899        pattern = "owned",
7900        name = "NarrativeBuilder",
7901        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
7902    )
7903)]
7904pub struct NarrativeInner {
7905    /** **Unique id for inter-element referencing**
7906
7907 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
7908
7909 */
7910    #[serde(default, skip_serializing_if = "Option::is_none")]
7911    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7912    #[serde(rename = "id")]
7913    pub id: Option<String>,
7914    /** **Additional content defined by implementations**
7915
7916 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.
7917
7918 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
7919    #[serde(default, skip_serializing_if = "Vec::is_empty")]
7920    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7921    #[serde(rename = "extension")]
7922    pub extension: Vec<Extension>,
7923    /** **[NarrativeStatus](http://hl7.org/fhir/ValueSet/narrative-status); generated | extensions | additional | empty**
7924
7925 The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.
7926
7927 */
7928    #[serde(rename = "status")]
7929    pub status: codes::NarrativeStatus,
7930    /// Extension field.
7931    #[serde(default, skip_serializing_if = "Option::is_none")]
7932    #[serde(rename = "_status")]
7933    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7934    pub status_ext: Option<FieldExtension>,
7935    /** **Limited xhtml content**
7936
7937 The actual narrative content, a stripped down version of XHTML.
7938
7939 The contents of the html element are an XHTML fragment containing only the basic html formatting elements described in chapters 7-11 and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained stylesheets. The XHTML content SHALL NOT contain a head, a body, external stylesheet references, scripts, forms, base/link/xlink, frames, iframes and objects. */
7940    #[serde(rename = "div")]
7941    pub div: String,
7942    /// Extension field.
7943    #[serde(default, skip_serializing_if = "Option::is_none")]
7944    #[serde(rename = "_div")]
7945    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
7946    pub div_ext: Option<FieldExtension>,
7947}
7948#[cfg(feature = "builders")]
7949impl NarrativeBuilder {
7950    #[doc = concat!("Finalize building ", "Narrative", ".")]
7951    pub fn build(self) -> Result<Narrative, crate::error::BuilderError> {
7952        self.build_inner().map(Into::into)
7953    }
7954}
7955impl From<NarrativeInner> for Narrative {
7956    fn from(inner: NarrativeInner) -> Self {
7957        Self(Box::new(inner))
7958    }
7959}
7960impl ::core::ops::Deref for Narrative {
7961    type Target = NarrativeInner;
7962    fn deref(&self) -> &Self::Target {
7963        &self.0
7964    }
7965}
7966impl ::core::ops::DerefMut for Narrative {
7967    fn deref_mut(&mut self) -> &mut Self::Target {
7968        &mut self.0
7969    }
7970}
7971impl Narrative {
7972    /// Start building an instance.
7973    #[cfg(feature = "builders")]
7974    #[must_use]
7975    pub fn builder() -> NarrativeBuilder {
7976        NarrativeBuilder::default()
7977    }
7978}
7979/** ParameterDefinition Type: The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.
7980
7981 **[ParameterDefinition](http://hl7.org/fhir/StructureDefinition/ParameterDefinition) v5.0.0**
7982
7983 Definition of a parameter to a module
7984
7985 The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.
7986
7987 */
7988#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7989#[serde(transparent)]
7990pub struct ParameterDefinition(pub Box<ParameterDefinitionInner>);
7991/** ParameterDefinition Type: The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.
7992
7993 **[ParameterDefinition](http://hl7.org/fhir/StructureDefinition/ParameterDefinition) v5.0.0**
7994
7995 Definition of a parameter to a module
7996
7997 The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.
7998
7999 */
8000#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8001#[cfg_attr(feature = "builders", derive(Builder))]
8002#[serde(rename_all = "camelCase")]
8003#[cfg_attr(
8004    feature = "builders",
8005    builder(
8006        pattern = "owned",
8007        name = "ParameterDefinitionBuilder",
8008        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
8009    )
8010)]
8011pub struct ParameterDefinitionInner {
8012    /** **Unique id for inter-element referencing**
8013
8014 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
8015
8016 */
8017    #[serde(default, skip_serializing_if = "Option::is_none")]
8018    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8019    #[serde(rename = "id")]
8020    pub id: Option<String>,
8021    /** **Additional content defined by implementations**
8022
8023 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.
8024
8025 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
8026    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8027    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8028    #[serde(rename = "extension")]
8029    pub extension: Vec<Extension>,
8030    /** **Name used to access the parameter value**
8031
8032 The name of the parameter used to allow access to the value of the parameter in evaluation contexts.
8033
8034 */
8035    #[serde(default, skip_serializing_if = "Option::is_none")]
8036    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8037    #[serde(rename = "name")]
8038    pub name: Option<String>,
8039    /// Extension field.
8040    #[serde(default, skip_serializing_if = "Option::is_none")]
8041    #[serde(rename = "_name")]
8042    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8043    pub name_ext: Option<FieldExtension>,
8044    /** **[ParameterUse](http://hl7.org/fhir/ValueSet/operation-parameter-use); in | out**
8045
8046 Whether the parameter is input or output for the module.
8047
8048 */
8049    #[serde(rename = "use")]
8050    pub r#use: codes::OperationParameterUse,
8051    /// Extension field.
8052    #[serde(default, skip_serializing_if = "Option::is_none")]
8053    #[serde(rename = "_use")]
8054    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8055    pub r#use_ext: Option<FieldExtension>,
8056    /** **Minimum cardinality**
8057
8058 The minimum number of times this parameter SHALL appear in the request or response.
8059
8060 */
8061    #[serde(default, skip_serializing_if = "Option::is_none")]
8062    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8063    #[serde(rename = "min")]
8064    pub min: Option<i32>,
8065    /// Extension field.
8066    #[serde(default, skip_serializing_if = "Option::is_none")]
8067    #[serde(rename = "_min")]
8068    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8069    pub min_ext: Option<FieldExtension>,
8070    /** **Maximum cardinality (a number of *)**
8071
8072 The maximum number of times this element is permitted to appear in the request or response.
8073
8074 */
8075    #[serde(default, skip_serializing_if = "Option::is_none")]
8076    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8077    #[serde(rename = "max")]
8078    pub max: Option<String>,
8079    /// Extension field.
8080    #[serde(default, skip_serializing_if = "Option::is_none")]
8081    #[serde(rename = "_max")]
8082    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8083    pub max_ext: Option<FieldExtension>,
8084    /** **A brief description of the parameter**
8085
8086 A brief discussion of what the parameter is for and how it is used by the module.
8087
8088 */
8089    #[serde(default, skip_serializing_if = "Option::is_none")]
8090    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8091    #[serde(rename = "documentation")]
8092    pub documentation: Option<String>,
8093    /// Extension field.
8094    #[serde(default, skip_serializing_if = "Option::is_none")]
8095    #[serde(rename = "_documentation")]
8096    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8097    pub documentation_ext: Option<FieldExtension>,
8098    /** **[FHIRTypes](http://hl7.org/fhir/ValueSet/fhir-types); What type of value**
8099
8100 The type of the parameter.
8101
8102 */
8103    #[serde(rename = "type")]
8104    pub r#type: codes::FHIRTypes,
8105    /// Extension field.
8106    #[serde(default, skip_serializing_if = "Option::is_none")]
8107    #[serde(rename = "_type")]
8108    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8109    pub r#type_ext: Option<FieldExtension>,
8110    /** **What profile the value is expected to be**
8111
8112 If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.
8113
8114 */
8115    #[serde(default, skip_serializing_if = "Option::is_none")]
8116    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8117    #[serde(rename = "profile")]
8118    pub profile: Option<String>,
8119    /// Extension field.
8120    #[serde(default, skip_serializing_if = "Option::is_none")]
8121    #[serde(rename = "_profile")]
8122    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8123    pub profile_ext: Option<FieldExtension>,
8124}
8125#[cfg(feature = "builders")]
8126impl ParameterDefinitionBuilder {
8127    #[doc = concat!("Finalize building ", "ParameterDefinition", ".")]
8128    pub fn build(self) -> Result<ParameterDefinition, crate::error::BuilderError> {
8129        self.build_inner().map(Into::into)
8130    }
8131}
8132impl From<ParameterDefinitionInner> for ParameterDefinition {
8133    fn from(inner: ParameterDefinitionInner) -> Self {
8134        Self(Box::new(inner))
8135    }
8136}
8137impl ::core::ops::Deref for ParameterDefinition {
8138    type Target = ParameterDefinitionInner;
8139    fn deref(&self) -> &Self::Target {
8140        &self.0
8141    }
8142}
8143impl ::core::ops::DerefMut for ParameterDefinition {
8144    fn deref_mut(&mut self) -> &mut Self::Target {
8145        &mut self.0
8146    }
8147}
8148impl ParameterDefinition {
8149    /// Start building an instance.
8150    #[cfg(feature = "builders")]
8151    #[must_use]
8152    pub fn builder() -> ParameterDefinitionBuilder {
8153        ParameterDefinitionBuilder::default()
8154    }
8155}
8156/** Period Type: A time period defined by a start and end date and optionally time.
8157
8158 **[Period](http://hl7.org/fhir/StructureDefinition/Period) v5.0.0**
8159
8160 Time range defined by start and end date/time
8161
8162 A time period defined by a start and end date and optionally time.
8163
8164 A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. "the patient was an inpatient of the hospital for this time range") or one value from the range applies (e.g. "give to the patient between these two times").
8165
8166Period is not used for a duration (a measure of elapsed time). See [Duration](datatypes.html#Duration). */
8167#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8168#[serde(transparent)]
8169pub struct Period(pub Box<PeriodInner>);
8170/** Period Type: A time period defined by a start and end date and optionally time.
8171
8172 **[Period](http://hl7.org/fhir/StructureDefinition/Period) v5.0.0**
8173
8174 Time range defined by start and end date/time
8175
8176 A time period defined by a start and end date and optionally time.
8177
8178 A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. "the patient was an inpatient of the hospital for this time range") or one value from the range applies (e.g. "give to the patient between these two times").
8179
8180Period is not used for a duration (a measure of elapsed time). See [Duration](datatypes.html#Duration). */
8181#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8182#[cfg_attr(feature = "builders", derive(Builder))]
8183#[serde(rename_all = "camelCase")]
8184#[cfg_attr(
8185    feature = "builders",
8186    builder(
8187        pattern = "owned",
8188        name = "PeriodBuilder",
8189        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
8190    )
8191)]
8192pub struct PeriodInner {
8193    /** **Unique id for inter-element referencing**
8194
8195 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
8196
8197 */
8198    #[serde(default, skip_serializing_if = "Option::is_none")]
8199    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8200    #[serde(rename = "id")]
8201    pub id: Option<String>,
8202    /** **Additional content defined by implementations**
8203
8204 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.
8205
8206 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
8207    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8208    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8209    #[serde(rename = "extension")]
8210    pub extension: Vec<Extension>,
8211    /** **Starting time with inclusive boundary**
8212
8213 The start of the period. The boundary is inclusive.
8214
8215 If the low element is missing, the meaning is that the low boundary is not known. */
8216    #[serde(default, skip_serializing_if = "Option::is_none")]
8217    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8218    #[serde(rename = "start")]
8219    pub start: Option<DateTime>,
8220    /// Extension field.
8221    #[serde(default, skip_serializing_if = "Option::is_none")]
8222    #[serde(rename = "_start")]
8223    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8224    pub start_ext: Option<FieldExtension>,
8225    /** **End time with inclusive boundary, if not ongoing**
8226
8227 The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.
8228
8229 The end value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has an end value of 2012-02-03. */
8230    #[serde(default, skip_serializing_if = "Option::is_none")]
8231    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8232    #[serde(rename = "end")]
8233    pub end: Option<DateTime>,
8234    /// Extension field.
8235    #[serde(default, skip_serializing_if = "Option::is_none")]
8236    #[serde(rename = "_end")]
8237    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8238    pub end_ext: Option<FieldExtension>,
8239}
8240#[cfg(feature = "builders")]
8241impl PeriodBuilder {
8242    #[doc = concat!("Finalize building ", "Period", ".")]
8243    pub fn build(self) -> Result<Period, crate::error::BuilderError> {
8244        self.build_inner().map(Into::into)
8245    }
8246}
8247impl From<PeriodInner> for Period {
8248    fn from(inner: PeriodInner) -> Self {
8249        Self(Box::new(inner))
8250    }
8251}
8252impl ::core::ops::Deref for Period {
8253    type Target = PeriodInner;
8254    fn deref(&self) -> &Self::Target {
8255        &self.0
8256    }
8257}
8258impl ::core::ops::DerefMut for Period {
8259    fn deref_mut(&mut self) -> &mut Self::Target {
8260        &mut self.0
8261    }
8262}
8263impl Period {
8264    /// Start building an instance.
8265    #[cfg(feature = "builders")]
8266    #[must_use]
8267    pub fn builder() -> PeriodBuilder {
8268        PeriodBuilder::default()
8269    }
8270}
8271/** ProductShelfLife Type: The shelf-life and storage information for a medicinal product item or container can be described using this class.
8272
8273 **[ProductShelfLife](http://hl7.org/fhir/StructureDefinition/ProductShelfLife) v5.0.0**
8274
8275 The shelf-life and storage information for a medicinal product item or container can be described using this class
8276
8277 The shelf-life and storage information for a medicinal product item or container can be described using this class.
8278
8279 */
8280#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8281#[serde(transparent)]
8282pub struct ProductShelfLife(pub Box<ProductShelfLifeInner>);
8283/** ProductShelfLife Type: The shelf-life and storage information for a medicinal product item or container can be described using this class.
8284
8285 **[ProductShelfLife](http://hl7.org/fhir/StructureDefinition/ProductShelfLife) v5.0.0**
8286
8287 The shelf-life and storage information for a medicinal product item or container can be described using this class
8288
8289 The shelf-life and storage information for a medicinal product item or container can be described using this class.
8290
8291 */
8292#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8293#[cfg_attr(feature = "builders", derive(Builder))]
8294#[serde(rename_all = "camelCase")]
8295#[cfg_attr(
8296    feature = "builders",
8297    builder(
8298        pattern = "owned",
8299        name = "ProductShelfLifeBuilder",
8300        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
8301    )
8302)]
8303pub struct ProductShelfLifeInner {
8304    /** **Unique id for inter-element referencing**
8305
8306 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
8307
8308 */
8309    #[serde(default, skip_serializing_if = "Option::is_none")]
8310    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8311    #[serde(rename = "id")]
8312    pub id: Option<String>,
8313    /** **Additional content defined by implementations**
8314
8315 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.
8316
8317 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
8318    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8319    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8320    #[serde(rename = "extension")]
8321    pub extension: Vec<Extension>,
8322    /** **Extensions that cannot be ignored even if unrecognized**
8323
8324 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.
8325
8326Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
8327
8328 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
8329    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8330    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8331    #[serde(rename = "modifierExtension")]
8332    pub modifier_extension: Vec<Extension>,
8333    /** **This describes the shelf life, taking into account various scenarios such as shelf life of the packaged Medicinal Product itself, shelf life after transformation where necessary and shelf life after the first opening of a bottle, etc. The shelf life type shall be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified**
8334
8335 This describes the shelf life, taking into account various scenarios such as shelf life of the packaged Medicinal Product itself, shelf life after transformation where necessary and shelf life after the first opening of a bottle, etc. The shelf life type shall be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified.
8336
8337 */
8338    #[serde(default, skip_serializing_if = "Option::is_none")]
8339    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8340    #[serde(rename = "type")]
8341    pub r#type: Option<CodeableConcept>,
8342    /// Extension field.
8343    #[serde(default, skip_serializing_if = "Option::is_none")]
8344    #[serde(rename = "_type")]
8345    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8346    pub r#type_ext: Option<FieldExtension>,
8347    /** **The shelf life time period can be specified using a numerical value for the period of time and its unit of time measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used**
8348
8349 The shelf life time period can be specified using a numerical value for the period of time and its unit of time measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.
8350
8351 */
8352    #[serde(default, skip_serializing_if = "Option::is_none")]
8353    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8354    #[serde(flatten)]
8355    pub period: Option<ProductShelfLifePeriod>,
8356    /// Extension field.
8357    #[serde(default, skip_serializing_if = "Option::is_none")]
8358    #[serde(flatten)]
8359    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8360    pub period_ext: Option<ProductShelfLifePeriodExtension>,
8361    /** **Special precautions for storage, if any, can be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified**
8362
8363 Special precautions for storage, if any, can be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified.
8364
8365 */
8366    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8367    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8368    #[serde(rename = "specialPrecautionsForStorage")]
8369    pub special_precautions_for_storage: Vec<Option<CodeableConcept>>,
8370    /// Extension field.
8371    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8372    #[serde(rename = "_specialPrecautionsForStorage")]
8373    #[cfg_attr(feature = "builders", builder(default))]
8374    pub special_precautions_for_storage_ext: Vec<Option<FieldExtension>>,
8375}
8376#[cfg(feature = "builders")]
8377impl ProductShelfLifeBuilder {
8378    #[doc = concat!("Finalize building ", "ProductShelfLife", ".")]
8379    pub fn build(self) -> Result<ProductShelfLife, crate::error::BuilderError> {
8380        self.build_inner().map(Into::into)
8381    }
8382}
8383impl From<ProductShelfLifeInner> for ProductShelfLife {
8384    fn from(inner: ProductShelfLifeInner) -> Self {
8385        Self(Box::new(inner))
8386    }
8387}
8388impl ::core::ops::Deref for ProductShelfLife {
8389    type Target = ProductShelfLifeInner;
8390    fn deref(&self) -> &Self::Target {
8391        &self.0
8392    }
8393}
8394impl ::core::ops::DerefMut for ProductShelfLife {
8395    fn deref_mut(&mut self) -> &mut Self::Target {
8396        &mut self.0
8397    }
8398}
8399impl ProductShelfLife {
8400    /// Start building an instance.
8401    #[cfg(feature = "builders")]
8402    #[must_use]
8403    pub fn builder() -> ProductShelfLifeBuilder {
8404        ProductShelfLifeBuilder::default()
8405    }
8406}
8407/// Choice of types for the period[x] field in ProductShelfLife
8408#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8409#[serde(rename_all = "camelCase")]
8410pub enum ProductShelfLifePeriod {
8411    /// Variant accepting the Duration type.
8412    #[serde(rename = "periodDuration")]
8413    Duration(Duration),
8414    /// Variant accepting the String type.
8415    #[serde(rename = "periodString")]
8416    String(String),
8417}
8418/// Extension value for ProductShelfLifePeriod.
8419#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8420#[serde(rename_all = "camelCase")]
8421pub enum ProductShelfLifePeriodExtension {
8422    /// Variant accepting the Duration extension.
8423    #[serde(rename = "_periodDuration")]
8424    Duration(FieldExtension),
8425    /// Variant accepting the String extension.
8426    #[serde(rename = "_periodString")]
8427    String(FieldExtension),
8428}
8429/** Quantity Type: A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
8430
8431 **[Quantity](http://hl7.org/fhir/StructureDefinition/Quantity) v5.0.0**
8432
8433 A measured or measurable amount
8434
8435 A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
8436
8437 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
8438#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8439#[serde(transparent)]
8440pub struct Quantity(pub Box<QuantityInner>);
8441/** Quantity Type: A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
8442
8443 **[Quantity](http://hl7.org/fhir/StructureDefinition/Quantity) v5.0.0**
8444
8445 A measured or measurable amount
8446
8447 A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
8448
8449 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
8450#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8451#[cfg_attr(feature = "builders", derive(Builder))]
8452#[serde(rename_all = "camelCase")]
8453#[cfg_attr(
8454    feature = "builders",
8455    builder(
8456        pattern = "owned",
8457        name = "QuantityBuilder",
8458        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
8459    )
8460)]
8461pub struct QuantityInner {
8462    /** **Unique id for inter-element referencing**
8463
8464 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
8465
8466 */
8467    #[serde(default, skip_serializing_if = "Option::is_none")]
8468    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8469    #[serde(rename = "id")]
8470    pub id: Option<String>,
8471    /** **Additional content defined by implementations**
8472
8473 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.
8474
8475 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
8476    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8477    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8478    #[serde(rename = "extension")]
8479    pub extension: Vec<Extension>,
8480    /** **Numerical value (with implicit precision)**
8481
8482 The value of the measured amount. The value includes an implicit precision in the presentation of the value.
8483
8484 The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books). */
8485    #[serde(default, skip_serializing_if = "Option::is_none")]
8486    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8487    #[serde(rename = "value")]
8488    pub value: Option<f64>,
8489    /// Extension field.
8490    #[serde(default, skip_serializing_if = "Option::is_none")]
8491    #[serde(rename = "_value")]
8492    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8493    pub value_ext: Option<FieldExtension>,
8494    /** **[QuantityComparator](http://hl7.org/fhir/ValueSet/quantity-comparator); < | <= | >= | > | ad - how to understand the value**
8495
8496 How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.
8497
8498 */
8499    #[serde(default, skip_serializing_if = "Option::is_none")]
8500    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8501    #[serde(rename = "comparator")]
8502    pub comparator: Option<codes::QuantityComparator>,
8503    /// Extension field.
8504    #[serde(default, skip_serializing_if = "Option::is_none")]
8505    #[serde(rename = "_comparator")]
8506    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8507    pub comparator_ext: Option<FieldExtension>,
8508    /** **Unit representation**
8509
8510 A human-readable form of the unit.
8511
8512 */
8513    #[serde(default, skip_serializing_if = "Option::is_none")]
8514    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8515    #[serde(rename = "unit")]
8516    pub unit: Option<String>,
8517    /// Extension field.
8518    #[serde(default, skip_serializing_if = "Option::is_none")]
8519    #[serde(rename = "_unit")]
8520    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8521    pub unit_ext: Option<FieldExtension>,
8522    /** **System that defines coded unit form**
8523
8524 The identification of the system that provides the coded form of the unit.
8525
8526 */
8527    #[serde(default, skip_serializing_if = "Option::is_none")]
8528    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8529    #[serde(rename = "system")]
8530    pub system: Option<String>,
8531    /// Extension field.
8532    #[serde(default, skip_serializing_if = "Option::is_none")]
8533    #[serde(rename = "_system")]
8534    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8535    pub system_ext: Option<FieldExtension>,
8536    /** **Coded form of the unit**
8537
8538 A computer processable form of the unit in some unit representation system.
8539
8540 The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency.  The context of use may additionally require a code from a particular system. */
8541    #[serde(default, skip_serializing_if = "Option::is_none")]
8542    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8543    #[serde(rename = "code")]
8544    pub code: Option<String>,
8545    /// Extension field.
8546    #[serde(default, skip_serializing_if = "Option::is_none")]
8547    #[serde(rename = "_code")]
8548    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8549    pub code_ext: Option<FieldExtension>,
8550}
8551#[cfg(feature = "builders")]
8552impl QuantityBuilder {
8553    #[doc = concat!("Finalize building ", "Quantity", ".")]
8554    pub fn build(self) -> Result<Quantity, crate::error::BuilderError> {
8555        self.build_inner().map(Into::into)
8556    }
8557}
8558impl From<QuantityInner> for Quantity {
8559    fn from(inner: QuantityInner) -> Self {
8560        Self(Box::new(inner))
8561    }
8562}
8563impl ::core::ops::Deref for Quantity {
8564    type Target = QuantityInner;
8565    fn deref(&self) -> &Self::Target {
8566        &self.0
8567    }
8568}
8569impl ::core::ops::DerefMut for Quantity {
8570    fn deref_mut(&mut self) -> &mut Self::Target {
8571        &mut self.0
8572    }
8573}
8574impl Quantity {
8575    /// Start building an instance.
8576    #[cfg(feature = "builders")]
8577    #[must_use]
8578    pub fn builder() -> QuantityBuilder {
8579        QuantityBuilder::default()
8580    }
8581}
8582/** Range Type: A set of ordered Quantities defined by a low and high limit.
8583
8584 **[Range](http://hl7.org/fhir/StructureDefinition/Range) v5.0.0**
8585
8586 Set of values bounded by low and high
8587
8588 A set of ordered Quantities defined by a low and high limit.
8589
8590 The stated low and high value are assumed to have arbitrarily high precision when it comes to determining which values are in the range. I.e. 1.99 is not in the range 2 -> 3. */
8591#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8592#[serde(transparent)]
8593pub struct Range(pub Box<RangeInner>);
8594/** Range Type: A set of ordered Quantities defined by a low and high limit.
8595
8596 **[Range](http://hl7.org/fhir/StructureDefinition/Range) v5.0.0**
8597
8598 Set of values bounded by low and high
8599
8600 A set of ordered Quantities defined by a low and high limit.
8601
8602 The stated low and high value are assumed to have arbitrarily high precision when it comes to determining which values are in the range. I.e. 1.99 is not in the range 2 -> 3. */
8603#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8604#[cfg_attr(feature = "builders", derive(Builder))]
8605#[serde(rename_all = "camelCase")]
8606#[cfg_attr(
8607    feature = "builders",
8608    builder(
8609        pattern = "owned",
8610        name = "RangeBuilder",
8611        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
8612    )
8613)]
8614pub struct RangeInner {
8615    /** **Unique id for inter-element referencing**
8616
8617 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
8618
8619 */
8620    #[serde(default, skip_serializing_if = "Option::is_none")]
8621    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8622    #[serde(rename = "id")]
8623    pub id: Option<String>,
8624    /** **Additional content defined by implementations**
8625
8626 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.
8627
8628 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
8629    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8630    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8631    #[serde(rename = "extension")]
8632    pub extension: Vec<Extension>,
8633    /** **Low limit**
8634
8635 The low limit. The boundary is inclusive.
8636
8637 If the low element is missing, the low boundary is not known. */
8638    #[serde(default, skip_serializing_if = "Option::is_none")]
8639    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8640    #[serde(rename = "low")]
8641    pub low: Option<Quantity>,
8642    /// Extension field.
8643    #[serde(default, skip_serializing_if = "Option::is_none")]
8644    #[serde(rename = "_low")]
8645    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8646    pub low_ext: Option<FieldExtension>,
8647    /** **High limit**
8648
8649 The high limit. The boundary is inclusive.
8650
8651 If the high element is missing, the high boundary is not known. */
8652    #[serde(default, skip_serializing_if = "Option::is_none")]
8653    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8654    #[serde(rename = "high")]
8655    pub high: Option<Quantity>,
8656    /// Extension field.
8657    #[serde(default, skip_serializing_if = "Option::is_none")]
8658    #[serde(rename = "_high")]
8659    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8660    pub high_ext: Option<FieldExtension>,
8661}
8662#[cfg(feature = "builders")]
8663impl RangeBuilder {
8664    #[doc = concat!("Finalize building ", "Range", ".")]
8665    pub fn build(self) -> Result<Range, crate::error::BuilderError> {
8666        self.build_inner().map(Into::into)
8667    }
8668}
8669impl From<RangeInner> for Range {
8670    fn from(inner: RangeInner) -> Self {
8671        Self(Box::new(inner))
8672    }
8673}
8674impl ::core::ops::Deref for Range {
8675    type Target = RangeInner;
8676    fn deref(&self) -> &Self::Target {
8677        &self.0
8678    }
8679}
8680impl ::core::ops::DerefMut for Range {
8681    fn deref_mut(&mut self) -> &mut Self::Target {
8682        &mut self.0
8683    }
8684}
8685impl Range {
8686    /// Start building an instance.
8687    #[cfg(feature = "builders")]
8688    #[must_use]
8689    pub fn builder() -> RangeBuilder {
8690        RangeBuilder::default()
8691    }
8692}
8693/** Ratio Type: A relationship of two Quantity values - expressed as a numerator and a denominator.
8694
8695 **[Ratio](http://hl7.org/fhir/StructureDefinition/Ratio) v5.0.0**
8696
8697 A ratio of two Quantity values - a numerator and a denominator
8698
8699 A relationship of two Quantity values - expressed as a numerator and a denominator.
8700
8701 The Ratio datatype should only be used to express a relationship of two numbers if the relationship cannot be suitably expressed using a Quantity and a common unit.  Where the denominator value is known to be fixed to "1", Quantity should be used instead of Ratio. */
8702#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8703#[serde(transparent)]
8704pub struct Ratio(pub Box<RatioInner>);
8705/** Ratio Type: A relationship of two Quantity values - expressed as a numerator and a denominator.
8706
8707 **[Ratio](http://hl7.org/fhir/StructureDefinition/Ratio) v5.0.0**
8708
8709 A ratio of two Quantity values - a numerator and a denominator
8710
8711 A relationship of two Quantity values - expressed as a numerator and a denominator.
8712
8713 The Ratio datatype should only be used to express a relationship of two numbers if the relationship cannot be suitably expressed using a Quantity and a common unit.  Where the denominator value is known to be fixed to "1", Quantity should be used instead of Ratio. */
8714#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8715#[cfg_attr(feature = "builders", derive(Builder))]
8716#[serde(rename_all = "camelCase")]
8717#[cfg_attr(
8718    feature = "builders",
8719    builder(
8720        pattern = "owned",
8721        name = "RatioBuilder",
8722        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
8723    )
8724)]
8725pub struct RatioInner {
8726    /** **Unique id for inter-element referencing**
8727
8728 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
8729
8730 */
8731    #[serde(default, skip_serializing_if = "Option::is_none")]
8732    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8733    #[serde(rename = "id")]
8734    pub id: Option<String>,
8735    /** **Additional content defined by implementations**
8736
8737 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.
8738
8739 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
8740    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8741    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8742    #[serde(rename = "extension")]
8743    pub extension: Vec<Extension>,
8744    /** **Numerator value**
8745
8746 The value of the numerator.
8747
8748 */
8749    #[serde(default, skip_serializing_if = "Option::is_none")]
8750    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8751    #[serde(rename = "numerator")]
8752    pub numerator: Option<Quantity>,
8753    /// Extension field.
8754    #[serde(default, skip_serializing_if = "Option::is_none")]
8755    #[serde(rename = "_numerator")]
8756    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8757    pub numerator_ext: Option<FieldExtension>,
8758    /** **Denominator value**
8759
8760 The value of the denominator.
8761
8762 */
8763    #[serde(default, skip_serializing_if = "Option::is_none")]
8764    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8765    #[serde(rename = "denominator")]
8766    pub denominator: Option<Quantity>,
8767    /// Extension field.
8768    #[serde(default, skip_serializing_if = "Option::is_none")]
8769    #[serde(rename = "_denominator")]
8770    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8771    pub denominator_ext: Option<FieldExtension>,
8772}
8773#[cfg(feature = "builders")]
8774impl RatioBuilder {
8775    #[doc = concat!("Finalize building ", "Ratio", ".")]
8776    pub fn build(self) -> Result<Ratio, crate::error::BuilderError> {
8777        self.build_inner().map(Into::into)
8778    }
8779}
8780impl From<RatioInner> for Ratio {
8781    fn from(inner: RatioInner) -> Self {
8782        Self(Box::new(inner))
8783    }
8784}
8785impl ::core::ops::Deref for Ratio {
8786    type Target = RatioInner;
8787    fn deref(&self) -> &Self::Target {
8788        &self.0
8789    }
8790}
8791impl ::core::ops::DerefMut for Ratio {
8792    fn deref_mut(&mut self) -> &mut Self::Target {
8793        &mut self.0
8794    }
8795}
8796impl Ratio {
8797    /// Start building an instance.
8798    #[cfg(feature = "builders")]
8799    #[must_use]
8800    pub fn builder() -> RatioBuilder {
8801        RatioBuilder::default()
8802    }
8803}
8804/** RatioRange Type: A range of ratios expressed as a low and high numerator and a denominator.
8805
8806 **[RatioRange](http://hl7.org/fhir/StructureDefinition/RatioRange) v5.0.0**
8807
8808 Range of ratio values
8809
8810 A range of ratios expressed as a low and high numerator and a denominator.
8811
8812 The stated low and high value are assumed to have arbitrarily high precision when it comes to determining which values are in the range. I.e. 1.99 is not in the range 2 -> 3. */
8813#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8814#[serde(transparent)]
8815pub struct RatioRange(pub Box<RatioRangeInner>);
8816/** RatioRange Type: A range of ratios expressed as a low and high numerator and a denominator.
8817
8818 **[RatioRange](http://hl7.org/fhir/StructureDefinition/RatioRange) v5.0.0**
8819
8820 Range of ratio values
8821
8822 A range of ratios expressed as a low and high numerator and a denominator.
8823
8824 The stated low and high value are assumed to have arbitrarily high precision when it comes to determining which values are in the range. I.e. 1.99 is not in the range 2 -> 3. */
8825#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8826#[cfg_attr(feature = "builders", derive(Builder))]
8827#[serde(rename_all = "camelCase")]
8828#[cfg_attr(
8829    feature = "builders",
8830    builder(
8831        pattern = "owned",
8832        name = "RatioRangeBuilder",
8833        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
8834    )
8835)]
8836pub struct RatioRangeInner {
8837    /** **Unique id for inter-element referencing**
8838
8839 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
8840
8841 */
8842    #[serde(default, skip_serializing_if = "Option::is_none")]
8843    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8844    #[serde(rename = "id")]
8845    pub id: Option<String>,
8846    /** **Additional content defined by implementations**
8847
8848 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.
8849
8850 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
8851    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8852    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8853    #[serde(rename = "extension")]
8854    pub extension: Vec<Extension>,
8855    /** **Low Numerator limit**
8856
8857 The value of the low limit numerator.
8858
8859 If the low element is missing, the low boundary is not known. */
8860    #[serde(default, skip_serializing_if = "Option::is_none")]
8861    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8862    #[serde(rename = "lowNumerator")]
8863    pub low_numerator: Option<Quantity>,
8864    /// Extension field.
8865    #[serde(default, skip_serializing_if = "Option::is_none")]
8866    #[serde(rename = "_lowNumerator")]
8867    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8868    pub low_numerator_ext: Option<FieldExtension>,
8869    /** **High Numerator limit**
8870
8871 The value of the high limit numerator.
8872
8873 If the high element is missing, the high boundary is not known. */
8874    #[serde(default, skip_serializing_if = "Option::is_none")]
8875    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8876    #[serde(rename = "highNumerator")]
8877    pub high_numerator: Option<Quantity>,
8878    /// Extension field.
8879    #[serde(default, skip_serializing_if = "Option::is_none")]
8880    #[serde(rename = "_highNumerator")]
8881    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8882    pub high_numerator_ext: Option<FieldExtension>,
8883    /** **Denominator value**
8884
8885 The value of the denominator.
8886
8887 */
8888    #[serde(default, skip_serializing_if = "Option::is_none")]
8889    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8890    #[serde(rename = "denominator")]
8891    pub denominator: Option<Quantity>,
8892    /// Extension field.
8893    #[serde(default, skip_serializing_if = "Option::is_none")]
8894    #[serde(rename = "_denominator")]
8895    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8896    pub denominator_ext: Option<FieldExtension>,
8897}
8898#[cfg(feature = "builders")]
8899impl RatioRangeBuilder {
8900    #[doc = concat!("Finalize building ", "RatioRange", ".")]
8901    pub fn build(self) -> Result<RatioRange, crate::error::BuilderError> {
8902        self.build_inner().map(Into::into)
8903    }
8904}
8905impl From<RatioRangeInner> for RatioRange {
8906    fn from(inner: RatioRangeInner) -> Self {
8907        Self(Box::new(inner))
8908    }
8909}
8910impl ::core::ops::Deref for RatioRange {
8911    type Target = RatioRangeInner;
8912    fn deref(&self) -> &Self::Target {
8913        &self.0
8914    }
8915}
8916impl ::core::ops::DerefMut for RatioRange {
8917    fn deref_mut(&mut self) -> &mut Self::Target {
8918        &mut self.0
8919    }
8920}
8921impl RatioRange {
8922    /// Start building an instance.
8923    #[cfg(feature = "builders")]
8924    #[must_use]
8925    pub fn builder() -> RatioRangeBuilder {
8926        RatioRangeBuilder::default()
8927    }
8928}
8929/** Reference Type: A reference from one resource to another.
8930
8931 **[Reference](http://hl7.org/fhir/StructureDefinition/Reference) v5.0.0**
8932
8933 A reference from one resource to another
8934
8935 A reference from one resource to another.
8936
8937 References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository. */
8938#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8939#[serde(transparent)]
8940pub struct Reference(pub Box<ReferenceInner>);
8941/** Reference Type: A reference from one resource to another.
8942
8943 **[Reference](http://hl7.org/fhir/StructureDefinition/Reference) v5.0.0**
8944
8945 A reference from one resource to another
8946
8947 A reference from one resource to another.
8948
8949 References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository. */
8950#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8951#[cfg_attr(feature = "builders", derive(Builder))]
8952#[serde(rename_all = "camelCase")]
8953#[cfg_attr(
8954    feature = "builders",
8955    builder(
8956        pattern = "owned",
8957        name = "ReferenceBuilder",
8958        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
8959    )
8960)]
8961pub struct ReferenceInner {
8962    /** **Unique id for inter-element referencing**
8963
8964 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
8965
8966 */
8967    #[serde(default, skip_serializing_if = "Option::is_none")]
8968    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8969    #[serde(rename = "id")]
8970    pub id: Option<String>,
8971    /** **Additional content defined by implementations**
8972
8973 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.
8974
8975 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
8976    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8977    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8978    #[serde(rename = "extension")]
8979    pub extension: Vec<Extension>,
8980    /** **Literal reference, Relative, internal or absolute URL**
8981
8982 A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.
8983
8984 Using absolute URLs provides a stable scalable approach suitable for a cloud/web context, while using relative/logical references provides a flexible approach suitable for use when trading across closed eco-system boundaries.   Absolute URLs do not need to point to a FHIR RESTful server, though this is the preferred approach. If the URL conforms to the structure "[type]/[id]" then it should be assumed that the reference is to a FHIR RESTful server. */
8985    #[serde(default, skip_serializing_if = "Option::is_none")]
8986    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8987    #[serde(rename = "reference")]
8988    pub reference: Option<String>,
8989    /// Extension field.
8990    #[serde(default, skip_serializing_if = "Option::is_none")]
8991    #[serde(rename = "_reference")]
8992    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
8993    pub reference_ext: Option<FieldExtension>,
8994    /** **[FHIRResourceTypeExt](http://hl7.org/fhir/ValueSet/resource-types); Type the reference refers to (e.g. "Patient") - must be a resource in resources**
8995
8996 The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent.
8997
8998The type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. "Patient" is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources).
8999
9000 This element is used to indicate the type of  the target of the reference. This may be used which ever of the other elements are populated (or not). In some cases, the type of the target may be determined by inspection of the reference (e.g. a known RESTful URL) or by resolving the target of the reference. */
9001    #[serde(default, skip_serializing_if = "Option::is_none")]
9002    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9003    #[serde(rename = "type")]
9004    pub r#type: Option<String>,
9005    /// Extension field.
9006    #[serde(default, skip_serializing_if = "Option::is_none")]
9007    #[serde(rename = "_type")]
9008    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9009    pub r#type_ext: Option<FieldExtension>,
9010    /** **Logical reference, when literal reference is not known**
9011
9012 An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.
9013
9014 When an identifier is provided in place of a reference, any system processing the reference will only be able to resolve the identifier to a reference if it understands the business context in which the identifier is used. Sometimes this is global (e.g. a national identifier) but often it is not. For this reason, none of the useful mechanisms described for working with references (e.g. chaining, includes) are possible, nor should servers be expected to be able resolve the reference. Servers may accept an identifier based reference untouched, resolve it, and/or reject it - see CapabilityStatement.rest.resource.referencePolicy.
9015
9016When both an identifier and a literal reference are provided, the literal reference is preferred. Applications processing the resource are allowed - but not required - to check that the identifier matches the literal reference
9017
9018Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it.
9019
9020Reference is intended to point to a structure that can potentially be expressed as a FHIR resource, though there is no need for it to exist as an actual FHIR resource instance - except in as much as an application wishes to actual find the target of the reference. The content referred to be the identifier must meet the logical constraints implied by any limitations on what resource types are permitted for the reference.  For example, it would not be legitimate to send the identifier for a drug prescription if the type were Reference(Observation|DiagnosticReport).  One of the use-cases for Reference.identifier is the situation where no FHIR representation exists (where the type is Reference (Any).
9021
9022This element only allows for a single identifier. In the case where additional identifers are required, use the [http://hl7.org/fhir/StructureDefinition/additionalIdentifier](http://hl7.org/fhir/extensions/StructureDefinition-additionalIdentifier.html) extension. */
9023    #[serde(default, skip_serializing_if = "Option::is_none")]
9024    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9025    #[serde(rename = "identifier")]
9026    pub identifier: Option<Identifier>,
9027    /// Extension field.
9028    #[serde(default, skip_serializing_if = "Option::is_none")]
9029    #[serde(rename = "_identifier")]
9030    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9031    pub identifier_ext: Option<FieldExtension>,
9032    /** **Text alternative for the resource**
9033
9034 Plain text narrative that identifies the resource in addition to the resource reference.
9035
9036 This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it. */
9037    #[serde(default, skip_serializing_if = "Option::is_none")]
9038    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9039    #[serde(rename = "display")]
9040    pub display: Option<String>,
9041    /// Extension field.
9042    #[serde(default, skip_serializing_if = "Option::is_none")]
9043    #[serde(rename = "_display")]
9044    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9045    pub display_ext: Option<FieldExtension>,
9046}
9047#[cfg(feature = "builders")]
9048impl ReferenceBuilder {
9049    #[doc = concat!("Finalize building ", "Reference", ".")]
9050    pub fn build(self) -> Result<Reference, crate::error::BuilderError> {
9051        self.build_inner().map(Into::into)
9052    }
9053}
9054impl From<ReferenceInner> for Reference {
9055    fn from(inner: ReferenceInner) -> Self {
9056        Self(Box::new(inner))
9057    }
9058}
9059impl ::core::ops::Deref for Reference {
9060    type Target = ReferenceInner;
9061    fn deref(&self) -> &Self::Target {
9062        &self.0
9063    }
9064}
9065impl ::core::ops::DerefMut for Reference {
9066    fn deref_mut(&mut self) -> &mut Self::Target {
9067        &mut self.0
9068    }
9069}
9070impl Reference {
9071    /// Start building an instance.
9072    #[cfg(feature = "builders")]
9073    #[must_use]
9074    pub fn builder() -> ReferenceBuilder {
9075        ReferenceBuilder::default()
9076    }
9077}
9078/** RelatedArtifact Type: Related artifacts such as additional documentation, justification, or bibliographic references.
9079
9080 **[RelatedArtifact](http://hl7.org/fhir/StructureDefinition/RelatedArtifact) v5.0.0**
9081
9082 Related artifacts for a knowledge resource
9083
9084 Related artifacts such as additional documentation, justification, or bibliographic references.
9085
9086 Each related artifact is either an attachment, or a reference to another knowledge resource, but not both. */
9087#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9088#[serde(transparent)]
9089pub struct RelatedArtifact(pub Box<RelatedArtifactInner>);
9090/** RelatedArtifact Type: Related artifacts such as additional documentation, justification, or bibliographic references.
9091
9092 **[RelatedArtifact](http://hl7.org/fhir/StructureDefinition/RelatedArtifact) v5.0.0**
9093
9094 Related artifacts for a knowledge resource
9095
9096 Related artifacts such as additional documentation, justification, or bibliographic references.
9097
9098 Each related artifact is either an attachment, or a reference to another knowledge resource, but not both. */
9099#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9100#[cfg_attr(feature = "builders", derive(Builder))]
9101#[serde(rename_all = "camelCase")]
9102#[cfg_attr(
9103    feature = "builders",
9104    builder(
9105        pattern = "owned",
9106        name = "RelatedArtifactBuilder",
9107        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
9108    )
9109)]
9110pub struct RelatedArtifactInner {
9111    /** **Unique id for inter-element referencing**
9112
9113 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
9114
9115 */
9116    #[serde(default, skip_serializing_if = "Option::is_none")]
9117    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9118    #[serde(rename = "id")]
9119    pub id: Option<String>,
9120    /** **Additional content defined by implementations**
9121
9122 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.
9123
9124 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
9125    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9126    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9127    #[serde(rename = "extension")]
9128    pub extension: Vec<Extension>,
9129    /** **[RelatedArtifactType](http://hl7.org/fhir/ValueSet/related-artifact-type); documentation | justification | citation | predecessor | successor | derived-from | depends-on | composed-of | part-of | amends | amended-with | appends | appended-with | cites | cited-by | comments-on | comment-in | contains | contained-in | corrects | correction-in | replaces | replaced-with | retracts | retracted-by | signs | similar-to | supports | supported-with | transforms | transformed-into | transformed-with | documents | specification-of | created-with | cite-as**
9130
9131 The type of relationship to the related artifact.
9132
9133 The presence of both sides of a relationship type (e.g. successor and predecessor) is required to support use cases where one side of a relationship is not represented in FHIR. However, this feature SHALL NOT be used to create bi-directional resource links in FHIR instances. Specifically, following the methodology of "new points to old" and "many points to one", when using related artifact elements to describe and reference FHIR resources, the type element SHALL be drawn from the fhir-related-artifact-type ValueSet. */
9134    #[serde(rename = "type")]
9135    pub r#type: codes::RelatedArtifactType,
9136    /// Extension field.
9137    #[serde(default, skip_serializing_if = "Option::is_none")]
9138    #[serde(rename = "_type")]
9139    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9140    pub r#type_ext: Option<FieldExtension>,
9141    /** **[RelatedArtifactClassifier](http://hl7.org/fhir/ValueSet/citation-artifact-classifier); Additional classifiers**
9142
9143 Provides additional classifiers of the related artifact.
9144
9145 */
9146    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9147    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9148    #[serde(rename = "classifier")]
9149    pub classifier: Vec<Option<CodeableConcept>>,
9150    /// Extension field.
9151    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9152    #[serde(rename = "_classifier")]
9153    #[cfg_attr(feature = "builders", builder(default))]
9154    pub classifier_ext: Vec<Option<FieldExtension>>,
9155    /** **Short label**
9156
9157 A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index.
9158
9159 */
9160    #[serde(default, skip_serializing_if = "Option::is_none")]
9161    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9162    #[serde(rename = "label")]
9163    pub label: Option<String>,
9164    /// Extension field.
9165    #[serde(default, skip_serializing_if = "Option::is_none")]
9166    #[serde(rename = "_label")]
9167    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9168    pub label_ext: Option<FieldExtension>,
9169    /** **Brief description of the related artifact**
9170
9171 A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.
9172
9173 */
9174    #[serde(default, skip_serializing_if = "Option::is_none")]
9175    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9176    #[serde(rename = "display")]
9177    pub display: Option<String>,
9178    /// Extension field.
9179    #[serde(default, skip_serializing_if = "Option::is_none")]
9180    #[serde(rename = "_display")]
9181    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9182    pub display_ext: Option<FieldExtension>,
9183    /** **Bibliographic citation for the artifact**
9184
9185 A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.
9186
9187 Additional structured information about citations should be captured as extensions. */
9188    #[serde(default, skip_serializing_if = "Option::is_none")]
9189    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9190    #[serde(rename = "citation")]
9191    pub citation: Option<String>,
9192    /// Extension field.
9193    #[serde(default, skip_serializing_if = "Option::is_none")]
9194    #[serde(rename = "_citation")]
9195    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9196    pub citation_ext: Option<FieldExtension>,
9197    /** **What document is being referenced**
9198
9199 The document being referenced, represented as an attachment. This is exclusive with the resource element.
9200
9201 */
9202    #[serde(default, skip_serializing_if = "Option::is_none")]
9203    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9204    #[serde(rename = "document")]
9205    pub document: Option<Attachment>,
9206    /// Extension field.
9207    #[serde(default, skip_serializing_if = "Option::is_none")]
9208    #[serde(rename = "_document")]
9209    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9210    pub document_ext: Option<FieldExtension>,
9211    /** **What artifact is being referenced**
9212
9213 The related artifact, such as a library, value set, profile, or other knowledge resource.
9214
9215 If the type is predecessor, this is a reference to the succeeding knowledge resource. If the type is successor, this is a reference to the prior knowledge resource. */
9216    #[serde(default, skip_serializing_if = "Option::is_none")]
9217    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9218    #[serde(rename = "resource")]
9219    pub resource: Option<String>,
9220    /// Extension field.
9221    #[serde(default, skip_serializing_if = "Option::is_none")]
9222    #[serde(rename = "_resource")]
9223    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9224    pub resource_ext: Option<FieldExtension>,
9225    /** **What artifact, if not a conformance resource**
9226
9227 The related artifact, if the artifact is not a canonical resource, or a resource reference to a canonical resource.
9228
9229 If both resource and resourceReference are present, they SHOULD be consistent and reference the same resource. Although relatedArtifact is intended to support references to definitional resources, there are cases where non-definitional resources can be definitional (such as Location where the kind is mode). Related artifacts SHOULD be used to reference definitional resources, and profiles SHOULD be used to make that explicit for particular use cases. */
9230    #[serde(default, skip_serializing_if = "Option::is_none")]
9231    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9232    #[serde(rename = "resourceReference")]
9233    pub resource_reference: Option<Reference>,
9234    /// Extension field.
9235    #[serde(default, skip_serializing_if = "Option::is_none")]
9236    #[serde(rename = "_resourceReference")]
9237    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9238    pub resource_reference_ext: Option<FieldExtension>,
9239    /** **[RelatedArtifactPublicationStatus](http://hl7.org/fhir/ValueSet/publication-status); draft | active | retired | unknown**
9240
9241 The publication status of the artifact being referred to.
9242
9243 */
9244    #[serde(default, skip_serializing_if = "Option::is_none")]
9245    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9246    #[serde(rename = "publicationStatus")]
9247    pub publication_status: Option<codes::PublicationStatus>,
9248    /// Extension field.
9249    #[serde(default, skip_serializing_if = "Option::is_none")]
9250    #[serde(rename = "_publicationStatus")]
9251    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9252    pub publication_status_ext: Option<FieldExtension>,
9253    /** **Date of publication of the artifact being referred to**
9254
9255 The date of publication of the artifact being referred to.
9256
9257 */
9258    #[serde(default, skip_serializing_if = "Option::is_none")]
9259    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9260    #[serde(rename = "publicationDate")]
9261    pub publication_date: Option<Date>,
9262    /// Extension field.
9263    #[serde(default, skip_serializing_if = "Option::is_none")]
9264    #[serde(rename = "_publicationDate")]
9265    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9266    pub publication_date_ext: Option<FieldExtension>,
9267}
9268#[cfg(feature = "builders")]
9269impl RelatedArtifactBuilder {
9270    #[doc = concat!("Finalize building ", "RelatedArtifact", ".")]
9271    pub fn build(self) -> Result<RelatedArtifact, crate::error::BuilderError> {
9272        self.build_inner().map(Into::into)
9273    }
9274}
9275impl From<RelatedArtifactInner> for RelatedArtifact {
9276    fn from(inner: RelatedArtifactInner) -> Self {
9277        Self(Box::new(inner))
9278    }
9279}
9280impl ::core::ops::Deref for RelatedArtifact {
9281    type Target = RelatedArtifactInner;
9282    fn deref(&self) -> &Self::Target {
9283        &self.0
9284    }
9285}
9286impl ::core::ops::DerefMut for RelatedArtifact {
9287    fn deref_mut(&mut self) -> &mut Self::Target {
9288        &mut self.0
9289    }
9290}
9291impl RelatedArtifact {
9292    /// Start building an instance.
9293    #[cfg(feature = "builders")]
9294    #[must_use]
9295    pub fn builder() -> RelatedArtifactBuilder {
9296        RelatedArtifactBuilder::default()
9297    }
9298}
9299/** SampledData Type: A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
9300
9301 **[SampledData](http://hl7.org/fhir/StructureDefinition/SampledData) v5.0.0**
9302
9303 A series of measurements taken by a device
9304
9305 A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
9306
9307 The data is not interpretable without at least origin, period, and dimensions, but these are optional to allow a separation between the template of measurement and the actual measurement, such as between DeviceCapabilities and DeviceLog.  When providing a summary view (for example with Observation.value[x]) SampledData should be represented with a brief display text such as "Sampled Data". */
9308#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9309#[serde(transparent)]
9310pub struct SampledData(pub Box<SampledDataInner>);
9311/** SampledData Type: A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
9312
9313 **[SampledData](http://hl7.org/fhir/StructureDefinition/SampledData) v5.0.0**
9314
9315 A series of measurements taken by a device
9316
9317 A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
9318
9319 The data is not interpretable without at least origin, period, and dimensions, but these are optional to allow a separation between the template of measurement and the actual measurement, such as between DeviceCapabilities and DeviceLog.  When providing a summary view (for example with Observation.value[x]) SampledData should be represented with a brief display text such as "Sampled Data". */
9320#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9321#[cfg_attr(feature = "builders", derive(Builder))]
9322#[serde(rename_all = "camelCase")]
9323#[cfg_attr(
9324    feature = "builders",
9325    builder(
9326        pattern = "owned",
9327        name = "SampledDataBuilder",
9328        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
9329    )
9330)]
9331pub struct SampledDataInner {
9332    /** **Unique id for inter-element referencing**
9333
9334 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
9335
9336 */
9337    #[serde(default, skip_serializing_if = "Option::is_none")]
9338    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9339    #[serde(rename = "id")]
9340    pub id: Option<String>,
9341    /** **Additional content defined by implementations**
9342
9343 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.
9344
9345 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
9346    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9347    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9348    #[serde(rename = "extension")]
9349    pub extension: Vec<Extension>,
9350    /** **Zero value and units**
9351
9352 The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.
9353
9354 */
9355    #[serde(rename = "origin")]
9356    pub origin: Quantity,
9357    /// Extension field.
9358    #[serde(default, skip_serializing_if = "Option::is_none")]
9359    #[serde(rename = "_origin")]
9360    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9361    pub origin_ext: Option<FieldExtension>,
9362    /** **Number of intervalUnits between samples**
9363
9364 Amount of intervalUnits between samples, e.g. milliseconds for time-based sampling.
9365
9366 This is usually a whole number. */
9367    #[serde(default, skip_serializing_if = "Option::is_none")]
9368    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9369    #[serde(rename = "interval")]
9370    pub interval: Option<f64>,
9371    /// Extension field.
9372    #[serde(default, skip_serializing_if = "Option::is_none")]
9373    #[serde(rename = "_interval")]
9374    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9375    pub interval_ext: Option<FieldExtension>,
9376    /** **[Units](http://hl7.org/fhir/ValueSet/ucum-units); The measurement unit of the interval between samples**
9377
9378 The measurement unit in which the sample interval is expressed.
9379
9380 */
9381    #[serde(rename = "intervalUnit")]
9382    pub interval_unit: String,
9383    /// Extension field.
9384    #[serde(default, skip_serializing_if = "Option::is_none")]
9385    #[serde(rename = "_intervalUnit")]
9386    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9387    pub interval_unit_ext: Option<FieldExtension>,
9388    /** **Multiply data by this before adding to origin**
9389
9390 A correction factor that is applied to the sampled data points before they are added to the origin.
9391
9392 */
9393    #[serde(default, skip_serializing_if = "Option::is_none")]
9394    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9395    #[serde(rename = "factor")]
9396    pub factor: Option<f64>,
9397    /// Extension field.
9398    #[serde(default, skip_serializing_if = "Option::is_none")]
9399    #[serde(rename = "_factor")]
9400    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9401    pub factor_ext: Option<FieldExtension>,
9402    /** **Lower limit of detection**
9403
9404 The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).
9405
9406 */
9407    #[serde(default, skip_serializing_if = "Option::is_none")]
9408    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9409    #[serde(rename = "lowerLimit")]
9410    pub lower_limit: Option<f64>,
9411    /// Extension field.
9412    #[serde(default, skip_serializing_if = "Option::is_none")]
9413    #[serde(rename = "_lowerLimit")]
9414    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9415    pub lower_limit_ext: Option<FieldExtension>,
9416    /** **Upper limit of detection**
9417
9418 The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).
9419
9420 */
9421    #[serde(default, skip_serializing_if = "Option::is_none")]
9422    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9423    #[serde(rename = "upperLimit")]
9424    pub upper_limit: Option<f64>,
9425    /// Extension field.
9426    #[serde(default, skip_serializing_if = "Option::is_none")]
9427    #[serde(rename = "_upperLimit")]
9428    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9429    pub upper_limit_ext: Option<FieldExtension>,
9430    /** **Number of sample points at each time point**
9431
9432 The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.
9433
9434 If there is more than one dimension, the code for the type of data will define the meaning of the dimensions (typically ECG data). */
9435    #[serde(rename = "dimensions")]
9436    pub dimensions: NonZeroU32,
9437    /// Extension field.
9438    #[serde(default, skip_serializing_if = "Option::is_none")]
9439    #[serde(rename = "_dimensions")]
9440    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9441    pub dimensions_ext: Option<FieldExtension>,
9442    /** **Defines the codes used in the data**
9443
9444 Reference to ConceptMap that defines the codes used in the data.
9445
9446 The ConceptMap cannot define meanings for the codes 'E', 'U', or 'L' (nor 'e', 'u', or 'l'). */
9447    #[serde(default, skip_serializing_if = "Option::is_none")]
9448    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9449    #[serde(rename = "codeMap")]
9450    pub code_map: Option<String>,
9451    /// Extension field.
9452    #[serde(default, skip_serializing_if = "Option::is_none")]
9453    #[serde(rename = "_codeMap")]
9454    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9455    pub code_map_ext: Option<FieldExtension>,
9456    /** **Offsets, typically in time, at which data values were taken**
9457
9458 A series of data points which are decimal values separated by a single space (character u20).  The units in which the offsets are expressed are found in intervalUnit.  The absolute point at which the measurements begin SHALL be conveyed outside the scope of this datatype, e.g. Observation.effectiveDateTime for a timing offset.
9459
9460 If offsets is present, the number of data points must be equal to the number of offsets mlutipled by the dimensions. */
9461    #[serde(default, skip_serializing_if = "Option::is_none")]
9462    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9463    #[serde(rename = "offsets")]
9464    pub offsets: Option<String>,
9465    /// Extension field.
9466    #[serde(default, skip_serializing_if = "Option::is_none")]
9467    #[serde(rename = "_offsets")]
9468    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9469    pub offsets_ext: Option<FieldExtension>,
9470    /** **Decimal values with spaces, or "E" | "U" | "L", or another code**
9471
9472 A series of data points which are decimal values or codes separated by a single space (character u20). The special codes "E" (error), "L" (below detection limit) and "U" (above detection limit) are also defined for used in place of decimal values.
9473
9474 The data may be missing if it is omitted for summarization purposes. In general, data is required for any actual use of a SampledData. */
9475    #[serde(default, skip_serializing_if = "Option::is_none")]
9476    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9477    #[serde(rename = "data")]
9478    pub data: Option<String>,
9479    /// Extension field.
9480    #[serde(default, skip_serializing_if = "Option::is_none")]
9481    #[serde(rename = "_data")]
9482    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9483    pub data_ext: Option<FieldExtension>,
9484}
9485#[cfg(feature = "builders")]
9486impl SampledDataBuilder {
9487    #[doc = concat!("Finalize building ", "SampledData", ".")]
9488    pub fn build(self) -> Result<SampledData, crate::error::BuilderError> {
9489        self.build_inner().map(Into::into)
9490    }
9491}
9492impl From<SampledDataInner> for SampledData {
9493    fn from(inner: SampledDataInner) -> Self {
9494        Self(Box::new(inner))
9495    }
9496}
9497impl ::core::ops::Deref for SampledData {
9498    type Target = SampledDataInner;
9499    fn deref(&self) -> &Self::Target {
9500        &self.0
9501    }
9502}
9503impl ::core::ops::DerefMut for SampledData {
9504    fn deref_mut(&mut self) -> &mut Self::Target {
9505        &mut self.0
9506    }
9507}
9508impl SampledData {
9509    /// Start building an instance.
9510    #[cfg(feature = "builders")]
9511    #[must_use]
9512    pub fn builder() -> SampledDataBuilder {
9513        SampledDataBuilder::default()
9514    }
9515}
9516/** Signature Type: A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities.
9517
9518 **[Signature](http://hl7.org/fhir/StructureDefinition/Signature) v5.0.0**
9519
9520 A Signature - XML DigSig, JWS, Graphical image of signature, etc.
9521
9522 A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities.
9523
9524 The elements of the Signature Resource are for ease of access of these elements. For digital signatures (Xml DigSig, JWS), the non-repudiation proof comes from the Signature  validation, which includes validation of the referenced objects (e.g. Resources) (a.k.a., Content) in the XML-Signature Detached form. */
9525#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9526#[serde(transparent)]
9527pub struct Signature(pub Box<SignatureInner>);
9528/** Signature Type: A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities.
9529
9530 **[Signature](http://hl7.org/fhir/StructureDefinition/Signature) v5.0.0**
9531
9532 A Signature - XML DigSig, JWS, Graphical image of signature, etc.
9533
9534 A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities.
9535
9536 The elements of the Signature Resource are for ease of access of these elements. For digital signatures (Xml DigSig, JWS), the non-repudiation proof comes from the Signature  validation, which includes validation of the referenced objects (e.g. Resources) (a.k.a., Content) in the XML-Signature Detached form. */
9537#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9538#[cfg_attr(feature = "builders", derive(Builder))]
9539#[serde(rename_all = "camelCase")]
9540#[cfg_attr(
9541    feature = "builders",
9542    builder(
9543        pattern = "owned",
9544        name = "SignatureBuilder",
9545        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
9546    )
9547)]
9548pub struct SignatureInner {
9549    /** **Unique id for inter-element referencing**
9550
9551 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
9552
9553 */
9554    #[serde(default, skip_serializing_if = "Option::is_none")]
9555    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9556    #[serde(rename = "id")]
9557    pub id: Option<String>,
9558    /** **Additional content defined by implementations**
9559
9560 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.
9561
9562 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
9563    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9564    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9565    #[serde(rename = "extension")]
9566    pub extension: Vec<Extension>,
9567    /** **[SignatureType](http://hl7.org/fhir/ValueSet/signature-type); Indication of the reason the entity signed the object(s)**
9568
9569 An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.
9570
9571 Examples include attesting to: authorship, correct transcription, and witness of specific event. Also known as a &quot;Commitment Type Indication&quot;. */
9572    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9573    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9574    #[serde(rename = "type")]
9575    pub r#type: Vec<Option<Coding>>,
9576    /// Extension field.
9577    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9578    #[serde(rename = "_type")]
9579    #[cfg_attr(feature = "builders", builder(default))]
9580    pub r#type_ext: Vec<Option<FieldExtension>>,
9581    /** **When the signature was created**
9582
9583 When the digital signature was signed.
9584
9585 This should agree with the information in the signature. */
9586    #[serde(default, skip_serializing_if = "Option::is_none")]
9587    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9588    #[serde(rename = "when")]
9589    pub when: Option<Instant>,
9590    /// Extension field.
9591    #[serde(default, skip_serializing_if = "Option::is_none")]
9592    #[serde(rename = "_when")]
9593    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9594    pub when_ext: Option<FieldExtension>,
9595    /** **Who signed**
9596
9597 A reference to an application-usable description of the identity that signed  (e.g. the signature used their private key).
9598
9599 This should agree with the information in the signature. */
9600    #[serde(default, skip_serializing_if = "Option::is_none")]
9601    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9602    #[serde(rename = "who")]
9603    pub who: Option<Reference>,
9604    /// Extension field.
9605    #[serde(default, skip_serializing_if = "Option::is_none")]
9606    #[serde(rename = "_who")]
9607    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9608    pub who_ext: Option<FieldExtension>,
9609    /** **The party represented**
9610
9611 A reference to an application-usable description of the identity that is represented by the signature.
9612
9613 The party that can't sign. For example a child. */
9614    #[serde(default, skip_serializing_if = "Option::is_none")]
9615    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9616    #[serde(rename = "onBehalfOf")]
9617    pub on_behalf_of: Option<Reference>,
9618    /// Extension field.
9619    #[serde(default, skip_serializing_if = "Option::is_none")]
9620    #[serde(rename = "_onBehalfOf")]
9621    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9622    pub on_behalf_of_ext: Option<FieldExtension>,
9623    /** **[MimeType](http://hl7.org/fhir/ValueSet/mimetypes); The technical format of the signed resources**
9624
9625 A mime type that indicates the technical format of the target resources signed by the signature.
9626
9627 "xml", "json" and "ttl" are allowed, which describe the simple encodings described in the specification (and imply appropriate bundle support). Otherwise, mime types are legal here. */
9628    #[serde(default, skip_serializing_if = "Option::is_none")]
9629    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9630    #[serde(rename = "targetFormat")]
9631    pub target_format: Option<String>,
9632    /// Extension field.
9633    #[serde(default, skip_serializing_if = "Option::is_none")]
9634    #[serde(rename = "_targetFormat")]
9635    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9636    pub target_format_ext: Option<FieldExtension>,
9637    #[doc = " **[MimeType](http://hl7.org/fhir/ValueSet/mimetypes); The technical format of the signature** \n\n A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jose for JWS, and image/* for a graphical image of a signature, etc. \n\n "]
9638    #[serde(default, skip_serializing_if = "Option::is_none")]
9639    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9640    #[serde(rename = "sigFormat")]
9641    pub sig_format: Option<String>,
9642    /// Extension field.
9643    #[serde(default, skip_serializing_if = "Option::is_none")]
9644    #[serde(rename = "_sigFormat")]
9645    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9646    pub sig_format_ext: Option<FieldExtension>,
9647    /** **The actual signature content (XML DigSig. JWS, picture, etc.)**
9648
9649 The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty.
9650
9651 Where the signature type is an XML DigSig, the signed content is a FHIR Resource(s), the signature is of the XML form of the Resource(s) using  XML-Signature (XMLDIG) "Detached Signature" form. */
9652    #[serde(default, skip_serializing_if = "Option::is_none")]
9653    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9654    #[serde(rename = "data")]
9655    pub data: Option<Base64Binary>,
9656    /// Extension field.
9657    #[serde(default, skip_serializing_if = "Option::is_none")]
9658    #[serde(rename = "_data")]
9659    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9660    pub data_ext: Option<FieldExtension>,
9661}
9662#[cfg(feature = "builders")]
9663impl SignatureBuilder {
9664    #[doc = concat!("Finalize building ", "Signature", ".")]
9665    pub fn build(self) -> Result<Signature, crate::error::BuilderError> {
9666        self.build_inner().map(Into::into)
9667    }
9668}
9669impl From<SignatureInner> for Signature {
9670    fn from(inner: SignatureInner) -> Self {
9671        Self(Box::new(inner))
9672    }
9673}
9674impl ::core::ops::Deref for Signature {
9675    type Target = SignatureInner;
9676    fn deref(&self) -> &Self::Target {
9677        &self.0
9678    }
9679}
9680impl ::core::ops::DerefMut for Signature {
9681    fn deref_mut(&mut self) -> &mut Self::Target {
9682        &mut self.0
9683    }
9684}
9685impl Signature {
9686    /// Start building an instance.
9687    #[cfg(feature = "builders")]
9688    #[must_use]
9689    pub fn builder() -> SignatureBuilder {
9690        SignatureBuilder::default()
9691    }
9692}
9693/** Timing Type: Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.
9694
9695 **[Timing](http://hl7.org/fhir/StructureDefinition/Timing) v5.0.0**
9696
9697 A timing schedule that specifies an event that may occur multiple times
9698
9699 Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.
9700
9701 Describes the occurrence of an event that may occur multiple times. Timing schedules are used for specifying when events are expected or requested to occur, and may also be used to represent the summary of a past or ongoing event.  For simplicity, the definitions of Timing components are expressed as 'future' events, but such components can also be used to describe historic or ongoing events.
9702
9703A Timing schedule can be a list of events and/or criteria for when the event happens, which can be expressed in a structured form and/or as a code. When both event and a repeating specification are provided, the list of events should be understood as an interpretation of the information in the repeat structure. */
9704#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9705#[serde(transparent)]
9706pub struct Timing(pub Box<TimingInner>);
9707/** Timing Type: Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.
9708
9709 **[Timing](http://hl7.org/fhir/StructureDefinition/Timing) v5.0.0**
9710
9711 A timing schedule that specifies an event that may occur multiple times
9712
9713 Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.
9714
9715 Describes the occurrence of an event that may occur multiple times. Timing schedules are used for specifying when events are expected or requested to occur, and may also be used to represent the summary of a past or ongoing event.  For simplicity, the definitions of Timing components are expressed as 'future' events, but such components can also be used to describe historic or ongoing events.
9716
9717A Timing schedule can be a list of events and/or criteria for when the event happens, which can be expressed in a structured form and/or as a code. When both event and a repeating specification are provided, the list of events should be understood as an interpretation of the information in the repeat structure. */
9718#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9719#[cfg_attr(feature = "builders", derive(Builder))]
9720#[serde(rename_all = "camelCase")]
9721#[cfg_attr(
9722    feature = "builders",
9723    builder(
9724        pattern = "owned",
9725        name = "TimingBuilder",
9726        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
9727    )
9728)]
9729pub struct TimingInner {
9730    /** **Unique id for inter-element referencing**
9731
9732 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
9733
9734 */
9735    #[serde(default, skip_serializing_if = "Option::is_none")]
9736    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9737    #[serde(rename = "id")]
9738    pub id: Option<String>,
9739    /** **Additional content defined by implementations**
9740
9741 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.
9742
9743 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
9744    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9745    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9746    #[serde(rename = "extension")]
9747    pub extension: Vec<Extension>,
9748    /** **Extensions that cannot be ignored even if unrecognized**
9749
9750 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.
9751
9752Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
9753
9754 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
9755    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9756    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9757    #[serde(rename = "modifierExtension")]
9758    pub modifier_extension: Vec<Extension>,
9759    /** **When the event occurs**
9760
9761 Identifies specific times when the event occurs.
9762
9763 */
9764    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9765    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9766    #[serde(rename = "event")]
9767    pub event: Vec<Option<DateTime>>,
9768    /// Extension field.
9769    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9770    #[serde(rename = "_event")]
9771    #[cfg_attr(feature = "builders", builder(default))]
9772    pub event_ext: Vec<Option<FieldExtension>>,
9773    /** **When the event is to occur**
9774
9775 A set of rules that describe when the event is scheduled.
9776
9777 */
9778    #[serde(default, skip_serializing_if = "Option::is_none")]
9779    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9780    #[serde(rename = "repeat")]
9781    pub repeat: Option<TimingRepeat>,
9782    /// Extension field.
9783    #[serde(default, skip_serializing_if = "Option::is_none")]
9784    #[serde(rename = "_repeat")]
9785    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9786    pub repeat_ext: Option<FieldExtension>,
9787    /** **[TimingAbbreviation](http://hl7.org/fhir/ValueSet/timing-abbreviation); C | BID | TID | QID | AM | PM | QD | QOD | +**
9788
9789 A code for the timing schedule (or just text in code.text). Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing, with the exception that .repeat.bounds still applies over the code (and is not contained in the code).
9790
9791 BID etc. are defined as 'at institutionally specified times'. For example, an institution may choose that BID is "always at 7am and 6pm".  If it is inappropriate for this choice to be made, the code BID should not be used. Instead, a distinct organization-specific code should be used in place of the HL7-defined BID code and/or a structured representation should be used (in this case, specifying the two event times). */
9792    #[serde(default, skip_serializing_if = "Option::is_none")]
9793    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9794    #[serde(rename = "code")]
9795    pub code: Option<CodeableConcept>,
9796    /// Extension field.
9797    #[serde(default, skip_serializing_if = "Option::is_none")]
9798    #[serde(rename = "_code")]
9799    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9800    pub code_ext: Option<FieldExtension>,
9801}
9802#[cfg(feature = "builders")]
9803impl TimingBuilder {
9804    #[doc = concat!("Finalize building ", "Timing", ".")]
9805    pub fn build(self) -> Result<Timing, crate::error::BuilderError> {
9806        self.build_inner().map(Into::into)
9807    }
9808}
9809impl From<TimingInner> for Timing {
9810    fn from(inner: TimingInner) -> Self {
9811        Self(Box::new(inner))
9812    }
9813}
9814impl ::core::ops::Deref for Timing {
9815    type Target = TimingInner;
9816    fn deref(&self) -> &Self::Target {
9817        &self.0
9818    }
9819}
9820impl ::core::ops::DerefMut for Timing {
9821    fn deref_mut(&mut self) -> &mut Self::Target {
9822        &mut self.0
9823    }
9824}
9825impl Timing {
9826    /// Start building an instance.
9827    #[cfg(feature = "builders")]
9828    #[must_use]
9829    pub fn builder() -> TimingBuilder {
9830        TimingBuilder::default()
9831    }
9832}
9833/// Sub-fields of the repeat field in Timing
9834#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9835#[cfg_attr(feature = "builders", derive(Builder))]
9836#[serde(rename_all = "camelCase")]
9837#[cfg_attr(
9838    feature = "builders",
9839    builder(
9840        pattern = "owned",
9841        name = "TimingRepeatBuilder",
9842        build_fn(error = "crate::error::BuilderError")
9843    )
9844)]
9845pub struct TimingRepeat {
9846    /** **Unique id for inter-element referencing**
9847
9848 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
9849
9850 */
9851    #[serde(default, skip_serializing_if = "Option::is_none")]
9852    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9853    #[serde(rename = "id")]
9854    pub id: Option<String>,
9855    /** **Additional content defined by implementations**
9856
9857 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.
9858
9859 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
9860    #[serde(default, skip_serializing_if = "Vec::is_empty")]
9861    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9862    #[serde(rename = "extension")]
9863    pub extension: Vec<Extension>,
9864    /** **Length/Range of lengths, or (Start and/or end) limits**
9865
9866 Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.
9867
9868 */
9869    #[serde(default, skip_serializing_if = "Option::is_none")]
9870    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9871    #[serde(flatten)]
9872    pub bounds: Option<TimingRepeatBounds>,
9873    /// Extension field.
9874    #[serde(default, skip_serializing_if = "Option::is_none")]
9875    #[serde(flatten)]
9876    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9877    pub bounds_ext: Option<TimingRepeatBoundsExtension>,
9878    /** **Number of times to repeat**
9879
9880 A total count of the desired number of repetitions across the duration of the entire timing specification. If countMax is present, this element indicates the lower bound of the allowed range of count values.
9881
9882 If you have both bounds and count, then this should be understood as within the bounds period, until count times happens. */
9883    #[serde(default, skip_serializing_if = "Option::is_none")]
9884    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9885    #[serde(rename = "count")]
9886    pub count: Option<NonZeroU32>,
9887    /// Extension field.
9888    #[serde(default, skip_serializing_if = "Option::is_none")]
9889    #[serde(rename = "_count")]
9890    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9891    pub count_ext: Option<FieldExtension>,
9892    /** **Maximum number of times to repeat**
9893
9894 If present, indicates that the count is a range - so to perform the action between [count] and [countMax] times.
9895
9896 */
9897    #[serde(default, skip_serializing_if = "Option::is_none")]
9898    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9899    #[serde(rename = "countMax")]
9900    pub count_max: Option<NonZeroU32>,
9901    /// Extension field.
9902    #[serde(default, skip_serializing_if = "Option::is_none")]
9903    #[serde(rename = "_countMax")]
9904    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9905    pub count_max_ext: Option<FieldExtension>,
9906    /** **How long when it happens**
9907
9908 How long this thing happens for when it happens. If durationMax is present, this element indicates the lower bound of the allowed range of the duration.
9909
9910 For some events the duration is part of the definition of the event (e.g. IV infusions, where the duration is implicit in the specified quantity and rate). For others, it's part of the timing specification (e.g. exercise). */
9911    #[serde(default, skip_serializing_if = "Option::is_none")]
9912    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9913    #[serde(rename = "duration")]
9914    pub duration: Option<f64>,
9915    /// Extension field.
9916    #[serde(default, skip_serializing_if = "Option::is_none")]
9917    #[serde(rename = "_duration")]
9918    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9919    pub duration_ext: Option<FieldExtension>,
9920    /** **How long when it happens (Max)**
9921
9922 If present, indicates that the duration is a range - so to perform the action between [duration] and [durationMax] time length.
9923
9924 For some events the duration is part of the definition of the event (e.g. IV infusions, where the duration is implicit in the specified quantity and rate). For others, it's part of the timing specification (e.g. exercise). */
9925    #[serde(default, skip_serializing_if = "Option::is_none")]
9926    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9927    #[serde(rename = "durationMax")]
9928    pub duration_max: Option<f64>,
9929    /// Extension field.
9930    #[serde(default, skip_serializing_if = "Option::is_none")]
9931    #[serde(rename = "_durationMax")]
9932    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9933    pub duration_max_ext: Option<FieldExtension>,
9934    /** **[UnitsOfTime](http://hl7.org/fhir/ValueSet/units-of-time); s | min | h | d | wk | mo | a - unit of time (UCUM)**
9935
9936 The units of time for the duration, in UCUM units
9937Normal practice is to use the 'mo' code as a calendar month when calculating the next occurrence.
9938
9939 */
9940    #[serde(default, skip_serializing_if = "Option::is_none")]
9941    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9942    #[serde(rename = "durationUnit")]
9943    pub duration_unit: Option<String>,
9944    /// Extension field.
9945    #[serde(default, skip_serializing_if = "Option::is_none")]
9946    #[serde(rename = "_durationUnit")]
9947    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9948    pub duration_unit_ext: Option<FieldExtension>,
9949    /** **Indicates the number of repetitions that should occur within a period. I.e. Event occurs frequency times per period**
9950
9951 The number of times to repeat the action within the specified period. If frequencyMax is present, this element indicates the lower bound of the allowed range of the frequency.
9952
9953 */
9954    #[serde(default, skip_serializing_if = "Option::is_none")]
9955    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9956    #[serde(rename = "frequency")]
9957    pub frequency: Option<NonZeroU32>,
9958    /// Extension field.
9959    #[serde(default, skip_serializing_if = "Option::is_none")]
9960    #[serde(rename = "_frequency")]
9961    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9962    pub frequency_ext: Option<FieldExtension>,
9963    /** **Event occurs up to frequencyMax times per period**
9964
9965 If present, indicates that the frequency is a range - so to repeat between [frequency] and [frequencyMax] times within the period or period range.
9966
9967 */
9968    #[serde(default, skip_serializing_if = "Option::is_none")]
9969    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9970    #[serde(rename = "frequencyMax")]
9971    pub frequency_max: Option<NonZeroU32>,
9972    /// Extension field.
9973    #[serde(default, skip_serializing_if = "Option::is_none")]
9974    #[serde(rename = "_frequencyMax")]
9975    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9976    pub frequency_max_ext: Option<FieldExtension>,
9977    /** **The duration to which the frequency applies. I.e. Event occurs frequency times per period**
9978
9979 Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. If periodMax is present, this element indicates the lower bound of the allowed range of the period length.
9980
9981 */
9982    #[serde(default, skip_serializing_if = "Option::is_none")]
9983    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9984    #[serde(rename = "period")]
9985    pub period: Option<f64>,
9986    /// Extension field.
9987    #[serde(default, skip_serializing_if = "Option::is_none")]
9988    #[serde(rename = "_period")]
9989    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9990    pub period_ext: Option<FieldExtension>,
9991    /** **Upper limit of period (3-4 hours)**
9992
9993 If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.
9994
9995 */
9996    #[serde(default, skip_serializing_if = "Option::is_none")]
9997    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
9998    #[serde(rename = "periodMax")]
9999    pub period_max: Option<f64>,
10000    /// Extension field.
10001    #[serde(default, skip_serializing_if = "Option::is_none")]
10002    #[serde(rename = "_periodMax")]
10003    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10004    pub period_max_ext: Option<FieldExtension>,
10005    /** **[UnitsOfTime](http://hl7.org/fhir/ValueSet/units-of-time); s | min | h | d | wk | mo | a - unit of time (UCUM)**
10006
10007 The units of time for the period in UCUM units
10008Normal practice is to use the 'mo' code as a calendar month when calculating the next occurrence.
10009
10010 */
10011    #[serde(default, skip_serializing_if = "Option::is_none")]
10012    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10013    #[serde(rename = "periodUnit")]
10014    pub period_unit: Option<String>,
10015    /// Extension field.
10016    #[serde(default, skip_serializing_if = "Option::is_none")]
10017    #[serde(rename = "_periodUnit")]
10018    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10019    pub period_unit_ext: Option<FieldExtension>,
10020    /** **[DayOfWeek](http://hl7.org/fhir/ValueSet/days-of-week); mon | tue | wed | thu | fri | sat | sun**
10021
10022 If one or more days of week is provided, then the action happens only on the specified day(s).
10023
10024 If no days are specified, the action is assumed to happen every day as otherwise specified. */
10025    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10026    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10027    #[serde(rename = "dayOfWeek")]
10028    pub day_of_week: Vec<Option<codes::DaysOfWeek>>,
10029    /// Extension field.
10030    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10031    #[serde(rename = "_dayOfWeek")]
10032    #[cfg_attr(feature = "builders", builder(default))]
10033    pub day_of_week_ext: Vec<Option<FieldExtension>>,
10034    /** **Time of day for action**
10035
10036 Specified time of day for action to take place.
10037
10038 When time of day is specified, it is inferred that the action happens every day (as filtered by dayofWeek) on the specified times. If there's a timeOfDay, there cannot be a when, or vice versa. */
10039    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10040    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10041    #[serde(rename = "timeOfDay")]
10042    pub time_of_day: Vec<Option<Time>>,
10043    /// Extension field.
10044    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10045    #[serde(rename = "_timeOfDay")]
10046    #[cfg_attr(feature = "builders", builder(default))]
10047    pub time_of_day_ext: Vec<Option<FieldExtension>>,
10048    /** **[EventTiming](http://hl7.org/fhir/ValueSet/event-timing); Code for time period of occurrence**
10049
10050 An approximate time period during the day, potentially linked to an event of daily living that indicates when the action should occur.
10051
10052 When more than one event is listed, the event is tied to the union of the specified events. */
10053    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10054    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10055    #[serde(rename = "when")]
10056    pub when: Vec<Option<codes::EventTiming>>,
10057    /// Extension field.
10058    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10059    #[serde(rename = "_when")]
10060    #[cfg_attr(feature = "builders", builder(default))]
10061    pub when_ext: Vec<Option<FieldExtension>>,
10062    /** **Minutes from event (before or after)**
10063
10064 The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.
10065
10066 */
10067    #[serde(default, skip_serializing_if = "Option::is_none")]
10068    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10069    #[serde(rename = "offset")]
10070    pub offset: Option<u32>,
10071    /// Extension field.
10072    #[serde(default, skip_serializing_if = "Option::is_none")]
10073    #[serde(rename = "_offset")]
10074    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10075    pub offset_ext: Option<FieldExtension>,
10076}
10077#[cfg(feature = "builders")]
10078impl TimingRepeat {
10079    ///Start building a new instance
10080    #[must_use]
10081    pub fn builder() -> TimingRepeatBuilder {
10082        TimingRepeatBuilder::default()
10083    }
10084}
10085/// Choice of types for the bounds[x] field in TimingRepeat
10086#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10087#[serde(rename_all = "camelCase")]
10088pub enum TimingRepeatBounds {
10089    /// Variant accepting the Duration type.
10090    #[serde(rename = "boundsDuration")]
10091    Duration(Duration),
10092    /// Variant accepting the Range type.
10093    #[serde(rename = "boundsRange")]
10094    Range(Range),
10095    /// Variant accepting the Period type.
10096    #[serde(rename = "boundsPeriod")]
10097    Period(Period),
10098}
10099/// Extension value for TimingRepeatBounds.
10100#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10101#[serde(rename_all = "camelCase")]
10102pub enum TimingRepeatBoundsExtension {
10103    /// Variant accepting the Duration extension.
10104    #[serde(rename = "_boundsDuration")]
10105    Duration(FieldExtension),
10106    /// Variant accepting the Range extension.
10107    #[serde(rename = "_boundsRange")]
10108    Range(FieldExtension),
10109    /// Variant accepting the Period extension.
10110    #[serde(rename = "_boundsPeriod")]
10111    Period(FieldExtension),
10112}
10113/** TriggerDefinition Type: A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element.
10114
10115 **[TriggerDefinition](http://hl7.org/fhir/StructureDefinition/TriggerDefinition) v5.0.0**
10116
10117 Defines an expected trigger for a module
10118
10119 A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element.
10120
10121 If an event is a named-event, it means the event is completely pre-coordinated, and no other information can be specified for the event. If the event is one of the data- events, the data and condition elements specify the triggering criteria. The data element specifies the structured component, and the condition element provides additional optional refinement of that structured component. If the event is periodic, the timing element defines when the event is triggered. For both data- and periodic events, a name can be provided as a shorthand for the formal semantics provided by the other elements. */
10122#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10123#[serde(transparent)]
10124pub struct TriggerDefinition(pub Box<TriggerDefinitionInner>);
10125/** TriggerDefinition Type: A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element.
10126
10127 **[TriggerDefinition](http://hl7.org/fhir/StructureDefinition/TriggerDefinition) v5.0.0**
10128
10129 Defines an expected trigger for a module
10130
10131 A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element.
10132
10133 If an event is a named-event, it means the event is completely pre-coordinated, and no other information can be specified for the event. If the event is one of the data- events, the data and condition elements specify the triggering criteria. The data element specifies the structured component, and the condition element provides additional optional refinement of that structured component. If the event is periodic, the timing element defines when the event is triggered. For both data- and periodic events, a name can be provided as a shorthand for the formal semantics provided by the other elements. */
10134#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10135#[cfg_attr(feature = "builders", derive(Builder))]
10136#[serde(rename_all = "camelCase")]
10137#[cfg_attr(
10138    feature = "builders",
10139    builder(
10140        pattern = "owned",
10141        name = "TriggerDefinitionBuilder",
10142        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
10143    )
10144)]
10145pub struct TriggerDefinitionInner {
10146    /** **Unique id for inter-element referencing**
10147
10148 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
10149
10150 */
10151    #[serde(default, skip_serializing_if = "Option::is_none")]
10152    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10153    #[serde(rename = "id")]
10154    pub id: Option<String>,
10155    /** **Additional content defined by implementations**
10156
10157 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.
10158
10159 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
10160    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10161    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10162    #[serde(rename = "extension")]
10163    pub extension: Vec<Extension>,
10164    /** **[TriggerType](http://hl7.org/fhir/ValueSet/trigger-type); named-event | periodic | data-changed | data-added | data-modified | data-removed | data-accessed | data-access-ended**
10165
10166 The type of triggering event.
10167
10168 */
10169    #[serde(rename = "type")]
10170    pub r#type: codes::TriggerType,
10171    /// Extension field.
10172    #[serde(default, skip_serializing_if = "Option::is_none")]
10173    #[serde(rename = "_type")]
10174    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10175    pub r#type_ext: Option<FieldExtension>,
10176    /** **Name or URI that identifies the event**
10177
10178 A formal name for the event. This may be an absolute URI that identifies the event formally (e.g. from a trigger registry), or a simple relative URI that identifies the event in a local context.
10179
10180 An event name can be provided for all event types, but is required for named events. If a name is provided for a type other than named events, it is considered to be a shorthand for the semantics described by the formal description of the event. */
10181    #[serde(default, skip_serializing_if = "Option::is_none")]
10182    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10183    #[serde(rename = "name")]
10184    pub name: Option<String>,
10185    /// Extension field.
10186    #[serde(default, skip_serializing_if = "Option::is_none")]
10187    #[serde(rename = "_name")]
10188    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10189    pub name_ext: Option<FieldExtension>,
10190    /** **Coded definition of the event**
10191
10192 A code that identifies the event.
10193
10194 */
10195    #[serde(default, skip_serializing_if = "Option::is_none")]
10196    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10197    #[serde(rename = "code")]
10198    pub code: Option<CodeableConcept>,
10199    /// Extension field.
10200    #[serde(default, skip_serializing_if = "Option::is_none")]
10201    #[serde(rename = "_code")]
10202    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10203    pub code_ext: Option<FieldExtension>,
10204    /** **What event**
10205
10206 A reference to a SubscriptionTopic resource that defines the event. If this element is provided, no other information about the trigger definition may be supplied.
10207
10208 */
10209    #[serde(default, skip_serializing_if = "Option::is_none")]
10210    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10211    #[serde(rename = "subscriptionTopic")]
10212    pub subscription_topic: Option<String>,
10213    /// Extension field.
10214    #[serde(default, skip_serializing_if = "Option::is_none")]
10215    #[serde(rename = "_subscriptionTopic")]
10216    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10217    pub subscription_topic_ext: Option<FieldExtension>,
10218    /** **Timing of the event**
10219
10220 The timing of the event (if this is a periodic trigger).
10221
10222 */
10223    #[serde(default, skip_serializing_if = "Option::is_none")]
10224    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10225    #[serde(flatten)]
10226    pub timing: Option<TriggerDefinitionTiming>,
10227    /// Extension field.
10228    #[serde(default, skip_serializing_if = "Option::is_none")]
10229    #[serde(flatten)]
10230    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10231    pub timing_ext: Option<TriggerDefinitionTimingExtension>,
10232    /** **Triggering data of the event (multiple = 'and')**
10233
10234 The triggering data of the event (if this is a data trigger). If more than one data is requirement is specified, then all the data requirements must be true.
10235
10236 This element shall be present for any data type trigger. */
10237    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10238    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10239    #[serde(rename = "data")]
10240    pub data: Vec<Option<DataRequirement>>,
10241    /// Extension field.
10242    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10243    #[serde(rename = "_data")]
10244    #[cfg_attr(feature = "builders", builder(default))]
10245    pub data_ext: Vec<Option<FieldExtension>>,
10246    /** **Whether the event triggers (boolean expression)**
10247
10248 A boolean-valued expression that is evaluated in the context of the container of the trigger definition and returns whether or not the trigger fires.
10249
10250 This element can be only be specified for data type triggers and provides additional semantics for the trigger. The context available within the condition is based on the type of data event. For all events, the current resource will be available as context. In addition, for modification events, the previous resource will also be available. The expression may be inlined, or may be a simple absolute URI, which is a reference to a named expression within a logic library referenced by a library element or extension within the containing resource. If the expression is a FHIR Path expression, it evaluates in the context of a resource of one of the type identified in the data requirement, and may also refer to the variable %previous for delta comparisons on events of type data-changed, data-modified, and data-deleted which will always have the same type. */
10251    #[serde(default, skip_serializing_if = "Option::is_none")]
10252    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10253    #[serde(rename = "condition")]
10254    pub condition: Option<Expression>,
10255    /// Extension field.
10256    #[serde(default, skip_serializing_if = "Option::is_none")]
10257    #[serde(rename = "_condition")]
10258    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10259    pub condition_ext: Option<FieldExtension>,
10260}
10261#[cfg(feature = "builders")]
10262impl TriggerDefinitionBuilder {
10263    #[doc = concat!("Finalize building ", "TriggerDefinition", ".")]
10264    pub fn build(self) -> Result<TriggerDefinition, crate::error::BuilderError> {
10265        self.build_inner().map(Into::into)
10266    }
10267}
10268impl From<TriggerDefinitionInner> for TriggerDefinition {
10269    fn from(inner: TriggerDefinitionInner) -> Self {
10270        Self(Box::new(inner))
10271    }
10272}
10273impl ::core::ops::Deref for TriggerDefinition {
10274    type Target = TriggerDefinitionInner;
10275    fn deref(&self) -> &Self::Target {
10276        &self.0
10277    }
10278}
10279impl ::core::ops::DerefMut for TriggerDefinition {
10280    fn deref_mut(&mut self) -> &mut Self::Target {
10281        &mut self.0
10282    }
10283}
10284impl TriggerDefinition {
10285    /// Start building an instance.
10286    #[cfg(feature = "builders")]
10287    #[must_use]
10288    pub fn builder() -> TriggerDefinitionBuilder {
10289        TriggerDefinitionBuilder::default()
10290    }
10291}
10292/// Choice of types for the timing[x] field in TriggerDefinition
10293#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10294#[serde(rename_all = "camelCase")]
10295pub enum TriggerDefinitionTiming {
10296    /// Variant accepting the Timing type.
10297    #[serde(rename = "timingTiming")]
10298    Timing(Timing),
10299    /// Variant accepting the Reference type.
10300    #[serde(rename = "timingReference")]
10301    Reference(Reference),
10302    /// Variant accepting the Date type.
10303    #[serde(rename = "timingDate")]
10304    Date(Date),
10305    /// Variant accepting the DateTime type.
10306    #[serde(rename = "timingDateTime")]
10307    DateTime(DateTime),
10308}
10309/// Extension value for TriggerDefinitionTiming.
10310#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10311#[serde(rename_all = "camelCase")]
10312pub enum TriggerDefinitionTimingExtension {
10313    /// Variant accepting the Timing extension.
10314    #[serde(rename = "_timingTiming")]
10315    Timing(FieldExtension),
10316    /// Variant accepting the Reference extension.
10317    #[serde(rename = "_timingReference")]
10318    Reference(FieldExtension),
10319    /// Variant accepting the Date extension.
10320    #[serde(rename = "_timingDate")]
10321    Date(FieldExtension),
10322    /// Variant accepting the DateTime extension.
10323    #[serde(rename = "_timingDateTime")]
10324    DateTime(FieldExtension),
10325}
10326/** UsageContext Type: Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care).
10327
10328 **[UsageContext](http://hl7.org/fhir/StructureDefinition/UsageContext) v5.0.0**
10329
10330 Describes the context of use for a conformance or knowledge resource
10331
10332 Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care).
10333
10334 */
10335#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10336#[serde(transparent)]
10337pub struct UsageContext(pub Box<UsageContextInner>);
10338/** UsageContext Type: Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care).
10339
10340 **[UsageContext](http://hl7.org/fhir/StructureDefinition/UsageContext) v5.0.0**
10341
10342 Describes the context of use for a conformance or knowledge resource
10343
10344 Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care).
10345
10346 */
10347#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10348#[cfg_attr(feature = "builders", derive(Builder))]
10349#[serde(rename_all = "camelCase")]
10350#[cfg_attr(
10351    feature = "builders",
10352    builder(
10353        pattern = "owned",
10354        name = "UsageContextBuilder",
10355        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
10356    )
10357)]
10358pub struct UsageContextInner {
10359    /** **Unique id for inter-element referencing**
10360
10361 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
10362
10363 */
10364    #[serde(default, skip_serializing_if = "Option::is_none")]
10365    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10366    #[serde(rename = "id")]
10367    pub id: Option<String>,
10368    /** **Additional content defined by implementations**
10369
10370 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.
10371
10372 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
10373    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10374    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10375    #[serde(rename = "extension")]
10376    pub extension: Vec<Extension>,
10377    /** **[UsageContextType](http://terminology.hl7.org/ValueSet/usage-context-type); Type of context being specified**
10378
10379 A code that identifies the type of context being specified by this usage context.
10380
10381 */
10382    #[serde(rename = "code")]
10383    pub code: Coding,
10384    /// Extension field.
10385    #[serde(default, skip_serializing_if = "Option::is_none")]
10386    #[serde(rename = "_code")]
10387    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10388    pub code_ext: Option<FieldExtension>,
10389    /** **Value that defines the context**
10390
10391 A value that defines the context specified in this context of use. The interpretation of the value is defined by the code.
10392
10393 */
10394    #[serde(flatten)]
10395    pub value: UsageContextValue,
10396    /// Extension field.
10397    #[serde(default, skip_serializing_if = "Option::is_none")]
10398    #[serde(flatten)]
10399    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10400    pub value_ext: Option<UsageContextValueExtension>,
10401}
10402#[cfg(feature = "builders")]
10403impl UsageContextBuilder {
10404    #[doc = concat!("Finalize building ", "UsageContext", ".")]
10405    pub fn build(self) -> Result<UsageContext, crate::error::BuilderError> {
10406        self.build_inner().map(Into::into)
10407    }
10408}
10409impl From<UsageContextInner> for UsageContext {
10410    fn from(inner: UsageContextInner) -> Self {
10411        Self(Box::new(inner))
10412    }
10413}
10414impl ::core::ops::Deref for UsageContext {
10415    type Target = UsageContextInner;
10416    fn deref(&self) -> &Self::Target {
10417        &self.0
10418    }
10419}
10420impl ::core::ops::DerefMut for UsageContext {
10421    fn deref_mut(&mut self) -> &mut Self::Target {
10422        &mut self.0
10423    }
10424}
10425impl UsageContext {
10426    /// Start building an instance.
10427    #[cfg(feature = "builders")]
10428    #[must_use]
10429    pub fn builder() -> UsageContextBuilder {
10430        UsageContextBuilder::default()
10431    }
10432}
10433/// Choice of types for the value[x] field in UsageContext
10434#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10435#[serde(rename_all = "camelCase")]
10436pub enum UsageContextValue {
10437    /// Variant accepting the CodeableConcept type.
10438    #[serde(rename = "valueCodeableConcept")]
10439    CodeableConcept(CodeableConcept),
10440    /// Variant accepting the Quantity type.
10441    #[serde(rename = "valueQuantity")]
10442    Quantity(Quantity),
10443    /// Variant accepting the Range type.
10444    #[serde(rename = "valueRange")]
10445    Range(Range),
10446    /// Variant accepting the Reference type.
10447    #[serde(rename = "valueReference")]
10448    Reference(Reference),
10449}
10450/// Extension value for UsageContextValue.
10451#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10452#[serde(rename_all = "camelCase")]
10453pub enum UsageContextValueExtension {
10454    /// Variant accepting the CodeableConcept extension.
10455    #[serde(rename = "_valueCodeableConcept")]
10456    CodeableConcept(FieldExtension),
10457    /// Variant accepting the Quantity extension.
10458    #[serde(rename = "_valueQuantity")]
10459    Quantity(FieldExtension),
10460    /// Variant accepting the Range extension.
10461    #[serde(rename = "_valueRange")]
10462    Range(FieldExtension),
10463    /// Variant accepting the Reference extension.
10464    #[serde(rename = "_valueReference")]
10465    Reference(FieldExtension),
10466}
10467/** VirtualServiceDetail Type: Virtual Service Contact Details.
10468
10469 **[VirtualServiceDetail](http://hl7.org/fhir/StructureDefinition/VirtualServiceDetail) v5.0.0**
10470
10471 Virtual Service Contact Details
10472
10473 Virtual Service Contact Details.
10474
10475 */
10476#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10477#[serde(transparent)]
10478pub struct VirtualServiceDetail(pub Box<VirtualServiceDetailInner>);
10479/** VirtualServiceDetail Type: Virtual Service Contact Details.
10480
10481 **[VirtualServiceDetail](http://hl7.org/fhir/StructureDefinition/VirtualServiceDetail) v5.0.0**
10482
10483 Virtual Service Contact Details
10484
10485 Virtual Service Contact Details.
10486
10487 */
10488#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10489#[cfg_attr(feature = "builders", derive(Builder))]
10490#[serde(rename_all = "camelCase")]
10491#[cfg_attr(
10492    feature = "builders",
10493    builder(
10494        pattern = "owned",
10495        name = "VirtualServiceDetailBuilder",
10496        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
10497    )
10498)]
10499pub struct VirtualServiceDetailInner {
10500    /** **Unique id for inter-element referencing**
10501
10502 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
10503
10504 */
10505    #[serde(default, skip_serializing_if = "Option::is_none")]
10506    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10507    #[serde(rename = "id")]
10508    pub id: Option<String>,
10509    /** **Additional content defined by implementations**
10510
10511 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.
10512
10513 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
10514    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10515    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10516    #[serde(rename = "extension")]
10517    pub extension: Vec<Extension>,
10518    /** **[VirtualServiceType](http://hl7.org/fhir/ValueSet/virtual-service-type); Channel Type**
10519
10520 The type of virtual service to connect to (i.e. Teams, Zoom, Specific VMR technology, WhatsApp).
10521
10522 As this type defines what the virtual service is, it then defines what address and additional information might be relevant.
10523
10524Some profiles could be used for specific types to define what the other values could/should be. */
10525    #[serde(default, skip_serializing_if = "Option::is_none")]
10526    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10527    #[serde(rename = "channelType")]
10528    pub channel_type: Option<Coding>,
10529    /// Extension field.
10530    #[serde(default, skip_serializing_if = "Option::is_none")]
10531    #[serde(rename = "_channelType")]
10532    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10533    pub channel_type_ext: Option<FieldExtension>,
10534    /** **Contact address/number**
10535
10536 What address or number needs to be used for a user to connect to the virtual service to join. The channelType informs as to which datatype is appropriate to use (requires knowledge of the specific type).
10537
10538 */
10539    #[serde(default, skip_serializing_if = "Option::is_none")]
10540    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10541    #[serde(flatten)]
10542    pub address: Option<VirtualServiceDetailAddress>,
10543    /// Extension field.
10544    #[serde(default, skip_serializing_if = "Option::is_none")]
10545    #[serde(flatten)]
10546    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10547    pub address_ext: Option<VirtualServiceDetailAddressExtension>,
10548    /** **Address to see alternative connection details**
10549
10550 Address to see alternative connection details.
10551
10552 This web address can be used to provide additional details on the call, such as alternative/regional call in numbers, or other associated services. */
10553    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10554    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10555    #[serde(rename = "additionalInfo")]
10556    pub additional_info: Vec<Option<String>>,
10557    /// Extension field.
10558    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10559    #[serde(rename = "_additionalInfo")]
10560    #[cfg_attr(feature = "builders", builder(default))]
10561    pub additional_info_ext: Vec<Option<FieldExtension>>,
10562    /** **Maximum number of participants supported by the virtual service**
10563
10564 Maximum number of participants supported by the virtual service.
10565
10566 Some services have only a limitted number of participants permitted to connect at a time, this is typically used in "shared" virtual services that you might find on location resources.
10567
10568Typically on-demand services might not have these restrictions. */
10569    #[serde(default, skip_serializing_if = "Option::is_none")]
10570    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10571    #[serde(rename = "maxParticipants")]
10572    pub max_participants: Option<NonZeroU32>,
10573    /// Extension field.
10574    #[serde(default, skip_serializing_if = "Option::is_none")]
10575    #[serde(rename = "_maxParticipants")]
10576    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10577    pub max_participants_ext: Option<FieldExtension>,
10578    /** **Session Key required by the virtual service**
10579
10580 Session Key required by the virtual service.
10581
10582 Some services require a session key to be able to access the service once connected.
10583
10584This could be in cases where a shared number is used, and a session key is added to put into a private line, or to identify the participant in a call. */
10585    #[serde(default, skip_serializing_if = "Option::is_none")]
10586    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10587    #[serde(rename = "sessionKey")]
10588    pub session_key: Option<String>,
10589    /// Extension field.
10590    #[serde(default, skip_serializing_if = "Option::is_none")]
10591    #[serde(rename = "_sessionKey")]
10592    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10593    pub session_key_ext: Option<FieldExtension>,
10594}
10595#[cfg(feature = "builders")]
10596impl VirtualServiceDetailBuilder {
10597    #[doc = concat!("Finalize building ", "VirtualServiceDetail", ".")]
10598    pub fn build(self) -> Result<VirtualServiceDetail, crate::error::BuilderError> {
10599        self.build_inner().map(Into::into)
10600    }
10601}
10602impl From<VirtualServiceDetailInner> for VirtualServiceDetail {
10603    fn from(inner: VirtualServiceDetailInner) -> Self {
10604        Self(Box::new(inner))
10605    }
10606}
10607impl ::core::ops::Deref for VirtualServiceDetail {
10608    type Target = VirtualServiceDetailInner;
10609    fn deref(&self) -> &Self::Target {
10610        &self.0
10611    }
10612}
10613impl ::core::ops::DerefMut for VirtualServiceDetail {
10614    fn deref_mut(&mut self) -> &mut Self::Target {
10615        &mut self.0
10616    }
10617}
10618impl VirtualServiceDetail {
10619    /// Start building an instance.
10620    #[cfg(feature = "builders")]
10621    #[must_use]
10622    pub fn builder() -> VirtualServiceDetailBuilder {
10623        VirtualServiceDetailBuilder::default()
10624    }
10625}
10626/// Choice of types for the address[x] field in VirtualServiceDetail
10627#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10628#[serde(rename_all = "camelCase")]
10629pub enum VirtualServiceDetailAddress {
10630    /// Variant accepting the Url type.
10631    #[serde(rename = "addressUrl")]
10632    Url(String),
10633    /// Variant accepting the String type.
10634    #[serde(rename = "addressString")]
10635    String(String),
10636    /// Variant accepting the ContactPoint type.
10637    #[serde(rename = "addressContactPoint")]
10638    ContactPoint(ContactPoint),
10639    /// Variant accepting the ExtendedContactDetail type.
10640    #[serde(rename = "addressExtendedContactDetail")]
10641    ExtendedContactDetail(ExtendedContactDetail),
10642}
10643/// Extension value for VirtualServiceDetailAddress.
10644#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10645#[serde(rename_all = "camelCase")]
10646pub enum VirtualServiceDetailAddressExtension {
10647    /// Variant accepting the Url extension.
10648    #[serde(rename = "_addressUrl")]
10649    Url(FieldExtension),
10650    /// Variant accepting the String extension.
10651    #[serde(rename = "_addressString")]
10652    String(FieldExtension),
10653    /// Variant accepting the ContactPoint extension.
10654    #[serde(rename = "_addressContactPoint")]
10655    ContactPoint(FieldExtension),
10656    /// Variant accepting the ExtendedContactDetail extension.
10657    #[serde(rename = "_addressExtendedContactDetail")]
10658    ExtendedContactDetail(FieldExtension),
10659}
10660/** An amount of money. With regard to precision, see [Decimal Precision](datatypes.html#precision)
10661
10662 **[MoneyQuantity](http://hl7.org/fhir/StructureDefinition/MoneyQuantity) v5.0.0**
10663
10664 An amount of money. With regard to precision, see [Decimal Precision](datatypes.html#precision)
10665
10666 There SHALL be a code if there is a value and it SHALL be an expression of currency.  If system is present, it SHALL be ISO 4217 (system = "urn:iso:std:iso:4217" - currency).
10667
10668 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
10669#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10670#[serde(transparent)]
10671pub struct MoneyQuantity(pub Box<MoneyQuantityInner>);
10672/** An amount of money. With regard to precision, see [Decimal Precision](datatypes.html#precision)
10673
10674 **[MoneyQuantity](http://hl7.org/fhir/StructureDefinition/MoneyQuantity) v5.0.0**
10675
10676 An amount of money. With regard to precision, see [Decimal Precision](datatypes.html#precision)
10677
10678 There SHALL be a code if there is a value and it SHALL be an expression of currency.  If system is present, it SHALL be ISO 4217 (system = "urn:iso:std:iso:4217" - currency).
10679
10680 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
10681#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10682#[cfg_attr(feature = "builders", derive(Builder))]
10683#[serde(rename_all = "camelCase")]
10684#[cfg_attr(
10685    feature = "builders",
10686    builder(
10687        pattern = "owned",
10688        name = "MoneyQuantityBuilder",
10689        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
10690    )
10691)]
10692pub struct MoneyQuantityInner {
10693    /** **Unique id for inter-element referencing**
10694
10695 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
10696
10697 */
10698    #[serde(default, skip_serializing_if = "Option::is_none")]
10699    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10700    #[serde(rename = "id")]
10701    pub id: Option<String>,
10702    /** **Additional content defined by implementations**
10703
10704 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.
10705
10706 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
10707    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10708    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10709    #[serde(rename = "extension")]
10710    pub extension: Vec<Extension>,
10711    /** **Numerical value (with implicit precision)**
10712
10713 The value of the measured amount. The value includes an implicit precision in the presentation of the value.
10714
10715 The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books). */
10716    #[serde(default, skip_serializing_if = "Option::is_none")]
10717    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10718    #[serde(rename = "value")]
10719    pub value: Option<f64>,
10720    /// Extension field.
10721    #[serde(default, skip_serializing_if = "Option::is_none")]
10722    #[serde(rename = "_value")]
10723    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10724    pub value_ext: Option<FieldExtension>,
10725    /** **[QuantityComparator](http://hl7.org/fhir/ValueSet/quantity-comparator); < | <= | >= | > | ad - how to understand the value**
10726
10727 How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.
10728
10729 */
10730    #[serde(default, skip_serializing_if = "Option::is_none")]
10731    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10732    #[serde(rename = "comparator")]
10733    pub comparator: Option<codes::QuantityComparator>,
10734    /// Extension field.
10735    #[serde(default, skip_serializing_if = "Option::is_none")]
10736    #[serde(rename = "_comparator")]
10737    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10738    pub comparator_ext: Option<FieldExtension>,
10739    /** **Unit representation**
10740
10741 A human-readable form of the unit.
10742
10743 */
10744    #[serde(default, skip_serializing_if = "Option::is_none")]
10745    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10746    #[serde(rename = "unit")]
10747    pub unit: Option<String>,
10748    /// Extension field.
10749    #[serde(default, skip_serializing_if = "Option::is_none")]
10750    #[serde(rename = "_unit")]
10751    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10752    pub unit_ext: Option<FieldExtension>,
10753    /** **System that defines coded unit form**
10754
10755 The identification of the system that provides the coded form of the unit.
10756
10757 */
10758    #[serde(default, skip_serializing_if = "Option::is_none")]
10759    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10760    #[serde(rename = "system")]
10761    pub system: Option<String>,
10762    /// Extension field.
10763    #[serde(default, skip_serializing_if = "Option::is_none")]
10764    #[serde(rename = "_system")]
10765    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10766    pub system_ext: Option<FieldExtension>,
10767    /** **Coded form of the unit**
10768
10769 A computer processable form of the unit in some unit representation system.
10770
10771 The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency.  The context of use may additionally require a code from a particular system. */
10772    #[serde(default, skip_serializing_if = "Option::is_none")]
10773    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10774    #[serde(rename = "code")]
10775    pub code: Option<String>,
10776    /// Extension field.
10777    #[serde(default, skip_serializing_if = "Option::is_none")]
10778    #[serde(rename = "_code")]
10779    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10780    pub code_ext: Option<FieldExtension>,
10781}
10782#[cfg(feature = "builders")]
10783impl MoneyQuantityBuilder {
10784    #[doc = concat!("Finalize building ", "MoneyQuantity", ".")]
10785    pub fn build(self) -> Result<MoneyQuantity, crate::error::BuilderError> {
10786        self.build_inner().map(Into::into)
10787    }
10788}
10789impl From<MoneyQuantityInner> for MoneyQuantity {
10790    fn from(inner: MoneyQuantityInner) -> Self {
10791        Self(Box::new(inner))
10792    }
10793}
10794impl ::core::ops::Deref for MoneyQuantity {
10795    type Target = MoneyQuantityInner;
10796    fn deref(&self) -> &Self::Target {
10797        &self.0
10798    }
10799}
10800impl ::core::ops::DerefMut for MoneyQuantity {
10801    fn deref_mut(&mut self) -> &mut Self::Target {
10802        &mut self.0
10803    }
10804}
10805impl MoneyQuantity {
10806    /// Start building an instance.
10807    #[cfg(feature = "builders")]
10808    #[must_use]
10809    pub fn builder() -> MoneyQuantityBuilder {
10810        MoneyQuantityBuilder::default()
10811    }
10812}
10813/** A fixed quantity (no comparator)
10814
10815 **[SimpleQuantity](http://hl7.org/fhir/StructureDefinition/SimpleQuantity) v5.0.0**
10816
10817 A fixed quantity (no comparator)
10818
10819 The comparator is not used on a SimpleQuantity
10820
10821 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
10822#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10823#[serde(transparent)]
10824pub struct SimpleQuantity(pub Box<SimpleQuantityInner>);
10825/** A fixed quantity (no comparator)
10826
10827 **[SimpleQuantity](http://hl7.org/fhir/StructureDefinition/SimpleQuantity) v5.0.0**
10828
10829 A fixed quantity (no comparator)
10830
10831 The comparator is not used on a SimpleQuantity
10832
10833 The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator. */
10834#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10835#[cfg_attr(feature = "builders", derive(Builder))]
10836#[serde(rename_all = "camelCase")]
10837#[cfg_attr(
10838    feature = "builders",
10839    builder(
10840        pattern = "owned",
10841        name = "SimpleQuantityBuilder",
10842        build_fn(error = "crate::error::BuilderError", name = "build_inner"),
10843    )
10844)]
10845pub struct SimpleQuantityInner {
10846    /** **Unique id for inter-element referencing**
10847
10848 Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
10849
10850 */
10851    #[serde(default, skip_serializing_if = "Option::is_none")]
10852    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10853    #[serde(rename = "id")]
10854    pub id: Option<String>,
10855    /** **Additional content defined by implementations**
10856
10857 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.
10858
10859 There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone. */
10860    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10861    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10862    #[serde(rename = "extension")]
10863    pub extension: Vec<Extension>,
10864    /** **Numerical value (with implicit precision)**
10865
10866 The value of the measured amount. The value includes an implicit precision in the presentation of the value.
10867
10868 The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books). */
10869    #[serde(default, skip_serializing_if = "Option::is_none")]
10870    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10871    #[serde(rename = "value")]
10872    pub value: Option<f64>,
10873    /// Extension field.
10874    #[serde(default, skip_serializing_if = "Option::is_none")]
10875    #[serde(rename = "_value")]
10876    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10877    pub value_ext: Option<FieldExtension>,
10878    /** **[QuantityComparator](http://hl7.org/fhir/ValueSet/quantity-comparator); < | <= | >= | > | ad - how to understand the value**
10879
10880 Not allowed to be used in this context
10881
10882 */
10883    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10884    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10885    #[serde(rename = "comparator")]
10886    pub comparator: Vec<Option<codes::QuantityComparator>>,
10887    /// Extension field.
10888    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10889    #[serde(rename = "_comparator")]
10890    #[cfg_attr(feature = "builders", builder(default))]
10891    pub comparator_ext: Vec<Option<FieldExtension>>,
10892    /** **Unit representation**
10893
10894 A human-readable form of the unit.
10895
10896 */
10897    #[serde(default, skip_serializing_if = "Option::is_none")]
10898    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10899    #[serde(rename = "unit")]
10900    pub unit: Option<String>,
10901    /// Extension field.
10902    #[serde(default, skip_serializing_if = "Option::is_none")]
10903    #[serde(rename = "_unit")]
10904    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10905    pub unit_ext: Option<FieldExtension>,
10906    /** **System that defines coded unit form**
10907
10908 The identification of the system that provides the coded form of the unit.
10909
10910 */
10911    #[serde(default, skip_serializing_if = "Option::is_none")]
10912    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10913    #[serde(rename = "system")]
10914    pub system: Option<String>,
10915    /// Extension field.
10916    #[serde(default, skip_serializing_if = "Option::is_none")]
10917    #[serde(rename = "_system")]
10918    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10919    pub system_ext: Option<FieldExtension>,
10920    /** **Coded form of the unit**
10921
10922 A computer processable form of the unit in some unit representation system.
10923
10924 The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency.  The context of use may additionally require a code from a particular system. */
10925    #[serde(default, skip_serializing_if = "Option::is_none")]
10926    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10927    #[serde(rename = "code")]
10928    pub code: Option<String>,
10929    /// Extension field.
10930    #[serde(default, skip_serializing_if = "Option::is_none")]
10931    #[serde(rename = "_code")]
10932    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10933    pub code_ext: Option<FieldExtension>,
10934}
10935#[cfg(feature = "builders")]
10936impl SimpleQuantityBuilder {
10937    #[doc = concat!("Finalize building ", "SimpleQuantity", ".")]
10938    pub fn build(self) -> Result<SimpleQuantity, crate::error::BuilderError> {
10939        self.build_inner().map(Into::into)
10940    }
10941}
10942impl From<SimpleQuantityInner> for SimpleQuantity {
10943    fn from(inner: SimpleQuantityInner) -> Self {
10944        Self(Box::new(inner))
10945    }
10946}
10947impl ::core::ops::Deref for SimpleQuantity {
10948    type Target = SimpleQuantityInner;
10949    fn deref(&self) -> &Self::Target {
10950        &self.0
10951    }
10952}
10953impl ::core::ops::DerefMut for SimpleQuantity {
10954    fn deref_mut(&mut self) -> &mut Self::Target {
10955        &mut self.0
10956    }
10957}
10958impl SimpleQuantity {
10959    /// Start building an instance.
10960    #[cfg(feature = "builders")]
10961    #[must_use]
10962    pub fn builder() -> SimpleQuantityBuilder {
10963        SimpleQuantityBuilder::default()
10964    }
10965}
10966/// Extension of a field.
10967#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
10968#[cfg_attr(feature = "builders", derive(Builder))]
10969#[serde(rename_all = "camelCase")]
10970#[cfg_attr(
10971    feature = "builders",
10972    builder(
10973        pattern = "owned",
10974        name = "FieldExtensionBuilder",
10975        build_fn(error = "crate::error::BuilderError")
10976    )
10977)]
10978pub struct FieldExtension {
10979    /// Unique id for inter-element referencing
10980    #[serde(default, skip_serializing_if = "Option::is_none")]
10981    #[cfg_attr(feature = "builders", builder(default, setter(strip_option)))]
10982    pub id: Option<String>,
10983    /// Additional content defined by implementations
10984    #[serde(default, skip_serializing_if = "Vec::is_empty")]
10985    #[cfg_attr(feature = "builders", builder(default))]
10986    pub extension: Vec<Extension>,
10987}
10988#[cfg(feature = "builders")]
10989impl FieldExtension {
10990    ///Start building a new FieldExtension.
10991    #[must_use]
10992    pub fn builder() -> FieldExtensionBuilder {
10993        FieldExtensionBuilder::default()
10994    }
10995}