1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
//! MolecularSequence
//!
//! URL: http://hl7.org/fhir/StructureDefinition/MolecularSequence
//!
//! Version: 4.0.1
//!
//! Information about a biological sequence
//!
//! FHIR R4: <https://hl7.org/fhir/R4/>
// The `types` import is unused by a handful of types that have only primitive fields.
#![allow(unused_imports)]
use crate::r4::types;
use ::serde::{Deserialize, Serialize};
use fhir_derive_macros::{Builder, Validate};
/// Raw data describing a biological sequence.
///
/// # Examples
///
/// ```
/// use fhir::r4::resources::molecular_sequence::MolecularSequence;
///
/// let value = MolecularSequence::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: MolecularSequence = ::serde_json::from_value(json).unwrap();
/// assert_eq!(value, back);
/// ```
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate, Builder)]
#[serde(rename_all = "camelCase")]
#[fhir_version("r4")]
pub struct MolecularSequence {
/// Logical id of this artifact
pub id: Option<types::String>,
/// Metadata about the resource
pub meta: Option<types::Meta>,
/// A set of rules under which this content was created
pub implicit_rules: Option<types::Uri>,
/// Primitive extension sibling for [`implicit_rules`](Self::implicit_rules) (FHIR `_implicitRules`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_implicitRules")]
pub implicit_rules_ext: Option<types::Element>,
/// Language of the resource content
pub language: Option<types::Code>,
/// Primitive extension sibling for [`language`](Self::language) (FHIR `_language`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_language")]
pub language_ext: Option<types::Element>,
/// Text summary of the resource, for human interpretation
pub text: Option<types::Narrative>,
/// Contained, inline Resources
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub contained: Vec<::serde_json::Value>,
/// Additional content defined by implementations
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub extension: Vec<types::Extension>,
/// Extensions that cannot be ignored
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub modifier_extension: Vec<types::Extension>,
/// Unique ID for this particular sequence. This is a FHIR-defined id
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub identifier: Vec<types::Identifier>,
/// aa | dna | rna
pub r#type: Option<crate::coded::Coded<crate::r4::codes::SequenceType>>,
/// Primitive extension sibling for [`r#type`](Self::r#type) (FHIR `_type`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_type")]
pub type_ext: Option<types::Element>,
/// Base number of coordinate system (0 for 0-based numbering or
/// coordinates, inclusive start, exclusive end, 1 for 1-based numbering,
/// inclusive start, inclusive end)
pub coordinate_system: types::Integer,
/// Primitive extension sibling for [`coordinate_system`](Self::coordinate_system) (FHIR `_coordinateSystem`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_coordinateSystem")]
pub coordinate_system_ext: Option<types::Element>,
/// Who and/or what this is about
pub patient: Option<types::Reference>,
/// Specimen used for sequencing
pub specimen: Option<types::Reference>,
/// The method for sequencing
pub device: Option<types::Reference>,
/// Who should be responsible for test result
pub performer: Option<types::Reference>,
/// The number of copies of the sequence of interest. (RNASeq)
pub quantity: Option<types::Quantity>,
/// A sequence used as reference
pub reference_seq: Option<MolecularSequenceReferenceSeq>,
/// Variant in sequence
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub variant: Vec<MolecularSequenceVariant>,
/// Sequence that was observed
pub observed_seq: Option<types::String>,
/// Primitive extension sibling for [`observed_seq`](Self::observed_seq) (FHIR `_observedSeq`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_observedSeq")]
pub observed_seq_ext: Option<types::Element>,
/// An set of value as quality of sequence
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub quality: Vec<MolecularSequenceQuality>,
/// Average number of reads representing a given nucleotide in the
/// reconstructed sequence
pub read_coverage: Option<types::Integer>,
/// Primitive extension sibling for [`read_coverage`](Self::read_coverage) (FHIR `_readCoverage`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_readCoverage")]
pub read_coverage_ext: Option<types::Element>,
/// External repository which contains detailed report related with
/// observedSeq in this resource
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub repository: Vec<MolecularSequenceRepository>,
/// Pointer to next atomic sequence
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub pointer: Vec<types::Reference>,
/// Structural variant
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub structure_variant: Vec<MolecularSequenceStructureVariant>,
}
/// An experimental feature attribute that defines the quality of the feature
/// in a quantitative way, such as a phred quality score
/// ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)).
///
/// # Examples
///
/// ```
/// use fhir::r4::resources::molecular_sequence::MolecularSequenceQuality;
///
/// let value = MolecularSequenceQuality::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: MolecularSequenceQuality = ::serde_json::from_value(json).unwrap();
/// assert_eq!(value, back);
/// ```
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
#[fhir_version("r4")]
pub struct MolecularSequenceQuality {
/// Unique id for inter-element referencing
pub id: Option<types::String>,
/// Additional content defined by implementations
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub extension: Vec<types::Extension>,
/// Extensions that cannot be ignored even if unrecognized
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub modifier_extension: Vec<types::Extension>,
/// indel | snp | unknown
pub r#type: crate::coded::Coded<crate::r4::codes::QualityType>,
/// Primitive extension sibling for [`r#type`](Self::r#type) (FHIR `_type`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_type")]
pub type_ext: Option<types::Element>,
/// Standard sequence for comparison
pub standard_sequence: Option<types::CodeableConcept>,
/// Start position of the sequence
pub start: Option<types::Integer>,
/// Primitive extension sibling for [`start`](Self::start) (FHIR `_start`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_start")]
pub start_ext: Option<types::Element>,
/// End position of the sequence
pub end: Option<types::Integer>,
/// Primitive extension sibling for [`end`](Self::end) (FHIR `_end`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_end")]
pub end_ext: Option<types::Element>,
/// Quality score for the comparison
pub score: Option<types::Quantity>,
/// Method to get quality
pub method: Option<types::CodeableConcept>,
/// True positives from the perspective of the truth data
#[serde(rename = "truthTP")]
pub truth_tp: Option<types::Decimal>,
/// Primitive extension sibling for [`truth_tp`](Self::truth_tp) (FHIR `_truthTP`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_truthTP")]
pub truth_tp_ext: Option<types::Element>,
/// True positives from the perspective of the query data
#[serde(rename = "queryTP")]
pub query_tp: Option<types::Decimal>,
/// Primitive extension sibling for [`query_tp`](Self::query_tp) (FHIR `_queryTP`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_queryTP")]
pub query_tp_ext: Option<types::Element>,
/// False negatives
#[serde(rename = "truthFN")]
pub truth_fn: Option<types::Decimal>,
/// Primitive extension sibling for [`truth_fn`](Self::truth_fn) (FHIR `_truthFN`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_truthFN")]
pub truth_fn_ext: Option<types::Element>,
/// False positives
#[serde(rename = "queryFP")]
pub query_fp: Option<types::Decimal>,
/// Primitive extension sibling for [`query_fp`](Self::query_fp) (FHIR `_queryFP`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_queryFP")]
pub query_fp_ext: Option<types::Element>,
/// False positives where the non-REF alleles in the Truth and Query Call
/// Sets match
#[serde(rename = "gtFP")]
pub gt_fp: Option<types::Decimal>,
/// Primitive extension sibling for [`gt_fp`](Self::gt_fp) (FHIR `_gtFP`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_gtFP")]
pub gt_fp_ext: Option<types::Element>,
/// Precision of comparison
pub precision: Option<types::Decimal>,
/// Primitive extension sibling for [`precision`](Self::precision) (FHIR `_precision`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_precision")]
pub precision_ext: Option<types::Element>,
/// Recall of comparison
pub recall: Option<types::Decimal>,
/// Primitive extension sibling for [`recall`](Self::recall) (FHIR `_recall`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_recall")]
pub recall_ext: Option<types::Element>,
/// F-score
pub f_score: Option<types::Decimal>,
/// Primitive extension sibling for [`f_score`](Self::f_score) (FHIR `_fScore`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_fScore")]
pub f_score_ext: Option<types::Element>,
/// Receiver Operator Characteristic (ROC) Curve
pub roc: Option<MolecularSequenceQualityRoc>,
}
/// Receiver Operator Characteristic (ROC) Curve to give
/// sensitivity/specificity tradeoff.
///
/// # Examples
///
/// ```
/// use fhir::r4::resources::molecular_sequence::MolecularSequenceQualityRoc;
///
/// let value = MolecularSequenceQualityRoc::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: MolecularSequenceQualityRoc = ::serde_json::from_value(json).unwrap();
/// assert_eq!(value, back);
/// ```
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
#[fhir_version("r4")]
pub struct MolecularSequenceQualityRoc {
/// Unique id for inter-element referencing
pub id: Option<types::String>,
/// Additional content defined by implementations
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub extension: Vec<types::Extension>,
/// Extensions that cannot be ignored even if unrecognized
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub modifier_extension: Vec<types::Extension>,
/// Genotype quality score
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub score: Vec<types::Integer>,
/// Primitive extension sibling for [`score`](Self::score) (FHIR `_score`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_score")]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub score_ext: Vec<Option<types::Element>>,
/// Roc score true positive numbers
#[serde(rename = "numTP")]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub num_tp: Vec<types::Integer>,
/// Primitive extension sibling for [`num_tp`](Self::num_tp) (FHIR `_numTP`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_numTP")]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub num_tp_ext: Vec<Option<types::Element>>,
/// Roc score false positive numbers
#[serde(rename = "numFP")]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub num_fp: Vec<types::Integer>,
/// Primitive extension sibling for [`num_fp`](Self::num_fp) (FHIR `_numFP`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_numFP")]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub num_fp_ext: Vec<Option<types::Element>>,
/// Roc score false negative numbers
#[serde(rename = "numFN")]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub num_fn: Vec<types::Integer>,
/// Primitive extension sibling for [`num_fn`](Self::num_fn) (FHIR `_numFN`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_numFN")]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub num_fn_ext: Vec<Option<types::Element>>,
/// Precision of the GQ score
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub precision: Vec<types::Decimal>,
/// Primitive extension sibling for [`precision`](Self::precision) (FHIR `_precision`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_precision")]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub precision_ext: Vec<Option<types::Element>>,
/// Sensitivity of the GQ score
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub sensitivity: Vec<types::Decimal>,
/// Primitive extension sibling for [`sensitivity`](Self::sensitivity) (FHIR `_sensitivity`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_sensitivity")]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub sensitivity_ext: Vec<Option<types::Element>>,
/// FScore of the GQ score
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub f_measure: Vec<types::Decimal>,
/// Primitive extension sibling for [`f_measure`](Self::f_measure) (FHIR `_fMeasure`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_fMeasure")]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub f_measure_ext: Vec<Option<types::Element>>,
}
/// A sequence that is used as a reference to describe variants that are
/// present in a sequence analyzed.
///
/// # Examples
///
/// ```
/// use fhir::r4::resources::molecular_sequence::MolecularSequenceReferenceSeq;
///
/// let value = MolecularSequenceReferenceSeq::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: MolecularSequenceReferenceSeq = ::serde_json::from_value(json).unwrap();
/// assert_eq!(value, back);
/// ```
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
#[fhir_version("r4")]
pub struct MolecularSequenceReferenceSeq {
/// Unique id for inter-element referencing
pub id: Option<types::String>,
/// Additional content defined by implementations
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub extension: Vec<types::Extension>,
/// Extensions that cannot be ignored even if unrecognized
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub modifier_extension: Vec<types::Extension>,
/// Chromosome containing genetic finding
pub chromosome: Option<types::CodeableConcept>,
/// The Genome Build used for reference, following GRCh build versions e.g.
/// 'GRCh 37'
pub genome_build: Option<types::String>,
/// Primitive extension sibling for [`genome_build`](Self::genome_build) (FHIR `_genomeBuild`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_genomeBuild")]
pub genome_build_ext: Option<types::Element>,
/// sense | antisense
pub orientation: Option<crate::coded::Coded<crate::r4::codes::OrientationType>>,
/// Primitive extension sibling for [`orientation`](Self::orientation) (FHIR `_orientation`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_orientation")]
pub orientation_ext: Option<types::Element>,
/// Reference identifier
pub reference_seq_id: Option<types::CodeableConcept>,
/// A pointer to another MolecularSequence entity as reference sequence
pub reference_seq_pointer: Option<types::Reference>,
/// A string to represent reference sequence
pub reference_seq_string: Option<types::String>,
/// Primitive extension sibling for [`reference_seq_string`](Self::reference_seq_string) (FHIR `_referenceSeqString`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_referenceSeqString")]
pub reference_seq_string_ext: Option<types::Element>,
/// watson | crick
pub strand: Option<crate::coded::Coded<crate::r4::codes::StrandType>>,
/// Primitive extension sibling for [`strand`](Self::strand) (FHIR `_strand`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_strand")]
pub strand_ext: Option<types::Element>,
/// Start position of the window on the reference sequence
pub window_start: Option<types::Integer>,
/// Primitive extension sibling for [`window_start`](Self::window_start) (FHIR `_windowStart`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_windowStart")]
pub window_start_ext: Option<types::Element>,
/// End position of the window on the reference sequence
pub window_end: Option<types::Integer>,
/// Primitive extension sibling for [`window_end`](Self::window_end) (FHIR `_windowEnd`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_windowEnd")]
pub window_end_ext: Option<types::Element>,
}
/// Configurations of the external repository. The repository shall store
/// target's observedSeq or records related with target's observedSeq.
///
/// # Examples
///
/// ```
/// use fhir::r4::resources::molecular_sequence::MolecularSequenceRepository;
///
/// let value = MolecularSequenceRepository::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: MolecularSequenceRepository = ::serde_json::from_value(json).unwrap();
/// assert_eq!(value, back);
/// ```
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
#[fhir_version("r4")]
pub struct MolecularSequenceRepository {
/// Unique id for inter-element referencing
pub id: Option<types::String>,
/// Additional content defined by implementations
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub extension: Vec<types::Extension>,
/// Extensions that cannot be ignored even if unrecognized
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub modifier_extension: Vec<types::Extension>,
/// directlink | openapi | login | oauth | other
pub r#type: crate::coded::Coded<crate::r4::codes::RepositoryType>,
/// Primitive extension sibling for [`r#type`](Self::r#type) (FHIR `_type`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_type")]
pub type_ext: Option<types::Element>,
/// URI of the repository
pub url: Option<types::Uri>,
/// Primitive extension sibling for [`url`](Self::url) (FHIR `_url`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_url")]
pub url_ext: Option<types::Element>,
/// Repository's name
pub name: Option<types::String>,
/// Primitive extension sibling for [`name`](Self::name) (FHIR `_name`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_name")]
pub name_ext: Option<types::Element>,
/// Id of the dataset that used to call for dataset in repository
pub dataset_id: Option<types::String>,
/// Primitive extension sibling for [`dataset_id`](Self::dataset_id) (FHIR `_datasetId`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_datasetId")]
pub dataset_id_ext: Option<types::Element>,
/// Id of the variantset that used to call for variantset in repository
pub variantset_id: Option<types::String>,
/// Primitive extension sibling for [`variantset_id`](Self::variantset_id) (FHIR `_variantsetId`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_variantsetId")]
pub variantset_id_ext: Option<types::Element>,
/// Id of the read
pub readset_id: Option<types::String>,
/// Primitive extension sibling for [`readset_id`](Self::readset_id) (FHIR `_readsetId`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_readsetId")]
pub readset_id_ext: Option<types::Element>,
}
/// Information about chromosome structure variation.
///
/// # Examples
///
/// ```
/// use fhir::r4::resources::molecular_sequence::MolecularSequenceStructureVariant;
///
/// let value = MolecularSequenceStructureVariant::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: MolecularSequenceStructureVariant = ::serde_json::from_value(json).unwrap();
/// assert_eq!(value, back);
/// ```
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
#[fhir_version("r4")]
pub struct MolecularSequenceStructureVariant {
/// Unique id for inter-element referencing
pub id: Option<types::String>,
/// Additional content defined by implementations
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub extension: Vec<types::Extension>,
/// Extensions that cannot be ignored even if unrecognized
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub modifier_extension: Vec<types::Extension>,
/// Structural variant change type
pub variant_type: Option<types::CodeableConcept>,
/// Does the structural variant have base pair resolution breakpoints?
pub exact: Option<types::Boolean>,
/// Primitive extension sibling for [`exact`](Self::exact) (FHIR `_exact`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_exact")]
pub exact_ext: Option<types::Element>,
/// Structural variant length
pub length: Option<types::Integer>,
/// Primitive extension sibling for [`length`](Self::length) (FHIR `_length`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_length")]
pub length_ext: Option<types::Element>,
/// Structural variant outer
pub outer: Option<MolecularSequenceStructureVariantOuter>,
/// Structural variant inner
pub inner: Option<MolecularSequenceStructureVariantInner>,
}
/// Structural variant inner.
///
/// # Examples
///
/// ```
/// use fhir::r4::resources::molecular_sequence::MolecularSequenceStructureVariantInner;
///
/// let value = MolecularSequenceStructureVariantInner::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: MolecularSequenceStructureVariantInner = ::serde_json::from_value(json).unwrap();
/// assert_eq!(value, back);
/// ```
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
#[fhir_version("r4")]
pub struct MolecularSequenceStructureVariantInner {
/// Unique id for inter-element referencing
pub id: Option<types::String>,
/// Additional content defined by implementations
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub extension: Vec<types::Extension>,
/// Extensions that cannot be ignored even if unrecognized
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub modifier_extension: Vec<types::Extension>,
/// Structural variant inner start
pub start: Option<types::Integer>,
/// Primitive extension sibling for [`start`](Self::start) (FHIR `_start`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_start")]
pub start_ext: Option<types::Element>,
/// Structural variant inner end
pub end: Option<types::Integer>,
/// Primitive extension sibling for [`end`](Self::end) (FHIR `_end`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_end")]
pub end_ext: Option<types::Element>,
}
/// Structural variant outer.
///
/// # Examples
///
/// ```
/// use fhir::r4::resources::molecular_sequence::MolecularSequenceStructureVariantOuter;
///
/// let value = MolecularSequenceStructureVariantOuter::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: MolecularSequenceStructureVariantOuter = ::serde_json::from_value(json).unwrap();
/// assert_eq!(value, back);
/// ```
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
#[fhir_version("r4")]
pub struct MolecularSequenceStructureVariantOuter {
/// Unique id for inter-element referencing
pub id: Option<types::String>,
/// Additional content defined by implementations
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub extension: Vec<types::Extension>,
/// Extensions that cannot be ignored even if unrecognized
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub modifier_extension: Vec<types::Extension>,
/// Structural variant outer start
pub start: Option<types::Integer>,
/// Primitive extension sibling for [`start`](Self::start) (FHIR `_start`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_start")]
pub start_ext: Option<types::Element>,
/// Structural variant outer end
pub end: Option<types::Integer>,
/// Primitive extension sibling for [`end`](Self::end) (FHIR `_end`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_end")]
pub end_ext: Option<types::Element>,
}
/// The definition of variant here originates from Sequence ontology
/// ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)).
/// This element can represent amino acid or nucleic sequence change(including
/// insertion,deletion,SNP,etc.) It can represent some complex mutation or
/// segment variation with the assist of CIGAR string.
///
/// # Examples
///
/// ```
/// use fhir::r4::resources::molecular_sequence::MolecularSequenceVariant;
///
/// let value = MolecularSequenceVariant::default();
/// let json = ::serde_json::to_value(&value).unwrap();
/// let back: MolecularSequenceVariant = ::serde_json::from_value(json).unwrap();
/// assert_eq!(value, back);
/// ```
#[serde_with::skip_serializing_none]
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Validate)]
#[serde(rename_all = "camelCase")]
#[fhir_version("r4")]
pub struct MolecularSequenceVariant {
/// Unique id for inter-element referencing
pub id: Option<types::String>,
/// Additional content defined by implementations
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub extension: Vec<types::Extension>,
/// Extensions that cannot be ignored even if unrecognized
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub modifier_extension: Vec<types::Extension>,
/// Start position of the variant on the reference sequence
pub start: Option<types::Integer>,
/// Primitive extension sibling for [`start`](Self::start) (FHIR `_start`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_start")]
pub start_ext: Option<types::Element>,
/// End position of the variant on the reference sequence
pub end: Option<types::Integer>,
/// Primitive extension sibling for [`end`](Self::end) (FHIR `_end`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_end")]
pub end_ext: Option<types::Element>,
/// Allele that was observed
pub observed_allele: Option<types::String>,
/// Primitive extension sibling for [`observed_allele`](Self::observed_allele) (FHIR `_observedAllele`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_observedAllele")]
pub observed_allele_ext: Option<types::Element>,
/// Allele in the reference sequence
pub reference_allele: Option<types::String>,
/// Primitive extension sibling for [`reference_allele`](Self::reference_allele) (FHIR `_referenceAllele`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_referenceAllele")]
pub reference_allele_ext: Option<types::Element>,
/// Extended CIGAR string for aligning the sequence with reference bases
pub cigar: Option<types::String>,
/// Primitive extension sibling for [`cigar`](Self::cigar) (FHIR `_cigar`):
/// carries `id` and/or `extension` for the primitive value.
#[serde(rename = "_cigar")]
pub cigar_ext: Option<types::Element>,
/// Pointer to observed variant information
pub variant_pointer: Option<types::Reference>,
}
#[cfg(test)]
mod tests {
use super::*;
type T = MolecularSequence;
#[test]
fn test_default() {
let _ = T::default();
}
#[test]
fn test_serde_round_trip() {
let value = T::default();
let json = ::serde_json::to_value(&value).expect("to_value");
let back: T = ::serde_json::from_value(json).expect("from_value");
assert_eq!(value, back);
}
}