Skip to main content

haste_fhir_model/r4/generated/
types.rs

1#![allow(non_snake_case)]
2#[doc = r" DO NOT EDIT THIS FILE. It is auto-generated by the FHIR Rust code generator."]
3use self::super::resources::Resource;
4use self::super::terminology;
5use haste_fhir_serialization_json;
6use haste_reflect::{MetaValue, derive::Reflect};
7#[derive(
8    Clone,
9    Reflect,
10    Debug,
11    Default,
12    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
13    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
14)]
15#[fhir_type = "Element"]
16#[fhir_serialize_type = "complex"]
17#[doc = "Base definition for all elements in a resource."]
18pub struct Element {
19    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
20    pub id: Option<String>,
21    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
22    pub extension: Option<Vec<Extension>>,
23}
24#[derive(
25    Clone,
26    Reflect,
27    Debug,
28    Default,
29    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
30    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
31)]
32#[fhir_type = "BackboneElement"]
33#[fhir_serialize_type = "complex"]
34#[doc = "Base definition for all elements that are defined inside a resource - but not those in a data type."]
35pub struct BackboneElement {
36    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
37    pub id: Option<String>,
38    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
39    pub extension: Option<Vec<Extension>>,
40    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
41    pub modifierExtension: Option<Vec<Extension>>,
42}
43#[derive(
44    Clone,
45    Reflect,
46    Debug,
47    Default,
48    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
49    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
50)]
51#[fhir_type = "base64Binary"]
52#[fhir_serialize_type = "primitive"]
53#[doc = "A stream of bytes"]
54pub struct FHIRBase64Binary {
55    #[doc = "unique id for the element within a resource (for internal references)"]
56    pub id: Option<String>,
57    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
58    pub extension: Option<Vec<Extension>>,
59    #[doc = "The actual value"]
60    pub value: Option<String>,
61}
62impl FHIRBase64Binary {
63    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
64        &mut self.extension
65    }
66    pub fn id_mut(&mut self) -> &mut Option<String> {
67        &mut self.id
68    }
69}
70impl From<String> for FHIRBase64Binary {
71    fn from(value: String) -> Self {
72        Self {
73            value: Some(value),
74            ..Default::default()
75        }
76    }
77}
78#[derive(
79    Clone,
80    Reflect,
81    Debug,
82    Default,
83    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
84    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
85)]
86#[fhir_type = "boolean"]
87#[fhir_serialize_type = "primitive"]
88#[doc = "Value of \"true\" or \"false\""]
89pub struct FHIRBoolean {
90    #[doc = "unique id for the element within a resource (for internal references)"]
91    pub id: Option<String>,
92    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
93    pub extension: Option<Vec<Extension>>,
94    #[doc = "The actual value"]
95    pub value: Option<bool>,
96}
97impl FHIRBoolean {
98    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
99        &mut self.extension
100    }
101    pub fn id_mut(&mut self) -> &mut Option<String> {
102        &mut self.id
103    }
104}
105impl From<bool> for FHIRBoolean {
106    fn from(value: bool) -> Self {
107        Self {
108            value: Some(value),
109            ..Default::default()
110        }
111    }
112}
113#[derive(
114    Clone,
115    Reflect,
116    Debug,
117    Default,
118    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
119    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
120)]
121#[fhir_type = "canonical"]
122#[fhir_serialize_type = "primitive"]
123#[doc = "A URI that is a reference to a canonical URL on a FHIR resource"]
124pub struct FHIRCanonical {
125    #[doc = "unique id for the element within a resource (for internal references)"]
126    pub id: Option<String>,
127    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
128    pub extension: Option<Vec<Extension>>,
129    #[doc = "Primitive value for canonical"]
130    pub value: Option<String>,
131}
132impl FHIRCanonical {
133    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
134        &mut self.extension
135    }
136    pub fn id_mut(&mut self) -> &mut Option<String> {
137        &mut self.id
138    }
139}
140impl From<String> for FHIRCanonical {
141    fn from(value: String) -> Self {
142        Self {
143            value: Some(value),
144            ..Default::default()
145        }
146    }
147}
148#[derive(
149    Clone,
150    Reflect,
151    Debug,
152    Default,
153    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
154    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
155)]
156#[fhir_type = "code"]
157#[fhir_serialize_type = "primitive"]
158#[doc = "A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents"]
159pub struct FHIRCode {
160    #[doc = "unique id for the element within a resource (for internal references)"]
161    pub id: Option<String>,
162    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
163    pub extension: Option<Vec<Extension>>,
164    #[doc = "Primitive value for code"]
165    pub value: Option<String>,
166}
167impl FHIRCode {
168    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
169        &mut self.extension
170    }
171    pub fn id_mut(&mut self) -> &mut Option<String> {
172        &mut self.id
173    }
174}
175impl From<String> for FHIRCode {
176    fn from(value: String) -> Self {
177        Self {
178            value: Some(value),
179            ..Default::default()
180        }
181    }
182}
183#[derive(
184    Clone,
185    Reflect,
186    Debug,
187    Default,
188    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
189    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
190)]
191#[fhir_type = "date"]
192#[fhir_serialize_type = "primitive"]
193#[doc = "A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates."]
194pub struct FHIRDate {
195    #[doc = "unique id for the element within a resource (for internal references)"]
196    pub id: Option<String>,
197    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
198    pub extension: Option<Vec<Extension>>,
199    #[doc = "The actual value"]
200    pub value: Option<crate::r4::datetime::Date>,
201}
202impl FHIRDate {
203    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
204        &mut self.extension
205    }
206    pub fn id_mut(&mut self) -> &mut Option<String> {
207        &mut self.id
208    }
209}
210impl From<crate::r4::datetime::Date> for FHIRDate {
211    fn from(value: crate::r4::datetime::Date) -> Self {
212        Self {
213            value: Some(value),
214            ..Default::default()
215        }
216    }
217}
218#[derive(
219    Clone,
220    Reflect,
221    Debug,
222    Default,
223    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
224    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
225)]
226#[fhir_type = "dateTime"]
227#[fhir_serialize_type = "primitive"]
228#[doc = "A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored.                 Dates SHALL be valid dates."]
229pub struct FHIRDateTime {
230    #[doc = "unique id for the element within a resource (for internal references)"]
231    pub id: Option<String>,
232    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
233    pub extension: Option<Vec<Extension>>,
234    #[doc = "The actual value"]
235    pub value: Option<crate::r4::datetime::DateTime>,
236}
237impl FHIRDateTime {
238    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
239        &mut self.extension
240    }
241    pub fn id_mut(&mut self) -> &mut Option<String> {
242        &mut self.id
243    }
244}
245impl From<crate::r4::datetime::DateTime> for FHIRDateTime {
246    fn from(value: crate::r4::datetime::DateTime) -> Self {
247        Self {
248            value: Some(value),
249            ..Default::default()
250        }
251    }
252}
253#[derive(
254    Clone,
255    Reflect,
256    Debug,
257    Default,
258    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
259    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
260)]
261#[fhir_type = "decimal"]
262#[fhir_serialize_type = "primitive"]
263#[doc = "A rational number with implicit precision"]
264pub struct FHIRDecimal {
265    #[doc = "unique id for the element within a resource (for internal references)"]
266    pub id: Option<String>,
267    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
268    pub extension: Option<Vec<Extension>>,
269    #[doc = "The actual value"]
270    pub value: Option<f64>,
271}
272impl FHIRDecimal {
273    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
274        &mut self.extension
275    }
276    pub fn id_mut(&mut self) -> &mut Option<String> {
277        &mut self.id
278    }
279}
280impl From<f64> for FHIRDecimal {
281    fn from(value: f64) -> Self {
282        Self {
283            value: Some(value),
284            ..Default::default()
285        }
286    }
287}
288#[derive(
289    Clone,
290    Reflect,
291    Debug,
292    Default,
293    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
294    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
295)]
296#[fhir_type = "id"]
297#[fhir_serialize_type = "primitive"]
298#[doc = "Any combination of letters, numerals, \"-\" and \".\", with a length limit of 64 characters.  (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.)  Ids are case-insensitive."]
299pub struct FHIRId {
300    #[doc = "unique id for the element within a resource (for internal references)"]
301    pub id: Option<String>,
302    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
303    pub extension: Option<Vec<Extension>>,
304    #[doc = "Primitive value for id"]
305    pub value: Option<String>,
306}
307impl FHIRId {
308    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
309        &mut self.extension
310    }
311    pub fn id_mut(&mut self) -> &mut Option<String> {
312        &mut self.id
313    }
314}
315impl From<String> for FHIRId {
316    fn from(value: String) -> Self {
317        Self {
318            value: Some(value),
319            ..Default::default()
320        }
321    }
322}
323#[derive(
324    Clone,
325    Reflect,
326    Debug,
327    Default,
328    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
329    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
330)]
331#[fhir_type = "instant"]
332#[fhir_serialize_type = "primitive"]
333#[doc = "An instant in time - known at least to the second"]
334pub struct FHIRInstant {
335    #[doc = "unique id for the element within a resource (for internal references)"]
336    pub id: Option<String>,
337    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
338    pub extension: Option<Vec<Extension>>,
339    #[doc = "The actual value"]
340    pub value: Option<crate::r4::datetime::Instant>,
341}
342impl FHIRInstant {
343    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
344        &mut self.extension
345    }
346    pub fn id_mut(&mut self) -> &mut Option<String> {
347        &mut self.id
348    }
349}
350impl From<crate::r4::datetime::Instant> for FHIRInstant {
351    fn from(value: crate::r4::datetime::Instant) -> Self {
352        Self {
353            value: Some(value),
354            ..Default::default()
355        }
356    }
357}
358#[derive(
359    Clone,
360    Reflect,
361    Debug,
362    Default,
363    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
364    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
365)]
366#[fhir_type = "integer"]
367#[fhir_serialize_type = "primitive"]
368#[doc = "A whole number"]
369pub struct FHIRInteger {
370    #[doc = "unique id for the element within a resource (for internal references)"]
371    pub id: Option<String>,
372    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
373    pub extension: Option<Vec<Extension>>,
374    #[doc = "The actual value"]
375    pub value: Option<i64>,
376}
377impl FHIRInteger {
378    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
379        &mut self.extension
380    }
381    pub fn id_mut(&mut self) -> &mut Option<String> {
382        &mut self.id
383    }
384}
385impl From<i64> for FHIRInteger {
386    fn from(value: i64) -> Self {
387        Self {
388            value: Some(value),
389            ..Default::default()
390        }
391    }
392}
393#[derive(
394    Clone,
395    Reflect,
396    Debug,
397    Default,
398    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
399    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
400)]
401#[fhir_type = "markdown"]
402#[fhir_serialize_type = "primitive"]
403#[doc = "A string that may contain Github Flavored Markdown syntax for optional processing by a mark down presentation engine"]
404pub struct FHIRMarkdown {
405    #[doc = "unique id for the element within a resource (for internal references)"]
406    pub id: Option<String>,
407    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
408    pub extension: Option<Vec<Extension>>,
409    #[doc = "Primitive value for markdown"]
410    pub value: Option<String>,
411}
412impl FHIRMarkdown {
413    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
414        &mut self.extension
415    }
416    pub fn id_mut(&mut self) -> &mut Option<String> {
417        &mut self.id
418    }
419}
420impl From<String> for FHIRMarkdown {
421    fn from(value: String) -> Self {
422        Self {
423            value: Some(value),
424            ..Default::default()
425        }
426    }
427}
428#[derive(
429    Clone,
430    Reflect,
431    Debug,
432    Default,
433    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
434    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
435)]
436#[fhir_type = "oid"]
437#[fhir_serialize_type = "primitive"]
438#[doc = "An OID represented as a URI"]
439pub struct FHIROid {
440    #[doc = "unique id for the element within a resource (for internal references)"]
441    pub id: Option<String>,
442    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
443    pub extension: Option<Vec<Extension>>,
444    #[doc = "Primitive value for oid"]
445    pub value: Option<String>,
446}
447impl FHIROid {
448    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
449        &mut self.extension
450    }
451    pub fn id_mut(&mut self) -> &mut Option<String> {
452        &mut self.id
453    }
454}
455impl From<String> for FHIROid {
456    fn from(value: String) -> Self {
457        Self {
458            value: Some(value),
459            ..Default::default()
460        }
461    }
462}
463#[derive(
464    Clone,
465    Reflect,
466    Debug,
467    Default,
468    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
469    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
470)]
471#[fhir_type = "positiveInt"]
472#[fhir_serialize_type = "primitive"]
473#[doc = "An integer with a value that is positive (e.g. >0)"]
474pub struct FHIRPositiveInt {
475    #[doc = "unique id for the element within a resource (for internal references)"]
476    pub id: Option<String>,
477    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
478    pub extension: Option<Vec<Extension>>,
479    #[doc = "Primitive value for positiveInt"]
480    pub value: Option<u64>,
481}
482impl FHIRPositiveInt {
483    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
484        &mut self.extension
485    }
486    pub fn id_mut(&mut self) -> &mut Option<String> {
487        &mut self.id
488    }
489}
490impl From<u64> for FHIRPositiveInt {
491    fn from(value: u64) -> Self {
492        Self {
493            value: Some(value),
494            ..Default::default()
495        }
496    }
497}
498#[derive(
499    Clone,
500    Reflect,
501    Debug,
502    Default,
503    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
504    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
505)]
506#[fhir_type = "string"]
507#[fhir_serialize_type = "primitive"]
508#[doc = "A sequence of Unicode characters"]
509pub struct FHIRString {
510    #[doc = "unique id for the element within a resource (for internal references)"]
511    pub id: Option<String>,
512    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
513    pub extension: Option<Vec<Extension>>,
514    #[doc = "The actual value"]
515    pub value: Option<String>,
516}
517impl FHIRString {
518    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
519        &mut self.extension
520    }
521    pub fn id_mut(&mut self) -> &mut Option<String> {
522        &mut self.id
523    }
524}
525impl From<String> for FHIRString {
526    fn from(value: String) -> Self {
527        Self {
528            value: Some(value),
529            ..Default::default()
530        }
531    }
532}
533#[derive(
534    Clone,
535    Reflect,
536    Debug,
537    Default,
538    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
539    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
540)]
541#[fhir_type = "time"]
542#[fhir_serialize_type = "primitive"]
543#[doc = "A time during the day, with no date specified"]
544pub struct FHIRTime {
545    #[doc = "unique id for the element within a resource (for internal references)"]
546    pub id: Option<String>,
547    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
548    pub extension: Option<Vec<Extension>>,
549    #[doc = "The actual value"]
550    pub value: Option<crate::r4::datetime::Time>,
551}
552impl FHIRTime {
553    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
554        &mut self.extension
555    }
556    pub fn id_mut(&mut self) -> &mut Option<String> {
557        &mut self.id
558    }
559}
560impl From<crate::r4::datetime::Time> for FHIRTime {
561    fn from(value: crate::r4::datetime::Time) -> Self {
562        Self {
563            value: Some(value),
564            ..Default::default()
565        }
566    }
567}
568#[derive(
569    Clone,
570    Reflect,
571    Debug,
572    Default,
573    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
574    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
575)]
576#[fhir_type = "unsignedInt"]
577#[fhir_serialize_type = "primitive"]
578#[doc = "An integer with a value that is not negative (e.g. >= 0)"]
579pub struct FHIRUnsignedInt {
580    #[doc = "unique id for the element within a resource (for internal references)"]
581    pub id: Option<String>,
582    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
583    pub extension: Option<Vec<Extension>>,
584    #[doc = "Primitive value for unsignedInt"]
585    pub value: Option<u64>,
586}
587impl FHIRUnsignedInt {
588    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
589        &mut self.extension
590    }
591    pub fn id_mut(&mut self) -> &mut Option<String> {
592        &mut self.id
593    }
594}
595impl From<u64> for FHIRUnsignedInt {
596    fn from(value: u64) -> Self {
597        Self {
598            value: Some(value),
599            ..Default::default()
600        }
601    }
602}
603#[derive(
604    Clone,
605    Reflect,
606    Debug,
607    Default,
608    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
609    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
610)]
611#[fhir_type = "uri"]
612#[fhir_serialize_type = "primitive"]
613#[doc = "String of characters used to identify a name or a resource"]
614pub struct FHIRUri {
615    #[doc = "unique id for the element within a resource (for internal references)"]
616    pub id: Option<String>,
617    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
618    pub extension: Option<Vec<Extension>>,
619    #[doc = "The actual value"]
620    pub value: Option<String>,
621}
622impl FHIRUri {
623    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
624        &mut self.extension
625    }
626    pub fn id_mut(&mut self) -> &mut Option<String> {
627        &mut self.id
628    }
629}
630impl From<String> for FHIRUri {
631    fn from(value: String) -> Self {
632        Self {
633            value: Some(value),
634            ..Default::default()
635        }
636    }
637}
638#[derive(
639    Clone,
640    Reflect,
641    Debug,
642    Default,
643    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
644    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
645)]
646#[fhir_type = "url"]
647#[fhir_serialize_type = "primitive"]
648#[doc = "A URI that is a literal reference"]
649pub struct FHIRUrl {
650    #[doc = "unique id for the element within a resource (for internal references)"]
651    pub id: Option<String>,
652    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
653    pub extension: Option<Vec<Extension>>,
654    #[doc = "Primitive value for url"]
655    pub value: Option<String>,
656}
657impl FHIRUrl {
658    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
659        &mut self.extension
660    }
661    pub fn id_mut(&mut self) -> &mut Option<String> {
662        &mut self.id
663    }
664}
665impl From<String> for FHIRUrl {
666    fn from(value: String) -> Self {
667        Self {
668            value: Some(value),
669            ..Default::default()
670        }
671    }
672}
673#[derive(
674    Clone,
675    Reflect,
676    Debug,
677    Default,
678    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
679    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
680)]
681#[fhir_type = "uuid"]
682#[fhir_serialize_type = "primitive"]
683#[doc = "A UUID, represented as a URI"]
684pub struct FHIRUuid {
685    #[doc = "unique id for the element within a resource (for internal references)"]
686    pub id: Option<String>,
687    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
688    pub extension: Option<Vec<Extension>>,
689    #[doc = "Primitive value for uuid"]
690    pub value: Option<String>,
691}
692impl FHIRUuid {
693    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
694        &mut self.extension
695    }
696    pub fn id_mut(&mut self) -> &mut Option<String> {
697        &mut self.id
698    }
699}
700impl From<String> for FHIRUuid {
701    fn from(value: String) -> Self {
702        Self {
703            value: Some(value),
704            ..Default::default()
705        }
706    }
707}
708#[derive(
709    Clone,
710    Reflect,
711    Debug,
712    Default,
713    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
714    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
715)]
716#[fhir_type = "xhtml"]
717#[fhir_serialize_type = "primitive"]
718#[doc = "XHTML"]
719pub struct FHIRXhtml {
720    #[doc = "unique id for the element within a resource (for internal references)"]
721    pub id: Option<String>,
722    #[cardinality(max = 0u64)]
723    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
724    pub extension: Option<Vec<Extension>>,
725    #[doc = "Actual xhtml"]
726    pub value: String,
727}
728impl FHIRXhtml {
729    pub fn extension_mut(&mut self) -> &mut Option<Vec<Extension>> {
730        &mut self.extension
731    }
732    pub fn id_mut(&mut self) -> &mut Option<String> {
733        &mut self.id
734    }
735}
736impl From<String> for FHIRXhtml {
737    fn from(value: String) -> Self {
738        Self {
739            value,
740            ..Default::default()
741        }
742    }
743}
744#[derive(
745    Clone,
746    Reflect,
747    Debug,
748    Default,
749    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
750    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
751)]
752#[fhir_type = "Address"]
753#[fhir_serialize_type = "complex"]
754#[doc = "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."]
755pub struct Address {
756    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
757    pub id: Option<String>,
758    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
759    pub extension: Option<Vec<Extension>>,
760    #[rename_field = "use"]
761    #[primitive]
762    #[doc = "The purpose of this address."]
763    pub use_: Option<terminology::BoundCode<terminology::AddressUse>>,
764    #[rename_field = "type"]
765    #[primitive]
766    #[doc = "Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both."]
767    pub type_: Option<terminology::BoundCode<terminology::AddressType>>,
768    #[primitive]
769    #[doc = "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."]
770    pub text: Option<Box<FHIRString>>,
771    #[primitive]
772    #[doc = "This component contains the house number, apartment number, street name, street direction,  P.O. Box number, delivery hints, and similar address information."]
773    pub line: Option<Vec<FHIRString>>,
774    #[primitive]
775    #[doc = "The name of the city, town, suburb, village or other community or delivery center."]
776    pub city: Option<Box<FHIRString>>,
777    #[primitive]
778    #[doc = "The name of the administrative area (county)."]
779    pub district: Option<Box<FHIRString>>,
780    #[primitive]
781    #[doc = "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)."]
782    pub state: Option<Box<FHIRString>>,
783    #[primitive]
784    #[doc = "A postal code designating a region defined by the postal service."]
785    pub postalCode: Option<Box<FHIRString>>,
786    #[primitive]
787    #[doc = "Country - a nation as commonly understood or generally accepted."]
788    pub country: Option<Box<FHIRString>>,
789    #[doc = "Time period when address was/is in use."]
790    pub period: Option<Box<Period>>,
791}
792#[derive(
793    Clone,
794    Reflect,
795    Debug,
796    Default,
797    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
798    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
799)]
800#[fhir_type = "Age"]
801#[fhir_serialize_type = "complex"]
802#[doc = "A duration of time during which an organism (or a process) has existed."]
803pub struct Age {
804    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
805    pub id: Option<String>,
806    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
807    pub extension: Option<Vec<Extension>>,
808    #[primitive]
809    #[doc = "The value of the measured amount. The value includes an implicit precision in the presentation of the value."]
810    pub value: Option<Box<FHIRDecimal>>,
811    #[primitive]
812    #[doc = "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."]
813    pub comparator: Option<terminology::BoundCode<terminology::QuantityComparator>>,
814    #[primitive]
815    #[doc = "A human-readable form of the unit."]
816    pub unit: Option<Box<FHIRString>>,
817    #[primitive]
818    #[doc = "The identification of the system that provides the coded form of the unit."]
819    pub system: Option<Box<FHIRUri>>,
820    #[primitive]
821    #[doc = "A computer processable form of the unit in some unit representation system."]
822    pub code: Option<Box<FHIRCode>>,
823}
824#[derive(
825    Clone,
826    Reflect,
827    Debug,
828    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
829    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
830)]
831#[fhir_serialize_type = "typechoice"]
832#[type_choice_field_name = "author"]
833pub enum AnnotationAuthorTypeChoice {
834    # [reference (targets = ["Practitioner" , "Patient" , "RelatedPerson" , "Organization"])]
835    Reference(Box<Reference>),
836    #[primitive]
837    String(Box<FHIRString>),
838}
839impl Default for AnnotationAuthorTypeChoice {
840    fn default() -> Self {
841        AnnotationAuthorTypeChoice::Reference(Box::default())
842    }
843}
844#[derive(
845    Clone,
846    Reflect,
847    Debug,
848    Default,
849    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
850    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
851)]
852#[fhir_type = "Annotation"]
853#[fhir_serialize_type = "complex"]
854#[doc = "A  text note which also  contains information about who made the statement and when."]
855pub struct Annotation {
856    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
857    pub id: Option<String>,
858    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
859    pub extension: Option<Vec<Extension>>,
860    # [type_choice_variants (complex = ["authorReference"] , primitive = ["authorString"])]
861    #[doc = "The individual responsible for making the annotation."]
862    pub author: Option<AnnotationAuthorTypeChoice>,
863    #[primitive]
864    #[doc = "Indicates when this particular annotation was made."]
865    pub time: Option<Box<FHIRDateTime>>,
866    #[primitive]
867    #[doc = "The text of the annotation in markdown format."]
868    pub text: Box<FHIRMarkdown>,
869}
870#[derive(
871    Clone,
872    Reflect,
873    Debug,
874    Default,
875    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
876    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
877)]
878#[fhir_type = "Attachment"]
879#[fhir_serialize_type = "complex"]
880#[doc = "For referring to data content defined in other formats."]
881pub struct Attachment {
882    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
883    pub id: Option<String>,
884    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
885    pub extension: Option<Vec<Extension>>,
886    #[primitive]
887    #[doc = "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."]
888    pub contentType: Option<Box<FHIRCode>>,
889    #[primitive]
890    #[doc = "The human language of the content. The value can be any valid value according to BCP 47."]
891    pub language: Option<Box<FHIRCode>>,
892    #[primitive]
893    #[doc = "The actual data of the attachment - a sequence of bytes, base64 encoded."]
894    pub data: Option<Box<FHIRBase64Binary>>,
895    #[primitive]
896    #[doc = "A location where the data can be accessed."]
897    pub url: Option<Box<FHIRUrl>>,
898    #[primitive]
899    #[doc = "The number of bytes of data that make up this attachment (before base64 encoding, if that is done)."]
900    pub size: Option<Box<FHIRUnsignedInt>>,
901    #[primitive]
902    #[doc = "The calculated hash of the data using SHA-1. Represented using base64."]
903    pub hash: Option<Box<FHIRBase64Binary>>,
904    #[primitive]
905    #[doc = "A label or set of text to display in place of the data."]
906    pub title: Option<Box<FHIRString>>,
907    #[primitive]
908    #[doc = "The date that the attachment was first created."]
909    pub creation: Option<Box<FHIRDateTime>>,
910}
911#[derive(
912    Clone,
913    Reflect,
914    Debug,
915    Default,
916    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
917    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
918)]
919#[fhir_type = "CodeableConcept"]
920#[fhir_serialize_type = "complex"]
921#[doc = "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text."]
922pub struct CodeableConcept {
923    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
924    pub id: Option<String>,
925    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
926    pub extension: Option<Vec<Extension>>,
927    #[doc = "A reference to a code defined by a terminology system."]
928    pub coding: Option<Vec<Coding>>,
929    #[primitive]
930    #[doc = "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."]
931    pub text: Option<Box<FHIRString>>,
932}
933#[derive(
934    Clone,
935    Reflect,
936    Debug,
937    Default,
938    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
939    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
940)]
941#[fhir_type = "Coding"]
942#[fhir_serialize_type = "complex"]
943#[doc = "A reference to a code defined by a terminology system."]
944pub struct Coding {
945    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
946    pub id: Option<String>,
947    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
948    pub extension: Option<Vec<Extension>>,
949    #[primitive]
950    #[doc = "The identification of the code system that defines the meaning of the symbol in the code."]
951    pub system: Option<Box<FHIRUri>>,
952    #[primitive]
953    #[doc = "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."]
954    pub version: Option<Box<FHIRString>>,
955    #[primitive]
956    #[doc = "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)."]
957    pub code: Option<Box<FHIRCode>>,
958    #[primitive]
959    #[doc = "A representation of the meaning of the code in the system, following the rules of the system."]
960    pub display: Option<Box<FHIRString>>,
961    #[primitive]
962    #[doc = "Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays)."]
963    pub userSelected: Option<Box<FHIRBoolean>>,
964}
965#[derive(
966    Clone,
967    Reflect,
968    Debug,
969    Default,
970    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
971    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
972)]
973#[fhir_type = "ContactDetail"]
974#[fhir_serialize_type = "complex"]
975#[doc = "Specifies contact information for a person or organization."]
976pub struct ContactDetail {
977    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
978    pub id: Option<String>,
979    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
980    pub extension: Option<Vec<Extension>>,
981    #[primitive]
982    #[doc = "The name of an individual to contact."]
983    pub name: Option<Box<FHIRString>>,
984    #[doc = "The contact details for the individual (if a name was provided) or the organization."]
985    pub telecom: Option<Vec<ContactPoint>>,
986}
987#[derive(
988    Clone,
989    Reflect,
990    Debug,
991    Default,
992    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
993    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
994)]
995#[fhir_type = "ContactPoint"]
996#[fhir_serialize_type = "complex"]
997#[doc = "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc."]
998pub struct ContactPoint {
999    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1000    pub id: Option<String>,
1001    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1002    pub extension: Option<Vec<Extension>>,
1003    #[primitive]
1004    #[doc = "Telecommunications form for contact point - what communications system is required to make use of the contact."]
1005    pub system: Option<terminology::BoundCode<terminology::ContactPointSystem>>,
1006    #[primitive]
1007    #[doc = "The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)."]
1008    pub value: Option<Box<FHIRString>>,
1009    #[rename_field = "use"]
1010    #[primitive]
1011    #[doc = "Identifies the purpose for the contact point."]
1012    pub use_: Option<terminology::BoundCode<terminology::ContactPointUse>>,
1013    #[primitive]
1014    #[doc = "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."]
1015    pub rank: Option<Box<FHIRPositiveInt>>,
1016    #[doc = "Time period when the contact point was/is in use."]
1017    pub period: Option<Box<Period>>,
1018}
1019#[derive(
1020    Clone,
1021    Reflect,
1022    Debug,
1023    Default,
1024    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1025    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1026)]
1027#[fhir_type = "Contributor"]
1028#[fhir_serialize_type = "complex"]
1029#[doc = "A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers."]
1030pub struct Contributor {
1031    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1032    pub id: Option<String>,
1033    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1034    pub extension: Option<Vec<Extension>>,
1035    #[rename_field = "type"]
1036    #[primitive]
1037    #[doc = "The type of contributor."]
1038    pub type_: terminology::BoundCode<terminology::ContributorType>,
1039    #[primitive]
1040    #[doc = "The name of the individual or organization responsible for the contribution."]
1041    pub name: Box<FHIRString>,
1042    #[doc = "Contact details to assist a user in finding and communicating with the contributor."]
1043    pub contact: Option<Vec<ContactDetail>>,
1044}
1045#[derive(
1046    Clone,
1047    Reflect,
1048    Debug,
1049    Default,
1050    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1051    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1052)]
1053#[fhir_type = "Count"]
1054#[fhir_serialize_type = "complex"]
1055#[doc = "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."]
1056pub struct Count {
1057    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1058    pub id: Option<String>,
1059    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1060    pub extension: Option<Vec<Extension>>,
1061    #[primitive]
1062    #[doc = "The value of the measured amount. The value includes an implicit precision in the presentation of the value."]
1063    pub value: Option<Box<FHIRDecimal>>,
1064    #[primitive]
1065    #[doc = "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."]
1066    pub comparator: Option<terminology::BoundCode<terminology::QuantityComparator>>,
1067    #[primitive]
1068    #[doc = "A human-readable form of the unit."]
1069    pub unit: Option<Box<FHIRString>>,
1070    #[primitive]
1071    #[doc = "The identification of the system that provides the coded form of the unit."]
1072    pub system: Option<Box<FHIRUri>>,
1073    #[primitive]
1074    #[doc = "A computer processable form of the unit in some unit representation system."]
1075    pub code: Option<Box<FHIRCode>>,
1076}
1077#[derive(
1078    Clone,
1079    Reflect,
1080    Debug,
1081    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1082    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1083)]
1084#[fhir_serialize_type = "typechoice"]
1085#[type_choice_field_name = "subject"]
1086pub enum DataRequirementSubjectTypeChoice {
1087    CodeableConcept(Box<CodeableConcept>),
1088    # [reference (targets = ["Group"])]
1089    Reference(Box<Reference>),
1090}
1091impl Default for DataRequirementSubjectTypeChoice {
1092    fn default() -> Self {
1093        DataRequirementSubjectTypeChoice::CodeableConcept(Box::default())
1094    }
1095}
1096#[derive(
1097    Clone,
1098    Reflect,
1099    Debug,
1100    Default,
1101    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1102    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1103)]
1104#[fhir_type = "Element"]
1105#[fhir_serialize_type = "complex"]
1106#[doc = "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."]
1107pub struct DataRequirementCodeFilter {
1108    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1109    pub id: Option<String>,
1110    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1111    pub extension: Option<Vec<Extension>>,
1112    #[primitive]
1113    #[doc = "The code-valued attribute of the filter. The specified path SHALL be a FHIRPath resolveable 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."]
1114    pub path: Option<Box<FHIRString>>,
1115    #[primitive]
1116    #[doc = "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."]
1117    pub searchParam: Option<Box<FHIRString>>,
1118    #[primitive]
1119    #[doc = "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."]
1120    pub valueSet: Option<Box<FHIRCanonical>>,
1121    #[doc = "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."]
1122    pub code: Option<Vec<Coding>>,
1123}
1124#[derive(
1125    Clone,
1126    Reflect,
1127    Debug,
1128    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1129    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1130)]
1131#[fhir_serialize_type = "typechoice"]
1132#[type_choice_field_name = "value"]
1133pub enum DataRequirementDateFilterValueTypeChoice {
1134    #[primitive]
1135    DateTime(Box<FHIRDateTime>),
1136    Period(Box<Period>),
1137    Duration(Box<Duration>),
1138}
1139impl Default for DataRequirementDateFilterValueTypeChoice {
1140    fn default() -> Self {
1141        DataRequirementDateFilterValueTypeChoice::DateTime(Box::default())
1142    }
1143}
1144#[derive(
1145    Clone,
1146    Reflect,
1147    Debug,
1148    Default,
1149    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1150    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1151)]
1152#[fhir_type = "Element"]
1153#[fhir_serialize_type = "complex"]
1154#[doc = "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."]
1155pub struct DataRequirementDateFilter {
1156    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1157    pub id: Option<String>,
1158    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1159    pub extension: Option<Vec<Extension>>,
1160    #[primitive]
1161    #[doc = "The date-valued attribute of the filter. The specified path SHALL be a FHIRPath resolveable 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."]
1162    pub path: Option<Box<FHIRString>>,
1163    #[primitive]
1164    #[doc = "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."]
1165    pub searchParam: Option<Box<FHIRString>>,
1166    # [type_choice_variants (complex = ["valuePeriod" , "valueDuration"] , primitive = ["valueDateTime"])]
1167    #[doc = "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."]
1168    pub value: Option<DataRequirementDateFilterValueTypeChoice>,
1169}
1170#[derive(
1171    Clone,
1172    Reflect,
1173    Debug,
1174    Default,
1175    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1176    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1177)]
1178#[fhir_type = "Element"]
1179#[fhir_serialize_type = "complex"]
1180#[doc = "Specifies the order of the results to be returned."]
1181pub struct DataRequirementSort {
1182    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1183    pub id: Option<String>,
1184    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1185    pub extension: Option<Vec<Extension>>,
1186    #[primitive]
1187    #[doc = "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."]
1188    pub path: Box<FHIRString>,
1189    #[primitive]
1190    #[doc = "The direction of the sort, ascending or descending."]
1191    pub direction: terminology::BoundCode<terminology::SortDirection>,
1192}
1193#[derive(
1194    Clone,
1195    Reflect,
1196    Debug,
1197    Default,
1198    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1199    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1200)]
1201#[fhir_type = "DataRequirement"]
1202#[fhir_serialize_type = "complex"]
1203#[doc = "Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data."]
1204pub struct DataRequirement {
1205    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1206    pub id: Option<String>,
1207    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1208    pub extension: Option<Vec<Extension>>,
1209    #[rename_field = "type"]
1210    #[primitive]
1211    #[doc = "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."]
1212    pub type_: terminology::BoundCode<terminology::AllTypes>,
1213    #[primitive]
1214    #[doc = "The profile of the required data, specified as the uri of the profile definition."]
1215    pub profile: Option<Vec<FHIRCanonical>>,
1216    # [type_choice_variants (complex = ["subjectCodeableConcept" , "subjectReference"] , primitive = [])]
1217    #[doc = "The intended subjects of the data requirement. If this element is not provided, a Patient subject is assumed."]
1218    pub subject: Option<DataRequirementSubjectTypeChoice>,
1219    #[primitive]
1220    #[doc = "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. \n\nThe value of mustSupport SHALL be a FHIRPath resolveable 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)."]
1221    pub mustSupport: Option<Vec<FHIRString>>,
1222    #[doc = "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."]
1223    pub codeFilter: Option<Vec<DataRequirementCodeFilter>>,
1224    #[doc = "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."]
1225    pub dateFilter: Option<Vec<DataRequirementDateFilter>>,
1226    #[primitive]
1227    #[doc = "Specifies a maximum number of results that are required (uses the _count search parameter)."]
1228    pub limit: Option<Box<FHIRPositiveInt>>,
1229    #[doc = "Specifies the order of the results to be returned."]
1230    pub sort: Option<Vec<DataRequirementSort>>,
1231}
1232#[derive(
1233    Clone,
1234    Reflect,
1235    Debug,
1236    Default,
1237    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1238    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1239)]
1240#[fhir_type = "Distance"]
1241#[fhir_serialize_type = "complex"]
1242#[doc = "A length - a value with a unit that is a physical distance."]
1243pub struct Distance {
1244    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1245    pub id: Option<String>,
1246    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1247    pub extension: Option<Vec<Extension>>,
1248    #[primitive]
1249    #[doc = "The value of the measured amount. The value includes an implicit precision in the presentation of the value."]
1250    pub value: Option<Box<FHIRDecimal>>,
1251    #[primitive]
1252    #[doc = "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."]
1253    pub comparator: Option<terminology::BoundCode<terminology::QuantityComparator>>,
1254    #[primitive]
1255    #[doc = "A human-readable form of the unit."]
1256    pub unit: Option<Box<FHIRString>>,
1257    #[primitive]
1258    #[doc = "The identification of the system that provides the coded form of the unit."]
1259    pub system: Option<Box<FHIRUri>>,
1260    #[primitive]
1261    #[doc = "A computer processable form of the unit in some unit representation system."]
1262    pub code: Option<Box<FHIRCode>>,
1263}
1264#[derive(
1265    Clone,
1266    Reflect,
1267    Debug,
1268    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1269    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1270)]
1271#[fhir_serialize_type = "typechoice"]
1272#[type_choice_field_name = "asNeeded"]
1273pub enum DosageAsNeededTypeChoice {
1274    #[primitive]
1275    Boolean(Box<FHIRBoolean>),
1276    CodeableConcept(Box<CodeableConcept>),
1277}
1278impl Default for DosageAsNeededTypeChoice {
1279    fn default() -> Self {
1280        DosageAsNeededTypeChoice::Boolean(Box::default())
1281    }
1282}
1283#[derive(
1284    Clone,
1285    Reflect,
1286    Debug,
1287    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1288    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1289)]
1290#[fhir_serialize_type = "typechoice"]
1291#[type_choice_field_name = "dose"]
1292pub enum DosageDoseAndRateDoseTypeChoice {
1293    Range(Box<Range>),
1294    Quantity(Box<Quantity>),
1295}
1296impl Default for DosageDoseAndRateDoseTypeChoice {
1297    fn default() -> Self {
1298        DosageDoseAndRateDoseTypeChoice::Range(Box::default())
1299    }
1300}
1301#[derive(
1302    Clone,
1303    Reflect,
1304    Debug,
1305    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1306    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1307)]
1308#[fhir_serialize_type = "typechoice"]
1309#[type_choice_field_name = "rate"]
1310pub enum DosageDoseAndRateRateTypeChoice {
1311    Ratio(Box<Ratio>),
1312    Range(Box<Range>),
1313    Quantity(Box<Quantity>),
1314}
1315impl Default for DosageDoseAndRateRateTypeChoice {
1316    fn default() -> Self {
1317        DosageDoseAndRateRateTypeChoice::Ratio(Box::default())
1318    }
1319}
1320#[derive(
1321    Clone,
1322    Reflect,
1323    Debug,
1324    Default,
1325    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1326    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1327)]
1328#[fhir_type = "Element"]
1329#[fhir_serialize_type = "complex"]
1330#[doc = "The amount of medication administered."]
1331pub struct DosageDoseAndRate {
1332    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1333    pub id: Option<String>,
1334    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1335    pub extension: Option<Vec<Extension>>,
1336    #[rename_field = "type"]
1337    #[doc = "The kind of dose or rate specified, for example, ordered or calculated."]
1338    pub type_: Option<Box<CodeableConcept>>,
1339    # [type_choice_variants (complex = ["doseRange" , "doseQuantity"] , primitive = [])]
1340    #[doc = "Amount of medication per dose."]
1341    pub dose: Option<DosageDoseAndRateDoseTypeChoice>,
1342    # [type_choice_variants (complex = ["rateRatio" , "rateRange" , "rateQuantity"] , primitive = [])]
1343    #[doc = "Amount of medication per unit of time."]
1344    pub rate: Option<DosageDoseAndRateRateTypeChoice>,
1345}
1346#[derive(
1347    Clone,
1348    Reflect,
1349    Debug,
1350    Default,
1351    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1352    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1353)]
1354#[fhir_type = "Dosage"]
1355#[fhir_serialize_type = "complex"]
1356#[doc = "Indicates how the medication is/was taken or should be taken by the patient."]
1357pub struct Dosage {
1358    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1359    pub id: Option<String>,
1360    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1361    pub extension: Option<Vec<Extension>>,
1362    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
1363    pub modifierExtension: Option<Vec<Extension>>,
1364    #[primitive]
1365    #[doc = "Indicates the order in which the dosage instructions should be applied or interpreted."]
1366    pub sequence: Option<Box<FHIRInteger>>,
1367    #[primitive]
1368    #[doc = "Free text dosage instructions e.g. SIG."]
1369    pub text: Option<Box<FHIRString>>,
1370    #[doc = "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\")."]
1371    pub additionalInstruction: Option<Vec<CodeableConcept>>,
1372    #[primitive]
1373    #[doc = "Instructions in terms that are understood by the patient or consumer."]
1374    pub patientInstruction: Option<Box<FHIRString>>,
1375    #[doc = "When medication should be administered."]
1376    pub timing: Option<Box<Timing>>,
1377    # [type_choice_variants (complex = ["asNeededCodeableConcept"] , primitive = ["asNeededBoolean"])]
1378    #[doc = "Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept)."]
1379    pub asNeeded: Option<DosageAsNeededTypeChoice>,
1380    #[doc = "Body site to administer to."]
1381    pub site: Option<Box<CodeableConcept>>,
1382    #[doc = "How drug should enter body."]
1383    pub route: Option<Box<CodeableConcept>>,
1384    #[doc = "Technique for administering medication."]
1385    pub method: Option<Box<CodeableConcept>>,
1386    #[doc = "The amount of medication administered."]
1387    pub doseAndRate: Option<Vec<DosageDoseAndRate>>,
1388    #[doc = "Upper limit on medication per unit of time."]
1389    pub maxDosePerPeriod: Option<Box<Ratio>>,
1390    #[doc = "Upper limit on medication per administration."]
1391    pub maxDosePerAdministration: Option<Box<Quantity>>,
1392    #[doc = "Upper limit on medication per lifetime of the patient."]
1393    pub maxDosePerLifetime: Option<Box<Quantity>>,
1394}
1395#[derive(
1396    Clone,
1397    Reflect,
1398    Debug,
1399    Default,
1400    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1401    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1402)]
1403#[fhir_type = "Duration"]
1404#[fhir_serialize_type = "complex"]
1405#[doc = "A length of time."]
1406pub struct Duration {
1407    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1408    pub id: Option<String>,
1409    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1410    pub extension: Option<Vec<Extension>>,
1411    #[primitive]
1412    #[doc = "The value of the measured amount. The value includes an implicit precision in the presentation of the value."]
1413    pub value: Option<Box<FHIRDecimal>>,
1414    #[primitive]
1415    #[doc = "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."]
1416    pub comparator: Option<terminology::BoundCode<terminology::QuantityComparator>>,
1417    #[primitive]
1418    #[doc = "A human-readable form of the unit."]
1419    pub unit: Option<Box<FHIRString>>,
1420    #[primitive]
1421    #[doc = "The identification of the system that provides the coded form of the unit."]
1422    pub system: Option<Box<FHIRUri>>,
1423    #[primitive]
1424    #[doc = "A computer processable form of the unit in some unit representation system."]
1425    pub code: Option<Box<FHIRCode>>,
1426}
1427#[derive(
1428    Clone,
1429    Reflect,
1430    Debug,
1431    Default,
1432    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1433    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1434)]
1435#[fhir_type = "Element"]
1436#[fhir_serialize_type = "complex"]
1437#[doc = "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."]
1438pub struct ElementDefinitionSlicingDiscriminator {
1439    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1440    pub id: Option<String>,
1441    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1442    pub extension: Option<Vec<Extension>>,
1443    #[rename_field = "type"]
1444    #[primitive]
1445    #[doc = "How the element value is interpreted when discrimination is evaluated."]
1446    pub type_: terminology::BoundCode<terminology::DiscriminatorType>,
1447    #[primitive]
1448    #[doc = "A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based."]
1449    pub path: Box<FHIRString>,
1450}
1451#[derive(
1452    Clone,
1453    Reflect,
1454    Debug,
1455    Default,
1456    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1457    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1458)]
1459#[fhir_type = "Element"]
1460#[fhir_serialize_type = "complex"]
1461#[doc = "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)."]
1462pub struct ElementDefinitionSlicing {
1463    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1464    pub id: Option<String>,
1465    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1466    pub extension: Option<Vec<Extension>>,
1467    #[doc = "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."]
1468    pub discriminator: Option<Vec<ElementDefinitionSlicingDiscriminator>>,
1469    #[primitive]
1470    #[doc = "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."]
1471    pub description: Option<Box<FHIRString>>,
1472    #[primitive]
1473    #[doc = "If the matching elements have to occur in the same order as defined in the profile."]
1474    pub ordered: Option<Box<FHIRBoolean>>,
1475    #[primitive]
1476    #[doc = "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."]
1477    pub rules: terminology::BoundCode<terminology::ResourceSlicingRules>,
1478}
1479#[derive(
1480    Clone,
1481    Reflect,
1482    Debug,
1483    Default,
1484    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1485    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1486)]
1487#[fhir_type = "Element"]
1488#[fhir_serialize_type = "complex"]
1489#[doc = "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 - i.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."]
1490pub struct ElementDefinitionBase {
1491    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1492    pub id: Option<String>,
1493    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1494    pub extension: Option<Vec<Extension>>,
1495    #[primitive]
1496    #[doc = "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."]
1497    pub path: Box<FHIRString>,
1498    #[primitive]
1499    #[doc = "Minimum cardinality of the base element identified by the path."]
1500    pub min: Box<FHIRUnsignedInt>,
1501    #[primitive]
1502    #[doc = "Maximum cardinality of the base element identified by the path."]
1503    pub max: Box<FHIRString>,
1504}
1505#[derive(
1506    Clone,
1507    Reflect,
1508    Debug,
1509    Default,
1510    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1511    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1512)]
1513#[fhir_type = "Element"]
1514#[fhir_serialize_type = "complex"]
1515#[doc = "The data type or resource that the value of this element is permitted to be."]
1516pub struct ElementDefinitionType {
1517    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1518    pub id: Option<String>,
1519    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1520    pub extension: Option<Vec<Extension>>,
1521    #[primitive]
1522    #[doc = "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."]
1523    pub code: Box<FHIRUri>,
1524    #[primitive]
1525    #[doc = "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."]
1526    pub profile: Option<Vec<FHIRCanonical>>,
1527    #[primitive]
1528    #[doc = "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."]
1529    pub targetProfile: Option<Vec<FHIRCanonical>>,
1530    #[primitive]
1531    #[doc = "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."]
1532    pub aggregation: Option<Vec<terminology::BoundCode<terminology::ResourceAggregationMode>>>,
1533    #[primitive]
1534    #[doc = "Whether this reference needs to be version specific or version independent, or whether either can be used."]
1535    pub versioning: Option<terminology::BoundCode<terminology::ReferenceVersionRules>>,
1536}
1537#[derive(
1538    Clone,
1539    Reflect,
1540    Debug,
1541    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1542    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1543)]
1544#[fhir_serialize_type = "typechoice"]
1545#[type_choice_field_name = "defaultValue"]
1546pub enum ElementDefinitionDefaultValueTypeChoice {
1547    #[primitive]
1548    Base64Binary(Box<FHIRBase64Binary>),
1549    #[primitive]
1550    Boolean(Box<FHIRBoolean>),
1551    #[primitive]
1552    Canonical(Box<FHIRCanonical>),
1553    #[primitive]
1554    Code(Box<FHIRCode>),
1555    #[primitive]
1556    Date(Box<FHIRDate>),
1557    #[primitive]
1558    DateTime(Box<FHIRDateTime>),
1559    #[primitive]
1560    Decimal(Box<FHIRDecimal>),
1561    #[primitive]
1562    Id(Box<FHIRId>),
1563    #[primitive]
1564    Instant(Box<FHIRInstant>),
1565    #[primitive]
1566    Integer(Box<FHIRInteger>),
1567    #[primitive]
1568    Markdown(Box<FHIRMarkdown>),
1569    #[primitive]
1570    Oid(Box<FHIROid>),
1571    #[primitive]
1572    PositiveInt(Box<FHIRPositiveInt>),
1573    #[primitive]
1574    String(Box<FHIRString>),
1575    #[primitive]
1576    Time(Box<FHIRTime>),
1577    #[primitive]
1578    UnsignedInt(Box<FHIRUnsignedInt>),
1579    #[primitive]
1580    Uri(Box<FHIRUri>),
1581    #[primitive]
1582    Url(Box<FHIRUrl>),
1583    #[primitive]
1584    Uuid(Box<FHIRUuid>),
1585    Address(Box<Address>),
1586    Age(Box<Age>),
1587    Annotation(Box<Annotation>),
1588    Attachment(Box<Attachment>),
1589    CodeableConcept(Box<CodeableConcept>),
1590    Coding(Box<Coding>),
1591    ContactPoint(Box<ContactPoint>),
1592    Count(Box<Count>),
1593    Distance(Box<Distance>),
1594    Duration(Box<Duration>),
1595    HumanName(Box<HumanName>),
1596    Identifier(Box<Identifier>),
1597    Money(Box<Money>),
1598    Period(Box<Period>),
1599    Quantity(Box<Quantity>),
1600    Range(Box<Range>),
1601    Ratio(Box<Ratio>),
1602    Reference(Box<Reference>),
1603    SampledData(Box<SampledData>),
1604    Signature(Box<Signature>),
1605    Timing(Box<Timing>),
1606    ContactDetail(Box<ContactDetail>),
1607    Contributor(Box<Contributor>),
1608    DataRequirement(Box<DataRequirement>),
1609    Expression(Box<Expression>),
1610    ParameterDefinition(Box<ParameterDefinition>),
1611    RelatedArtifact(Box<RelatedArtifact>),
1612    TriggerDefinition(Box<TriggerDefinition>),
1613    UsageContext(Box<UsageContext>),
1614    Dosage(Box<Dosage>),
1615    Meta(Box<Meta>),
1616}
1617impl Default for ElementDefinitionDefaultValueTypeChoice {
1618    fn default() -> Self {
1619        ElementDefinitionDefaultValueTypeChoice::Base64Binary(Box::default())
1620    }
1621}
1622#[derive(
1623    Clone,
1624    Reflect,
1625    Debug,
1626    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1627    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1628)]
1629#[fhir_serialize_type = "typechoice"]
1630#[type_choice_field_name = "fixed"]
1631pub enum ElementDefinitionFixedTypeChoice {
1632    #[primitive]
1633    Base64Binary(Box<FHIRBase64Binary>),
1634    #[primitive]
1635    Boolean(Box<FHIRBoolean>),
1636    #[primitive]
1637    Canonical(Box<FHIRCanonical>),
1638    #[primitive]
1639    Code(Box<FHIRCode>),
1640    #[primitive]
1641    Date(Box<FHIRDate>),
1642    #[primitive]
1643    DateTime(Box<FHIRDateTime>),
1644    #[primitive]
1645    Decimal(Box<FHIRDecimal>),
1646    #[primitive]
1647    Id(Box<FHIRId>),
1648    #[primitive]
1649    Instant(Box<FHIRInstant>),
1650    #[primitive]
1651    Integer(Box<FHIRInteger>),
1652    #[primitive]
1653    Markdown(Box<FHIRMarkdown>),
1654    #[primitive]
1655    Oid(Box<FHIROid>),
1656    #[primitive]
1657    PositiveInt(Box<FHIRPositiveInt>),
1658    #[primitive]
1659    String(Box<FHIRString>),
1660    #[primitive]
1661    Time(Box<FHIRTime>),
1662    #[primitive]
1663    UnsignedInt(Box<FHIRUnsignedInt>),
1664    #[primitive]
1665    Uri(Box<FHIRUri>),
1666    #[primitive]
1667    Url(Box<FHIRUrl>),
1668    #[primitive]
1669    Uuid(Box<FHIRUuid>),
1670    Address(Box<Address>),
1671    Age(Box<Age>),
1672    Annotation(Box<Annotation>),
1673    Attachment(Box<Attachment>),
1674    CodeableConcept(Box<CodeableConcept>),
1675    Coding(Box<Coding>),
1676    ContactPoint(Box<ContactPoint>),
1677    Count(Box<Count>),
1678    Distance(Box<Distance>),
1679    Duration(Box<Duration>),
1680    HumanName(Box<HumanName>),
1681    Identifier(Box<Identifier>),
1682    Money(Box<Money>),
1683    Period(Box<Period>),
1684    Quantity(Box<Quantity>),
1685    Range(Box<Range>),
1686    Ratio(Box<Ratio>),
1687    Reference(Box<Reference>),
1688    SampledData(Box<SampledData>),
1689    Signature(Box<Signature>),
1690    Timing(Box<Timing>),
1691    ContactDetail(Box<ContactDetail>),
1692    Contributor(Box<Contributor>),
1693    DataRequirement(Box<DataRequirement>),
1694    Expression(Box<Expression>),
1695    ParameterDefinition(Box<ParameterDefinition>),
1696    RelatedArtifact(Box<RelatedArtifact>),
1697    TriggerDefinition(Box<TriggerDefinition>),
1698    UsageContext(Box<UsageContext>),
1699    Dosage(Box<Dosage>),
1700    Meta(Box<Meta>),
1701}
1702impl Default for ElementDefinitionFixedTypeChoice {
1703    fn default() -> Self {
1704        ElementDefinitionFixedTypeChoice::Base64Binary(Box::default())
1705    }
1706}
1707#[derive(
1708    Clone,
1709    Reflect,
1710    Debug,
1711    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1712    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1713)]
1714#[fhir_serialize_type = "typechoice"]
1715#[type_choice_field_name = "pattern"]
1716pub enum ElementDefinitionPatternTypeChoice {
1717    #[primitive]
1718    Base64Binary(Box<FHIRBase64Binary>),
1719    #[primitive]
1720    Boolean(Box<FHIRBoolean>),
1721    #[primitive]
1722    Canonical(Box<FHIRCanonical>),
1723    #[primitive]
1724    Code(Box<FHIRCode>),
1725    #[primitive]
1726    Date(Box<FHIRDate>),
1727    #[primitive]
1728    DateTime(Box<FHIRDateTime>),
1729    #[primitive]
1730    Decimal(Box<FHIRDecimal>),
1731    #[primitive]
1732    Id(Box<FHIRId>),
1733    #[primitive]
1734    Instant(Box<FHIRInstant>),
1735    #[primitive]
1736    Integer(Box<FHIRInteger>),
1737    #[primitive]
1738    Markdown(Box<FHIRMarkdown>),
1739    #[primitive]
1740    Oid(Box<FHIROid>),
1741    #[primitive]
1742    PositiveInt(Box<FHIRPositiveInt>),
1743    #[primitive]
1744    String(Box<FHIRString>),
1745    #[primitive]
1746    Time(Box<FHIRTime>),
1747    #[primitive]
1748    UnsignedInt(Box<FHIRUnsignedInt>),
1749    #[primitive]
1750    Uri(Box<FHIRUri>),
1751    #[primitive]
1752    Url(Box<FHIRUrl>),
1753    #[primitive]
1754    Uuid(Box<FHIRUuid>),
1755    Address(Box<Address>),
1756    Age(Box<Age>),
1757    Annotation(Box<Annotation>),
1758    Attachment(Box<Attachment>),
1759    CodeableConcept(Box<CodeableConcept>),
1760    Coding(Box<Coding>),
1761    ContactPoint(Box<ContactPoint>),
1762    Count(Box<Count>),
1763    Distance(Box<Distance>),
1764    Duration(Box<Duration>),
1765    HumanName(Box<HumanName>),
1766    Identifier(Box<Identifier>),
1767    Money(Box<Money>),
1768    Period(Box<Period>),
1769    Quantity(Box<Quantity>),
1770    Range(Box<Range>),
1771    Ratio(Box<Ratio>),
1772    Reference(Box<Reference>),
1773    SampledData(Box<SampledData>),
1774    Signature(Box<Signature>),
1775    Timing(Box<Timing>),
1776    ContactDetail(Box<ContactDetail>),
1777    Contributor(Box<Contributor>),
1778    DataRequirement(Box<DataRequirement>),
1779    Expression(Box<Expression>),
1780    ParameterDefinition(Box<ParameterDefinition>),
1781    RelatedArtifact(Box<RelatedArtifact>),
1782    TriggerDefinition(Box<TriggerDefinition>),
1783    UsageContext(Box<UsageContext>),
1784    Dosage(Box<Dosage>),
1785    Meta(Box<Meta>),
1786}
1787impl Default for ElementDefinitionPatternTypeChoice {
1788    fn default() -> Self {
1789        ElementDefinitionPatternTypeChoice::Base64Binary(Box::default())
1790    }
1791}
1792#[derive(
1793    Clone,
1794    Reflect,
1795    Debug,
1796    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1797    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1798)]
1799#[fhir_serialize_type = "typechoice"]
1800#[type_choice_field_name = "value"]
1801pub enum ElementDefinitionExampleValueTypeChoice {
1802    #[primitive]
1803    Base64Binary(Box<FHIRBase64Binary>),
1804    #[primitive]
1805    Boolean(Box<FHIRBoolean>),
1806    #[primitive]
1807    Canonical(Box<FHIRCanonical>),
1808    #[primitive]
1809    Code(Box<FHIRCode>),
1810    #[primitive]
1811    Date(Box<FHIRDate>),
1812    #[primitive]
1813    DateTime(Box<FHIRDateTime>),
1814    #[primitive]
1815    Decimal(Box<FHIRDecimal>),
1816    #[primitive]
1817    Id(Box<FHIRId>),
1818    #[primitive]
1819    Instant(Box<FHIRInstant>),
1820    #[primitive]
1821    Integer(Box<FHIRInteger>),
1822    #[primitive]
1823    Markdown(Box<FHIRMarkdown>),
1824    #[primitive]
1825    Oid(Box<FHIROid>),
1826    #[primitive]
1827    PositiveInt(Box<FHIRPositiveInt>),
1828    #[primitive]
1829    String(Box<FHIRString>),
1830    #[primitive]
1831    Time(Box<FHIRTime>),
1832    #[primitive]
1833    UnsignedInt(Box<FHIRUnsignedInt>),
1834    #[primitive]
1835    Uri(Box<FHIRUri>),
1836    #[primitive]
1837    Url(Box<FHIRUrl>),
1838    #[primitive]
1839    Uuid(Box<FHIRUuid>),
1840    Address(Box<Address>),
1841    Age(Box<Age>),
1842    Annotation(Box<Annotation>),
1843    Attachment(Box<Attachment>),
1844    CodeableConcept(Box<CodeableConcept>),
1845    Coding(Box<Coding>),
1846    ContactPoint(Box<ContactPoint>),
1847    Count(Box<Count>),
1848    Distance(Box<Distance>),
1849    Duration(Box<Duration>),
1850    HumanName(Box<HumanName>),
1851    Identifier(Box<Identifier>),
1852    Money(Box<Money>),
1853    Period(Box<Period>),
1854    Quantity(Box<Quantity>),
1855    Range(Box<Range>),
1856    Ratio(Box<Ratio>),
1857    Reference(Box<Reference>),
1858    SampledData(Box<SampledData>),
1859    Signature(Box<Signature>),
1860    Timing(Box<Timing>),
1861    ContactDetail(Box<ContactDetail>),
1862    Contributor(Box<Contributor>),
1863    DataRequirement(Box<DataRequirement>),
1864    Expression(Box<Expression>),
1865    ParameterDefinition(Box<ParameterDefinition>),
1866    RelatedArtifact(Box<RelatedArtifact>),
1867    TriggerDefinition(Box<TriggerDefinition>),
1868    UsageContext(Box<UsageContext>),
1869    Dosage(Box<Dosage>),
1870    Meta(Box<Meta>),
1871}
1872impl Default for ElementDefinitionExampleValueTypeChoice {
1873    fn default() -> Self {
1874        ElementDefinitionExampleValueTypeChoice::Base64Binary(Box::default())
1875    }
1876}
1877#[derive(
1878    Clone,
1879    Reflect,
1880    Debug,
1881    Default,
1882    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1883    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1884)]
1885#[fhir_type = "Element"]
1886#[fhir_serialize_type = "complex"]
1887#[doc = "A sample value for this element demonstrating the type of information that would typically be found in the element."]
1888pub struct ElementDefinitionExample {
1889    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1890    pub id: Option<String>,
1891    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1892    pub extension: Option<Vec<Extension>>,
1893    #[primitive]
1894    #[doc = "Describes the purpose of this example amoung the set of examples."]
1895    pub label: Box<FHIRString>,
1896    # [type_choice_variants (complex = ["valueAddress" , "valueAge" , "valueAnnotation" , "valueAttachment" , "valueCodeableConcept" , "valueCoding" , "valueContactPoint" , "valueCount" , "valueDistance" , "valueDuration" , "valueHumanName" , "valueIdentifier" , "valueMoney" , "valuePeriod" , "valueQuantity" , "valueRange" , "valueRatio" , "valueReference" , "valueSampledData" , "valueSignature" , "valueTiming" , "valueContactDetail" , "valueContributor" , "valueDataRequirement" , "valueExpression" , "valueParameterDefinition" , "valueRelatedArtifact" , "valueTriggerDefinition" , "valueUsageContext" , "valueDosage" , "valueMeta"] , primitive = ["valueBase64Binary" , "valueBoolean" , "valueCanonical" , "valueCode" , "valueDate" , "valueDateTime" , "valueDecimal" , "valueId" , "valueInstant" , "valueInteger" , "valueMarkdown" , "valueOid" , "valuePositiveInt" , "valueString" , "valueTime" , "valueUnsignedInt" , "valueUri" , "valueUrl" , "valueUuid"])]
1897    #[doc = "The actual value for the element, which must be one of the types allowed for this element."]
1898    pub value: ElementDefinitionExampleValueTypeChoice,
1899}
1900#[derive(
1901    Clone,
1902    Reflect,
1903    Debug,
1904    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1905    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1906)]
1907#[fhir_serialize_type = "typechoice"]
1908#[type_choice_field_name = "minValue"]
1909pub enum ElementDefinitionMinValueTypeChoice {
1910    #[primitive]
1911    Date(Box<FHIRDate>),
1912    #[primitive]
1913    DateTime(Box<FHIRDateTime>),
1914    #[primitive]
1915    Instant(Box<FHIRInstant>),
1916    #[primitive]
1917    Time(Box<FHIRTime>),
1918    #[primitive]
1919    Decimal(Box<FHIRDecimal>),
1920    #[primitive]
1921    Integer(Box<FHIRInteger>),
1922    #[primitive]
1923    PositiveInt(Box<FHIRPositiveInt>),
1924    #[primitive]
1925    UnsignedInt(Box<FHIRUnsignedInt>),
1926    Quantity(Box<Quantity>),
1927}
1928impl Default for ElementDefinitionMinValueTypeChoice {
1929    fn default() -> Self {
1930        ElementDefinitionMinValueTypeChoice::Date(Box::default())
1931    }
1932}
1933#[derive(
1934    Clone,
1935    Reflect,
1936    Debug,
1937    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1938    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1939)]
1940#[fhir_serialize_type = "typechoice"]
1941#[type_choice_field_name = "maxValue"]
1942pub enum ElementDefinitionMaxValueTypeChoice {
1943    #[primitive]
1944    Date(Box<FHIRDate>),
1945    #[primitive]
1946    DateTime(Box<FHIRDateTime>),
1947    #[primitive]
1948    Instant(Box<FHIRInstant>),
1949    #[primitive]
1950    Time(Box<FHIRTime>),
1951    #[primitive]
1952    Decimal(Box<FHIRDecimal>),
1953    #[primitive]
1954    Integer(Box<FHIRInteger>),
1955    #[primitive]
1956    PositiveInt(Box<FHIRPositiveInt>),
1957    #[primitive]
1958    UnsignedInt(Box<FHIRUnsignedInt>),
1959    Quantity(Box<Quantity>),
1960}
1961impl Default for ElementDefinitionMaxValueTypeChoice {
1962    fn default() -> Self {
1963        ElementDefinitionMaxValueTypeChoice::Date(Box::default())
1964    }
1965}
1966#[derive(
1967    Clone,
1968    Reflect,
1969    Debug,
1970    Default,
1971    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
1972    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
1973)]
1974#[fhir_type = "Element"]
1975#[fhir_serialize_type = "complex"]
1976#[doc = "Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance."]
1977pub struct ElementDefinitionConstraint {
1978    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
1979    pub id: Option<String>,
1980    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
1981    pub extension: Option<Vec<Extension>>,
1982    #[primitive]
1983    #[doc = "Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality."]
1984    pub key: Box<FHIRId>,
1985    #[primitive]
1986    #[doc = "Description of why this constraint is necessary or appropriate."]
1987    pub requirements: Option<Box<FHIRString>>,
1988    #[primitive]
1989    #[doc = "Identifies the impact constraint violation has on the conformance of the instance."]
1990    pub severity: terminology::BoundCode<terminology::ConstraintSeverity>,
1991    #[primitive]
1992    #[doc = "Text that can be used to describe the constraint in messages identifying that the constraint has been violated."]
1993    pub human: Box<FHIRString>,
1994    #[primitive]
1995    #[doc = "A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met."]
1996    pub expression: Option<Box<FHIRString>>,
1997    #[primitive]
1998    #[doc = "An XPath expression of constraint that can be executed to see if this constraint is met."]
1999    pub xpath: Option<Box<FHIRString>>,
2000    #[primitive]
2001    #[doc = "A reference to the original source of the constraint, for traceability purposes."]
2002    pub source: Option<Box<FHIRCanonical>>,
2003}
2004#[derive(
2005    Clone,
2006    Reflect,
2007    Debug,
2008    Default,
2009    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2010    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2011)]
2012#[fhir_type = "Element"]
2013#[fhir_serialize_type = "complex"]
2014#[doc = "Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri)."]
2015pub struct ElementDefinitionBinding {
2016    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2017    pub id: Option<String>,
2018    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2019    pub extension: Option<Vec<Extension>>,
2020    #[primitive]
2021    #[doc = "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."]
2022    pub strength: terminology::BoundCode<terminology::BindingStrength>,
2023    #[primitive]
2024    #[doc = "Describes the intended use of this particular set of codes."]
2025    pub description: Option<Box<FHIRString>>,
2026    #[primitive]
2027    #[doc = "Refers to the value set that identifies the set of codes the binding refers to."]
2028    pub valueSet: Option<Box<FHIRCanonical>>,
2029}
2030#[derive(
2031    Clone,
2032    Reflect,
2033    Debug,
2034    Default,
2035    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2036    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2037)]
2038#[fhir_type = "Element"]
2039#[fhir_serialize_type = "complex"]
2040#[doc = "Identifies a concept from an external specification that roughly corresponds to this element."]
2041pub struct ElementDefinitionMapping {
2042    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2043    pub id: Option<String>,
2044    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2045    pub extension: Option<Vec<Extension>>,
2046    #[primitive]
2047    #[doc = "An internal reference to the definition of a mapping."]
2048    pub identity: Box<FHIRId>,
2049    #[primitive]
2050    #[doc = "Identifies the computable language in which mapping.map is expressed."]
2051    pub language: Option<Box<FHIRCode>>,
2052    #[primitive]
2053    #[doc = "Expresses what part of the target specification corresponds to this element."]
2054    pub map: Box<FHIRString>,
2055    #[primitive]
2056    #[doc = "Comments that provide information about the mapping or its use."]
2057    pub comment: Option<Box<FHIRString>>,
2058}
2059#[derive(
2060    Clone,
2061    Reflect,
2062    Debug,
2063    Default,
2064    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2065    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2066)]
2067#[fhir_type = "ElementDefinition"]
2068#[fhir_serialize_type = "complex"]
2069#[doc = "Captures constraints on each element within the resource, profile, or extension."]
2070pub struct ElementDefinition {
2071    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2072    pub id: Option<String>,
2073    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2074    pub extension: Option<Vec<Extension>>,
2075    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
2076    pub modifierExtension: Option<Vec<Extension>>,
2077    #[primitive]
2078    #[doc = "The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource or extension."]
2079    pub path: Box<FHIRString>,
2080    #[primitive]
2081    #[doc = "Codes that define how this element is represented in instances, when the deviation varies from the normal case."]
2082    pub representation: Option<Vec<terminology::BoundCode<terminology::PropertyRepresentation>>>,
2083    #[primitive]
2084    #[doc = "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."]
2085    pub sliceName: Option<Box<FHIRString>>,
2086    #[primitive]
2087    #[doc = "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."]
2088    pub sliceIsConstraining: Option<Box<FHIRBoolean>>,
2089    #[primitive]
2090    #[doc = "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."]
2091    pub label: Option<Box<FHIRString>>,
2092    #[doc = "A code that has the same meaning as the element in a particular terminology."]
2093    pub code: Option<Vec<Coding>>,
2094    #[doc = "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)."]
2095    pub slicing: Option<ElementDefinitionSlicing>,
2096    #[primitive]
2097    #[doc = "A concise description of what this element means (e.g. for use in autogenerated summaries)."]
2098    pub short: Option<Box<FHIRString>>,
2099    #[primitive]
2100    #[doc = "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)."]
2101    pub definition: Option<Box<FHIRMarkdown>>,
2102    #[primitive]
2103    #[doc = "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)."]
2104    pub comment: Option<Box<FHIRMarkdown>>,
2105    #[primitive]
2106    #[doc = "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."]
2107    pub requirements: Option<Box<FHIRMarkdown>>,
2108    #[primitive]
2109    #[doc = "Identifies additional names by which this element might also be known."]
2110    pub alias: Option<Vec<FHIRString>>,
2111    #[primitive]
2112    #[doc = "The minimum number of times this element SHALL appear in the instance."]
2113    pub min: Option<Box<FHIRUnsignedInt>>,
2114    #[primitive]
2115    #[doc = "The maximum number of times this element is permitted to appear in the instance."]
2116    pub max: Option<Box<FHIRString>>,
2117    #[doc = "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 - i.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."]
2118    pub base: Option<ElementDefinitionBase>,
2119    #[primitive]
2120    #[doc = "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."]
2121    pub contentReference: Option<Box<FHIRUri>>,
2122    #[rename_field = "type"]
2123    #[doc = "The data type or resource that the value of this element is permitted to be."]
2124    pub type_: Option<Vec<ElementDefinitionType>>,
2125    # [type_choice_variants (complex = ["defaultValueAddress" , "defaultValueAge" , "defaultValueAnnotation" , "defaultValueAttachment" , "defaultValueCodeableConcept" , "defaultValueCoding" , "defaultValueContactPoint" , "defaultValueCount" , "defaultValueDistance" , "defaultValueDuration" , "defaultValueHumanName" , "defaultValueIdentifier" , "defaultValueMoney" , "defaultValuePeriod" , "defaultValueQuantity" , "defaultValueRange" , "defaultValueRatio" , "defaultValueReference" , "defaultValueSampledData" , "defaultValueSignature" , "defaultValueTiming" , "defaultValueContactDetail" , "defaultValueContributor" , "defaultValueDataRequirement" , "defaultValueExpression" , "defaultValueParameterDefinition" , "defaultValueRelatedArtifact" , "defaultValueTriggerDefinition" , "defaultValueUsageContext" , "defaultValueDosage" , "defaultValueMeta"] , primitive = ["defaultValueBase64Binary" , "defaultValueBoolean" , "defaultValueCanonical" , "defaultValueCode" , "defaultValueDate" , "defaultValueDateTime" , "defaultValueDecimal" , "defaultValueId" , "defaultValueInstant" , "defaultValueInteger" , "defaultValueMarkdown" , "defaultValueOid" , "defaultValuePositiveInt" , "defaultValueString" , "defaultValueTime" , "defaultValueUnsignedInt" , "defaultValueUri" , "defaultValueUrl" , "defaultValueUuid"])]
2126    #[doc = "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')."]
2127    pub defaultValue: Option<ElementDefinitionDefaultValueTypeChoice>,
2128    #[primitive]
2129    #[doc = "The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing')."]
2130    pub meaningWhenMissing: Option<Box<FHIRMarkdown>>,
2131    #[primitive]
2132    #[doc = "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."]
2133    pub orderMeaning: Option<Box<FHIRString>>,
2134    # [type_choice_variants (complex = ["fixedAddress" , "fixedAge" , "fixedAnnotation" , "fixedAttachment" , "fixedCodeableConcept" , "fixedCoding" , "fixedContactPoint" , "fixedCount" , "fixedDistance" , "fixedDuration" , "fixedHumanName" , "fixedIdentifier" , "fixedMoney" , "fixedPeriod" , "fixedQuantity" , "fixedRange" , "fixedRatio" , "fixedReference" , "fixedSampledData" , "fixedSignature" , "fixedTiming" , "fixedContactDetail" , "fixedContributor" , "fixedDataRequirement" , "fixedExpression" , "fixedParameterDefinition" , "fixedRelatedArtifact" , "fixedTriggerDefinition" , "fixedUsageContext" , "fixedDosage" , "fixedMeta"] , primitive = ["fixedBase64Binary" , "fixedBoolean" , "fixedCanonical" , "fixedCode" , "fixedDate" , "fixedDateTime" , "fixedDecimal" , "fixedId" , "fixedInstant" , "fixedInteger" , "fixedMarkdown" , "fixedOid" , "fixedPositiveInt" , "fixedString" , "fixedTime" , "fixedUnsignedInt" , "fixedUri" , "fixedUrl" , "fixedUuid"])]
2135    #[doc = "Specifies a value that SHALL be exactly the value  for this element in the instance. 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."]
2136    pub fixed: Option<ElementDefinitionFixedTypeChoice>,
2137    # [type_choice_variants (complex = ["patternAddress" , "patternAge" , "patternAnnotation" , "patternAttachment" , "patternCodeableConcept" , "patternCoding" , "patternContactPoint" , "patternCount" , "patternDistance" , "patternDuration" , "patternHumanName" , "patternIdentifier" , "patternMoney" , "patternPeriod" , "patternQuantity" , "patternRange" , "patternRatio" , "patternReference" , "patternSampledData" , "patternSignature" , "patternTiming" , "patternContactDetail" , "patternContributor" , "patternDataRequirement" , "patternExpression" , "patternParameterDefinition" , "patternRelatedArtifact" , "patternTriggerDefinition" , "patternUsageContext" , "patternDosage" , "patternMeta"] , primitive = ["patternBase64Binary" , "patternBoolean" , "patternCanonical" , "patternCode" , "patternDate" , "patternDateTime" , "patternDecimal" , "patternId" , "patternInstant" , "patternInteger" , "patternMarkdown" , "patternOid" , "patternPositiveInt" , "patternString" , "patternTime" , "patternUnsignedInt" , "patternUri" , "patternUrl" , "patternUuid"])]
2138    #[doc = "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  \n\nWhen pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.\n\nWhen pattern[x] is used to constrain an array, it means that each element provided in the pattern[x] array must (recursively) match at least one element from the instance array.\n\nWhen 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.,\n\n1. If primitive: it must match exactly the pattern value\n2. If a complex object: it must match (recursively) the pattern value\n3. If an array: it must match (recursively) the pattern value."]
2139    pub pattern: Option<ElementDefinitionPatternTypeChoice>,
2140    #[doc = "A sample value for this element demonstrating the type of information that would typically be found in the element."]
2141    pub example: Option<Vec<ElementDefinitionExample>>,
2142    # [type_choice_variants (complex = ["minValueQuantity"] , primitive = ["minValueDate" , "minValueDateTime" , "minValueInstant" , "minValueTime" , "minValueDecimal" , "minValueInteger" , "minValuePositiveInt" , "minValueUnsignedInt"])]
2143    #[doc = "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."]
2144    pub minValue: Option<ElementDefinitionMinValueTypeChoice>,
2145    # [type_choice_variants (complex = ["maxValueQuantity"] , primitive = ["maxValueDate" , "maxValueDateTime" , "maxValueInstant" , "maxValueTime" , "maxValueDecimal" , "maxValueInteger" , "maxValuePositiveInt" , "maxValueUnsignedInt"])]
2146    #[doc = "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."]
2147    pub maxValue: Option<ElementDefinitionMaxValueTypeChoice>,
2148    #[primitive]
2149    #[doc = "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."]
2150    pub maxLength: Option<Box<FHIRInteger>>,
2151    #[primitive]
2152    #[doc = "A reference to an invariant that may make additional statements about the cardinality or value in the instance."]
2153    pub condition: Option<Vec<FHIRId>>,
2154    #[doc = "Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance."]
2155    pub constraint: Option<Vec<ElementDefinitionConstraint>>,
2156    #[primitive]
2157    #[doc = "If true, implementations that produce or consume resources SHALL provide \"support\" for the element in some meaningful way.  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."]
2158    pub mustSupport: Option<Box<FHIRBoolean>>,
2159    #[primitive]
2160    #[doc = "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."]
2161    pub isModifier: Option<Box<FHIRBoolean>>,
2162    #[primitive]
2163    #[doc = "Explains how that element affects the interpretation of the resource or element that contains it."]
2164    pub isModifierReason: Option<Box<FHIRString>>,
2165    #[primitive]
2166    #[doc = "Whether the element should be included if a client requests a search with the parameter _summary=true."]
2167    pub isSummary: Option<Box<FHIRBoolean>>,
2168    #[doc = "Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri)."]
2169    pub binding: Option<ElementDefinitionBinding>,
2170    #[doc = "Identifies a concept from an external specification that roughly corresponds to this element."]
2171    pub mapping: Option<Vec<ElementDefinitionMapping>>,
2172}
2173#[derive(
2174    Clone,
2175    Reflect,
2176    Debug,
2177    Default,
2178    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2179    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2180)]
2181#[fhir_type = "Expression"]
2182#[fhir_serialize_type = "complex"]
2183#[doc = "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."]
2184pub struct Expression {
2185    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2186    pub id: Option<String>,
2187    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2188    pub extension: Option<Vec<Extension>>,
2189    #[primitive]
2190    #[doc = "A brief, natural language description of the condition that effectively communicates the intended semantics."]
2191    pub description: Option<Box<FHIRString>>,
2192    #[primitive]
2193    #[doc = "A short name assigned to the expression to allow for multiple reuse of the expression in the context where it is defined."]
2194    pub name: Option<Box<FHIRId>>,
2195    #[primitive]
2196    #[doc = "The media type of the language for the expression."]
2197    pub language: Box<FHIRCode>,
2198    #[primitive]
2199    #[doc = "An expression in the specified language that returns a value."]
2200    pub expression: Option<Box<FHIRString>>,
2201    #[primitive]
2202    #[doc = "A URI that defines where the expression is found."]
2203    pub reference: Option<Box<FHIRUri>>,
2204}
2205#[derive(
2206    Clone,
2207    Reflect,
2208    Debug,
2209    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2210    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2211)]
2212#[fhir_serialize_type = "typechoice"]
2213#[type_choice_field_name = "value"]
2214pub enum ExtensionValueTypeChoice {
2215    #[primitive]
2216    Base64Binary(Box<FHIRBase64Binary>),
2217    #[primitive]
2218    Boolean(Box<FHIRBoolean>),
2219    #[primitive]
2220    Canonical(Box<FHIRCanonical>),
2221    #[primitive]
2222    Code(Box<FHIRCode>),
2223    #[primitive]
2224    Date(Box<FHIRDate>),
2225    #[primitive]
2226    DateTime(Box<FHIRDateTime>),
2227    #[primitive]
2228    Decimal(Box<FHIRDecimal>),
2229    #[primitive]
2230    Id(Box<FHIRId>),
2231    #[primitive]
2232    Instant(Box<FHIRInstant>),
2233    #[primitive]
2234    Integer(Box<FHIRInteger>),
2235    #[primitive]
2236    Markdown(Box<FHIRMarkdown>),
2237    #[primitive]
2238    Oid(Box<FHIROid>),
2239    #[primitive]
2240    PositiveInt(Box<FHIRPositiveInt>),
2241    #[primitive]
2242    String(Box<FHIRString>),
2243    #[primitive]
2244    Time(Box<FHIRTime>),
2245    #[primitive]
2246    UnsignedInt(Box<FHIRUnsignedInt>),
2247    #[primitive]
2248    Uri(Box<FHIRUri>),
2249    #[primitive]
2250    Url(Box<FHIRUrl>),
2251    #[primitive]
2252    Uuid(Box<FHIRUuid>),
2253    Address(Box<Address>),
2254    Age(Box<Age>),
2255    Annotation(Box<Annotation>),
2256    Attachment(Box<Attachment>),
2257    CodeableConcept(Box<CodeableConcept>),
2258    Coding(Box<Coding>),
2259    ContactPoint(Box<ContactPoint>),
2260    Count(Box<Count>),
2261    Distance(Box<Distance>),
2262    Duration(Box<Duration>),
2263    HumanName(Box<HumanName>),
2264    Identifier(Box<Identifier>),
2265    Money(Box<Money>),
2266    Period(Box<Period>),
2267    Quantity(Box<Quantity>),
2268    Range(Box<Range>),
2269    Ratio(Box<Ratio>),
2270    Reference(Box<Reference>),
2271    SampledData(Box<SampledData>),
2272    Signature(Box<Signature>),
2273    Timing(Box<Timing>),
2274    ContactDetail(Box<ContactDetail>),
2275    Contributor(Box<Contributor>),
2276    DataRequirement(Box<DataRequirement>),
2277    Expression(Box<Expression>),
2278    ParameterDefinition(Box<ParameterDefinition>),
2279    RelatedArtifact(Box<RelatedArtifact>),
2280    TriggerDefinition(Box<TriggerDefinition>),
2281    UsageContext(Box<UsageContext>),
2282    Dosage(Box<Dosage>),
2283    Meta(Box<Meta>),
2284}
2285impl Default for ExtensionValueTypeChoice {
2286    fn default() -> Self {
2287        ExtensionValueTypeChoice::Base64Binary(Box::default())
2288    }
2289}
2290#[derive(
2291    Clone,
2292    Reflect,
2293    Debug,
2294    Default,
2295    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2296    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2297)]
2298#[fhir_type = "Extension"]
2299#[fhir_serialize_type = "complex"]
2300#[doc = "Optional Extension Element - found in all resources."]
2301pub struct Extension {
2302    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2303    pub id: Option<String>,
2304    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2305    pub extension: Option<Vec<Extension>>,
2306    #[doc = "Source of the definition for the extension code - a logical name or a URL."]
2307    pub url: String,
2308    # [type_choice_variants (complex = ["valueAddress" , "valueAge" , "valueAnnotation" , "valueAttachment" , "valueCodeableConcept" , "valueCoding" , "valueContactPoint" , "valueCount" , "valueDistance" , "valueDuration" , "valueHumanName" , "valueIdentifier" , "valueMoney" , "valuePeriod" , "valueQuantity" , "valueRange" , "valueRatio" , "valueReference" , "valueSampledData" , "valueSignature" , "valueTiming" , "valueContactDetail" , "valueContributor" , "valueDataRequirement" , "valueExpression" , "valueParameterDefinition" , "valueRelatedArtifact" , "valueTriggerDefinition" , "valueUsageContext" , "valueDosage" , "valueMeta"] , primitive = ["valueBase64Binary" , "valueBoolean" , "valueCanonical" , "valueCode" , "valueDate" , "valueDateTime" , "valueDecimal" , "valueId" , "valueInstant" , "valueInteger" , "valueMarkdown" , "valueOid" , "valuePositiveInt" , "valueString" , "valueTime" , "valueUnsignedInt" , "valueUri" , "valueUrl" , "valueUuid"])]
2309    #[doc = "Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list)."]
2310    pub value: Option<ExtensionValueTypeChoice>,
2311}
2312#[derive(
2313    Clone,
2314    Reflect,
2315    Debug,
2316    Default,
2317    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2318    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2319)]
2320#[fhir_type = "HumanName"]
2321#[fhir_serialize_type = "complex"]
2322#[doc = "A human's name with the ability to identify parts and usage."]
2323pub struct HumanName {
2324    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2325    pub id: Option<String>,
2326    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2327    pub extension: Option<Vec<Extension>>,
2328    #[rename_field = "use"]
2329    #[primitive]
2330    #[doc = "Identifies the purpose for this name."]
2331    pub use_: Option<terminology::BoundCode<terminology::NameUse>>,
2332    #[primitive]
2333    #[doc = "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."]
2334    pub text: Option<Box<FHIRString>>,
2335    #[primitive]
2336    #[doc = "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."]
2337    pub family: Option<Box<FHIRString>>,
2338    #[primitive]
2339    #[doc = "Given name."]
2340    pub given: Option<Vec<FHIRString>>,
2341    #[primitive]
2342    #[doc = "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."]
2343    pub prefix: Option<Vec<FHIRString>>,
2344    #[primitive]
2345    #[doc = "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."]
2346    pub suffix: Option<Vec<FHIRString>>,
2347    #[doc = "Indicates the period of time when this name was valid for the named person."]
2348    pub period: Option<Box<Period>>,
2349}
2350#[derive(
2351    Clone,
2352    Reflect,
2353    Debug,
2354    Default,
2355    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2356    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2357)]
2358#[fhir_type = "Identifier"]
2359#[fhir_serialize_type = "complex"]
2360#[doc = "An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers."]
2361pub struct Identifier {
2362    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2363    pub id: Option<String>,
2364    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2365    pub extension: Option<Vec<Extension>>,
2366    #[rename_field = "use"]
2367    #[primitive]
2368    #[doc = "The purpose of this identifier."]
2369    pub use_: Option<terminology::BoundCode<terminology::IdentifierUse>>,
2370    #[rename_field = "type"]
2371    #[doc = "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose."]
2372    pub type_: Option<Box<CodeableConcept>>,
2373    #[primitive]
2374    #[doc = "Establishes the namespace for the value - that is, a URL that describes a set values that are unique."]
2375    pub system: Option<Box<FHIRUri>>,
2376    #[primitive]
2377    #[doc = "The portion of the identifier typically relevant to the user and which is unique within the context of the system."]
2378    pub value: Option<Box<FHIRString>>,
2379    #[doc = "Time period during which identifier is/was valid for use."]
2380    pub period: Option<Box<Period>>,
2381    # [reference (targets = ["Organization"])]
2382    #[doc = "Organization that issued/manages the identifier."]
2383    pub assigner: Option<Box<Reference>>,
2384}
2385#[derive(
2386    Clone,
2387    Reflect,
2388    Debug,
2389    Default,
2390    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2391    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2392)]
2393#[fhir_type = "MarketingStatus"]
2394#[fhir_serialize_type = "complex"]
2395#[doc = "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."]
2396pub struct MarketingStatus {
2397    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2398    pub id: Option<String>,
2399    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2400    pub extension: Option<Vec<Extension>>,
2401    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
2402    pub modifierExtension: Option<Vec<Extension>>,
2403    #[doc = "The country in which the marketing authorisation has been granted shall be specified It should be specified using the ISO 3166 ‑ 1 alpha-2 code elements."]
2404    pub country: Box<CodeableConcept>,
2405    #[doc = "Where a Medicines Regulatory Agency has granted a marketing authorisation 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."]
2406    pub jurisdiction: Option<Box<CodeableConcept>>,
2407    #[doc = "This attribute provides information on the status of the marketing of the medicinal product See ISO/TS 20443 for more information and examples."]
2408    pub status: Box<CodeableConcept>,
2409    #[doc = "The date when the Medicinal Product is placed on the market by the Marketing Authorisation 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."]
2410    pub dateRange: Box<Period>,
2411    #[primitive]
2412    #[doc = "The date when the Medicinal Product is placed on the market by the Marketing Authorisation 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."]
2413    pub restoreDate: Option<Box<FHIRDateTime>>,
2414}
2415#[derive(
2416    Clone,
2417    Reflect,
2418    Debug,
2419    Default,
2420    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2421    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2422)]
2423#[fhir_type = "Meta"]
2424#[fhir_serialize_type = "complex"]
2425#[doc = "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."]
2426pub struct Meta {
2427    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2428    pub id: Option<String>,
2429    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2430    pub extension: Option<Vec<Extension>>,
2431    #[primitive]
2432    #[doc = "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."]
2433    pub versionId: Option<Box<FHIRId>>,
2434    #[primitive]
2435    #[doc = "When the resource last changed - e.g. when the version changed."]
2436    pub lastUpdated: Option<Box<FHIRInstant>>,
2437    #[primitive]
2438    #[doc = "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."]
2439    pub source: Option<Box<FHIRUri>>,
2440    #[primitive]
2441    #[doc = "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)."]
2442    pub profile: Option<Vec<FHIRCanonical>>,
2443    #[doc = "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure."]
2444    pub security: Option<Vec<Coding>>,
2445    #[doc = "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."]
2446    pub tag: Option<Vec<Coding>>,
2447}
2448#[derive(
2449    Clone,
2450    Reflect,
2451    Debug,
2452    Default,
2453    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2454    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2455)]
2456#[fhir_type = "Money"]
2457#[fhir_serialize_type = "complex"]
2458#[doc = "An amount of economic utility in some recognized currency."]
2459pub struct Money {
2460    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2461    pub id: Option<String>,
2462    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2463    pub extension: Option<Vec<Extension>>,
2464    #[primitive]
2465    #[doc = "Numerical value (with implicit precision)."]
2466    pub value: Option<Box<FHIRDecimal>>,
2467    #[primitive]
2468    #[doc = "ISO 4217 Currency Code."]
2469    pub currency: Option<Box<FHIRCode>>,
2470}
2471#[derive(
2472    Clone,
2473    Reflect,
2474    Debug,
2475    Default,
2476    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2477    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2478)]
2479#[fhir_type = "Narrative"]
2480#[fhir_serialize_type = "complex"]
2481#[doc = "A human-readable summary of the resource conveying the essential clinical and business information for the resource."]
2482pub struct Narrative {
2483    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2484    pub id: Option<String>,
2485    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2486    pub extension: Option<Vec<Extension>>,
2487    #[primitive]
2488    #[doc = "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."]
2489    pub status: terminology::BoundCode<terminology::NarrativeStatus>,
2490    #[primitive]
2491    #[doc = "The actual narrative content, a stripped down version of XHTML."]
2492    pub div: Box<FHIRXhtml>,
2493}
2494#[derive(
2495    Clone,
2496    Reflect,
2497    Debug,
2498    Default,
2499    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2500    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2501)]
2502#[fhir_type = "ParameterDefinition"]
2503#[fhir_serialize_type = "complex"]
2504#[doc = "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."]
2505pub struct ParameterDefinition {
2506    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2507    pub id: Option<String>,
2508    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2509    pub extension: Option<Vec<Extension>>,
2510    #[primitive]
2511    #[doc = "The name of the parameter used to allow access to the value of the parameter in evaluation contexts."]
2512    pub name: Option<Box<FHIRCode>>,
2513    #[rename_field = "use"]
2514    #[primitive]
2515    #[doc = "Whether the parameter is input or output for the module."]
2516    pub use_: terminology::BoundCode<terminology::OperationParameterUse>,
2517    #[primitive]
2518    #[doc = "The minimum number of times this parameter SHALL appear in the request or response."]
2519    pub min: Option<Box<FHIRInteger>>,
2520    #[primitive]
2521    #[doc = "The maximum number of times this element is permitted to appear in the request or response."]
2522    pub max: Option<Box<FHIRString>>,
2523    #[primitive]
2524    #[doc = "A brief discussion of what the parameter is for and how it is used by the module."]
2525    pub documentation: Option<Box<FHIRString>>,
2526    #[rename_field = "type"]
2527    #[primitive]
2528    #[doc = "The type of the parameter."]
2529    pub type_: terminology::BoundCode<terminology::AllTypes>,
2530    #[primitive]
2531    #[doc = "If specified, this indicates a profile that the input data must conform to, or that the output data will conform to."]
2532    pub profile: Option<Box<FHIRCanonical>>,
2533}
2534#[derive(
2535    Clone,
2536    Reflect,
2537    Debug,
2538    Default,
2539    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2540    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2541)]
2542#[fhir_type = "Period"]
2543#[fhir_serialize_type = "complex"]
2544#[doc = "A time period defined by a start and end date and optionally time."]
2545pub struct Period {
2546    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2547    pub id: Option<String>,
2548    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2549    pub extension: Option<Vec<Extension>>,
2550    #[primitive]
2551    #[doc = "The start of the period. The boundary is inclusive."]
2552    pub start: Option<Box<FHIRDateTime>>,
2553    #[primitive]
2554    #[doc = "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."]
2555    pub end: Option<Box<FHIRDateTime>>,
2556}
2557#[derive(
2558    Clone,
2559    Reflect,
2560    Debug,
2561    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2562    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2563)]
2564#[fhir_serialize_type = "typechoice"]
2565#[type_choice_field_name = "age"]
2566pub enum PopulationAgeTypeChoice {
2567    Range(Box<Range>),
2568    CodeableConcept(Box<CodeableConcept>),
2569}
2570impl Default for PopulationAgeTypeChoice {
2571    fn default() -> Self {
2572        PopulationAgeTypeChoice::Range(Box::default())
2573    }
2574}
2575#[derive(
2576    Clone,
2577    Reflect,
2578    Debug,
2579    Default,
2580    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2581    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2582)]
2583#[fhir_type = "Population"]
2584#[fhir_serialize_type = "complex"]
2585#[doc = "A populatioof people with some set of grouping criteria."]
2586pub struct Population {
2587    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2588    pub id: Option<String>,
2589    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2590    pub extension: Option<Vec<Extension>>,
2591    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
2592    pub modifierExtension: Option<Vec<Extension>>,
2593    # [type_choice_variants (complex = ["ageRange" , "ageCodeableConcept"] , primitive = [])]
2594    #[doc = "The age of the specific population."]
2595    pub age: Option<PopulationAgeTypeChoice>,
2596    #[doc = "The gender of the specific population."]
2597    pub gender: Option<Box<CodeableConcept>>,
2598    #[doc = "Race of the specific population."]
2599    pub race: Option<Box<CodeableConcept>>,
2600    #[doc = "The existing physiological conditions of the specific population to which this applies."]
2601    pub physiologicalCondition: Option<Box<CodeableConcept>>,
2602}
2603#[derive(
2604    Clone,
2605    Reflect,
2606    Debug,
2607    Default,
2608    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2609    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2610)]
2611#[fhir_type = "ProdCharacteristic"]
2612#[fhir_serialize_type = "complex"]
2613#[doc = "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."]
2614pub struct ProdCharacteristic {
2615    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2616    pub id: Option<String>,
2617    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2618    pub extension: Option<Vec<Extension>>,
2619    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
2620    pub modifierExtension: Option<Vec<Extension>>,
2621    #[doc = "Where applicable, the height can be specified using a numerical value and its unit of 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."]
2622    pub height: Option<Box<Quantity>>,
2623    #[doc = "Where applicable, the width can be specified using a numerical value and its unit of 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."]
2624    pub width: Option<Box<Quantity>>,
2625    #[doc = "Where applicable, the depth can be specified using a numerical value and its unit of 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."]
2626    pub depth: Option<Box<Quantity>>,
2627    #[doc = "Where applicable, the weight can be specified using a numerical value and its unit of 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."]
2628    pub weight: Option<Box<Quantity>>,
2629    #[doc = "Where applicable, the nominal volume can be specified using a numerical value and its unit of 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."]
2630    pub nominalVolume: Option<Box<Quantity>>,
2631    #[doc = "Where applicable, the external diameter can be specified using a numerical value and its unit of 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."]
2632    pub externalDiameter: Option<Box<Quantity>>,
2633    #[primitive]
2634    #[doc = "Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used."]
2635    pub shape: Option<Box<FHIRString>>,
2636    #[primitive]
2637    #[doc = "Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used."]
2638    pub color: Option<Vec<FHIRString>>,
2639    #[primitive]
2640    #[doc = "Where applicable, the imprint can be specified as text."]
2641    pub imprint: Option<Vec<FHIRString>>,
2642    #[doc = "Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations."]
2643    pub image: Option<Vec<Attachment>>,
2644    #[doc = "Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used."]
2645    pub scoring: Option<Box<CodeableConcept>>,
2646}
2647#[derive(
2648    Clone,
2649    Reflect,
2650    Debug,
2651    Default,
2652    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2653    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2654)]
2655#[fhir_type = "ProductShelfLife"]
2656#[fhir_serialize_type = "complex"]
2657#[doc = "The shelf-life and storage information for a medicinal product item or container can be described using this class."]
2658pub struct ProductShelfLife {
2659    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2660    pub id: Option<String>,
2661    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2662    pub extension: Option<Vec<Extension>>,
2663    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
2664    pub modifierExtension: Option<Vec<Extension>>,
2665    #[rename_field = "identifier"]
2666    #[doc = "Unique identifier for the packaged Medicinal Product."]
2667    pub identifier_: Option<Box<Identifier>>,
2668    #[rename_field = "type"]
2669    #[doc = "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."]
2670    pub type_: Box<CodeableConcept>,
2671    #[doc = "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."]
2672    pub period: Box<Quantity>,
2673    #[doc = "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."]
2674    pub specialPrecautionsForStorage: Option<Vec<CodeableConcept>>,
2675}
2676#[derive(
2677    Clone,
2678    Reflect,
2679    Debug,
2680    Default,
2681    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2682    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2683)]
2684#[fhir_type = "Quantity"]
2685#[fhir_serialize_type = "complex"]
2686#[doc = "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."]
2687pub struct Quantity {
2688    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2689    pub id: Option<String>,
2690    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2691    pub extension: Option<Vec<Extension>>,
2692    #[primitive]
2693    #[doc = "The value of the measured amount. The value includes an implicit precision in the presentation of the value."]
2694    pub value: Option<Box<FHIRDecimal>>,
2695    #[primitive]
2696    #[doc = "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."]
2697    pub comparator: Option<terminology::BoundCode<terminology::QuantityComparator>>,
2698    #[primitive]
2699    #[doc = "A human-readable form of the unit."]
2700    pub unit: Option<Box<FHIRString>>,
2701    #[primitive]
2702    #[doc = "The identification of the system that provides the coded form of the unit."]
2703    pub system: Option<Box<FHIRUri>>,
2704    #[primitive]
2705    #[doc = "A computer processable form of the unit in some unit representation system."]
2706    pub code: Option<Box<FHIRCode>>,
2707}
2708#[derive(
2709    Clone,
2710    Reflect,
2711    Debug,
2712    Default,
2713    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2714    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2715)]
2716#[fhir_type = "Range"]
2717#[fhir_serialize_type = "complex"]
2718#[doc = "A set of ordered Quantities defined by a low and high limit."]
2719pub struct Range {
2720    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2721    pub id: Option<String>,
2722    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2723    pub extension: Option<Vec<Extension>>,
2724    #[doc = "The low limit. The boundary is inclusive."]
2725    pub low: Option<Box<Quantity>>,
2726    #[doc = "The high limit. The boundary is inclusive."]
2727    pub high: Option<Box<Quantity>>,
2728}
2729#[derive(
2730    Clone,
2731    Reflect,
2732    Debug,
2733    Default,
2734    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2735    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2736)]
2737#[fhir_type = "Ratio"]
2738#[fhir_serialize_type = "complex"]
2739#[doc = "A relationship of two Quantity values - expressed as a numerator and a denominator."]
2740pub struct Ratio {
2741    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2742    pub id: Option<String>,
2743    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2744    pub extension: Option<Vec<Extension>>,
2745    #[doc = "The value of the numerator."]
2746    pub numerator: Option<Box<Quantity>>,
2747    #[doc = "The value of the denominator."]
2748    pub denominator: Option<Box<Quantity>>,
2749}
2750#[derive(
2751    Clone,
2752    Reflect,
2753    Debug,
2754    Default,
2755    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2756    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2757)]
2758#[fhir_type = "Reference"]
2759#[fhir_serialize_type = "complex"]
2760#[doc = "A reference from one resource to another."]
2761pub struct Reference {
2762    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2763    pub id: Option<String>,
2764    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2765    pub extension: Option<Vec<Extension>>,
2766    #[primitive]
2767    #[doc = "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."]
2768    pub reference: Option<Box<FHIRString>>,
2769    #[rename_field = "type"]
2770    #[primitive]
2771    #[doc = "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.\n\nThe 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)."]
2772    pub type_: Option<Box<FHIRUri>>,
2773    #[rename_field = "identifier"]
2774    #[doc = "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."]
2775    pub identifier_: Option<Box<Identifier>>,
2776    #[primitive]
2777    #[doc = "Plain text narrative that identifies the resource in addition to the resource reference."]
2778    pub display: Option<Box<FHIRString>>,
2779}
2780#[derive(
2781    Clone,
2782    Reflect,
2783    Debug,
2784    Default,
2785    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2786    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2787)]
2788#[fhir_type = "RelatedArtifact"]
2789#[fhir_serialize_type = "complex"]
2790#[doc = "Related artifacts such as additional documentation, justification, or bibliographic references."]
2791pub struct RelatedArtifact {
2792    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2793    pub id: Option<String>,
2794    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2795    pub extension: Option<Vec<Extension>>,
2796    #[rename_field = "type"]
2797    #[primitive]
2798    #[doc = "The type of relationship to the related artifact."]
2799    pub type_: terminology::BoundCode<terminology::RelatedArtifactType>,
2800    #[primitive]
2801    #[doc = "A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index."]
2802    pub label: Option<Box<FHIRString>>,
2803    #[primitive]
2804    #[doc = "A brief description of the document or knowledge resource being referenced, suitable for display to a consumer."]
2805    pub display: Option<Box<FHIRString>>,
2806    #[primitive]
2807    #[doc = "A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format."]
2808    pub citation: Option<Box<FHIRMarkdown>>,
2809    #[primitive]
2810    #[doc = "A url for the artifact that can be followed to access the actual content."]
2811    pub url: Option<Box<FHIRUrl>>,
2812    #[doc = "The document being referenced, represented as an attachment. This is exclusive with the resource element."]
2813    pub document: Option<Box<Attachment>>,
2814    #[primitive]
2815    #[doc = "The related resource, such as a library, value set, profile, or other knowledge resource."]
2816    pub resource: Option<Box<FHIRCanonical>>,
2817}
2818#[derive(
2819    Clone,
2820    Reflect,
2821    Debug,
2822    Default,
2823    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2824    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2825)]
2826#[fhir_type = "SampledData"]
2827#[fhir_serialize_type = "complex"]
2828#[doc = "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data."]
2829pub struct SampledData {
2830    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2831    pub id: Option<String>,
2832    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2833    pub extension: Option<Vec<Extension>>,
2834    #[doc = "The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series."]
2835    pub origin: Box<Quantity>,
2836    #[primitive]
2837    #[doc = "The length of time between sampling times, measured in milliseconds."]
2838    pub period: Box<FHIRDecimal>,
2839    #[primitive]
2840    #[doc = "A correction factor that is applied to the sampled data points before they are added to the origin."]
2841    pub factor: Option<Box<FHIRDecimal>>,
2842    #[primitive]
2843    #[doc = "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)."]
2844    pub lowerLimit: Option<Box<FHIRDecimal>>,
2845    #[primitive]
2846    #[doc = "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)."]
2847    pub upperLimit: Option<Box<FHIRDecimal>>,
2848    #[primitive]
2849    #[doc = "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."]
2850    pub dimensions: Box<FHIRPositiveInt>,
2851    #[primitive]
2852    #[doc = "A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value."]
2853    pub data: Option<Box<FHIRString>>,
2854}
2855#[derive(
2856    Clone,
2857    Reflect,
2858    Debug,
2859    Default,
2860    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2861    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2862)]
2863#[fhir_type = "Signature"]
2864#[fhir_serialize_type = "complex"]
2865#[doc = "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."]
2866pub struct Signature {
2867    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2868    pub id: Option<String>,
2869    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2870    pub extension: Option<Vec<Extension>>,
2871    #[rename_field = "type"]
2872    #[cardinality(min = 1u64)]
2873    #[doc = "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."]
2874    pub type_: Vec<Coding>,
2875    #[primitive]
2876    #[doc = "When the digital signature was signed."]
2877    pub when: Box<FHIRInstant>,
2878    # [reference (targets = ["Practitioner" , "PractitionerRole" , "RelatedPerson" , "Patient" , "Device" , "Organization"])]
2879    #[doc = "A reference to an application-usable description of the identity that signed  (e.g. the signature used their private key)."]
2880    pub who: Box<Reference>,
2881    # [reference (targets = ["Practitioner" , "PractitionerRole" , "RelatedPerson" , "Patient" , "Device" , "Organization"])]
2882    #[doc = "A reference to an application-usable description of the identity that is represented by the signature."]
2883    pub onBehalfOf: Option<Box<Reference>>,
2884    #[primitive]
2885    #[doc = "A mime type that indicates the technical format of the target resources signed by the signature."]
2886    pub targetFormat: Option<Box<FHIRCode>>,
2887    #[primitive]
2888    #[doc = "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."]
2889    pub sigFormat: Option<Box<FHIRCode>>,
2890    #[primitive]
2891    #[doc = "The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty."]
2892    pub data: Option<Box<FHIRBase64Binary>>,
2893}
2894#[derive(
2895    Clone,
2896    Reflect,
2897    Debug,
2898    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2899    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2900)]
2901#[fhir_serialize_type = "typechoice"]
2902#[type_choice_field_name = "amount"]
2903pub enum SubstanceAmountAmountTypeChoice {
2904    Quantity(Box<Quantity>),
2905    Range(Box<Range>),
2906    #[primitive]
2907    String(Box<FHIRString>),
2908}
2909impl Default for SubstanceAmountAmountTypeChoice {
2910    fn default() -> Self {
2911        SubstanceAmountAmountTypeChoice::Quantity(Box::default())
2912    }
2913}
2914#[derive(
2915    Clone,
2916    Reflect,
2917    Debug,
2918    Default,
2919    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2920    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2921)]
2922#[fhir_type = "Element"]
2923#[fhir_serialize_type = "complex"]
2924#[doc = "Reference range of possible or expected values."]
2925pub struct SubstanceAmountReferenceRange {
2926    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2927    pub id: Option<String>,
2928    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2929    pub extension: Option<Vec<Extension>>,
2930    #[doc = "Lower limit possible or expected."]
2931    pub lowLimit: Option<Box<Quantity>>,
2932    #[doc = "Upper limit possible or expected."]
2933    pub highLimit: Option<Box<Quantity>>,
2934}
2935#[derive(
2936    Clone,
2937    Reflect,
2938    Debug,
2939    Default,
2940    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2941    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2942)]
2943#[fhir_type = "SubstanceAmount"]
2944#[fhir_serialize_type = "complex"]
2945#[doc = "Chemical substances are a single substance type whose primary defining element is the molecular structure. Chemical substances shall be defined on the basis of their complete covalent molecular structure; the presence of a salt (counter-ion) and/or solvates (water, alcohols) is also captured. Purity, grade, physical form or particle size are not taken into account in the definition of a chemical substance or in the assignment of a Substance ID."]
2946pub struct SubstanceAmount {
2947    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2948    pub id: Option<String>,
2949    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2950    pub extension: Option<Vec<Extension>>,
2951    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
2952    pub modifierExtension: Option<Vec<Extension>>,
2953    # [type_choice_variants (complex = ["amountQuantity" , "amountRange"] , primitive = ["amountString"])]
2954    #[doc = "Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field."]
2955    pub amount: Option<SubstanceAmountAmountTypeChoice>,
2956    #[doc = "Most elements that require a quantitative value will also have a field called amount type. Amount type should always be specified because the actual value of the amount is often dependent on it. EXAMPLE: In capturing the actual relative amounts of substances or molecular fragments it is essential to indicate whether the amount refers to a mole ratio or weight ratio. For any given element an effort should be made to use same the amount type for all related definitional elements."]
2957    pub amountType: Option<Box<CodeableConcept>>,
2958    #[primitive]
2959    #[doc = "A textual comment on a numeric value."]
2960    pub amountText: Option<Box<FHIRString>>,
2961    #[doc = "Reference range of possible or expected values."]
2962    pub referenceRange: Option<SubstanceAmountReferenceRange>,
2963}
2964#[derive(
2965    Clone,
2966    Reflect,
2967    Debug,
2968    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2969    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2970)]
2971#[fhir_serialize_type = "typechoice"]
2972#[type_choice_field_name = "bounds"]
2973pub enum TimingRepeatBoundsTypeChoice {
2974    Duration(Box<Duration>),
2975    Range(Box<Range>),
2976    Period(Box<Period>),
2977}
2978impl Default for TimingRepeatBoundsTypeChoice {
2979    fn default() -> Self {
2980        TimingRepeatBoundsTypeChoice::Duration(Box::default())
2981    }
2982}
2983#[derive(
2984    Clone,
2985    Reflect,
2986    Debug,
2987    Default,
2988    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
2989    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
2990)]
2991#[fhir_type = "Element"]
2992#[fhir_serialize_type = "complex"]
2993#[doc = "A set of rules that describe when the event is scheduled."]
2994pub struct TimingRepeat {
2995    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
2996    pub id: Option<String>,
2997    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
2998    pub extension: Option<Vec<Extension>>,
2999    # [type_choice_variants (complex = ["boundsDuration" , "boundsRange" , "boundsPeriod"] , primitive = [])]
3000    #[doc = "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."]
3001    pub bounds: Option<TimingRepeatBoundsTypeChoice>,
3002    #[primitive]
3003    #[doc = "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."]
3004    pub count: Option<Box<FHIRPositiveInt>>,
3005    #[primitive]
3006    #[doc = "If present, indicates that the count is a range - so to perform the action between [count] and [countMax] times."]
3007    pub countMax: Option<Box<FHIRPositiveInt>>,
3008    #[primitive]
3009    #[doc = "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."]
3010    pub duration: Option<Box<FHIRDecimal>>,
3011    #[primitive]
3012    #[doc = "If present, indicates that the duration is a range - so to perform the action between [duration] and [durationMax] time length."]
3013    pub durationMax: Option<Box<FHIRDecimal>>,
3014    #[primitive]
3015    #[doc = "The units of time for the duration, in UCUM units."]
3016    pub durationUnit: Option<terminology::BoundCode<terminology::UnitsOfTime>>,
3017    #[primitive]
3018    #[doc = "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."]
3019    pub frequency: Option<Box<FHIRPositiveInt>>,
3020    #[primitive]
3021    #[doc = "If present, indicates that the frequency is a range - so to repeat between [frequency] and [frequencyMax] times within the period or period range."]
3022    pub frequencyMax: Option<Box<FHIRPositiveInt>>,
3023    #[primitive]
3024    #[doc = "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."]
3025    pub period: Option<Box<FHIRDecimal>>,
3026    #[primitive]
3027    #[doc = "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."]
3028    pub periodMax: Option<Box<FHIRDecimal>>,
3029    #[primitive]
3030    #[doc = "The units of time for the period in UCUM units."]
3031    pub periodUnit: Option<terminology::BoundCode<terminology::UnitsOfTime>>,
3032    #[primitive]
3033    #[doc = "If one or more days of week is provided, then the action happens only on the specified day(s)."]
3034    pub dayOfWeek: Option<Vec<terminology::BoundCode<terminology::DaysOfWeek>>>,
3035    #[primitive]
3036    #[doc = "Specified time of day for action to take place."]
3037    pub timeOfDay: Option<Vec<FHIRTime>>,
3038    #[primitive]
3039    #[doc = "An approximate time period during the day, potentially linked to an event of daily living that indicates when the action should occur."]
3040    pub when: Option<Vec<terminology::BoundCode<terminology::EventTiming>>>,
3041    #[primitive]
3042    #[doc = "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."]
3043    pub offset: Option<Box<FHIRUnsignedInt>>,
3044}
3045#[derive(
3046    Clone,
3047    Reflect,
3048    Debug,
3049    Default,
3050    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
3051    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
3052)]
3053#[fhir_type = "Timing"]
3054#[fhir_serialize_type = "complex"]
3055#[doc = "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."]
3056pub struct Timing {
3057    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
3058    pub id: Option<String>,
3059    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
3060    pub extension: Option<Vec<Extension>>,
3061    #[doc = "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
3062    pub modifierExtension: Option<Vec<Extension>>,
3063    #[primitive]
3064    #[doc = "Identifies specific times when the event occurs."]
3065    pub event: Option<Vec<FHIRDateTime>>,
3066    #[doc = "A set of rules that describe when the event is scheduled."]
3067    pub repeat: Option<TimingRepeat>,
3068    #[doc = "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)."]
3069    pub code: Option<Box<CodeableConcept>>,
3070}
3071#[derive(
3072    Clone,
3073    Reflect,
3074    Debug,
3075    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
3076    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
3077)]
3078#[fhir_serialize_type = "typechoice"]
3079#[type_choice_field_name = "timing"]
3080pub enum TriggerDefinitionTimingTypeChoice {
3081    Timing(Box<Timing>),
3082    # [reference (targets = ["Schedule"])]
3083    Reference(Box<Reference>),
3084    #[primitive]
3085    Date(Box<FHIRDate>),
3086    #[primitive]
3087    DateTime(Box<FHIRDateTime>),
3088}
3089impl Default for TriggerDefinitionTimingTypeChoice {
3090    fn default() -> Self {
3091        TriggerDefinitionTimingTypeChoice::Timing(Box::default())
3092    }
3093}
3094#[derive(
3095    Clone,
3096    Reflect,
3097    Debug,
3098    Default,
3099    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
3100    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
3101)]
3102#[fhir_type = "TriggerDefinition"]
3103#[fhir_serialize_type = "complex"]
3104#[doc = "A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element."]
3105pub struct TriggerDefinition {
3106    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
3107    pub id: Option<String>,
3108    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
3109    pub extension: Option<Vec<Extension>>,
3110    #[rename_field = "type"]
3111    #[primitive]
3112    #[doc = "The type of triggering event."]
3113    pub type_: terminology::BoundCode<terminology::TriggerType>,
3114    #[primitive]
3115    #[doc = "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."]
3116    pub name: Option<Box<FHIRString>>,
3117    # [type_choice_variants (complex = ["timingTiming" , "timingReference"] , primitive = ["timingDate" , "timingDateTime"])]
3118    #[doc = "The timing of the event (if this is a periodic trigger)."]
3119    pub timing: Option<TriggerDefinitionTimingTypeChoice>,
3120    #[doc = "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."]
3121    pub data: Option<Vec<DataRequirement>>,
3122    #[doc = "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."]
3123    pub condition: Option<Box<Expression>>,
3124}
3125#[derive(
3126    Clone,
3127    Reflect,
3128    Debug,
3129    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
3130    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
3131)]
3132#[fhir_serialize_type = "typechoice"]
3133#[type_choice_field_name = "value"]
3134pub enum UsageContextValueTypeChoice {
3135    CodeableConcept(Box<CodeableConcept>),
3136    Quantity(Box<Quantity>),
3137    Range(Box<Range>),
3138    # [reference (targets = ["PlanDefinition" , "ResearchStudy" , "InsurancePlan" , "HealthcareService" , "Group" , "Location" , "Organization"])]
3139    Reference(Box<Reference>),
3140}
3141impl Default for UsageContextValueTypeChoice {
3142    fn default() -> Self {
3143        UsageContextValueTypeChoice::CodeableConcept(Box::default())
3144    }
3145}
3146#[derive(
3147    Clone,
3148    Reflect,
3149    Debug,
3150    Default,
3151    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
3152    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
3153)]
3154#[fhir_type = "UsageContext"]
3155#[fhir_serialize_type = "complex"]
3156#[doc = "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)."]
3157pub struct UsageContext {
3158    #[doc = "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."]
3159    pub id: Option<String>,
3160    #[doc = "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
3161    pub extension: Option<Vec<Extension>>,
3162    #[doc = "A code that identifies the type of context being specified by this usage context."]
3163    pub code: Box<Coding>,
3164    # [type_choice_variants (complex = ["valueCodeableConcept" , "valueQuantity" , "valueRange" , "valueReference"] , primitive = [])]
3165    #[doc = "A value that defines the context specified in this context of use. The interpretation of the value is defined by the code."]
3166    pub value: UsageContextValueTypeChoice,
3167}
3168#[derive(
3169    Clone,
3170    Reflect,
3171    Debug,
3172    Default,
3173    haste_fhir_serialization_json :: derive :: FHIRSerdeSerialize,
3174    haste_fhir_serialization_json :: derive :: FHIRSerdeDeserialize,
3175)]
3176#[fhir_type = "MetadataResource"]
3177#[fhir_serialize_type = "complex"]
3178#[doc = "Common Ancestor declaration for conformance and knowledge artifact resources."]
3179pub struct MetadataResource {
3180    #[doc = "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes."]
3181    pub id: Option<String>,
3182    #[doc = "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource."]
3183    pub meta: Option<Box<Meta>>,
3184    #[primitive]
3185    #[doc = "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc."]
3186    pub implicitRules: Option<Box<FHIRUri>>,
3187    #[primitive]
3188    #[doc = "The base language in which the resource is written."]
3189    pub language: Option<Box<FHIRCode>>,
3190    #[doc = "A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety."]
3191    pub text: Option<Box<Narrative>>,
3192    #[doc = "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope."]
3193    pub contained: Option<Vec<Resource>>,
3194    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."]
3195    pub extension: Option<Vec<Extension>>,
3196    #[doc = "May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."]
3197    pub modifierExtension: Option<Vec<Extension>>,
3198    #[primitive]
3199    #[doc = "An absolute URI that is used to identify this metadata resource when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this metadata resource is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the metadata resource is stored on different servers."]
3200    pub url: Option<Box<FHIRUri>>,
3201    #[primitive]
3202    #[doc = "The identifier that is used to identify this version of the metadata resource when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the metadata resource author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence."]
3203    pub version: Option<Box<FHIRString>>,
3204    #[primitive]
3205    #[doc = "A natural language name identifying the metadata resource. This name should be usable as an identifier for the module by machine processing applications such as code generation."]
3206    pub name: Option<Box<FHIRString>>,
3207    #[primitive]
3208    #[doc = "A short, descriptive, user-friendly title for the metadata resource."]
3209    pub title: Option<Box<FHIRString>>,
3210    #[primitive]
3211    #[doc = "The status of this metadata resource. Enables tracking the life-cycle of the content."]
3212    pub status: terminology::BoundCode<terminology::PublicationStatus>,
3213    #[primitive]
3214    #[doc = "A Boolean value to indicate that this metadata resource is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage."]
3215    pub experimental: Option<Box<FHIRBoolean>>,
3216    #[primitive]
3217    #[doc = "The date  (and optionally time) when the metadata resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the metadata resource changes."]
3218    pub date: Option<Box<FHIRDateTime>>,
3219    #[primitive]
3220    #[doc = "The name of the organization or individual that published the metadata resource."]
3221    pub publisher: Option<Box<FHIRString>>,
3222    #[doc = "Contact details to assist a user in finding and communicating with the publisher."]
3223    pub contact: Option<Vec<ContactDetail>>,
3224    #[primitive]
3225    #[doc = "A free text natural language description of the metadata resource from a consumer's perspective."]
3226    pub description: Option<Box<FHIRMarkdown>>,
3227    #[doc = "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate metadata resource instances."]
3228    pub useContext: Option<Vec<UsageContext>>,
3229    #[doc = "A legal or geographic region in which the metadata resource is intended to be used."]
3230    pub jurisdiction: Option<Vec<CodeableConcept>>,
3231}