001package org.hl7.fhir.r4.model;
002
003import java.math.BigDecimal;
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
035import java.util.ArrayList;
036import java.util.List;
037
038import org.hl7.fhir.exceptions.FHIRException;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.utilities.Utilities;
041
042import ca.uhn.fhir.model.api.annotation.Block;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.ResourceDef;
046import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
047
048/**
049 * Raw data describing a biological sequence.
050 */
051@ResourceDef(name = "MolecularSequence", profile = "http://hl7.org/fhir/StructureDefinition/MolecularSequence")
052public class MolecularSequence extends DomainResource {
053
054  public enum SequenceType {
055    /**
056     * Amino acid sequence.
057     */
058    AA,
059    /**
060     * DNA Sequence.
061     */
062    DNA,
063    /**
064     * RNA Sequence.
065     */
066    RNA,
067    /**
068     * added to help the parsers with the generic types
069     */
070    NULL;
071
072    public static SequenceType fromCode(String codeString) throws FHIRException {
073      if (codeString == null || "".equals(codeString))
074        return null;
075      if ("aa".equals(codeString))
076        return AA;
077      if ("dna".equals(codeString))
078        return DNA;
079      if ("rna".equals(codeString))
080        return RNA;
081      if (Configuration.isAcceptInvalidEnums())
082        return null;
083      else
084        throw new FHIRException("Unknown SequenceType code '" + codeString + "'");
085    }
086
087    public String toCode() {
088      switch (this) {
089      case AA:
090        return "aa";
091      case DNA:
092        return "dna";
093      case RNA:
094        return "rna";
095      case NULL:
096        return null;
097      default:
098        return "?";
099      }
100    }
101
102    public String getSystem() {
103      switch (this) {
104      case AA:
105        return "http://hl7.org/fhir/sequence-type";
106      case DNA:
107        return "http://hl7.org/fhir/sequence-type";
108      case RNA:
109        return "http://hl7.org/fhir/sequence-type";
110      case NULL:
111        return null;
112      default:
113        return "?";
114      }
115    }
116
117    public String getDefinition() {
118      switch (this) {
119      case AA:
120        return "Amino acid sequence.";
121      case DNA:
122        return "DNA Sequence.";
123      case RNA:
124        return "RNA Sequence.";
125      case NULL:
126        return null;
127      default:
128        return "?";
129      }
130    }
131
132    public String getDisplay() {
133      switch (this) {
134      case AA:
135        return "AA Sequence";
136      case DNA:
137        return "DNA Sequence";
138      case RNA:
139        return "RNA Sequence";
140      case NULL:
141        return null;
142      default:
143        return "?";
144      }
145    }
146  }
147
148  public static class SequenceTypeEnumFactory implements EnumFactory<SequenceType> {
149    public SequenceType fromCode(String codeString) throws IllegalArgumentException {
150      if (codeString == null || "".equals(codeString))
151        if (codeString == null || "".equals(codeString))
152          return null;
153      if ("aa".equals(codeString))
154        return SequenceType.AA;
155      if ("dna".equals(codeString))
156        return SequenceType.DNA;
157      if ("rna".equals(codeString))
158        return SequenceType.RNA;
159      throw new IllegalArgumentException("Unknown SequenceType code '" + codeString + "'");
160    }
161
162    public Enumeration<SequenceType> fromType(PrimitiveType<?> code) throws FHIRException {
163      if (code == null)
164        return null;
165      if (code.isEmpty())
166        return new Enumeration<SequenceType>(this, SequenceType.NULL, code);
167      String codeString = code.asStringValue();
168      if (codeString == null || "".equals(codeString))
169        return new Enumeration<SequenceType>(this, SequenceType.NULL, code);
170      if ("aa".equals(codeString))
171        return new Enumeration<SequenceType>(this, SequenceType.AA, code);
172      if ("dna".equals(codeString))
173        return new Enumeration<SequenceType>(this, SequenceType.DNA, code);
174      if ("rna".equals(codeString))
175        return new Enumeration<SequenceType>(this, SequenceType.RNA, code);
176      throw new FHIRException("Unknown SequenceType code '" + codeString + "'");
177    }
178
179    public String toCode(SequenceType code) {
180      if (code == SequenceType.AA)
181        return "aa";
182      if (code == SequenceType.DNA)
183        return "dna";
184      if (code == SequenceType.RNA)
185        return "rna";
186      return "?";
187    }
188
189    public String toSystem(SequenceType code) {
190      return code.getSystem();
191    }
192  }
193
194  public enum OrientationType {
195    /**
196     * Sense orientation of reference sequence.
197     */
198    SENSE,
199    /**
200     * Antisense orientation of reference sequence.
201     */
202    ANTISENSE,
203    /**
204     * added to help the parsers with the generic types
205     */
206    NULL;
207
208    public static OrientationType fromCode(String codeString) throws FHIRException {
209      if (codeString == null || "".equals(codeString))
210        return null;
211      if ("sense".equals(codeString))
212        return SENSE;
213      if ("antisense".equals(codeString))
214        return ANTISENSE;
215      if (Configuration.isAcceptInvalidEnums())
216        return null;
217      else
218        throw new FHIRException("Unknown OrientationType code '" + codeString + "'");
219    }
220
221    public String toCode() {
222      switch (this) {
223      case SENSE:
224        return "sense";
225      case ANTISENSE:
226        return "antisense";
227      case NULL:
228        return null;
229      default:
230        return "?";
231      }
232    }
233
234    public String getSystem() {
235      switch (this) {
236      case SENSE:
237        return "http://hl7.org/fhir/orientation-type";
238      case ANTISENSE:
239        return "http://hl7.org/fhir/orientation-type";
240      case NULL:
241        return null;
242      default:
243        return "?";
244      }
245    }
246
247    public String getDefinition() {
248      switch (this) {
249      case SENSE:
250        return "Sense orientation of reference sequence.";
251      case ANTISENSE:
252        return "Antisense orientation of reference sequence.";
253      case NULL:
254        return null;
255      default:
256        return "?";
257      }
258    }
259
260    public String getDisplay() {
261      switch (this) {
262      case SENSE:
263        return "Sense orientation of referenceSeq";
264      case ANTISENSE:
265        return "Antisense orientation of referenceSeq";
266      case NULL:
267        return null;
268      default:
269        return "?";
270      }
271    }
272  }
273
274  public static class OrientationTypeEnumFactory implements EnumFactory<OrientationType> {
275    public OrientationType fromCode(String codeString) throws IllegalArgumentException {
276      if (codeString == null || "".equals(codeString))
277        if (codeString == null || "".equals(codeString))
278          return null;
279      if ("sense".equals(codeString))
280        return OrientationType.SENSE;
281      if ("antisense".equals(codeString))
282        return OrientationType.ANTISENSE;
283      throw new IllegalArgumentException("Unknown OrientationType code '" + codeString + "'");
284    }
285
286    public Enumeration<OrientationType> fromType(PrimitiveType<?> code) throws FHIRException {
287      if (code == null)
288        return null;
289      if (code.isEmpty())
290        return new Enumeration<OrientationType>(this, OrientationType.NULL, code);
291      String codeString = code.asStringValue();
292      if (codeString == null || "".equals(codeString))
293        return new Enumeration<OrientationType>(this, OrientationType.NULL, code);
294      if ("sense".equals(codeString))
295        return new Enumeration<OrientationType>(this, OrientationType.SENSE, code);
296      if ("antisense".equals(codeString))
297        return new Enumeration<OrientationType>(this, OrientationType.ANTISENSE, code);
298      throw new FHIRException("Unknown OrientationType code '" + codeString + "'");
299    }
300
301    public String toCode(OrientationType code) {
302      if (code == OrientationType.SENSE)
303        return "sense";
304      if (code == OrientationType.ANTISENSE)
305        return "antisense";
306      return "?";
307    }
308
309    public String toSystem(OrientationType code) {
310      return code.getSystem();
311    }
312  }
313
314  public enum StrandType {
315    /**
316     * Watson strand of reference sequence.
317     */
318    WATSON,
319    /**
320     * Crick strand of reference sequence.
321     */
322    CRICK,
323    /**
324     * added to help the parsers with the generic types
325     */
326    NULL;
327
328    public static StrandType fromCode(String codeString) throws FHIRException {
329      if (codeString == null || "".equals(codeString))
330        return null;
331      if ("watson".equals(codeString))
332        return WATSON;
333      if ("crick".equals(codeString))
334        return CRICK;
335      if (Configuration.isAcceptInvalidEnums())
336        return null;
337      else
338        throw new FHIRException("Unknown StrandType code '" + codeString + "'");
339    }
340
341    public String toCode() {
342      switch (this) {
343      case WATSON:
344        return "watson";
345      case CRICK:
346        return "crick";
347      case NULL:
348        return null;
349      default:
350        return "?";
351      }
352    }
353
354    public String getSystem() {
355      switch (this) {
356      case WATSON:
357        return "http://hl7.org/fhir/strand-type";
358      case CRICK:
359        return "http://hl7.org/fhir/strand-type";
360      case NULL:
361        return null;
362      default:
363        return "?";
364      }
365    }
366
367    public String getDefinition() {
368      switch (this) {
369      case WATSON:
370        return "Watson strand of reference sequence.";
371      case CRICK:
372        return "Crick strand of reference sequence.";
373      case NULL:
374        return null;
375      default:
376        return "?";
377      }
378    }
379
380    public String getDisplay() {
381      switch (this) {
382      case WATSON:
383        return "Watson strand of referenceSeq";
384      case CRICK:
385        return "Crick strand of referenceSeq";
386      case NULL:
387        return null;
388      default:
389        return "?";
390      }
391    }
392  }
393
394  public static class StrandTypeEnumFactory implements EnumFactory<StrandType> {
395    public StrandType fromCode(String codeString) throws IllegalArgumentException {
396      if (codeString == null || "".equals(codeString))
397        if (codeString == null || "".equals(codeString))
398          return null;
399      if ("watson".equals(codeString))
400        return StrandType.WATSON;
401      if ("crick".equals(codeString))
402        return StrandType.CRICK;
403      throw new IllegalArgumentException("Unknown StrandType code '" + codeString + "'");
404    }
405
406    public Enumeration<StrandType> fromType(PrimitiveType<?> code) throws FHIRException {
407      if (code == null)
408        return null;
409      if (code.isEmpty())
410        return new Enumeration<StrandType>(this, StrandType.NULL, code);
411      String codeString = code.asStringValue();
412      if (codeString == null || "".equals(codeString))
413        return new Enumeration<StrandType>(this, StrandType.NULL, code);
414      if ("watson".equals(codeString))
415        return new Enumeration<StrandType>(this, StrandType.WATSON, code);
416      if ("crick".equals(codeString))
417        return new Enumeration<StrandType>(this, StrandType.CRICK, code);
418      throw new FHIRException("Unknown StrandType code '" + codeString + "'");
419    }
420
421    public String toCode(StrandType code) {
422      if (code == StrandType.WATSON)
423        return "watson";
424      if (code == StrandType.CRICK)
425        return "crick";
426      return "?";
427    }
428
429    public String toSystem(StrandType code) {
430      return code.getSystem();
431    }
432  }
433
434  public enum QualityType {
435    /**
436     * INDEL Comparison.
437     */
438    INDEL,
439    /**
440     * SNP Comparison.
441     */
442    SNP,
443    /**
444     * UNKNOWN Comparison.
445     */
446    UNKNOWN,
447    /**
448     * added to help the parsers with the generic types
449     */
450    NULL;
451
452    public static QualityType fromCode(String codeString) throws FHIRException {
453      if (codeString == null || "".equals(codeString))
454        return null;
455      if ("indel".equals(codeString))
456        return INDEL;
457      if ("snp".equals(codeString))
458        return SNP;
459      if ("unknown".equals(codeString))
460        return UNKNOWN;
461      if (Configuration.isAcceptInvalidEnums())
462        return null;
463      else
464        throw new FHIRException("Unknown QualityType code '" + codeString + "'");
465    }
466
467    public String toCode() {
468      switch (this) {
469      case INDEL:
470        return "indel";
471      case SNP:
472        return "snp";
473      case UNKNOWN:
474        return "unknown";
475      case NULL:
476        return null;
477      default:
478        return "?";
479      }
480    }
481
482    public String getSystem() {
483      switch (this) {
484      case INDEL:
485        return "http://hl7.org/fhir/quality-type";
486      case SNP:
487        return "http://hl7.org/fhir/quality-type";
488      case UNKNOWN:
489        return "http://hl7.org/fhir/quality-type";
490      case NULL:
491        return null;
492      default:
493        return "?";
494      }
495    }
496
497    public String getDefinition() {
498      switch (this) {
499      case INDEL:
500        return "INDEL Comparison.";
501      case SNP:
502        return "SNP Comparison.";
503      case UNKNOWN:
504        return "UNKNOWN Comparison.";
505      case NULL:
506        return null;
507      default:
508        return "?";
509      }
510    }
511
512    public String getDisplay() {
513      switch (this) {
514      case INDEL:
515        return "INDEL Comparison";
516      case SNP:
517        return "SNP Comparison";
518      case UNKNOWN:
519        return "UNKNOWN Comparison";
520      case NULL:
521        return null;
522      default:
523        return "?";
524      }
525    }
526  }
527
528  public static class QualityTypeEnumFactory implements EnumFactory<QualityType> {
529    public QualityType fromCode(String codeString) throws IllegalArgumentException {
530      if (codeString == null || "".equals(codeString))
531        if (codeString == null || "".equals(codeString))
532          return null;
533      if ("indel".equals(codeString))
534        return QualityType.INDEL;
535      if ("snp".equals(codeString))
536        return QualityType.SNP;
537      if ("unknown".equals(codeString))
538        return QualityType.UNKNOWN;
539      throw new IllegalArgumentException("Unknown QualityType code '" + codeString + "'");
540    }
541
542    public Enumeration<QualityType> fromType(PrimitiveType<?> code) throws FHIRException {
543      if (code == null)
544        return null;
545      if (code.isEmpty())
546        return new Enumeration<QualityType>(this, QualityType.NULL, code);
547      String codeString = code.asStringValue();
548      if (codeString == null || "".equals(codeString))
549        return new Enumeration<QualityType>(this, QualityType.NULL, code);
550      if ("indel".equals(codeString))
551        return new Enumeration<QualityType>(this, QualityType.INDEL, code);
552      if ("snp".equals(codeString))
553        return new Enumeration<QualityType>(this, QualityType.SNP, code);
554      if ("unknown".equals(codeString))
555        return new Enumeration<QualityType>(this, QualityType.UNKNOWN, code);
556      throw new FHIRException("Unknown QualityType code '" + codeString + "'");
557    }
558
559    public String toCode(QualityType code) {
560      if (code == QualityType.INDEL)
561        return "indel";
562      if (code == QualityType.SNP)
563        return "snp";
564      if (code == QualityType.UNKNOWN)
565        return "unknown";
566      return "?";
567    }
568
569    public String toSystem(QualityType code) {
570      return code.getSystem();
571    }
572  }
573
574  public enum RepositoryType {
575    /**
576     * When URL is clicked, the resource can be seen directly (by webpage or by
577     * download link format).
578     */
579    DIRECTLINK,
580    /**
581     * When the API method (e.g. [base_url]/[parameter]) related with the URL of the
582     * website is executed, the resource can be seen directly (usually in JSON or
583     * XML format).
584     */
585    OPENAPI,
586    /**
587     * When logged into the website, the resource can be seen.
588     */
589    LOGIN,
590    /**
591     * When logged in and follow the API in the website related with URL, the
592     * resource can be seen.
593     */
594    OAUTH,
595    /**
596     * Some other complicated or particular way to get resource from URL.
597     */
598    OTHER,
599    /**
600     * added to help the parsers with the generic types
601     */
602    NULL;
603
604    public static RepositoryType fromCode(String codeString) throws FHIRException {
605      if (codeString == null || "".equals(codeString))
606        return null;
607      if ("directlink".equals(codeString))
608        return DIRECTLINK;
609      if ("openapi".equals(codeString))
610        return OPENAPI;
611      if ("login".equals(codeString))
612        return LOGIN;
613      if ("oauth".equals(codeString))
614        return OAUTH;
615      if ("other".equals(codeString))
616        return OTHER;
617      if (Configuration.isAcceptInvalidEnums())
618        return null;
619      else
620        throw new FHIRException("Unknown RepositoryType code '" + codeString + "'");
621    }
622
623    public String toCode() {
624      switch (this) {
625      case DIRECTLINK:
626        return "directlink";
627      case OPENAPI:
628        return "openapi";
629      case LOGIN:
630        return "login";
631      case OAUTH:
632        return "oauth";
633      case OTHER:
634        return "other";
635      case NULL:
636        return null;
637      default:
638        return "?";
639      }
640    }
641
642    public String getSystem() {
643      switch (this) {
644      case DIRECTLINK:
645        return "http://hl7.org/fhir/repository-type";
646      case OPENAPI:
647        return "http://hl7.org/fhir/repository-type";
648      case LOGIN:
649        return "http://hl7.org/fhir/repository-type";
650      case OAUTH:
651        return "http://hl7.org/fhir/repository-type";
652      case OTHER:
653        return "http://hl7.org/fhir/repository-type";
654      case NULL:
655        return null;
656      default:
657        return "?";
658      }
659    }
660
661    public String getDefinition() {
662      switch (this) {
663      case DIRECTLINK:
664        return "When URL is clicked, the resource can be seen directly (by webpage or by download link format).";
665      case OPENAPI:
666        return "When the API method (e.g. [base_url]/[parameter]) related with the URL of the website is executed, the resource can be seen directly (usually in JSON or XML format).";
667      case LOGIN:
668        return "When logged into the website, the resource can be seen.";
669      case OAUTH:
670        return "When logged in and  follow the API in the website related with URL, the resource can be seen.";
671      case OTHER:
672        return "Some other complicated or particular way to get resource from URL.";
673      case NULL:
674        return null;
675      default:
676        return "?";
677      }
678    }
679
680    public String getDisplay() {
681      switch (this) {
682      case DIRECTLINK:
683        return "Click and see";
684      case OPENAPI:
685        return "The URL is the RESTful or other kind of API that can access to the result.";
686      case LOGIN:
687        return "Result cannot be access unless an account is logged in";
688      case OAUTH:
689        return "Result need to be fetched with API and need LOGIN( or cookies are required when visiting the link of resource)";
690      case OTHER:
691        return "Some other complicated or particular way to get resource from URL.";
692      case NULL:
693        return null;
694      default:
695        return "?";
696      }
697    }
698  }
699
700  public static class RepositoryTypeEnumFactory implements EnumFactory<RepositoryType> {
701    public RepositoryType fromCode(String codeString) throws IllegalArgumentException {
702      if (codeString == null || "".equals(codeString))
703        if (codeString == null || "".equals(codeString))
704          return null;
705      if ("directlink".equals(codeString))
706        return RepositoryType.DIRECTLINK;
707      if ("openapi".equals(codeString))
708        return RepositoryType.OPENAPI;
709      if ("login".equals(codeString))
710        return RepositoryType.LOGIN;
711      if ("oauth".equals(codeString))
712        return RepositoryType.OAUTH;
713      if ("other".equals(codeString))
714        return RepositoryType.OTHER;
715      throw new IllegalArgumentException("Unknown RepositoryType code '" + codeString + "'");
716    }
717
718    public Enumeration<RepositoryType> fromType(PrimitiveType<?> code) throws FHIRException {
719      if (code == null)
720        return null;
721      if (code.isEmpty())
722        return new Enumeration<RepositoryType>(this, RepositoryType.NULL, code);
723      String codeString = code.asStringValue();
724      if (codeString == null || "".equals(codeString))
725        return new Enumeration<RepositoryType>(this, RepositoryType.NULL, code);
726      if ("directlink".equals(codeString))
727        return new Enumeration<RepositoryType>(this, RepositoryType.DIRECTLINK, code);
728      if ("openapi".equals(codeString))
729        return new Enumeration<RepositoryType>(this, RepositoryType.OPENAPI, code);
730      if ("login".equals(codeString))
731        return new Enumeration<RepositoryType>(this, RepositoryType.LOGIN, code);
732      if ("oauth".equals(codeString))
733        return new Enumeration<RepositoryType>(this, RepositoryType.OAUTH, code);
734      if ("other".equals(codeString))
735        return new Enumeration<RepositoryType>(this, RepositoryType.OTHER, code);
736      throw new FHIRException("Unknown RepositoryType code '" + codeString + "'");
737    }
738
739    public String toCode(RepositoryType code) {
740      if (code == RepositoryType.DIRECTLINK)
741        return "directlink";
742      if (code == RepositoryType.OPENAPI)
743        return "openapi";
744      if (code == RepositoryType.LOGIN)
745        return "login";
746      if (code == RepositoryType.OAUTH)
747        return "oauth";
748      if (code == RepositoryType.OTHER)
749        return "other";
750      return "?";
751    }
752
753    public String toSystem(RepositoryType code) {
754      return code.getSystem();
755    }
756  }
757
758  @Block()
759  public static class MolecularSequenceReferenceSeqComponent extends BackboneElement implements IBaseBackboneElement {
760    /**
761     * Structural unit composed of a nucleic acid molecule which controls its own
762     * replication through the interaction of specific proteins at one or more
763     * origins of replication
764     * ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).
765     */
766    @Child(name = "chromosome", type = {
767        CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
768    @Description(shortDefinition = "Chromosome containing genetic finding", formalDefinition = "Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).")
769    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/chromosome-human")
770    protected CodeableConcept chromosome;
771
772    /**
773     * The Genome Build used for reference, following GRCh build versions e.g. 'GRCh
774     * 37'. Version number must be included if a versioned release of a primary
775     * build was used.
776     */
777    @Child(name = "genomeBuild", type = {
778        StringType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
779    @Description(shortDefinition = "The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'", formalDefinition = "The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'.  Version number must be included if a versioned release of a primary build was used.")
780    protected StringType genomeBuild;
781
782    /**
783     * A relative reference to a DNA strand based on gene orientation. The strand
784     * that contains the open reading frame of the gene is the "sense" strand, and
785     * the opposite complementary strand is the "antisense" strand.
786     */
787    @Child(name = "orientation", type = {
788        CodeType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
789    @Description(shortDefinition = "sense | antisense", formalDefinition = "A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the \"sense\" strand, and the opposite complementary strand is the \"antisense\" strand.")
790    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/orientation-type")
791    protected Enumeration<OrientationType> orientation;
792
793    /**
794     * Reference identifier of reference sequence submitted to NCBI. It must match
795     * the type in the MolecularSequence.type field. For example, the prefix, ?NG_?
796     * identifies reference sequence for genes, ?NM_? for messenger RNA transcripts,
797     * and ?NP_? for amino acid sequences.
798     */
799    @Child(name = "referenceSeqId", type = {
800        CodeableConcept.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
801    @Description(shortDefinition = "Reference identifier", formalDefinition = "Reference identifier of reference sequence submitted to NCBI. It must match the type in the MolecularSequence.type field. For example, the prefix, ?NG_? identifies reference sequence for genes, ?NM_? for messenger RNA transcripts, and ?NP_? for amino acid sequences.")
802    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/sequence-referenceSeq")
803    protected CodeableConcept referenceSeqId;
804
805    /**
806     * A pointer to another MolecularSequence entity as reference sequence.
807     */
808    @Child(name = "referenceSeqPointer", type = {
809        MolecularSequence.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
810    @Description(shortDefinition = "A pointer to another MolecularSequence entity as reference sequence", formalDefinition = "A pointer to another MolecularSequence entity as reference sequence.")
811    protected Reference referenceSeqPointer;
812
813    /**
814     * The actual object that is the target of the reference (A pointer to another
815     * MolecularSequence entity as reference sequence.)
816     */
817    protected MolecularSequence referenceSeqPointerTarget;
818
819    /**
820     * A string like "ACGT".
821     */
822    @Child(name = "referenceSeqString", type = {
823        StringType.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
824    @Description(shortDefinition = "A string to represent reference sequence", formalDefinition = "A string like \"ACGT\".")
825    protected StringType referenceSeqString;
826
827    /**
828     * An absolute reference to a strand. The Watson strand is the strand whose
829     * 5'-end is on the short arm of the chromosome, and the Crick strand as the one
830     * whose 5'-end is on the long arm.
831     */
832    @Child(name = "strand", type = { CodeType.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
833    @Description(shortDefinition = "watson | crick", formalDefinition = "An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.")
834    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/strand-type")
835    protected Enumeration<StrandType> strand;
836
837    /**
838     * Start position of the window on the reference sequence. If the coordinate
839     * system is either 0-based or 1-based, then start position is inclusive.
840     */
841    @Child(name = "windowStart", type = {
842        IntegerType.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
843    @Description(shortDefinition = "Start position of the window on the  reference sequence", formalDefinition = "Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.")
844    protected IntegerType windowStart;
845
846    /**
847     * End position of the window on the reference sequence. If the coordinate
848     * system is 0-based then end is exclusive and does not include the last
849     * position. If the coordinate system is 1-base, then end is inclusive and
850     * includes the last position.
851     */
852    @Child(name = "windowEnd", type = {
853        IntegerType.class }, order = 9, min = 0, max = 1, modifier = false, summary = true)
854    @Description(shortDefinition = "End position of the window on the reference sequence", formalDefinition = "End position of the window on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.")
855    protected IntegerType windowEnd;
856
857    private static final long serialVersionUID = 307364267L;
858
859    /**
860     * Constructor
861     */
862    public MolecularSequenceReferenceSeqComponent() {
863      super();
864    }
865
866    /**
867     * @return {@link #chromosome} (Structural unit composed of a nucleic acid
868     *         molecule which controls its own replication through the interaction
869     *         of specific proteins at one or more origins of replication
870     *         ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).)
871     */
872    public CodeableConcept getChromosome() {
873      if (this.chromosome == null)
874        if (Configuration.errorOnAutoCreate())
875          throw new Error("Attempt to auto-create MolecularSequenceReferenceSeqComponent.chromosome");
876        else if (Configuration.doAutoCreate())
877          this.chromosome = new CodeableConcept(); // cc
878      return this.chromosome;
879    }
880
881    public boolean hasChromosome() {
882      return this.chromosome != null && !this.chromosome.isEmpty();
883    }
884
885    /**
886     * @param value {@link #chromosome} (Structural unit composed of a nucleic acid
887     *              molecule which controls its own replication through the
888     *              interaction of specific proteins at one or more origins of
889     *              replication
890     *              ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).)
891     */
892    public MolecularSequenceReferenceSeqComponent setChromosome(CodeableConcept value) {
893      this.chromosome = value;
894      return this;
895    }
896
897    /**
898     * @return {@link #genomeBuild} (The Genome Build used for reference, following
899     *         GRCh build versions e.g. 'GRCh 37'. Version number must be included
900     *         if a versioned release of a primary build was used.). This is the
901     *         underlying object with id, value and extensions. The accessor
902     *         "getGenomeBuild" gives direct access to the value
903     */
904    public StringType getGenomeBuildElement() {
905      if (this.genomeBuild == null)
906        if (Configuration.errorOnAutoCreate())
907          throw new Error("Attempt to auto-create MolecularSequenceReferenceSeqComponent.genomeBuild");
908        else if (Configuration.doAutoCreate())
909          this.genomeBuild = new StringType(); // bb
910      return this.genomeBuild;
911    }
912
913    public boolean hasGenomeBuildElement() {
914      return this.genomeBuild != null && !this.genomeBuild.isEmpty();
915    }
916
917    public boolean hasGenomeBuild() {
918      return this.genomeBuild != null && !this.genomeBuild.isEmpty();
919    }
920
921    /**
922     * @param value {@link #genomeBuild} (The Genome Build used for reference,
923     *              following GRCh build versions e.g. 'GRCh 37'. Version number
924     *              must be included if a versioned release of a primary build was
925     *              used.). This is the underlying object with id, value and
926     *              extensions. The accessor "getGenomeBuild" gives direct access to
927     *              the value
928     */
929    public MolecularSequenceReferenceSeqComponent setGenomeBuildElement(StringType value) {
930      this.genomeBuild = value;
931      return this;
932    }
933
934    /**
935     * @return The Genome Build used for reference, following GRCh build versions
936     *         e.g. 'GRCh 37'. Version number must be included if a versioned
937     *         release of a primary build was used.
938     */
939    public String getGenomeBuild() {
940      return this.genomeBuild == null ? null : this.genomeBuild.getValue();
941    }
942
943    /**
944     * @param value The Genome Build used for reference, following GRCh build
945     *              versions e.g. 'GRCh 37'. Version number must be included if a
946     *              versioned release of a primary build was used.
947     */
948    public MolecularSequenceReferenceSeqComponent setGenomeBuild(String value) {
949      if (Utilities.noString(value))
950        this.genomeBuild = null;
951      else {
952        if (this.genomeBuild == null)
953          this.genomeBuild = new StringType();
954        this.genomeBuild.setValue(value);
955      }
956      return this;
957    }
958
959    /**
960     * @return {@link #orientation} (A relative reference to a DNA strand based on
961     *         gene orientation. The strand that contains the open reading frame of
962     *         the gene is the "sense" strand, and the opposite complementary strand
963     *         is the "antisense" strand.). This is the underlying object with id,
964     *         value and extensions. The accessor "getOrientation" gives direct
965     *         access to the value
966     */
967    public Enumeration<OrientationType> getOrientationElement() {
968      if (this.orientation == null)
969        if (Configuration.errorOnAutoCreate())
970          throw new Error("Attempt to auto-create MolecularSequenceReferenceSeqComponent.orientation");
971        else if (Configuration.doAutoCreate())
972          this.orientation = new Enumeration<OrientationType>(new OrientationTypeEnumFactory()); // bb
973      return this.orientation;
974    }
975
976    public boolean hasOrientationElement() {
977      return this.orientation != null && !this.orientation.isEmpty();
978    }
979
980    public boolean hasOrientation() {
981      return this.orientation != null && !this.orientation.isEmpty();
982    }
983
984    /**
985     * @param value {@link #orientation} (A relative reference to a DNA strand based
986     *              on gene orientation. The strand that contains the open reading
987     *              frame of the gene is the "sense" strand, and the opposite
988     *              complementary strand is the "antisense" strand.). This is the
989     *              underlying object with id, value and extensions. The accessor
990     *              "getOrientation" gives direct access to the value
991     */
992    public MolecularSequenceReferenceSeqComponent setOrientationElement(Enumeration<OrientationType> value) {
993      this.orientation = value;
994      return this;
995    }
996
997    /**
998     * @return A relative reference to a DNA strand based on gene orientation. The
999     *         strand that contains the open reading frame of the gene is the
1000     *         "sense" strand, and the opposite complementary strand is the
1001     *         "antisense" strand.
1002     */
1003    public OrientationType getOrientation() {
1004      return this.orientation == null ? null : this.orientation.getValue();
1005    }
1006
1007    /**
1008     * @param value A relative reference to a DNA strand based on gene orientation.
1009     *              The strand that contains the open reading frame of the gene is
1010     *              the "sense" strand, and the opposite complementary strand is the
1011     *              "antisense" strand.
1012     */
1013    public MolecularSequenceReferenceSeqComponent setOrientation(OrientationType value) {
1014      if (value == null)
1015        this.orientation = null;
1016      else {
1017        if (this.orientation == null)
1018          this.orientation = new Enumeration<OrientationType>(new OrientationTypeEnumFactory());
1019        this.orientation.setValue(value);
1020      }
1021      return this;
1022    }
1023
1024    /**
1025     * @return {@link #referenceSeqId} (Reference identifier of reference sequence
1026     *         submitted to NCBI. It must match the type in the
1027     *         MolecularSequence.type field. For example, the prefix, ?NG_?
1028     *         identifies reference sequence for genes, ?NM_? for messenger RNA
1029     *         transcripts, and ?NP_? for amino acid sequences.)
1030     */
1031    public CodeableConcept getReferenceSeqId() {
1032      if (this.referenceSeqId == null)
1033        if (Configuration.errorOnAutoCreate())
1034          throw new Error("Attempt to auto-create MolecularSequenceReferenceSeqComponent.referenceSeqId");
1035        else if (Configuration.doAutoCreate())
1036          this.referenceSeqId = new CodeableConcept(); // cc
1037      return this.referenceSeqId;
1038    }
1039
1040    public boolean hasReferenceSeqId() {
1041      return this.referenceSeqId != null && !this.referenceSeqId.isEmpty();
1042    }
1043
1044    /**
1045     * @param value {@link #referenceSeqId} (Reference identifier of reference
1046     *              sequence submitted to NCBI. It must match the type in the
1047     *              MolecularSequence.type field. For example, the prefix, ?NG_?
1048     *              identifies reference sequence for genes, ?NM_? for messenger RNA
1049     *              transcripts, and ?NP_? for amino acid sequences.)
1050     */
1051    public MolecularSequenceReferenceSeqComponent setReferenceSeqId(CodeableConcept value) {
1052      this.referenceSeqId = value;
1053      return this;
1054    }
1055
1056    /**
1057     * @return {@link #referenceSeqPointer} (A pointer to another MolecularSequence
1058     *         entity as reference sequence.)
1059     */
1060    public Reference getReferenceSeqPointer() {
1061      if (this.referenceSeqPointer == null)
1062        if (Configuration.errorOnAutoCreate())
1063          throw new Error("Attempt to auto-create MolecularSequenceReferenceSeqComponent.referenceSeqPointer");
1064        else if (Configuration.doAutoCreate())
1065          this.referenceSeqPointer = new Reference(); // cc
1066      return this.referenceSeqPointer;
1067    }
1068
1069    public boolean hasReferenceSeqPointer() {
1070      return this.referenceSeqPointer != null && !this.referenceSeqPointer.isEmpty();
1071    }
1072
1073    /**
1074     * @param value {@link #referenceSeqPointer} (A pointer to another
1075     *              MolecularSequence entity as reference sequence.)
1076     */
1077    public MolecularSequenceReferenceSeqComponent setReferenceSeqPointer(Reference value) {
1078      this.referenceSeqPointer = value;
1079      return this;
1080    }
1081
1082    /**
1083     * @return {@link #referenceSeqPointer} The actual object that is the target of
1084     *         the reference. The reference library doesn't populate this, but you
1085     *         can use it to hold the resource if you resolve it. (A pointer to
1086     *         another MolecularSequence entity as reference sequence.)
1087     */
1088    public MolecularSequence getReferenceSeqPointerTarget() {
1089      if (this.referenceSeqPointerTarget == null)
1090        if (Configuration.errorOnAutoCreate())
1091          throw new Error("Attempt to auto-create MolecularSequenceReferenceSeqComponent.referenceSeqPointer");
1092        else if (Configuration.doAutoCreate())
1093          this.referenceSeqPointerTarget = new MolecularSequence(); // aa
1094      return this.referenceSeqPointerTarget;
1095    }
1096
1097    /**
1098     * @param value {@link #referenceSeqPointer} The actual object that is the
1099     *              target of the reference. The reference library doesn't use
1100     *              these, but you can use it to hold the resource if you resolve
1101     *              it. (A pointer to another MolecularSequence entity as reference
1102     *              sequence.)
1103     */
1104    public MolecularSequenceReferenceSeqComponent setReferenceSeqPointerTarget(MolecularSequence value) {
1105      this.referenceSeqPointerTarget = value;
1106      return this;
1107    }
1108
1109    /**
1110     * @return {@link #referenceSeqString} (A string like "ACGT".). This is the
1111     *         underlying object with id, value and extensions. The accessor
1112     *         "getReferenceSeqString" gives direct access to the value
1113     */
1114    public StringType getReferenceSeqStringElement() {
1115      if (this.referenceSeqString == null)
1116        if (Configuration.errorOnAutoCreate())
1117          throw new Error("Attempt to auto-create MolecularSequenceReferenceSeqComponent.referenceSeqString");
1118        else if (Configuration.doAutoCreate())
1119          this.referenceSeqString = new StringType(); // bb
1120      return this.referenceSeqString;
1121    }
1122
1123    public boolean hasReferenceSeqStringElement() {
1124      return this.referenceSeqString != null && !this.referenceSeqString.isEmpty();
1125    }
1126
1127    public boolean hasReferenceSeqString() {
1128      return this.referenceSeqString != null && !this.referenceSeqString.isEmpty();
1129    }
1130
1131    /**
1132     * @param value {@link #referenceSeqString} (A string like "ACGT".). This is the
1133     *              underlying object with id, value and extensions. The accessor
1134     *              "getReferenceSeqString" gives direct access to the value
1135     */
1136    public MolecularSequenceReferenceSeqComponent setReferenceSeqStringElement(StringType value) {
1137      this.referenceSeqString = value;
1138      return this;
1139    }
1140
1141    /**
1142     * @return A string like "ACGT".
1143     */
1144    public String getReferenceSeqString() {
1145      return this.referenceSeqString == null ? null : this.referenceSeqString.getValue();
1146    }
1147
1148    /**
1149     * @param value A string like "ACGT".
1150     */
1151    public MolecularSequenceReferenceSeqComponent setReferenceSeqString(String value) {
1152      if (Utilities.noString(value))
1153        this.referenceSeqString = null;
1154      else {
1155        if (this.referenceSeqString == null)
1156          this.referenceSeqString = new StringType();
1157        this.referenceSeqString.setValue(value);
1158      }
1159      return this;
1160    }
1161
1162    /**
1163     * @return {@link #strand} (An absolute reference to a strand. The Watson strand
1164     *         is the strand whose 5'-end is on the short arm of the chromosome, and
1165     *         the Crick strand as the one whose 5'-end is on the long arm.). This
1166     *         is the underlying object with id, value and extensions. The accessor
1167     *         "getStrand" gives direct access to the value
1168     */
1169    public Enumeration<StrandType> getStrandElement() {
1170      if (this.strand == null)
1171        if (Configuration.errorOnAutoCreate())
1172          throw new Error("Attempt to auto-create MolecularSequenceReferenceSeqComponent.strand");
1173        else if (Configuration.doAutoCreate())
1174          this.strand = new Enumeration<StrandType>(new StrandTypeEnumFactory()); // bb
1175      return this.strand;
1176    }
1177
1178    public boolean hasStrandElement() {
1179      return this.strand != null && !this.strand.isEmpty();
1180    }
1181
1182    public boolean hasStrand() {
1183      return this.strand != null && !this.strand.isEmpty();
1184    }
1185
1186    /**
1187     * @param value {@link #strand} (An absolute reference to a strand. The Watson
1188     *              strand is the strand whose 5'-end is on the short arm of the
1189     *              chromosome, and the Crick strand as the one whose 5'-end is on
1190     *              the long arm.). This is the underlying object with id, value and
1191     *              extensions. The accessor "getStrand" gives direct access to the
1192     *              value
1193     */
1194    public MolecularSequenceReferenceSeqComponent setStrandElement(Enumeration<StrandType> value) {
1195      this.strand = value;
1196      return this;
1197    }
1198
1199    /**
1200     * @return An absolute reference to a strand. The Watson strand is the strand
1201     *         whose 5'-end is on the short arm of the chromosome, and the Crick
1202     *         strand as the one whose 5'-end is on the long arm.
1203     */
1204    public StrandType getStrand() {
1205      return this.strand == null ? null : this.strand.getValue();
1206    }
1207
1208    /**
1209     * @param value An absolute reference to a strand. The Watson strand is the
1210     *              strand whose 5'-end is on the short arm of the chromosome, and
1211     *              the Crick strand as the one whose 5'-end is on the long arm.
1212     */
1213    public MolecularSequenceReferenceSeqComponent setStrand(StrandType value) {
1214      if (value == null)
1215        this.strand = null;
1216      else {
1217        if (this.strand == null)
1218          this.strand = new Enumeration<StrandType>(new StrandTypeEnumFactory());
1219        this.strand.setValue(value);
1220      }
1221      return this;
1222    }
1223
1224    /**
1225     * @return {@link #windowStart} (Start position of the window on the reference
1226     *         sequence. If the coordinate system is either 0-based or 1-based, then
1227     *         start position is inclusive.). This is the underlying object with id,
1228     *         value and extensions. The accessor "getWindowStart" gives direct
1229     *         access to the value
1230     */
1231    public IntegerType getWindowStartElement() {
1232      if (this.windowStart == null)
1233        if (Configuration.errorOnAutoCreate())
1234          throw new Error("Attempt to auto-create MolecularSequenceReferenceSeqComponent.windowStart");
1235        else if (Configuration.doAutoCreate())
1236          this.windowStart = new IntegerType(); // bb
1237      return this.windowStart;
1238    }
1239
1240    public boolean hasWindowStartElement() {
1241      return this.windowStart != null && !this.windowStart.isEmpty();
1242    }
1243
1244    public boolean hasWindowStart() {
1245      return this.windowStart != null && !this.windowStart.isEmpty();
1246    }
1247
1248    /**
1249     * @param value {@link #windowStart} (Start position of the window on the
1250     *              reference sequence. If the coordinate system is either 0-based
1251     *              or 1-based, then start position is inclusive.). This is the
1252     *              underlying object with id, value and extensions. The accessor
1253     *              "getWindowStart" gives direct access to the value
1254     */
1255    public MolecularSequenceReferenceSeqComponent setWindowStartElement(IntegerType value) {
1256      this.windowStart = value;
1257      return this;
1258    }
1259
1260    /**
1261     * @return Start position of the window on the reference sequence. If the
1262     *         coordinate system is either 0-based or 1-based, then start position
1263     *         is inclusive.
1264     */
1265    public int getWindowStart() {
1266      return this.windowStart == null || this.windowStart.isEmpty() ? 0 : this.windowStart.getValue();
1267    }
1268
1269    /**
1270     * @param value Start position of the window on the reference sequence. If the
1271     *              coordinate system is either 0-based or 1-based, then start
1272     *              position is inclusive.
1273     */
1274    public MolecularSequenceReferenceSeqComponent setWindowStart(int value) {
1275      if (this.windowStart == null)
1276        this.windowStart = new IntegerType();
1277      this.windowStart.setValue(value);
1278      return this;
1279    }
1280
1281    /**
1282     * @return {@link #windowEnd} (End position of the window on the reference
1283     *         sequence. If the coordinate system is 0-based then end is exclusive
1284     *         and does not include the last position. If the coordinate system is
1285     *         1-base, then end is inclusive and includes the last position.). This
1286     *         is the underlying object with id, value and extensions. The accessor
1287     *         "getWindowEnd" gives direct access to the value
1288     */
1289    public IntegerType getWindowEndElement() {
1290      if (this.windowEnd == null)
1291        if (Configuration.errorOnAutoCreate())
1292          throw new Error("Attempt to auto-create MolecularSequenceReferenceSeqComponent.windowEnd");
1293        else if (Configuration.doAutoCreate())
1294          this.windowEnd = new IntegerType(); // bb
1295      return this.windowEnd;
1296    }
1297
1298    public boolean hasWindowEndElement() {
1299      return this.windowEnd != null && !this.windowEnd.isEmpty();
1300    }
1301
1302    public boolean hasWindowEnd() {
1303      return this.windowEnd != null && !this.windowEnd.isEmpty();
1304    }
1305
1306    /**
1307     * @param value {@link #windowEnd} (End position of the window on the reference
1308     *              sequence. If the coordinate system is 0-based then end is
1309     *              exclusive and does not include the last position. If the
1310     *              coordinate system is 1-base, then end is inclusive and includes
1311     *              the last position.). This is the underlying object with id,
1312     *              value and extensions. The accessor "getWindowEnd" gives direct
1313     *              access to the value
1314     */
1315    public MolecularSequenceReferenceSeqComponent setWindowEndElement(IntegerType value) {
1316      this.windowEnd = value;
1317      return this;
1318    }
1319
1320    /**
1321     * @return End position of the window on the reference sequence. If the
1322     *         coordinate system is 0-based then end is exclusive and does not
1323     *         include the last position. If the coordinate system is 1-base, then
1324     *         end is inclusive and includes the last position.
1325     */
1326    public int getWindowEnd() {
1327      return this.windowEnd == null || this.windowEnd.isEmpty() ? 0 : this.windowEnd.getValue();
1328    }
1329
1330    /**
1331     * @param value End position of the window on the reference sequence. If the
1332     *              coordinate system is 0-based then end is exclusive and does not
1333     *              include the last position. If the coordinate system is 1-base,
1334     *              then end is inclusive and includes the last position.
1335     */
1336    public MolecularSequenceReferenceSeqComponent setWindowEnd(int value) {
1337      if (this.windowEnd == null)
1338        this.windowEnd = new IntegerType();
1339      this.windowEnd.setValue(value);
1340      return this;
1341    }
1342
1343    protected void listChildren(List<Property> children) {
1344      super.listChildren(children);
1345      children.add(new Property("chromosome", "CodeableConcept",
1346          "Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).",
1347          0, 1, chromosome));
1348      children.add(new Property("genomeBuild", "string",
1349          "The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'.  Version number must be included if a versioned release of a primary build was used.",
1350          0, 1, genomeBuild));
1351      children.add(new Property("orientation", "code",
1352          "A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the \"sense\" strand, and the opposite complementary strand is the \"antisense\" strand.",
1353          0, 1, orientation));
1354      children.add(new Property("referenceSeqId", "CodeableConcept",
1355          "Reference identifier of reference sequence submitted to NCBI. It must match the type in the MolecularSequence.type field. For example, the prefix, ?NG_? identifies reference sequence for genes, ?NM_? for messenger RNA transcripts, and ?NP_? for amino acid sequences.",
1356          0, 1, referenceSeqId));
1357      children.add(new Property("referenceSeqPointer", "Reference(MolecularSequence)",
1358          "A pointer to another MolecularSequence entity as reference sequence.", 0, 1, referenceSeqPointer));
1359      children.add(new Property("referenceSeqString", "string", "A string like \"ACGT\".", 0, 1, referenceSeqString));
1360      children.add(new Property("strand", "code",
1361          "An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.",
1362          0, 1, strand));
1363      children.add(new Property("windowStart", "integer",
1364          "Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.",
1365          0, 1, windowStart));
1366      children.add(new Property("windowEnd", "integer",
1367          "End position of the window on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.",
1368          0, 1, windowEnd));
1369    }
1370
1371    @Override
1372    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1373      switch (_hash) {
1374      case -1499470472:
1375        /* chromosome */ return new Property("chromosome", "CodeableConcept",
1376            "Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).",
1377            0, 1, chromosome);
1378      case 1061239735:
1379        /* genomeBuild */ return new Property("genomeBuild", "string",
1380            "The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'.  Version number must be included if a versioned release of a primary build was used.",
1381            0, 1, genomeBuild);
1382      case -1439500848:
1383        /* orientation */ return new Property("orientation", "code",
1384            "A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the \"sense\" strand, and the opposite complementary strand is the \"antisense\" strand.",
1385            0, 1, orientation);
1386      case -1911500465:
1387        /* referenceSeqId */ return new Property("referenceSeqId", "CodeableConcept",
1388            "Reference identifier of reference sequence submitted to NCBI. It must match the type in the MolecularSequence.type field. For example, the prefix, ?NG_? identifies reference sequence for genes, ?NM_? for messenger RNA transcripts, and ?NP_? for amino acid sequences.",
1389            0, 1, referenceSeqId);
1390      case 1923414665:
1391        /* referenceSeqPointer */ return new Property("referenceSeqPointer", "Reference(MolecularSequence)",
1392            "A pointer to another MolecularSequence entity as reference sequence.", 0, 1, referenceSeqPointer);
1393      case -1648301499:
1394        /* referenceSeqString */ return new Property("referenceSeqString", "string", "A string like \"ACGT\".", 0, 1,
1395            referenceSeqString);
1396      case -891993594:
1397        /* strand */ return new Property("strand", "code",
1398            "An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.",
1399            0, 1, strand);
1400      case 1903685202:
1401        /* windowStart */ return new Property("windowStart", "integer",
1402            "Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.",
1403            0, 1, windowStart);
1404      case -217026869:
1405        /* windowEnd */ return new Property("windowEnd", "integer",
1406            "End position of the window on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.",
1407            0, 1, windowEnd);
1408      default:
1409        return super.getNamedProperty(_hash, _name, _checkValid);
1410      }
1411
1412    }
1413
1414    @Override
1415    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1416      switch (hash) {
1417      case -1499470472:
1418        /* chromosome */ return this.chromosome == null ? new Base[0] : new Base[] { this.chromosome }; // CodeableConcept
1419      case 1061239735:
1420        /* genomeBuild */ return this.genomeBuild == null ? new Base[0] : new Base[] { this.genomeBuild }; // StringType
1421      case -1439500848:
1422        /* orientation */ return this.orientation == null ? new Base[0] : new Base[] { this.orientation }; // Enumeration<OrientationType>
1423      case -1911500465:
1424        /* referenceSeqId */ return this.referenceSeqId == null ? new Base[0] : new Base[] { this.referenceSeqId }; // CodeableConcept
1425      case 1923414665:
1426        /* referenceSeqPointer */ return this.referenceSeqPointer == null ? new Base[0]
1427            : new Base[] { this.referenceSeqPointer }; // Reference
1428      case -1648301499:
1429        /* referenceSeqString */ return this.referenceSeqString == null ? new Base[0]
1430            : new Base[] { this.referenceSeqString }; // StringType
1431      case -891993594:
1432        /* strand */ return this.strand == null ? new Base[0] : new Base[] { this.strand }; // Enumeration<StrandType>
1433      case 1903685202:
1434        /* windowStart */ return this.windowStart == null ? new Base[0] : new Base[] { this.windowStart }; // IntegerType
1435      case -217026869:
1436        /* windowEnd */ return this.windowEnd == null ? new Base[0] : new Base[] { this.windowEnd }; // IntegerType
1437      default:
1438        return super.getProperty(hash, name, checkValid);
1439      }
1440
1441    }
1442
1443    @Override
1444    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1445      switch (hash) {
1446      case -1499470472: // chromosome
1447        this.chromosome = castToCodeableConcept(value); // CodeableConcept
1448        return value;
1449      case 1061239735: // genomeBuild
1450        this.genomeBuild = castToString(value); // StringType
1451        return value;
1452      case -1439500848: // orientation
1453        value = new OrientationTypeEnumFactory().fromType(castToCode(value));
1454        this.orientation = (Enumeration) value; // Enumeration<OrientationType>
1455        return value;
1456      case -1911500465: // referenceSeqId
1457        this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept
1458        return value;
1459      case 1923414665: // referenceSeqPointer
1460        this.referenceSeqPointer = castToReference(value); // Reference
1461        return value;
1462      case -1648301499: // referenceSeqString
1463        this.referenceSeqString = castToString(value); // StringType
1464        return value;
1465      case -891993594: // strand
1466        value = new StrandTypeEnumFactory().fromType(castToCode(value));
1467        this.strand = (Enumeration) value; // Enumeration<StrandType>
1468        return value;
1469      case 1903685202: // windowStart
1470        this.windowStart = castToInteger(value); // IntegerType
1471        return value;
1472      case -217026869: // windowEnd
1473        this.windowEnd = castToInteger(value); // IntegerType
1474        return value;
1475      default:
1476        return super.setProperty(hash, name, value);
1477      }
1478
1479    }
1480
1481    @Override
1482    public Base setProperty(String name, Base value) throws FHIRException {
1483      if (name.equals("chromosome")) {
1484        this.chromosome = castToCodeableConcept(value); // CodeableConcept
1485      } else if (name.equals("genomeBuild")) {
1486        this.genomeBuild = castToString(value); // StringType
1487      } else if (name.equals("orientation")) {
1488        value = new OrientationTypeEnumFactory().fromType(castToCode(value));
1489        this.orientation = (Enumeration) value; // Enumeration<OrientationType>
1490      } else if (name.equals("referenceSeqId")) {
1491        this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept
1492      } else if (name.equals("referenceSeqPointer")) {
1493        this.referenceSeqPointer = castToReference(value); // Reference
1494      } else if (name.equals("referenceSeqString")) {
1495        this.referenceSeqString = castToString(value); // StringType
1496      } else if (name.equals("strand")) {
1497        value = new StrandTypeEnumFactory().fromType(castToCode(value));
1498        this.strand = (Enumeration) value; // Enumeration<StrandType>
1499      } else if (name.equals("windowStart")) {
1500        this.windowStart = castToInteger(value); // IntegerType
1501      } else if (name.equals("windowEnd")) {
1502        this.windowEnd = castToInteger(value); // IntegerType
1503      } else
1504        return super.setProperty(name, value);
1505      return value;
1506    }
1507
1508  @Override
1509  public void removeChild(String name, Base value) throws FHIRException {
1510      if (name.equals("chromosome")) {
1511        this.chromosome = null;
1512      } else if (name.equals("genomeBuild")) {
1513        this.genomeBuild = null;
1514      } else if (name.equals("orientation")) {
1515        this.orientation = null;
1516      } else if (name.equals("referenceSeqId")) {
1517        this.referenceSeqId = null;
1518      } else if (name.equals("referenceSeqPointer")) {
1519        this.referenceSeqPointer = null;
1520      } else if (name.equals("referenceSeqString")) {
1521        this.referenceSeqString = null;
1522      } else if (name.equals("strand")) {
1523        this.strand = null;
1524      } else if (name.equals("windowStart")) {
1525        this.windowStart = null;
1526      } else if (name.equals("windowEnd")) {
1527        this.windowEnd = null;
1528      } else
1529        super.removeChild(name, value);
1530      
1531    }
1532
1533    @Override
1534    public Base makeProperty(int hash, String name) throws FHIRException {
1535      switch (hash) {
1536      case -1499470472:
1537        return getChromosome();
1538      case 1061239735:
1539        return getGenomeBuildElement();
1540      case -1439500848:
1541        return getOrientationElement();
1542      case -1911500465:
1543        return getReferenceSeqId();
1544      case 1923414665:
1545        return getReferenceSeqPointer();
1546      case -1648301499:
1547        return getReferenceSeqStringElement();
1548      case -891993594:
1549        return getStrandElement();
1550      case 1903685202:
1551        return getWindowStartElement();
1552      case -217026869:
1553        return getWindowEndElement();
1554      default:
1555        return super.makeProperty(hash, name);
1556      }
1557
1558    }
1559
1560    @Override
1561    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1562      switch (hash) {
1563      case -1499470472:
1564        /* chromosome */ return new String[] { "CodeableConcept" };
1565      case 1061239735:
1566        /* genomeBuild */ return new String[] { "string" };
1567      case -1439500848:
1568        /* orientation */ return new String[] { "code" };
1569      case -1911500465:
1570        /* referenceSeqId */ return new String[] { "CodeableConcept" };
1571      case 1923414665:
1572        /* referenceSeqPointer */ return new String[] { "Reference" };
1573      case -1648301499:
1574        /* referenceSeqString */ return new String[] { "string" };
1575      case -891993594:
1576        /* strand */ return new String[] { "code" };
1577      case 1903685202:
1578        /* windowStart */ return new String[] { "integer" };
1579      case -217026869:
1580        /* windowEnd */ return new String[] { "integer" };
1581      default:
1582        return super.getTypesForProperty(hash, name);
1583      }
1584
1585    }
1586
1587    @Override
1588    public Base addChild(String name) throws FHIRException {
1589      if (name.equals("chromosome")) {
1590        this.chromosome = new CodeableConcept();
1591        return this.chromosome;
1592      } else if (name.equals("genomeBuild")) {
1593        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.genomeBuild");
1594      } else if (name.equals("orientation")) {
1595        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.orientation");
1596      } else if (name.equals("referenceSeqId")) {
1597        this.referenceSeqId = new CodeableConcept();
1598        return this.referenceSeqId;
1599      } else if (name.equals("referenceSeqPointer")) {
1600        this.referenceSeqPointer = new Reference();
1601        return this.referenceSeqPointer;
1602      } else if (name.equals("referenceSeqString")) {
1603        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.referenceSeqString");
1604      } else if (name.equals("strand")) {
1605        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.strand");
1606      } else if (name.equals("windowStart")) {
1607        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.windowStart");
1608      } else if (name.equals("windowEnd")) {
1609        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.windowEnd");
1610      } else
1611        return super.addChild(name);
1612    }
1613
1614    public MolecularSequenceReferenceSeqComponent copy() {
1615      MolecularSequenceReferenceSeqComponent dst = new MolecularSequenceReferenceSeqComponent();
1616      copyValues(dst);
1617      return dst;
1618    }
1619
1620    public void copyValues(MolecularSequenceReferenceSeqComponent dst) {
1621      super.copyValues(dst);
1622      dst.chromosome = chromosome == null ? null : chromosome.copy();
1623      dst.genomeBuild = genomeBuild == null ? null : genomeBuild.copy();
1624      dst.orientation = orientation == null ? null : orientation.copy();
1625      dst.referenceSeqId = referenceSeqId == null ? null : referenceSeqId.copy();
1626      dst.referenceSeqPointer = referenceSeqPointer == null ? null : referenceSeqPointer.copy();
1627      dst.referenceSeqString = referenceSeqString == null ? null : referenceSeqString.copy();
1628      dst.strand = strand == null ? null : strand.copy();
1629      dst.windowStart = windowStart == null ? null : windowStart.copy();
1630      dst.windowEnd = windowEnd == null ? null : windowEnd.copy();
1631    }
1632
1633    @Override
1634    public boolean equalsDeep(Base other_) {
1635      if (!super.equalsDeep(other_))
1636        return false;
1637      if (!(other_ instanceof MolecularSequenceReferenceSeqComponent))
1638        return false;
1639      MolecularSequenceReferenceSeqComponent o = (MolecularSequenceReferenceSeqComponent) other_;
1640      return compareDeep(chromosome, o.chromosome, true) && compareDeep(genomeBuild, o.genomeBuild, true)
1641          && compareDeep(orientation, o.orientation, true) && compareDeep(referenceSeqId, o.referenceSeqId, true)
1642          && compareDeep(referenceSeqPointer, o.referenceSeqPointer, true)
1643          && compareDeep(referenceSeqString, o.referenceSeqString, true) && compareDeep(strand, o.strand, true)
1644          && compareDeep(windowStart, o.windowStart, true) && compareDeep(windowEnd, o.windowEnd, true);
1645    }
1646
1647    @Override
1648    public boolean equalsShallow(Base other_) {
1649      if (!super.equalsShallow(other_))
1650        return false;
1651      if (!(other_ instanceof MolecularSequenceReferenceSeqComponent))
1652        return false;
1653      MolecularSequenceReferenceSeqComponent o = (MolecularSequenceReferenceSeqComponent) other_;
1654      return compareValues(genomeBuild, o.genomeBuild, true) && compareValues(orientation, o.orientation, true)
1655          && compareValues(referenceSeqString, o.referenceSeqString, true) && compareValues(strand, o.strand, true)
1656          && compareValues(windowStart, o.windowStart, true) && compareValues(windowEnd, o.windowEnd, true);
1657    }
1658
1659    public boolean isEmpty() {
1660      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(chromosome, genomeBuild, orientation,
1661          referenceSeqId, referenceSeqPointer, referenceSeqString, strand, windowStart, windowEnd);
1662    }
1663
1664    public String fhirType() {
1665      return "MolecularSequence.referenceSeq";
1666
1667    }
1668
1669  }
1670
1671  @Block()
1672  public static class MolecularSequenceVariantComponent extends BackboneElement implements IBaseBackboneElement {
1673    /**
1674     * Start position of the variant on the reference sequence. If the coordinate
1675     * system is either 0-based or 1-based, then start position is inclusive.
1676     */
1677    @Child(name = "start", type = { IntegerType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
1678    @Description(shortDefinition = "Start position of the variant on the  reference sequence", formalDefinition = "Start position of the variant on the  reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.")
1679    protected IntegerType start;
1680
1681    /**
1682     * End position of the variant on the reference sequence. If the coordinate
1683     * system is 0-based then end is exclusive and does not include the last
1684     * position. If the coordinate system is 1-base, then end is inclusive and
1685     * includes the last position.
1686     */
1687    @Child(name = "end", type = { IntegerType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
1688    @Description(shortDefinition = "End position of the variant on the reference sequence", formalDefinition = "End position of the variant on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.")
1689    protected IntegerType end;
1690
1691    /**
1692     * An allele is one of a set of coexisting sequence variants of a gene
1693     * ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).
1694     * Nucleotide(s)/amino acids from start position of sequence to stop position of
1695     * sequence on the positive (+) strand of the observed sequence. When the
1696     * sequence type is DNA, it should be the sequence on the positive (+) strand.
1697     * This will lay in the range between variant.start and variant.end.
1698     */
1699    @Child(name = "observedAllele", type = {
1700        StringType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
1701    @Description(shortDefinition = "Allele that was observed", formalDefinition = "An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).  Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed  sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.")
1702    protected StringType observedAllele;
1703
1704    /**
1705     * An allele is one of a set of coexisting sequence variants of a gene
1706     * ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).
1707     * Nucleotide(s)/amino acids from start position of sequence to stop position of
1708     * sequence on the positive (+) strand of the reference sequence. When the
1709     * sequence type is DNA, it should be the sequence on the positive (+) strand.
1710     * This will lay in the range between variant.start and variant.end.
1711     */
1712    @Child(name = "referenceAllele", type = {
1713        StringType.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
1714    @Description(shortDefinition = "Allele in the reference sequence", formalDefinition = "An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.")
1715    protected StringType referenceAllele;
1716
1717    /**
1718     * Extended CIGAR string for aligning the sequence with reference bases. See
1719     * detailed documentation
1720     * [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).
1721     */
1722    @Child(name = "cigar", type = { StringType.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
1723    @Description(shortDefinition = "Extended CIGAR string for aligning the sequence with reference bases", formalDefinition = "Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).")
1724    protected StringType cigar;
1725
1726    /**
1727     * A pointer to an Observation containing variant information.
1728     */
1729    @Child(name = "variantPointer", type = {
1730        Observation.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
1731    @Description(shortDefinition = "Pointer to observed variant information", formalDefinition = "A pointer to an Observation containing variant information.")
1732    protected Reference variantPointer;
1733
1734    /**
1735     * The actual object that is the target of the reference (A pointer to an
1736     * Observation containing variant information.)
1737     */
1738    protected Observation variantPointerTarget;
1739
1740    private static final long serialVersionUID = 105611837L;
1741
1742    /**
1743     * Constructor
1744     */
1745    public MolecularSequenceVariantComponent() {
1746      super();
1747    }
1748
1749    /**
1750     * @return {@link #start} (Start position of the variant on the reference
1751     *         sequence. If the coordinate system is either 0-based or 1-based, then
1752     *         start position is inclusive.). This is the underlying object with id,
1753     *         value and extensions. The accessor "getStart" gives direct access to
1754     *         the value
1755     */
1756    public IntegerType getStartElement() {
1757      if (this.start == null)
1758        if (Configuration.errorOnAutoCreate())
1759          throw new Error("Attempt to auto-create MolecularSequenceVariantComponent.start");
1760        else if (Configuration.doAutoCreate())
1761          this.start = new IntegerType(); // bb
1762      return this.start;
1763    }
1764
1765    public boolean hasStartElement() {
1766      return this.start != null && !this.start.isEmpty();
1767    }
1768
1769    public boolean hasStart() {
1770      return this.start != null && !this.start.isEmpty();
1771    }
1772
1773    /**
1774     * @param value {@link #start} (Start position of the variant on the reference
1775     *              sequence. If the coordinate system is either 0-based or 1-based,
1776     *              then start position is inclusive.). This is the underlying
1777     *              object with id, value and extensions. The accessor "getStart"
1778     *              gives direct access to the value
1779     */
1780    public MolecularSequenceVariantComponent setStartElement(IntegerType value) {
1781      this.start = value;
1782      return this;
1783    }
1784
1785    /**
1786     * @return Start position of the variant on the reference sequence. If the
1787     *         coordinate system is either 0-based or 1-based, then start position
1788     *         is inclusive.
1789     */
1790    public int getStart() {
1791      return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
1792    }
1793
1794    /**
1795     * @param value Start position of the variant on the reference sequence. If the
1796     *              coordinate system is either 0-based or 1-based, then start
1797     *              position is inclusive.
1798     */
1799    public MolecularSequenceVariantComponent setStart(int value) {
1800      if (this.start == null)
1801        this.start = new IntegerType();
1802      this.start.setValue(value);
1803      return this;
1804    }
1805
1806    /**
1807     * @return {@link #end} (End position of the variant on the reference sequence.
1808     *         If the coordinate system is 0-based then end is exclusive and does
1809     *         not include the last position. If the coordinate system is 1-base,
1810     *         then end is inclusive and includes the last position.). This is the
1811     *         underlying object with id, value and extensions. The accessor
1812     *         "getEnd" gives direct access to the value
1813     */
1814    public IntegerType getEndElement() {
1815      if (this.end == null)
1816        if (Configuration.errorOnAutoCreate())
1817          throw new Error("Attempt to auto-create MolecularSequenceVariantComponent.end");
1818        else if (Configuration.doAutoCreate())
1819          this.end = new IntegerType(); // bb
1820      return this.end;
1821    }
1822
1823    public boolean hasEndElement() {
1824      return this.end != null && !this.end.isEmpty();
1825    }
1826
1827    public boolean hasEnd() {
1828      return this.end != null && !this.end.isEmpty();
1829    }
1830
1831    /**
1832     * @param value {@link #end} (End position of the variant on the reference
1833     *              sequence. If the coordinate system is 0-based then end is
1834     *              exclusive and does not include the last position. If the
1835     *              coordinate system is 1-base, then end is inclusive and includes
1836     *              the last position.). This is the underlying object with id,
1837     *              value and extensions. The accessor "getEnd" gives direct access
1838     *              to the value
1839     */
1840    public MolecularSequenceVariantComponent setEndElement(IntegerType value) {
1841      this.end = value;
1842      return this;
1843    }
1844
1845    /**
1846     * @return End position of the variant on the reference sequence. If the
1847     *         coordinate system is 0-based then end is exclusive and does not
1848     *         include the last position. If the coordinate system is 1-base, then
1849     *         end is inclusive and includes the last position.
1850     */
1851    public int getEnd() {
1852      return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
1853    }
1854
1855    /**
1856     * @param value End position of the variant on the reference sequence. If the
1857     *              coordinate system is 0-based then end is exclusive and does not
1858     *              include the last position. If the coordinate system is 1-base,
1859     *              then end is inclusive and includes the last position.
1860     */
1861    public MolecularSequenceVariantComponent setEnd(int value) {
1862      if (this.end == null)
1863        this.end = new IntegerType();
1864      this.end.setValue(value);
1865      return this;
1866    }
1867
1868    /**
1869     * @return {@link #observedAllele} (An allele is one of a set of coexisting
1870     *         sequence variants of a gene
1871     *         ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).
1872     *         Nucleotide(s)/amino acids from start position of sequence to stop
1873     *         position of sequence on the positive (+) strand of the observed
1874     *         sequence. When the sequence type is DNA, it should be the sequence on
1875     *         the positive (+) strand. This will lay in the range between
1876     *         variant.start and variant.end.). This is the underlying object with
1877     *         id, value and extensions. The accessor "getObservedAllele" gives
1878     *         direct access to the value
1879     */
1880    public StringType getObservedAlleleElement() {
1881      if (this.observedAllele == null)
1882        if (Configuration.errorOnAutoCreate())
1883          throw new Error("Attempt to auto-create MolecularSequenceVariantComponent.observedAllele");
1884        else if (Configuration.doAutoCreate())
1885          this.observedAllele = new StringType(); // bb
1886      return this.observedAllele;
1887    }
1888
1889    public boolean hasObservedAlleleElement() {
1890      return this.observedAllele != null && !this.observedAllele.isEmpty();
1891    }
1892
1893    public boolean hasObservedAllele() {
1894      return this.observedAllele != null && !this.observedAllele.isEmpty();
1895    }
1896
1897    /**
1898     * @param value {@link #observedAllele} (An allele is one of a set of coexisting
1899     *              sequence variants of a gene
1900     *              ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).
1901     *              Nucleotide(s)/amino acids from start position of sequence to
1902     *              stop position of sequence on the positive (+) strand of the
1903     *              observed sequence. When the sequence type is DNA, it should be
1904     *              the sequence on the positive (+) strand. This will lay in the
1905     *              range between variant.start and variant.end.). This is the
1906     *              underlying object with id, value and extensions. The accessor
1907     *              "getObservedAllele" gives direct access to the value
1908     */
1909    public MolecularSequenceVariantComponent setObservedAlleleElement(StringType value) {
1910      this.observedAllele = value;
1911      return this;
1912    }
1913
1914    /**
1915     * @return An allele is one of a set of coexisting sequence variants of a gene
1916     *         ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).
1917     *         Nucleotide(s)/amino acids from start position of sequence to stop
1918     *         position of sequence on the positive (+) strand of the observed
1919     *         sequence. When the sequence type is DNA, it should be the sequence on
1920     *         the positive (+) strand. This will lay in the range between
1921     *         variant.start and variant.end.
1922     */
1923    public String getObservedAllele() {
1924      return this.observedAllele == null ? null : this.observedAllele.getValue();
1925    }
1926
1927    /**
1928     * @param value An allele is one of a set of coexisting sequence variants of a
1929     *              gene
1930     *              ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).
1931     *              Nucleotide(s)/amino acids from start position of sequence to
1932     *              stop position of sequence on the positive (+) strand of the
1933     *              observed sequence. When the sequence type is DNA, it should be
1934     *              the sequence on the positive (+) strand. This will lay in the
1935     *              range between variant.start and variant.end.
1936     */
1937    public MolecularSequenceVariantComponent setObservedAllele(String value) {
1938      if (Utilities.noString(value))
1939        this.observedAllele = null;
1940      else {
1941        if (this.observedAllele == null)
1942          this.observedAllele = new StringType();
1943        this.observedAllele.setValue(value);
1944      }
1945      return this;
1946    }
1947
1948    /**
1949     * @return {@link #referenceAllele} (An allele is one of a set of coexisting
1950     *         sequence variants of a gene
1951     *         ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).
1952     *         Nucleotide(s)/amino acids from start position of sequence to stop
1953     *         position of sequence on the positive (+) strand of the reference
1954     *         sequence. When the sequence type is DNA, it should be the sequence on
1955     *         the positive (+) strand. This will lay in the range between
1956     *         variant.start and variant.end.). This is the underlying object with
1957     *         id, value and extensions. The accessor "getReferenceAllele" gives
1958     *         direct access to the value
1959     */
1960    public StringType getReferenceAlleleElement() {
1961      if (this.referenceAllele == null)
1962        if (Configuration.errorOnAutoCreate())
1963          throw new Error("Attempt to auto-create MolecularSequenceVariantComponent.referenceAllele");
1964        else if (Configuration.doAutoCreate())
1965          this.referenceAllele = new StringType(); // bb
1966      return this.referenceAllele;
1967    }
1968
1969    public boolean hasReferenceAlleleElement() {
1970      return this.referenceAllele != null && !this.referenceAllele.isEmpty();
1971    }
1972
1973    public boolean hasReferenceAllele() {
1974      return this.referenceAllele != null && !this.referenceAllele.isEmpty();
1975    }
1976
1977    /**
1978     * @param value {@link #referenceAllele} (An allele is one of a set of
1979     *              coexisting sequence variants of a gene
1980     *              ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).
1981     *              Nucleotide(s)/amino acids from start position of sequence to
1982     *              stop position of sequence on the positive (+) strand of the
1983     *              reference sequence. When the sequence type is DNA, it should be
1984     *              the sequence on the positive (+) strand. This will lay in the
1985     *              range between variant.start and variant.end.). This is the
1986     *              underlying object with id, value and extensions. The accessor
1987     *              "getReferenceAllele" gives direct access to the value
1988     */
1989    public MolecularSequenceVariantComponent setReferenceAlleleElement(StringType value) {
1990      this.referenceAllele = value;
1991      return this;
1992    }
1993
1994    /**
1995     * @return An allele is one of a set of coexisting sequence variants of a gene
1996     *         ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).
1997     *         Nucleotide(s)/amino acids from start position of sequence to stop
1998     *         position of sequence on the positive (+) strand of the reference
1999     *         sequence. When the sequence type is DNA, it should be the sequence on
2000     *         the positive (+) strand. This will lay in the range between
2001     *         variant.start and variant.end.
2002     */
2003    public String getReferenceAllele() {
2004      return this.referenceAllele == null ? null : this.referenceAllele.getValue();
2005    }
2006
2007    /**
2008     * @param value An allele is one of a set of coexisting sequence variants of a
2009     *              gene
2010     *              ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).
2011     *              Nucleotide(s)/amino acids from start position of sequence to
2012     *              stop position of sequence on the positive (+) strand of the
2013     *              reference sequence. When the sequence type is DNA, it should be
2014     *              the sequence on the positive (+) strand. This will lay in the
2015     *              range between variant.start and variant.end.
2016     */
2017    public MolecularSequenceVariantComponent setReferenceAllele(String value) {
2018      if (Utilities.noString(value))
2019        this.referenceAllele = null;
2020      else {
2021        if (this.referenceAllele == null)
2022          this.referenceAllele = new StringType();
2023        this.referenceAllele.setValue(value);
2024      }
2025      return this;
2026    }
2027
2028    /**
2029     * @return {@link #cigar} (Extended CIGAR string for aligning the sequence with
2030     *         reference bases. See detailed documentation
2031     *         [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).).
2032     *         This is the underlying object with id, value and extensions. The
2033     *         accessor "getCigar" gives direct access to the value
2034     */
2035    public StringType getCigarElement() {
2036      if (this.cigar == null)
2037        if (Configuration.errorOnAutoCreate())
2038          throw new Error("Attempt to auto-create MolecularSequenceVariantComponent.cigar");
2039        else if (Configuration.doAutoCreate())
2040          this.cigar = new StringType(); // bb
2041      return this.cigar;
2042    }
2043
2044    public boolean hasCigarElement() {
2045      return this.cigar != null && !this.cigar.isEmpty();
2046    }
2047
2048    public boolean hasCigar() {
2049      return this.cigar != null && !this.cigar.isEmpty();
2050    }
2051
2052    /**
2053     * @param value {@link #cigar} (Extended CIGAR string for aligning the sequence
2054     *              with reference bases. See detailed documentation
2055     *              [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).).
2056     *              This is the underlying object with id, value and extensions. The
2057     *              accessor "getCigar" gives direct access to the value
2058     */
2059    public MolecularSequenceVariantComponent setCigarElement(StringType value) {
2060      this.cigar = value;
2061      return this;
2062    }
2063
2064    /**
2065     * @return Extended CIGAR string for aligning the sequence with reference bases.
2066     *         See detailed documentation
2067     *         [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).
2068     */
2069    public String getCigar() {
2070      return this.cigar == null ? null : this.cigar.getValue();
2071    }
2072
2073    /**
2074     * @param value Extended CIGAR string for aligning the sequence with reference
2075     *              bases. See detailed documentation
2076     *              [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).
2077     */
2078    public MolecularSequenceVariantComponent setCigar(String value) {
2079      if (Utilities.noString(value))
2080        this.cigar = null;
2081      else {
2082        if (this.cigar == null)
2083          this.cigar = new StringType();
2084        this.cigar.setValue(value);
2085      }
2086      return this;
2087    }
2088
2089    /**
2090     * @return {@link #variantPointer} (A pointer to an Observation containing
2091     *         variant information.)
2092     */
2093    public Reference getVariantPointer() {
2094      if (this.variantPointer == null)
2095        if (Configuration.errorOnAutoCreate())
2096          throw new Error("Attempt to auto-create MolecularSequenceVariantComponent.variantPointer");
2097        else if (Configuration.doAutoCreate())
2098          this.variantPointer = new Reference(); // cc
2099      return this.variantPointer;
2100    }
2101
2102    public boolean hasVariantPointer() {
2103      return this.variantPointer != null && !this.variantPointer.isEmpty();
2104    }
2105
2106    /**
2107     * @param value {@link #variantPointer} (A pointer to an Observation containing
2108     *              variant information.)
2109     */
2110    public MolecularSequenceVariantComponent setVariantPointer(Reference value) {
2111      this.variantPointer = value;
2112      return this;
2113    }
2114
2115    /**
2116     * @return {@link #variantPointer} The actual object that is the target of the
2117     *         reference. The reference library doesn't populate this, but you can
2118     *         use it to hold the resource if you resolve it. (A pointer to an
2119     *         Observation containing variant information.)
2120     */
2121    public Observation getVariantPointerTarget() {
2122      if (this.variantPointerTarget == null)
2123        if (Configuration.errorOnAutoCreate())
2124          throw new Error("Attempt to auto-create MolecularSequenceVariantComponent.variantPointer");
2125        else if (Configuration.doAutoCreate())
2126          this.variantPointerTarget = new Observation(); // aa
2127      return this.variantPointerTarget;
2128    }
2129
2130    /**
2131     * @param value {@link #variantPointer} The actual object that is the target of
2132     *              the reference. The reference library doesn't use these, but you
2133     *              can use it to hold the resource if you resolve it. (A pointer to
2134     *              an Observation containing variant information.)
2135     */
2136    public MolecularSequenceVariantComponent setVariantPointerTarget(Observation value) {
2137      this.variantPointerTarget = value;
2138      return this;
2139    }
2140
2141    protected void listChildren(List<Property> children) {
2142      super.listChildren(children);
2143      children.add(new Property("start", "integer",
2144          "Start position of the variant on the  reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.",
2145          0, 1, start));
2146      children.add(new Property("end", "integer",
2147          "End position of the variant on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.",
2148          0, 1, end));
2149      children.add(new Property("observedAllele", "string",
2150          "An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).  Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed  sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.",
2151          0, 1, observedAllele));
2152      children.add(new Property("referenceAllele", "string",
2153          "An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.",
2154          0, 1, referenceAllele));
2155      children.add(new Property("cigar", "string",
2156          "Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).",
2157          0, 1, cigar));
2158      children.add(new Property("variantPointer", "Reference(Observation)",
2159          "A pointer to an Observation containing variant information.", 0, 1, variantPointer));
2160    }
2161
2162    @Override
2163    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2164      switch (_hash) {
2165      case 109757538:
2166        /* start */ return new Property("start", "integer",
2167            "Start position of the variant on the  reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.",
2168            0, 1, start);
2169      case 100571:
2170        /* end */ return new Property("end", "integer",
2171            "End position of the variant on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.",
2172            0, 1, end);
2173      case -1418745787:
2174        /* observedAllele */ return new Property("observedAllele", "string",
2175            "An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).  Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed  sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.",
2176            0, 1, observedAllele);
2177      case 364045960:
2178        /* referenceAllele */ return new Property("referenceAllele", "string",
2179            "An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.",
2180            0, 1, referenceAllele);
2181      case 94658738:
2182        /* cigar */ return new Property("cigar", "string",
2183            "Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).",
2184            0, 1, cigar);
2185      case -1654319624:
2186        /* variantPointer */ return new Property("variantPointer", "Reference(Observation)",
2187            "A pointer to an Observation containing variant information.", 0, 1, variantPointer);
2188      default:
2189        return super.getNamedProperty(_hash, _name, _checkValid);
2190      }
2191
2192    }
2193
2194    @Override
2195    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2196      switch (hash) {
2197      case 109757538:
2198        /* start */ return this.start == null ? new Base[0] : new Base[] { this.start }; // IntegerType
2199      case 100571:
2200        /* end */ return this.end == null ? new Base[0] : new Base[] { this.end }; // IntegerType
2201      case -1418745787:
2202        /* observedAllele */ return this.observedAllele == null ? new Base[0] : new Base[] { this.observedAllele }; // StringType
2203      case 364045960:
2204        /* referenceAllele */ return this.referenceAllele == null ? new Base[0] : new Base[] { this.referenceAllele }; // StringType
2205      case 94658738:
2206        /* cigar */ return this.cigar == null ? new Base[0] : new Base[] { this.cigar }; // StringType
2207      case -1654319624:
2208        /* variantPointer */ return this.variantPointer == null ? new Base[0] : new Base[] { this.variantPointer }; // Reference
2209      default:
2210        return super.getProperty(hash, name, checkValid);
2211      }
2212
2213    }
2214
2215    @Override
2216    public Base setProperty(int hash, String name, Base value) throws FHIRException {
2217      switch (hash) {
2218      case 109757538: // start
2219        this.start = castToInteger(value); // IntegerType
2220        return value;
2221      case 100571: // end
2222        this.end = castToInteger(value); // IntegerType
2223        return value;
2224      case -1418745787: // observedAllele
2225        this.observedAllele = castToString(value); // StringType
2226        return value;
2227      case 364045960: // referenceAllele
2228        this.referenceAllele = castToString(value); // StringType
2229        return value;
2230      case 94658738: // cigar
2231        this.cigar = castToString(value); // StringType
2232        return value;
2233      case -1654319624: // variantPointer
2234        this.variantPointer = castToReference(value); // Reference
2235        return value;
2236      default:
2237        return super.setProperty(hash, name, value);
2238      }
2239
2240    }
2241
2242    @Override
2243    public Base setProperty(String name, Base value) throws FHIRException {
2244      if (name.equals("start")) {
2245        this.start = castToInteger(value); // IntegerType
2246      } else if (name.equals("end")) {
2247        this.end = castToInteger(value); // IntegerType
2248      } else if (name.equals("observedAllele")) {
2249        this.observedAllele = castToString(value); // StringType
2250      } else if (name.equals("referenceAllele")) {
2251        this.referenceAllele = castToString(value); // StringType
2252      } else if (name.equals("cigar")) {
2253        this.cigar = castToString(value); // StringType
2254      } else if (name.equals("variantPointer")) {
2255        this.variantPointer = castToReference(value); // Reference
2256      } else
2257        return super.setProperty(name, value);
2258      return value;
2259    }
2260
2261  @Override
2262  public void removeChild(String name, Base value) throws FHIRException {
2263      if (name.equals("start")) {
2264        this.start = null;
2265      } else if (name.equals("end")) {
2266        this.end = null;
2267      } else if (name.equals("observedAllele")) {
2268        this.observedAllele = null;
2269      } else if (name.equals("referenceAllele")) {
2270        this.referenceAllele = null;
2271      } else if (name.equals("cigar")) {
2272        this.cigar = null;
2273      } else if (name.equals("variantPointer")) {
2274        this.variantPointer = null;
2275      } else
2276        super.removeChild(name, value);
2277      
2278    }
2279
2280    @Override
2281    public Base makeProperty(int hash, String name) throws FHIRException {
2282      switch (hash) {
2283      case 109757538:
2284        return getStartElement();
2285      case 100571:
2286        return getEndElement();
2287      case -1418745787:
2288        return getObservedAlleleElement();
2289      case 364045960:
2290        return getReferenceAlleleElement();
2291      case 94658738:
2292        return getCigarElement();
2293      case -1654319624:
2294        return getVariantPointer();
2295      default:
2296        return super.makeProperty(hash, name);
2297      }
2298
2299    }
2300
2301    @Override
2302    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2303      switch (hash) {
2304      case 109757538:
2305        /* start */ return new String[] { "integer" };
2306      case 100571:
2307        /* end */ return new String[] { "integer" };
2308      case -1418745787:
2309        /* observedAllele */ return new String[] { "string" };
2310      case 364045960:
2311        /* referenceAllele */ return new String[] { "string" };
2312      case 94658738:
2313        /* cigar */ return new String[] { "string" };
2314      case -1654319624:
2315        /* variantPointer */ return new String[] { "Reference" };
2316      default:
2317        return super.getTypesForProperty(hash, name);
2318      }
2319
2320    }
2321
2322    @Override
2323    public Base addChild(String name) throws FHIRException {
2324      if (name.equals("start")) {
2325        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.start");
2326      } else if (name.equals("end")) {
2327        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.end");
2328      } else if (name.equals("observedAllele")) {
2329        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.observedAllele");
2330      } else if (name.equals("referenceAllele")) {
2331        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.referenceAllele");
2332      } else if (name.equals("cigar")) {
2333        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.cigar");
2334      } else if (name.equals("variantPointer")) {
2335        this.variantPointer = new Reference();
2336        return this.variantPointer;
2337      } else
2338        return super.addChild(name);
2339    }
2340
2341    public MolecularSequenceVariantComponent copy() {
2342      MolecularSequenceVariantComponent dst = new MolecularSequenceVariantComponent();
2343      copyValues(dst);
2344      return dst;
2345    }
2346
2347    public void copyValues(MolecularSequenceVariantComponent dst) {
2348      super.copyValues(dst);
2349      dst.start = start == null ? null : start.copy();
2350      dst.end = end == null ? null : end.copy();
2351      dst.observedAllele = observedAllele == null ? null : observedAllele.copy();
2352      dst.referenceAllele = referenceAllele == null ? null : referenceAllele.copy();
2353      dst.cigar = cigar == null ? null : cigar.copy();
2354      dst.variantPointer = variantPointer == null ? null : variantPointer.copy();
2355    }
2356
2357    @Override
2358    public boolean equalsDeep(Base other_) {
2359      if (!super.equalsDeep(other_))
2360        return false;
2361      if (!(other_ instanceof MolecularSequenceVariantComponent))
2362        return false;
2363      MolecularSequenceVariantComponent o = (MolecularSequenceVariantComponent) other_;
2364      return compareDeep(start, o.start, true) && compareDeep(end, o.end, true)
2365          && compareDeep(observedAllele, o.observedAllele, true)
2366          && compareDeep(referenceAllele, o.referenceAllele, true) && compareDeep(cigar, o.cigar, true)
2367          && compareDeep(variantPointer, o.variantPointer, true);
2368    }
2369
2370    @Override
2371    public boolean equalsShallow(Base other_) {
2372      if (!super.equalsShallow(other_))
2373        return false;
2374      if (!(other_ instanceof MolecularSequenceVariantComponent))
2375        return false;
2376      MolecularSequenceVariantComponent o = (MolecularSequenceVariantComponent) other_;
2377      return compareValues(start, o.start, true) && compareValues(end, o.end, true)
2378          && compareValues(observedAllele, o.observedAllele, true)
2379          && compareValues(referenceAllele, o.referenceAllele, true) && compareValues(cigar, o.cigar, true);
2380    }
2381
2382    public boolean isEmpty() {
2383      return super.isEmpty()
2384          && ca.uhn.fhir.util.ElementUtil.isEmpty(start, end, observedAllele, referenceAllele, cigar, variantPointer);
2385    }
2386
2387    public String fhirType() {
2388      return "MolecularSequence.variant";
2389
2390    }
2391
2392  }
2393
2394  @Block()
2395  public static class MolecularSequenceQualityComponent extends BackboneElement implements IBaseBackboneElement {
2396    /**
2397     * INDEL / SNP / Undefined variant.
2398     */
2399    @Child(name = "type", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
2400    @Description(shortDefinition = "indel | snp | unknown", formalDefinition = "INDEL / SNP / Undefined variant.")
2401    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/quality-type")
2402    protected Enumeration<QualityType> type;
2403
2404    /**
2405     * Gold standard sequence used for comparing against.
2406     */
2407    @Child(name = "standardSequence", type = {
2408        CodeableConcept.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
2409    @Description(shortDefinition = "Standard sequence for comparison", formalDefinition = "Gold standard sequence used for comparing against.")
2410    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/sequence-quality-standardSequence")
2411    protected CodeableConcept standardSequence;
2412
2413    /**
2414     * Start position of the sequence. If the coordinate system is either 0-based or
2415     * 1-based, then start position is inclusive.
2416     */
2417    @Child(name = "start", type = { IntegerType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
2418    @Description(shortDefinition = "Start position of the sequence", formalDefinition = "Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.")
2419    protected IntegerType start;
2420
2421    /**
2422     * End position of the sequence. If the coordinate system is 0-based then end is
2423     * exclusive and does not include the last position. If the coordinate system is
2424     * 1-base, then end is inclusive and includes the last position.
2425     */
2426    @Child(name = "end", type = { IntegerType.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
2427    @Description(shortDefinition = "End position of the sequence", formalDefinition = "End position of the sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.")
2428    protected IntegerType end;
2429
2430    /**
2431     * The score of an experimentally derived feature such as a p-value
2432     * ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).
2433     */
2434    @Child(name = "score", type = { Quantity.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
2435    @Description(shortDefinition = "Quality score for the comparison", formalDefinition = "The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).")
2436    protected Quantity score;
2437
2438    /**
2439     * Which method is used to get sequence quality.
2440     */
2441    @Child(name = "method", type = {
2442        CodeableConcept.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
2443    @Description(shortDefinition = "Method to get quality", formalDefinition = "Which method is used to get sequence quality.")
2444    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/sequence-quality-method")
2445    protected CodeableConcept method;
2446
2447    /**
2448     * True positives, from the perspective of the truth data, i.e. the number of
2449     * sites in the Truth Call Set for which there are paths through the Query Call
2450     * Set that are consistent with all of the alleles at this site, and for which
2451     * there is an accurate genotype call for the event.
2452     */
2453    @Child(name = "truthTP", type = {
2454        DecimalType.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
2455    @Description(shortDefinition = "True positives from the perspective of the truth data", formalDefinition = "True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.")
2456    protected DecimalType truthTP;
2457
2458    /**
2459     * True positives, from the perspective of the query data, i.e. the number of
2460     * sites in the Query Call Set for which there are paths through the Truth Call
2461     * Set that are consistent with all of the alleles at this site, and for which
2462     * there is an accurate genotype call for the event.
2463     */
2464    @Child(name = "queryTP", type = {
2465        DecimalType.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
2466    @Description(shortDefinition = "True positives from the perspective of the query data", formalDefinition = "True positives, from the perspective of the query data, i.e. the number of sites in the Query Call Set for which there are paths through the Truth Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.")
2467    protected DecimalType queryTP;
2468
2469    /**
2470     * False negatives, i.e. the number of sites in the Truth Call Set for which
2471     * there is no path through the Query Call Set that is consistent with all of
2472     * the alleles at this site, or sites for which there is an inaccurate genotype
2473     * call for the event. Sites with correct variant but incorrect genotype are
2474     * counted here.
2475     */
2476    @Child(name = "truthFN", type = {
2477        DecimalType.class }, order = 9, min = 0, max = 1, modifier = false, summary = true)
2478    @Description(shortDefinition = "False negatives", formalDefinition = "False negatives, i.e. the number of sites in the Truth Call Set for which there is no path through the Query Call Set that is consistent with all of the alleles at this site, or sites for which there is an inaccurate genotype call for the event. Sites with correct variant but incorrect genotype are counted here.")
2479    protected DecimalType truthFN;
2480
2481    /**
2482     * False positives, i.e. the number of sites in the Query Call Set for which
2483     * there is no path through the Truth Call Set that is consistent with this
2484     * site. Sites with correct variant but incorrect genotype are counted here.
2485     */
2486    @Child(name = "queryFP", type = {
2487        DecimalType.class }, order = 10, min = 0, max = 1, modifier = false, summary = true)
2488    @Description(shortDefinition = "False positives", formalDefinition = "False positives, i.e. the number of sites in the Query Call Set for which there is no path through the Truth Call Set that is consistent with this site. Sites with correct variant but incorrect genotype are counted here.")
2489    protected DecimalType queryFP;
2490
2491    /**
2492     * The number of false positives where the non-REF alleles in the Truth and
2493     * Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1
2494     * or similar).
2495     */
2496    @Child(name = "gtFP", type = { DecimalType.class }, order = 11, min = 0, max = 1, modifier = false, summary = true)
2497    @Description(shortDefinition = "False positives where the non-REF alleles in the Truth and Query Call Sets match", formalDefinition = "The number of false positives where the non-REF alleles in the Truth and Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1 or similar).")
2498    protected DecimalType gtFP;
2499
2500    /**
2501     * QUERY.TP / (QUERY.TP + QUERY.FP).
2502     */
2503    @Child(name = "precision", type = {
2504        DecimalType.class }, order = 12, min = 0, max = 1, modifier = false, summary = true)
2505    @Description(shortDefinition = "Precision of comparison", formalDefinition = "QUERY.TP / (QUERY.TP + QUERY.FP).")
2506    protected DecimalType precision;
2507
2508    /**
2509     * TRUTH.TP / (TRUTH.TP + TRUTH.FN).
2510     */
2511    @Child(name = "recall", type = {
2512        DecimalType.class }, order = 13, min = 0, max = 1, modifier = false, summary = true)
2513    @Description(shortDefinition = "Recall of comparison", formalDefinition = "TRUTH.TP / (TRUTH.TP + TRUTH.FN).")
2514    protected DecimalType recall;
2515
2516    /**
2517     * Harmonic mean of Recall and Precision, computed as: 2 * precision * recall /
2518     * (precision + recall).
2519     */
2520    @Child(name = "fScore", type = {
2521        DecimalType.class }, order = 14, min = 0, max = 1, modifier = false, summary = true)
2522    @Description(shortDefinition = "F-score", formalDefinition = "Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).")
2523    protected DecimalType fScore;
2524
2525    /**
2526     * Receiver Operator Characteristic (ROC) Curve to give sensitivity/specificity
2527     * tradeoff.
2528     */
2529    @Child(name = "roc", type = {}, order = 15, min = 0, max = 1, modifier = false, summary = true)
2530    @Description(shortDefinition = "Receiver Operator Characteristic (ROC) Curve", formalDefinition = "Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff.")
2531    protected MolecularSequenceQualityRocComponent roc;
2532
2533    private static final long serialVersionUID = -811933526L;
2534
2535    /**
2536     * Constructor
2537     */
2538    public MolecularSequenceQualityComponent() {
2539      super();
2540    }
2541
2542    /**
2543     * Constructor
2544     */
2545    public MolecularSequenceQualityComponent(Enumeration<QualityType> type) {
2546      super();
2547      this.type = type;
2548    }
2549
2550    /**
2551     * @return {@link #type} (INDEL / SNP / Undefined variant.). This is the
2552     *         underlying object with id, value and extensions. The accessor
2553     *         "getType" gives direct access to the value
2554     */
2555    public Enumeration<QualityType> getTypeElement() {
2556      if (this.type == null)
2557        if (Configuration.errorOnAutoCreate())
2558          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.type");
2559        else if (Configuration.doAutoCreate())
2560          this.type = new Enumeration<QualityType>(new QualityTypeEnumFactory()); // bb
2561      return this.type;
2562    }
2563
2564    public boolean hasTypeElement() {
2565      return this.type != null && !this.type.isEmpty();
2566    }
2567
2568    public boolean hasType() {
2569      return this.type != null && !this.type.isEmpty();
2570    }
2571
2572    /**
2573     * @param value {@link #type} (INDEL / SNP / Undefined variant.). This is the
2574     *              underlying object with id, value and extensions. The accessor
2575     *              "getType" gives direct access to the value
2576     */
2577    public MolecularSequenceQualityComponent setTypeElement(Enumeration<QualityType> value) {
2578      this.type = value;
2579      return this;
2580    }
2581
2582    /**
2583     * @return INDEL / SNP / Undefined variant.
2584     */
2585    public QualityType getType() {
2586      return this.type == null ? null : this.type.getValue();
2587    }
2588
2589    /**
2590     * @param value INDEL / SNP / Undefined variant.
2591     */
2592    public MolecularSequenceQualityComponent setType(QualityType value) {
2593      if (this.type == null)
2594        this.type = new Enumeration<QualityType>(new QualityTypeEnumFactory());
2595      this.type.setValue(value);
2596      return this;
2597    }
2598
2599    /**
2600     * @return {@link #standardSequence} (Gold standard sequence used for comparing
2601     *         against.)
2602     */
2603    public CodeableConcept getStandardSequence() {
2604      if (this.standardSequence == null)
2605        if (Configuration.errorOnAutoCreate())
2606          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.standardSequence");
2607        else if (Configuration.doAutoCreate())
2608          this.standardSequence = new CodeableConcept(); // cc
2609      return this.standardSequence;
2610    }
2611
2612    public boolean hasStandardSequence() {
2613      return this.standardSequence != null && !this.standardSequence.isEmpty();
2614    }
2615
2616    /**
2617     * @param value {@link #standardSequence} (Gold standard sequence used for
2618     *              comparing against.)
2619     */
2620    public MolecularSequenceQualityComponent setStandardSequence(CodeableConcept value) {
2621      this.standardSequence = value;
2622      return this;
2623    }
2624
2625    /**
2626     * @return {@link #start} (Start position of the sequence. If the coordinate
2627     *         system is either 0-based or 1-based, then start position is
2628     *         inclusive.). This is the underlying object with id, value and
2629     *         extensions. The accessor "getStart" gives direct access to the value
2630     */
2631    public IntegerType getStartElement() {
2632      if (this.start == null)
2633        if (Configuration.errorOnAutoCreate())
2634          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.start");
2635        else if (Configuration.doAutoCreate())
2636          this.start = new IntegerType(); // bb
2637      return this.start;
2638    }
2639
2640    public boolean hasStartElement() {
2641      return this.start != null && !this.start.isEmpty();
2642    }
2643
2644    public boolean hasStart() {
2645      return this.start != null && !this.start.isEmpty();
2646    }
2647
2648    /**
2649     * @param value {@link #start} (Start position of the sequence. If the
2650     *              coordinate system is either 0-based or 1-based, then start
2651     *              position is inclusive.). This is the underlying object with id,
2652     *              value and extensions. The accessor "getStart" gives direct
2653     *              access to the value
2654     */
2655    public MolecularSequenceQualityComponent setStartElement(IntegerType value) {
2656      this.start = value;
2657      return this;
2658    }
2659
2660    /**
2661     * @return Start position of the sequence. If the coordinate system is either
2662     *         0-based or 1-based, then start position is inclusive.
2663     */
2664    public int getStart() {
2665      return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
2666    }
2667
2668    /**
2669     * @param value Start position of the sequence. If the coordinate system is
2670     *              either 0-based or 1-based, then start position is inclusive.
2671     */
2672    public MolecularSequenceQualityComponent setStart(int value) {
2673      if (this.start == null)
2674        this.start = new IntegerType();
2675      this.start.setValue(value);
2676      return this;
2677    }
2678
2679    /**
2680     * @return {@link #end} (End position of the sequence. If the coordinate system
2681     *         is 0-based then end is exclusive and does not include the last
2682     *         position. If the coordinate system is 1-base, then end is inclusive
2683     *         and includes the last position.). This is the underlying object with
2684     *         id, value and extensions. The accessor "getEnd" gives direct access
2685     *         to the value
2686     */
2687    public IntegerType getEndElement() {
2688      if (this.end == null)
2689        if (Configuration.errorOnAutoCreate())
2690          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.end");
2691        else if (Configuration.doAutoCreate())
2692          this.end = new IntegerType(); // bb
2693      return this.end;
2694    }
2695
2696    public boolean hasEndElement() {
2697      return this.end != null && !this.end.isEmpty();
2698    }
2699
2700    public boolean hasEnd() {
2701      return this.end != null && !this.end.isEmpty();
2702    }
2703
2704    /**
2705     * @param value {@link #end} (End position of the sequence. If the coordinate
2706     *              system is 0-based then end is exclusive and does not include the
2707     *              last position. If the coordinate system is 1-base, then end is
2708     *              inclusive and includes the last position.). This is the
2709     *              underlying object with id, value and extensions. The accessor
2710     *              "getEnd" gives direct access to the value
2711     */
2712    public MolecularSequenceQualityComponent setEndElement(IntegerType value) {
2713      this.end = value;
2714      return this;
2715    }
2716
2717    /**
2718     * @return End position of the sequence. If the coordinate system is 0-based
2719     *         then end is exclusive and does not include the last position. If the
2720     *         coordinate system is 1-base, then end is inclusive and includes the
2721     *         last position.
2722     */
2723    public int getEnd() {
2724      return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
2725    }
2726
2727    /**
2728     * @param value End position of the sequence. If the coordinate system is
2729     *              0-based then end is exclusive and does not include the last
2730     *              position. If the coordinate system is 1-base, then end is
2731     *              inclusive and includes the last position.
2732     */
2733    public MolecularSequenceQualityComponent setEnd(int value) {
2734      if (this.end == null)
2735        this.end = new IntegerType();
2736      this.end.setValue(value);
2737      return this;
2738    }
2739
2740    /**
2741     * @return {@link #score} (The score of an experimentally derived feature such
2742     *         as a p-value
2743     *         ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).)
2744     */
2745    public Quantity getScore() {
2746      if (this.score == null)
2747        if (Configuration.errorOnAutoCreate())
2748          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.score");
2749        else if (Configuration.doAutoCreate())
2750          this.score = new Quantity(); // cc
2751      return this.score;
2752    }
2753
2754    public boolean hasScore() {
2755      return this.score != null && !this.score.isEmpty();
2756    }
2757
2758    /**
2759     * @param value {@link #score} (The score of an experimentally derived feature
2760     *              such as a p-value
2761     *              ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).)
2762     */
2763    public MolecularSequenceQualityComponent setScore(Quantity value) {
2764      this.score = value;
2765      return this;
2766    }
2767
2768    /**
2769     * @return {@link #method} (Which method is used to get sequence quality.)
2770     */
2771    public CodeableConcept getMethod() {
2772      if (this.method == null)
2773        if (Configuration.errorOnAutoCreate())
2774          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.method");
2775        else if (Configuration.doAutoCreate())
2776          this.method = new CodeableConcept(); // cc
2777      return this.method;
2778    }
2779
2780    public boolean hasMethod() {
2781      return this.method != null && !this.method.isEmpty();
2782    }
2783
2784    /**
2785     * @param value {@link #method} (Which method is used to get sequence quality.)
2786     */
2787    public MolecularSequenceQualityComponent setMethod(CodeableConcept value) {
2788      this.method = value;
2789      return this;
2790    }
2791
2792    /**
2793     * @return {@link #truthTP} (True positives, from the perspective of the truth
2794     *         data, i.e. the number of sites in the Truth Call Set for which there
2795     *         are paths through the Query Call Set that are consistent with all of
2796     *         the alleles at this site, and for which there is an accurate genotype
2797     *         call for the event.). This is the underlying object with id, value
2798     *         and extensions. The accessor "getTruthTP" gives direct access to the
2799     *         value
2800     */
2801    public DecimalType getTruthTPElement() {
2802      if (this.truthTP == null)
2803        if (Configuration.errorOnAutoCreate())
2804          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.truthTP");
2805        else if (Configuration.doAutoCreate())
2806          this.truthTP = new DecimalType(); // bb
2807      return this.truthTP;
2808    }
2809
2810    public boolean hasTruthTPElement() {
2811      return this.truthTP != null && !this.truthTP.isEmpty();
2812    }
2813
2814    public boolean hasTruthTP() {
2815      return this.truthTP != null && !this.truthTP.isEmpty();
2816    }
2817
2818    /**
2819     * @param value {@link #truthTP} (True positives, from the perspective of the
2820     *              truth data, i.e. the number of sites in the Truth Call Set for
2821     *              which there are paths through the Query Call Set that are
2822     *              consistent with all of the alleles at this site, and for which
2823     *              there is an accurate genotype call for the event.). This is the
2824     *              underlying object with id, value and extensions. The accessor
2825     *              "getTruthTP" gives direct access to the value
2826     */
2827    public MolecularSequenceQualityComponent setTruthTPElement(DecimalType value) {
2828      this.truthTP = value;
2829      return this;
2830    }
2831
2832    /**
2833     * @return True positives, from the perspective of the truth data, i.e. the
2834     *         number of sites in the Truth Call Set for which there are paths
2835     *         through the Query Call Set that are consistent with all of the
2836     *         alleles at this site, and for which there is an accurate genotype
2837     *         call for the event.
2838     */
2839    public BigDecimal getTruthTP() {
2840      return this.truthTP == null ? null : this.truthTP.getValue();
2841    }
2842
2843    /**
2844     * @param value True positives, from the perspective of the truth data, i.e. the
2845     *              number of sites in the Truth Call Set for which there are paths
2846     *              through the Query Call Set that are consistent with all of the
2847     *              alleles at this site, and for which there is an accurate
2848     *              genotype call for the event.
2849     */
2850    public MolecularSequenceQualityComponent setTruthTP(BigDecimal value) {
2851      if (value == null)
2852        this.truthTP = null;
2853      else {
2854        if (this.truthTP == null)
2855          this.truthTP = new DecimalType();
2856        this.truthTP.setValue(value);
2857      }
2858      return this;
2859    }
2860
2861    /**
2862     * @param value True positives, from the perspective of the truth data, i.e. the
2863     *              number of sites in the Truth Call Set for which there are paths
2864     *              through the Query Call Set that are consistent with all of the
2865     *              alleles at this site, and for which there is an accurate
2866     *              genotype call for the event.
2867     */
2868    public MolecularSequenceQualityComponent setTruthTP(long value) {
2869      this.truthTP = new DecimalType();
2870      this.truthTP.setValue(value);
2871      return this;
2872    }
2873
2874    /**
2875     * @param value True positives, from the perspective of the truth data, i.e. the
2876     *              number of sites in the Truth Call Set for which there are paths
2877     *              through the Query Call Set that are consistent with all of the
2878     *              alleles at this site, and for which there is an accurate
2879     *              genotype call for the event.
2880     */
2881    public MolecularSequenceQualityComponent setTruthTP(double value) {
2882      this.truthTP = new DecimalType();
2883      this.truthTP.setValue(value);
2884      return this;
2885    }
2886
2887    /**
2888     * @return {@link #queryTP} (True positives, from the perspective of the query
2889     *         data, i.e. the number of sites in the Query Call Set for which there
2890     *         are paths through the Truth Call Set that are consistent with all of
2891     *         the alleles at this site, and for which there is an accurate genotype
2892     *         call for the event.). This is the underlying object with id, value
2893     *         and extensions. The accessor "getQueryTP" gives direct access to the
2894     *         value
2895     */
2896    public DecimalType getQueryTPElement() {
2897      if (this.queryTP == null)
2898        if (Configuration.errorOnAutoCreate())
2899          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.queryTP");
2900        else if (Configuration.doAutoCreate())
2901          this.queryTP = new DecimalType(); // bb
2902      return this.queryTP;
2903    }
2904
2905    public boolean hasQueryTPElement() {
2906      return this.queryTP != null && !this.queryTP.isEmpty();
2907    }
2908
2909    public boolean hasQueryTP() {
2910      return this.queryTP != null && !this.queryTP.isEmpty();
2911    }
2912
2913    /**
2914     * @param value {@link #queryTP} (True positives, from the perspective of the
2915     *              query data, i.e. the number of sites in the Query Call Set for
2916     *              which there are paths through the Truth Call Set that are
2917     *              consistent with all of the alleles at this site, and for which
2918     *              there is an accurate genotype call for the event.). This is the
2919     *              underlying object with id, value and extensions. The accessor
2920     *              "getQueryTP" gives direct access to the value
2921     */
2922    public MolecularSequenceQualityComponent setQueryTPElement(DecimalType value) {
2923      this.queryTP = value;
2924      return this;
2925    }
2926
2927    /**
2928     * @return True positives, from the perspective of the query data, i.e. the
2929     *         number of sites in the Query Call Set for which there are paths
2930     *         through the Truth Call Set that are consistent with all of the
2931     *         alleles at this site, and for which there is an accurate genotype
2932     *         call for the event.
2933     */
2934    public BigDecimal getQueryTP() {
2935      return this.queryTP == null ? null : this.queryTP.getValue();
2936    }
2937
2938    /**
2939     * @param value True positives, from the perspective of the query data, i.e. the
2940     *              number of sites in the Query Call Set for which there are paths
2941     *              through the Truth Call Set that are consistent with all of the
2942     *              alleles at this site, and for which there is an accurate
2943     *              genotype call for the event.
2944     */
2945    public MolecularSequenceQualityComponent setQueryTP(BigDecimal value) {
2946      if (value == null)
2947        this.queryTP = null;
2948      else {
2949        if (this.queryTP == null)
2950          this.queryTP = new DecimalType();
2951        this.queryTP.setValue(value);
2952      }
2953      return this;
2954    }
2955
2956    /**
2957     * @param value True positives, from the perspective of the query data, i.e. the
2958     *              number of sites in the Query Call Set for which there are paths
2959     *              through the Truth Call Set that are consistent with all of the
2960     *              alleles at this site, and for which there is an accurate
2961     *              genotype call for the event.
2962     */
2963    public MolecularSequenceQualityComponent setQueryTP(long value) {
2964      this.queryTP = new DecimalType();
2965      this.queryTP.setValue(value);
2966      return this;
2967    }
2968
2969    /**
2970     * @param value True positives, from the perspective of the query data, i.e. the
2971     *              number of sites in the Query Call Set for which there are paths
2972     *              through the Truth Call Set that are consistent with all of the
2973     *              alleles at this site, and for which there is an accurate
2974     *              genotype call for the event.
2975     */
2976    public MolecularSequenceQualityComponent setQueryTP(double value) {
2977      this.queryTP = new DecimalType();
2978      this.queryTP.setValue(value);
2979      return this;
2980    }
2981
2982    /**
2983     * @return {@link #truthFN} (False negatives, i.e. the number of sites in the
2984     *         Truth Call Set for which there is no path through the Query Call Set
2985     *         that is consistent with all of the alleles at this site, or sites for
2986     *         which there is an inaccurate genotype call for the event. Sites with
2987     *         correct variant but incorrect genotype are counted here.). This is
2988     *         the underlying object with id, value and extensions. The accessor
2989     *         "getTruthFN" gives direct access to the value
2990     */
2991    public DecimalType getTruthFNElement() {
2992      if (this.truthFN == null)
2993        if (Configuration.errorOnAutoCreate())
2994          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.truthFN");
2995        else if (Configuration.doAutoCreate())
2996          this.truthFN = new DecimalType(); // bb
2997      return this.truthFN;
2998    }
2999
3000    public boolean hasTruthFNElement() {
3001      return this.truthFN != null && !this.truthFN.isEmpty();
3002    }
3003
3004    public boolean hasTruthFN() {
3005      return this.truthFN != null && !this.truthFN.isEmpty();
3006    }
3007
3008    /**
3009     * @param value {@link #truthFN} (False negatives, i.e. the number of sites in
3010     *              the Truth Call Set for which there is no path through the Query
3011     *              Call Set that is consistent with all of the alleles at this
3012     *              site, or sites for which there is an inaccurate genotype call
3013     *              for the event. Sites with correct variant but incorrect genotype
3014     *              are counted here.). This is the underlying object with id, value
3015     *              and extensions. The accessor "getTruthFN" gives direct access to
3016     *              the value
3017     */
3018    public MolecularSequenceQualityComponent setTruthFNElement(DecimalType value) {
3019      this.truthFN = value;
3020      return this;
3021    }
3022
3023    /**
3024     * @return False negatives, i.e. the number of sites in the Truth Call Set for
3025     *         which there is no path through the Query Call Set that is consistent
3026     *         with all of the alleles at this site, or sites for which there is an
3027     *         inaccurate genotype call for the event. Sites with correct variant
3028     *         but incorrect genotype are counted here.
3029     */
3030    public BigDecimal getTruthFN() {
3031      return this.truthFN == null ? null : this.truthFN.getValue();
3032    }
3033
3034    /**
3035     * @param value False negatives, i.e. the number of sites in the Truth Call Set
3036     *              for which there is no path through the Query Call Set that is
3037     *              consistent with all of the alleles at this site, or sites for
3038     *              which there is an inaccurate genotype call for the event. Sites
3039     *              with correct variant but incorrect genotype are counted here.
3040     */
3041    public MolecularSequenceQualityComponent setTruthFN(BigDecimal value) {
3042      if (value == null)
3043        this.truthFN = null;
3044      else {
3045        if (this.truthFN == null)
3046          this.truthFN = new DecimalType();
3047        this.truthFN.setValue(value);
3048      }
3049      return this;
3050    }
3051
3052    /**
3053     * @param value False negatives, i.e. the number of sites in the Truth Call Set
3054     *              for which there is no path through the Query Call Set that is
3055     *              consistent with all of the alleles at this site, or sites for
3056     *              which there is an inaccurate genotype call for the event. Sites
3057     *              with correct variant but incorrect genotype are counted here.
3058     */
3059    public MolecularSequenceQualityComponent setTruthFN(long value) {
3060      this.truthFN = new DecimalType();
3061      this.truthFN.setValue(value);
3062      return this;
3063    }
3064
3065    /**
3066     * @param value False negatives, i.e. the number of sites in the Truth Call Set
3067     *              for which there is no path through the Query Call Set that is
3068     *              consistent with all of the alleles at this site, or sites for
3069     *              which there is an inaccurate genotype call for the event. Sites
3070     *              with correct variant but incorrect genotype are counted here.
3071     */
3072    public MolecularSequenceQualityComponent setTruthFN(double value) {
3073      this.truthFN = new DecimalType();
3074      this.truthFN.setValue(value);
3075      return this;
3076    }
3077
3078    /**
3079     * @return {@link #queryFP} (False positives, i.e. the number of sites in the
3080     *         Query Call Set for which there is no path through the Truth Call Set
3081     *         that is consistent with this site. Sites with correct variant but
3082     *         incorrect genotype are counted here.). This is the underlying object
3083     *         with id, value and extensions. The accessor "getQueryFP" gives direct
3084     *         access to the value
3085     */
3086    public DecimalType getQueryFPElement() {
3087      if (this.queryFP == null)
3088        if (Configuration.errorOnAutoCreate())
3089          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.queryFP");
3090        else if (Configuration.doAutoCreate())
3091          this.queryFP = new DecimalType(); // bb
3092      return this.queryFP;
3093    }
3094
3095    public boolean hasQueryFPElement() {
3096      return this.queryFP != null && !this.queryFP.isEmpty();
3097    }
3098
3099    public boolean hasQueryFP() {
3100      return this.queryFP != null && !this.queryFP.isEmpty();
3101    }
3102
3103    /**
3104     * @param value {@link #queryFP} (False positives, i.e. the number of sites in
3105     *              the Query Call Set for which there is no path through the Truth
3106     *              Call Set that is consistent with this site. Sites with correct
3107     *              variant but incorrect genotype are counted here.). This is the
3108     *              underlying object with id, value and extensions. The accessor
3109     *              "getQueryFP" gives direct access to the value
3110     */
3111    public MolecularSequenceQualityComponent setQueryFPElement(DecimalType value) {
3112      this.queryFP = value;
3113      return this;
3114    }
3115
3116    /**
3117     * @return False positives, i.e. the number of sites in the Query Call Set for
3118     *         which there is no path through the Truth Call Set that is consistent
3119     *         with this site. Sites with correct variant but incorrect genotype are
3120     *         counted here.
3121     */
3122    public BigDecimal getQueryFP() {
3123      return this.queryFP == null ? null : this.queryFP.getValue();
3124    }
3125
3126    /**
3127     * @param value False positives, i.e. the number of sites in the Query Call Set
3128     *              for which there is no path through the Truth Call Set that is
3129     *              consistent with this site. Sites with correct variant but
3130     *              incorrect genotype are counted here.
3131     */
3132    public MolecularSequenceQualityComponent setQueryFP(BigDecimal value) {
3133      if (value == null)
3134        this.queryFP = null;
3135      else {
3136        if (this.queryFP == null)
3137          this.queryFP = new DecimalType();
3138        this.queryFP.setValue(value);
3139      }
3140      return this;
3141    }
3142
3143    /**
3144     * @param value False positives, i.e. the number of sites in the Query Call Set
3145     *              for which there is no path through the Truth Call Set that is
3146     *              consistent with this site. Sites with correct variant but
3147     *              incorrect genotype are counted here.
3148     */
3149    public MolecularSequenceQualityComponent setQueryFP(long value) {
3150      this.queryFP = new DecimalType();
3151      this.queryFP.setValue(value);
3152      return this;
3153    }
3154
3155    /**
3156     * @param value False positives, i.e. the number of sites in the Query Call Set
3157     *              for which there is no path through the Truth Call Set that is
3158     *              consistent with this site. Sites with correct variant but
3159     *              incorrect genotype are counted here.
3160     */
3161    public MolecularSequenceQualityComponent setQueryFP(double value) {
3162      this.queryFP = new DecimalType();
3163      this.queryFP.setValue(value);
3164      return this;
3165    }
3166
3167    /**
3168     * @return {@link #gtFP} (The number of false positives where the non-REF
3169     *         alleles in the Truth and Query Call Sets match (i.e. cases where the
3170     *         truth is 1/1 and the query is 0/1 or similar).). This is the
3171     *         underlying object with id, value and extensions. The accessor
3172     *         "getGtFP" gives direct access to the value
3173     */
3174    public DecimalType getGtFPElement() {
3175      if (this.gtFP == null)
3176        if (Configuration.errorOnAutoCreate())
3177          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.gtFP");
3178        else if (Configuration.doAutoCreate())
3179          this.gtFP = new DecimalType(); // bb
3180      return this.gtFP;
3181    }
3182
3183    public boolean hasGtFPElement() {
3184      return this.gtFP != null && !this.gtFP.isEmpty();
3185    }
3186
3187    public boolean hasGtFP() {
3188      return this.gtFP != null && !this.gtFP.isEmpty();
3189    }
3190
3191    /**
3192     * @param value {@link #gtFP} (The number of false positives where the non-REF
3193     *              alleles in the Truth and Query Call Sets match (i.e. cases where
3194     *              the truth is 1/1 and the query is 0/1 or similar).). This is the
3195     *              underlying object with id, value and extensions. The accessor
3196     *              "getGtFP" gives direct access to the value
3197     */
3198    public MolecularSequenceQualityComponent setGtFPElement(DecimalType value) {
3199      this.gtFP = value;
3200      return this;
3201    }
3202
3203    /**
3204     * @return The number of false positives where the non-REF alleles in the Truth
3205     *         and Query Call Sets match (i.e. cases where the truth is 1/1 and the
3206     *         query is 0/1 or similar).
3207     */
3208    public BigDecimal getGtFP() {
3209      return this.gtFP == null ? null : this.gtFP.getValue();
3210    }
3211
3212    /**
3213     * @param value The number of false positives where the non-REF alleles in the
3214     *              Truth and Query Call Sets match (i.e. cases where the truth is
3215     *              1/1 and the query is 0/1 or similar).
3216     */
3217    public MolecularSequenceQualityComponent setGtFP(BigDecimal value) {
3218      if (value == null)
3219        this.gtFP = null;
3220      else {
3221        if (this.gtFP == null)
3222          this.gtFP = new DecimalType();
3223        this.gtFP.setValue(value);
3224      }
3225      return this;
3226    }
3227
3228    /**
3229     * @param value The number of false positives where the non-REF alleles in the
3230     *              Truth and Query Call Sets match (i.e. cases where the truth is
3231     *              1/1 and the query is 0/1 or similar).
3232     */
3233    public MolecularSequenceQualityComponent setGtFP(long value) {
3234      this.gtFP = new DecimalType();
3235      this.gtFP.setValue(value);
3236      return this;
3237    }
3238
3239    /**
3240     * @param value The number of false positives where the non-REF alleles in the
3241     *              Truth and Query Call Sets match (i.e. cases where the truth is
3242     *              1/1 and the query is 0/1 or similar).
3243     */
3244    public MolecularSequenceQualityComponent setGtFP(double value) {
3245      this.gtFP = new DecimalType();
3246      this.gtFP.setValue(value);
3247      return this;
3248    }
3249
3250    /**
3251     * @return {@link #precision} (QUERY.TP / (QUERY.TP + QUERY.FP).). This is the
3252     *         underlying object with id, value and extensions. The accessor
3253     *         "getPrecision" gives direct access to the value
3254     */
3255    public DecimalType getPrecisionElement() {
3256      if (this.precision == null)
3257        if (Configuration.errorOnAutoCreate())
3258          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.precision");
3259        else if (Configuration.doAutoCreate())
3260          this.precision = new DecimalType(); // bb
3261      return this.precision;
3262    }
3263
3264    public boolean hasPrecisionElement() {
3265      return this.precision != null && !this.precision.isEmpty();
3266    }
3267
3268    public boolean hasPrecision() {
3269      return this.precision != null && !this.precision.isEmpty();
3270    }
3271
3272    /**
3273     * @param value {@link #precision} (QUERY.TP / (QUERY.TP + QUERY.FP).). This is
3274     *              the underlying object with id, value and extensions. The
3275     *              accessor "getPrecision" gives direct access to the value
3276     */
3277    public MolecularSequenceQualityComponent setPrecisionElement(DecimalType value) {
3278      this.precision = value;
3279      return this;
3280    }
3281
3282    /**
3283     * @return QUERY.TP / (QUERY.TP + QUERY.FP).
3284     */
3285    public BigDecimal getPrecision() {
3286      return this.precision == null ? null : this.precision.getValue();
3287    }
3288
3289    /**
3290     * @param value QUERY.TP / (QUERY.TP + QUERY.FP).
3291     */
3292    public MolecularSequenceQualityComponent setPrecision(BigDecimal value) {
3293      if (value == null)
3294        this.precision = null;
3295      else {
3296        if (this.precision == null)
3297          this.precision = new DecimalType();
3298        this.precision.setValue(value);
3299      }
3300      return this;
3301    }
3302
3303    /**
3304     * @param value QUERY.TP / (QUERY.TP + QUERY.FP).
3305     */
3306    public MolecularSequenceQualityComponent setPrecision(long value) {
3307      this.precision = new DecimalType();
3308      this.precision.setValue(value);
3309      return this;
3310    }
3311
3312    /**
3313     * @param value QUERY.TP / (QUERY.TP + QUERY.FP).
3314     */
3315    public MolecularSequenceQualityComponent setPrecision(double value) {
3316      this.precision = new DecimalType();
3317      this.precision.setValue(value);
3318      return this;
3319    }
3320
3321    /**
3322     * @return {@link #recall} (TRUTH.TP / (TRUTH.TP + TRUTH.FN).). This is the
3323     *         underlying object with id, value and extensions. The accessor
3324     *         "getRecall" gives direct access to the value
3325     */
3326    public DecimalType getRecallElement() {
3327      if (this.recall == null)
3328        if (Configuration.errorOnAutoCreate())
3329          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.recall");
3330        else if (Configuration.doAutoCreate())
3331          this.recall = new DecimalType(); // bb
3332      return this.recall;
3333    }
3334
3335    public boolean hasRecallElement() {
3336      return this.recall != null && !this.recall.isEmpty();
3337    }
3338
3339    public boolean hasRecall() {
3340      return this.recall != null && !this.recall.isEmpty();
3341    }
3342
3343    /**
3344     * @param value {@link #recall} (TRUTH.TP / (TRUTH.TP + TRUTH.FN).). This is the
3345     *              underlying object with id, value and extensions. The accessor
3346     *              "getRecall" gives direct access to the value
3347     */
3348    public MolecularSequenceQualityComponent setRecallElement(DecimalType value) {
3349      this.recall = value;
3350      return this;
3351    }
3352
3353    /**
3354     * @return TRUTH.TP / (TRUTH.TP + TRUTH.FN).
3355     */
3356    public BigDecimal getRecall() {
3357      return this.recall == null ? null : this.recall.getValue();
3358    }
3359
3360    /**
3361     * @param value TRUTH.TP / (TRUTH.TP + TRUTH.FN).
3362     */
3363    public MolecularSequenceQualityComponent setRecall(BigDecimal value) {
3364      if (value == null)
3365        this.recall = null;
3366      else {
3367        if (this.recall == null)
3368          this.recall = new DecimalType();
3369        this.recall.setValue(value);
3370      }
3371      return this;
3372    }
3373
3374    /**
3375     * @param value TRUTH.TP / (TRUTH.TP + TRUTH.FN).
3376     */
3377    public MolecularSequenceQualityComponent setRecall(long value) {
3378      this.recall = new DecimalType();
3379      this.recall.setValue(value);
3380      return this;
3381    }
3382
3383    /**
3384     * @param value TRUTH.TP / (TRUTH.TP + TRUTH.FN).
3385     */
3386    public MolecularSequenceQualityComponent setRecall(double value) {
3387      this.recall = new DecimalType();
3388      this.recall.setValue(value);
3389      return this;
3390    }
3391
3392    /**
3393     * @return {@link #fScore} (Harmonic mean of Recall and Precision, computed as:
3394     *         2 * precision * recall / (precision + recall).). This is the
3395     *         underlying object with id, value and extensions. The accessor
3396     *         "getFScore" gives direct access to the value
3397     */
3398    public DecimalType getFScoreElement() {
3399      if (this.fScore == null)
3400        if (Configuration.errorOnAutoCreate())
3401          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.fScore");
3402        else if (Configuration.doAutoCreate())
3403          this.fScore = new DecimalType(); // bb
3404      return this.fScore;
3405    }
3406
3407    public boolean hasFScoreElement() {
3408      return this.fScore != null && !this.fScore.isEmpty();
3409    }
3410
3411    public boolean hasFScore() {
3412      return this.fScore != null && !this.fScore.isEmpty();
3413    }
3414
3415    /**
3416     * @param value {@link #fScore} (Harmonic mean of Recall and Precision, computed
3417     *              as: 2 * precision * recall / (precision + recall).). This is the
3418     *              underlying object with id, value and extensions. The accessor
3419     *              "getFScore" gives direct access to the value
3420     */
3421    public MolecularSequenceQualityComponent setFScoreElement(DecimalType value) {
3422      this.fScore = value;
3423      return this;
3424    }
3425
3426    /**
3427     * @return Harmonic mean of Recall and Precision, computed as: 2 * precision *
3428     *         recall / (precision + recall).
3429     */
3430    public BigDecimal getFScore() {
3431      return this.fScore == null ? null : this.fScore.getValue();
3432    }
3433
3434    /**
3435     * @param value Harmonic mean of Recall and Precision, computed as: 2 *
3436     *              precision * recall / (precision + recall).
3437     */
3438    public MolecularSequenceQualityComponent setFScore(BigDecimal value) {
3439      if (value == null)
3440        this.fScore = null;
3441      else {
3442        if (this.fScore == null)
3443          this.fScore = new DecimalType();
3444        this.fScore.setValue(value);
3445      }
3446      return this;
3447    }
3448
3449    /**
3450     * @param value Harmonic mean of Recall and Precision, computed as: 2 *
3451     *              precision * recall / (precision + recall).
3452     */
3453    public MolecularSequenceQualityComponent setFScore(long value) {
3454      this.fScore = new DecimalType();
3455      this.fScore.setValue(value);
3456      return this;
3457    }
3458
3459    /**
3460     * @param value Harmonic mean of Recall and Precision, computed as: 2 *
3461     *              precision * recall / (precision + recall).
3462     */
3463    public MolecularSequenceQualityComponent setFScore(double value) {
3464      this.fScore = new DecimalType();
3465      this.fScore.setValue(value);
3466      return this;
3467    }
3468
3469    /**
3470     * @return {@link #roc} (Receiver Operator Characteristic (ROC) Curve to give
3471     *         sensitivity/specificity tradeoff.)
3472     */
3473    public MolecularSequenceQualityRocComponent getRoc() {
3474      if (this.roc == null)
3475        if (Configuration.errorOnAutoCreate())
3476          throw new Error("Attempt to auto-create MolecularSequenceQualityComponent.roc");
3477        else if (Configuration.doAutoCreate())
3478          this.roc = new MolecularSequenceQualityRocComponent(); // cc
3479      return this.roc;
3480    }
3481
3482    public boolean hasRoc() {
3483      return this.roc != null && !this.roc.isEmpty();
3484    }
3485
3486    /**
3487     * @param value {@link #roc} (Receiver Operator Characteristic (ROC) Curve to
3488     *              give sensitivity/specificity tradeoff.)
3489     */
3490    public MolecularSequenceQualityComponent setRoc(MolecularSequenceQualityRocComponent value) {
3491      this.roc = value;
3492      return this;
3493    }
3494
3495    protected void listChildren(List<Property> children) {
3496      super.listChildren(children);
3497      children.add(new Property("type", "code", "INDEL / SNP / Undefined variant.", 0, 1, type));
3498      children.add(new Property("standardSequence", "CodeableConcept",
3499          "Gold standard sequence used for comparing against.", 0, 1, standardSequence));
3500      children.add(new Property("start", "integer",
3501          "Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.",
3502          0, 1, start));
3503      children.add(new Property("end", "integer",
3504          "End position of the sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.",
3505          0, 1, end));
3506      children.add(new Property("score", "Quantity",
3507          "The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).",
3508          0, 1, score));
3509      children.add(
3510          new Property("method", "CodeableConcept", "Which method is used to get sequence quality.", 0, 1, method));
3511      children.add(new Property("truthTP", "decimal",
3512          "True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.",
3513          0, 1, truthTP));
3514      children.add(new Property("queryTP", "decimal",
3515          "True positives, from the perspective of the query data, i.e. the number of sites in the Query Call Set for which there are paths through the Truth Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.",
3516          0, 1, queryTP));
3517      children.add(new Property("truthFN", "decimal",
3518          "False negatives, i.e. the number of sites in the Truth Call Set for which there is no path through the Query Call Set that is consistent with all of the alleles at this site, or sites for which there is an inaccurate genotype call for the event. Sites with correct variant but incorrect genotype are counted here.",
3519          0, 1, truthFN));
3520      children.add(new Property("queryFP", "decimal",
3521          "False positives, i.e. the number of sites in the Query Call Set for which there is no path through the Truth Call Set that is consistent with this site. Sites with correct variant but incorrect genotype are counted here.",
3522          0, 1, queryFP));
3523      children.add(new Property("gtFP", "decimal",
3524          "The number of false positives where the non-REF alleles in the Truth and Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1 or similar).",
3525          0, 1, gtFP));
3526      children.add(new Property("precision", "decimal", "QUERY.TP / (QUERY.TP + QUERY.FP).", 0, 1, precision));
3527      children.add(new Property("recall", "decimal", "TRUTH.TP / (TRUTH.TP + TRUTH.FN).", 0, 1, recall));
3528      children.add(new Property("fScore", "decimal",
3529          "Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).", 0, 1,
3530          fScore));
3531      children.add(new Property("roc", "",
3532          "Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff.", 0, 1, roc));
3533    }
3534
3535    @Override
3536    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3537      switch (_hash) {
3538      case 3575610:
3539        /* type */ return new Property("type", "code", "INDEL / SNP / Undefined variant.", 0, 1, type);
3540      case -1861227106:
3541        /* standardSequence */ return new Property("standardSequence", "CodeableConcept",
3542            "Gold standard sequence used for comparing against.", 0, 1, standardSequence);
3543      case 109757538:
3544        /* start */ return new Property("start", "integer",
3545            "Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.",
3546            0, 1, start);
3547      case 100571:
3548        /* end */ return new Property("end", "integer",
3549            "End position of the sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.",
3550            0, 1, end);
3551      case 109264530:
3552        /* score */ return new Property("score", "Quantity",
3553            "The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).",
3554            0, 1, score);
3555      case -1077554975:
3556        /* method */ return new Property("method", "CodeableConcept", "Which method is used to get sequence quality.",
3557            0, 1, method);
3558      case -1048421849:
3559        /* truthTP */ return new Property("truthTP", "decimal",
3560            "True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.",
3561            0, 1, truthTP);
3562      case 655102276:
3563        /* queryTP */ return new Property("queryTP", "decimal",
3564            "True positives, from the perspective of the query data, i.e. the number of sites in the Query Call Set for which there are paths through the Truth Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.",
3565            0, 1, queryTP);
3566      case -1048422285:
3567        /* truthFN */ return new Property("truthFN", "decimal",
3568            "False negatives, i.e. the number of sites in the Truth Call Set for which there is no path through the Query Call Set that is consistent with all of the alleles at this site, or sites for which there is an inaccurate genotype call for the event. Sites with correct variant but incorrect genotype are counted here.",
3569            0, 1, truthFN);
3570      case 655101842:
3571        /* queryFP */ return new Property("queryFP", "decimal",
3572            "False positives, i.e. the number of sites in the Query Call Set for which there is no path through the Truth Call Set that is consistent with this site. Sites with correct variant but incorrect genotype are counted here.",
3573            0, 1, queryFP);
3574      case 3182199:
3575        /* gtFP */ return new Property("gtFP", "decimal",
3576            "The number of false positives where the non-REF alleles in the Truth and Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1 or similar).",
3577            0, 1, gtFP);
3578      case -1376177026:
3579        /* precision */ return new Property("precision", "decimal", "QUERY.TP / (QUERY.TP + QUERY.FP).", 0, 1,
3580            precision);
3581      case -934922479:
3582        /* recall */ return new Property("recall", "decimal", "TRUTH.TP / (TRUTH.TP + TRUTH.FN).", 0, 1, recall);
3583      case -1295082036:
3584        /* fScore */ return new Property("fScore", "decimal",
3585            "Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).", 0, 1,
3586            fScore);
3587      case 113094:
3588        /* roc */ return new Property("roc", "",
3589            "Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff.", 0, 1, roc);
3590      default:
3591        return super.getNamedProperty(_hash, _name, _checkValid);
3592      }
3593
3594    }
3595
3596    @Override
3597    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3598      switch (hash) {
3599      case 3575610:
3600        /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // Enumeration<QualityType>
3601      case -1861227106:
3602        /* standardSequence */ return this.standardSequence == null ? new Base[0]
3603            : new Base[] { this.standardSequence }; // CodeableConcept
3604      case 109757538:
3605        /* start */ return this.start == null ? new Base[0] : new Base[] { this.start }; // IntegerType
3606      case 100571:
3607        /* end */ return this.end == null ? new Base[0] : new Base[] { this.end }; // IntegerType
3608      case 109264530:
3609        /* score */ return this.score == null ? new Base[0] : new Base[] { this.score }; // Quantity
3610      case -1077554975:
3611        /* method */ return this.method == null ? new Base[0] : new Base[] { this.method }; // CodeableConcept
3612      case -1048421849:
3613        /* truthTP */ return this.truthTP == null ? new Base[0] : new Base[] { this.truthTP }; // DecimalType
3614      case 655102276:
3615        /* queryTP */ return this.queryTP == null ? new Base[0] : new Base[] { this.queryTP }; // DecimalType
3616      case -1048422285:
3617        /* truthFN */ return this.truthFN == null ? new Base[0] : new Base[] { this.truthFN }; // DecimalType
3618      case 655101842:
3619        /* queryFP */ return this.queryFP == null ? new Base[0] : new Base[] { this.queryFP }; // DecimalType
3620      case 3182199:
3621        /* gtFP */ return this.gtFP == null ? new Base[0] : new Base[] { this.gtFP }; // DecimalType
3622      case -1376177026:
3623        /* precision */ return this.precision == null ? new Base[0] : new Base[] { this.precision }; // DecimalType
3624      case -934922479:
3625        /* recall */ return this.recall == null ? new Base[0] : new Base[] { this.recall }; // DecimalType
3626      case -1295082036:
3627        /* fScore */ return this.fScore == null ? new Base[0] : new Base[] { this.fScore }; // DecimalType
3628      case 113094:
3629        /* roc */ return this.roc == null ? new Base[0] : new Base[] { this.roc }; // MolecularSequenceQualityRocComponent
3630      default:
3631        return super.getProperty(hash, name, checkValid);
3632      }
3633
3634    }
3635
3636    @Override
3637    public Base setProperty(int hash, String name, Base value) throws FHIRException {
3638      switch (hash) {
3639      case 3575610: // type
3640        value = new QualityTypeEnumFactory().fromType(castToCode(value));
3641        this.type = (Enumeration) value; // Enumeration<QualityType>
3642        return value;
3643      case -1861227106: // standardSequence
3644        this.standardSequence = castToCodeableConcept(value); // CodeableConcept
3645        return value;
3646      case 109757538: // start
3647        this.start = castToInteger(value); // IntegerType
3648        return value;
3649      case 100571: // end
3650        this.end = castToInteger(value); // IntegerType
3651        return value;
3652      case 109264530: // score
3653        this.score = castToQuantity(value); // Quantity
3654        return value;
3655      case -1077554975: // method
3656        this.method = castToCodeableConcept(value); // CodeableConcept
3657        return value;
3658      case -1048421849: // truthTP
3659        this.truthTP = castToDecimal(value); // DecimalType
3660        return value;
3661      case 655102276: // queryTP
3662        this.queryTP = castToDecimal(value); // DecimalType
3663        return value;
3664      case -1048422285: // truthFN
3665        this.truthFN = castToDecimal(value); // DecimalType
3666        return value;
3667      case 655101842: // queryFP
3668        this.queryFP = castToDecimal(value); // DecimalType
3669        return value;
3670      case 3182199: // gtFP
3671        this.gtFP = castToDecimal(value); // DecimalType
3672        return value;
3673      case -1376177026: // precision
3674        this.precision = castToDecimal(value); // DecimalType
3675        return value;
3676      case -934922479: // recall
3677        this.recall = castToDecimal(value); // DecimalType
3678        return value;
3679      case -1295082036: // fScore
3680        this.fScore = castToDecimal(value); // DecimalType
3681        return value;
3682      case 113094: // roc
3683        this.roc = (MolecularSequenceQualityRocComponent) value; // MolecularSequenceQualityRocComponent
3684        return value;
3685      default:
3686        return super.setProperty(hash, name, value);
3687      }
3688
3689    }
3690
3691    @Override
3692    public Base setProperty(String name, Base value) throws FHIRException {
3693      if (name.equals("type")) {
3694        value = new QualityTypeEnumFactory().fromType(castToCode(value));
3695        this.type = (Enumeration) value; // Enumeration<QualityType>
3696      } else if (name.equals("standardSequence")) {
3697        this.standardSequence = castToCodeableConcept(value); // CodeableConcept
3698      } else if (name.equals("start")) {
3699        this.start = castToInteger(value); // IntegerType
3700      } else if (name.equals("end")) {
3701        this.end = castToInteger(value); // IntegerType
3702      } else if (name.equals("score")) {
3703        this.score = castToQuantity(value); // Quantity
3704      } else if (name.equals("method")) {
3705        this.method = castToCodeableConcept(value); // CodeableConcept
3706      } else if (name.equals("truthTP")) {
3707        this.truthTP = castToDecimal(value); // DecimalType
3708      } else if (name.equals("queryTP")) {
3709        this.queryTP = castToDecimal(value); // DecimalType
3710      } else if (name.equals("truthFN")) {
3711        this.truthFN = castToDecimal(value); // DecimalType
3712      } else if (name.equals("queryFP")) {
3713        this.queryFP = castToDecimal(value); // DecimalType
3714      } else if (name.equals("gtFP")) {
3715        this.gtFP = castToDecimal(value); // DecimalType
3716      } else if (name.equals("precision")) {
3717        this.precision = castToDecimal(value); // DecimalType
3718      } else if (name.equals("recall")) {
3719        this.recall = castToDecimal(value); // DecimalType
3720      } else if (name.equals("fScore")) {
3721        this.fScore = castToDecimal(value); // DecimalType
3722      } else if (name.equals("roc")) {
3723        this.roc = (MolecularSequenceQualityRocComponent) value; // MolecularSequenceQualityRocComponent
3724      } else
3725        return super.setProperty(name, value);
3726      return value;
3727    }
3728
3729  @Override
3730  public void removeChild(String name, Base value) throws FHIRException {
3731      if (name.equals("type")) {
3732        this.type = null;
3733      } else if (name.equals("standardSequence")) {
3734        this.standardSequence = null;
3735      } else if (name.equals("start")) {
3736        this.start = null;
3737      } else if (name.equals("end")) {
3738        this.end = null;
3739      } else if (name.equals("score")) {
3740        this.score = null;
3741      } else if (name.equals("method")) {
3742        this.method = null;
3743      } else if (name.equals("truthTP")) {
3744        this.truthTP = null;
3745      } else if (name.equals("queryTP")) {
3746        this.queryTP = null;
3747      } else if (name.equals("truthFN")) {
3748        this.truthFN = null;
3749      } else if (name.equals("queryFP")) {
3750        this.queryFP = null;
3751      } else if (name.equals("gtFP")) {
3752        this.gtFP = null;
3753      } else if (name.equals("precision")) {
3754        this.precision = null;
3755      } else if (name.equals("recall")) {
3756        this.recall = null;
3757      } else if (name.equals("fScore")) {
3758        this.fScore = null;
3759      } else if (name.equals("roc")) {
3760        this.roc = (MolecularSequenceQualityRocComponent) value; // MolecularSequenceQualityRocComponent
3761      } else
3762        super.removeChild(name, value);
3763      
3764    }
3765
3766    @Override
3767    public Base makeProperty(int hash, String name) throws FHIRException {
3768      switch (hash) {
3769      case 3575610:
3770        return getTypeElement();
3771      case -1861227106:
3772        return getStandardSequence();
3773      case 109757538:
3774        return getStartElement();
3775      case 100571:
3776        return getEndElement();
3777      case 109264530:
3778        return getScore();
3779      case -1077554975:
3780        return getMethod();
3781      case -1048421849:
3782        return getTruthTPElement();
3783      case 655102276:
3784        return getQueryTPElement();
3785      case -1048422285:
3786        return getTruthFNElement();
3787      case 655101842:
3788        return getQueryFPElement();
3789      case 3182199:
3790        return getGtFPElement();
3791      case -1376177026:
3792        return getPrecisionElement();
3793      case -934922479:
3794        return getRecallElement();
3795      case -1295082036:
3796        return getFScoreElement();
3797      case 113094:
3798        return getRoc();
3799      default:
3800        return super.makeProperty(hash, name);
3801      }
3802
3803    }
3804
3805    @Override
3806    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3807      switch (hash) {
3808      case 3575610:
3809        /* type */ return new String[] { "code" };
3810      case -1861227106:
3811        /* standardSequence */ return new String[] { "CodeableConcept" };
3812      case 109757538:
3813        /* start */ return new String[] { "integer" };
3814      case 100571:
3815        /* end */ return new String[] { "integer" };
3816      case 109264530:
3817        /* score */ return new String[] { "Quantity" };
3818      case -1077554975:
3819        /* method */ return new String[] { "CodeableConcept" };
3820      case -1048421849:
3821        /* truthTP */ return new String[] { "decimal" };
3822      case 655102276:
3823        /* queryTP */ return new String[] { "decimal" };
3824      case -1048422285:
3825        /* truthFN */ return new String[] { "decimal" };
3826      case 655101842:
3827        /* queryFP */ return new String[] { "decimal" };
3828      case 3182199:
3829        /* gtFP */ return new String[] { "decimal" };
3830      case -1376177026:
3831        /* precision */ return new String[] { "decimal" };
3832      case -934922479:
3833        /* recall */ return new String[] { "decimal" };
3834      case -1295082036:
3835        /* fScore */ return new String[] { "decimal" };
3836      case 113094:
3837        /* roc */ return new String[] {};
3838      default:
3839        return super.getTypesForProperty(hash, name);
3840      }
3841
3842    }
3843
3844    @Override
3845    public Base addChild(String name) throws FHIRException {
3846      if (name.equals("type")) {
3847        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.type");
3848      } else if (name.equals("standardSequence")) {
3849        this.standardSequence = new CodeableConcept();
3850        return this.standardSequence;
3851      } else if (name.equals("start")) {
3852        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.start");
3853      } else if (name.equals("end")) {
3854        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.end");
3855      } else if (name.equals("score")) {
3856        this.score = new Quantity();
3857        return this.score;
3858      } else if (name.equals("method")) {
3859        this.method = new CodeableConcept();
3860        return this.method;
3861      } else if (name.equals("truthTP")) {
3862        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.truthTP");
3863      } else if (name.equals("queryTP")) {
3864        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.queryTP");
3865      } else if (name.equals("truthFN")) {
3866        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.truthFN");
3867      } else if (name.equals("queryFP")) {
3868        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.queryFP");
3869      } else if (name.equals("gtFP")) {
3870        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.gtFP");
3871      } else if (name.equals("precision")) {
3872        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.precision");
3873      } else if (name.equals("recall")) {
3874        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.recall");
3875      } else if (name.equals("fScore")) {
3876        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.fScore");
3877      } else if (name.equals("roc")) {
3878        this.roc = new MolecularSequenceQualityRocComponent();
3879        return this.roc;
3880      } else
3881        return super.addChild(name);
3882    }
3883
3884    public MolecularSequenceQualityComponent copy() {
3885      MolecularSequenceQualityComponent dst = new MolecularSequenceQualityComponent();
3886      copyValues(dst);
3887      return dst;
3888    }
3889
3890    public void copyValues(MolecularSequenceQualityComponent dst) {
3891      super.copyValues(dst);
3892      dst.type = type == null ? null : type.copy();
3893      dst.standardSequence = standardSequence == null ? null : standardSequence.copy();
3894      dst.start = start == null ? null : start.copy();
3895      dst.end = end == null ? null : end.copy();
3896      dst.score = score == null ? null : score.copy();
3897      dst.method = method == null ? null : method.copy();
3898      dst.truthTP = truthTP == null ? null : truthTP.copy();
3899      dst.queryTP = queryTP == null ? null : queryTP.copy();
3900      dst.truthFN = truthFN == null ? null : truthFN.copy();
3901      dst.queryFP = queryFP == null ? null : queryFP.copy();
3902      dst.gtFP = gtFP == null ? null : gtFP.copy();
3903      dst.precision = precision == null ? null : precision.copy();
3904      dst.recall = recall == null ? null : recall.copy();
3905      dst.fScore = fScore == null ? null : fScore.copy();
3906      dst.roc = roc == null ? null : roc.copy();
3907    }
3908
3909    @Override
3910    public boolean equalsDeep(Base other_) {
3911      if (!super.equalsDeep(other_))
3912        return false;
3913      if (!(other_ instanceof MolecularSequenceQualityComponent))
3914        return false;
3915      MolecularSequenceQualityComponent o = (MolecularSequenceQualityComponent) other_;
3916      return compareDeep(type, o.type, true) && compareDeep(standardSequence, o.standardSequence, true)
3917          && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(score, o.score, true)
3918          && compareDeep(method, o.method, true) && compareDeep(truthTP, o.truthTP, true)
3919          && compareDeep(queryTP, o.queryTP, true) && compareDeep(truthFN, o.truthFN, true)
3920          && compareDeep(queryFP, o.queryFP, true) && compareDeep(gtFP, o.gtFP, true)
3921          && compareDeep(precision, o.precision, true) && compareDeep(recall, o.recall, true)
3922          && compareDeep(fScore, o.fScore, true) && compareDeep(roc, o.roc, true);
3923    }
3924
3925    @Override
3926    public boolean equalsShallow(Base other_) {
3927      if (!super.equalsShallow(other_))
3928        return false;
3929      if (!(other_ instanceof MolecularSequenceQualityComponent))
3930        return false;
3931      MolecularSequenceQualityComponent o = (MolecularSequenceQualityComponent) other_;
3932      return compareValues(type, o.type, true) && compareValues(start, o.start, true) && compareValues(end, o.end, true)
3933          && compareValues(truthTP, o.truthTP, true) && compareValues(queryTP, o.queryTP, true)
3934          && compareValues(truthFN, o.truthFN, true) && compareValues(queryFP, o.queryFP, true)
3935          && compareValues(gtFP, o.gtFP, true) && compareValues(precision, o.precision, true)
3936          && compareValues(recall, o.recall, true) && compareValues(fScore, o.fScore, true);
3937    }
3938
3939    public boolean isEmpty() {
3940      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, standardSequence, start, end, score, method,
3941          truthTP, queryTP, truthFN, queryFP, gtFP, precision, recall, fScore, roc);
3942    }
3943
3944    public String fhirType() {
3945      return "MolecularSequence.quality";
3946
3947    }
3948
3949  }
3950
3951  @Block()
3952  public static class MolecularSequenceQualityRocComponent extends BackboneElement implements IBaseBackboneElement {
3953    /**
3954     * Invidual data point representing the GQ (genotype quality) score threshold.
3955     */
3956    @Child(name = "score", type = {
3957        IntegerType.class }, order = 1, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
3958    @Description(shortDefinition = "Genotype quality score", formalDefinition = "Invidual data point representing the GQ (genotype quality) score threshold.")
3959    protected List<IntegerType> score;
3960
3961    /**
3962     * The number of true positives if the GQ score threshold was set to "score"
3963     * field value.
3964     */
3965    @Child(name = "numTP", type = {
3966        IntegerType.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
3967    @Description(shortDefinition = "Roc score true positive numbers", formalDefinition = "The number of true positives if the GQ score threshold was set to \"score\" field value.")
3968    protected List<IntegerType> numTP;
3969
3970    /**
3971     * The number of false positives if the GQ score threshold was set to "score"
3972     * field value.
3973     */
3974    @Child(name = "numFP", type = {
3975        IntegerType.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
3976    @Description(shortDefinition = "Roc score false positive numbers", formalDefinition = "The number of false positives if the GQ score threshold was set to \"score\" field value.")
3977    protected List<IntegerType> numFP;
3978
3979    /**
3980     * The number of false negatives if the GQ score threshold was set to "score"
3981     * field value.
3982     */
3983    @Child(name = "numFN", type = {
3984        IntegerType.class }, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
3985    @Description(shortDefinition = "Roc score false negative numbers", formalDefinition = "The number of false negatives if the GQ score threshold was set to \"score\" field value.")
3986    protected List<IntegerType> numFN;
3987
3988    /**
3989     * Calculated precision if the GQ score threshold was set to "score" field
3990     * value.
3991     */
3992    @Child(name = "precision", type = {
3993        DecimalType.class }, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
3994    @Description(shortDefinition = "Precision of the GQ score", formalDefinition = "Calculated precision if the GQ score threshold was set to \"score\" field value.")
3995    protected List<DecimalType> precision;
3996
3997    /**
3998     * Calculated sensitivity if the GQ score threshold was set to "score" field
3999     * value.
4000     */
4001    @Child(name = "sensitivity", type = {
4002        DecimalType.class }, order = 6, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
4003    @Description(shortDefinition = "Sensitivity of the GQ score", formalDefinition = "Calculated sensitivity if the GQ score threshold was set to \"score\" field value.")
4004    protected List<DecimalType> sensitivity;
4005
4006    /**
4007     * Calculated fScore if the GQ score threshold was set to "score" field value.
4008     */
4009    @Child(name = "fMeasure", type = {
4010        DecimalType.class }, order = 7, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
4011    @Description(shortDefinition = "FScore of the GQ score", formalDefinition = "Calculated fScore if the GQ score threshold was set to \"score\" field value.")
4012    protected List<DecimalType> fMeasure;
4013
4014    private static final long serialVersionUID = 1923392132L;
4015
4016    /**
4017     * Constructor
4018     */
4019    public MolecularSequenceQualityRocComponent() {
4020      super();
4021    }
4022
4023    /**
4024     * @return {@link #score} (Invidual data point representing the GQ (genotype
4025     *         quality) score threshold.)
4026     */
4027    public List<IntegerType> getScore() {
4028      if (this.score == null)
4029        this.score = new ArrayList<IntegerType>();
4030      return this.score;
4031    }
4032
4033    /**
4034     * @return Returns a reference to <code>this</code> for easy method chaining
4035     */
4036    public MolecularSequenceQualityRocComponent setScore(List<IntegerType> theScore) {
4037      this.score = theScore;
4038      return this;
4039    }
4040
4041    public boolean hasScore() {
4042      if (this.score == null)
4043        return false;
4044      for (IntegerType item : this.score)
4045        if (!item.isEmpty())
4046          return true;
4047      return false;
4048    }
4049
4050    /**
4051     * @return {@link #score} (Invidual data point representing the GQ (genotype
4052     *         quality) score threshold.)
4053     */
4054    public IntegerType addScoreElement() {// 2
4055      IntegerType t = new IntegerType();
4056      if (this.score == null)
4057        this.score = new ArrayList<IntegerType>();
4058      this.score.add(t);
4059      return t;
4060    }
4061
4062    /**
4063     * @param value {@link #score} (Invidual data point representing the GQ
4064     *              (genotype quality) score threshold.)
4065     */
4066    public MolecularSequenceQualityRocComponent addScore(int value) { // 1
4067      IntegerType t = new IntegerType();
4068      t.setValue(value);
4069      if (this.score == null)
4070        this.score = new ArrayList<IntegerType>();
4071      this.score.add(t);
4072      return this;
4073    }
4074
4075    /**
4076     * @param value {@link #score} (Invidual data point representing the GQ
4077     *              (genotype quality) score threshold.)
4078     */
4079    public boolean hasScore(int value) {
4080      if (this.score == null)
4081        return false;
4082      for (IntegerType v : this.score)
4083        if (v.getValue().equals(value)) // integer
4084          return true;
4085      return false;
4086    }
4087
4088    /**
4089     * @return {@link #numTP} (The number of true positives if the GQ score
4090     *         threshold was set to "score" field value.)
4091     */
4092    public List<IntegerType> getNumTP() {
4093      if (this.numTP == null)
4094        this.numTP = new ArrayList<IntegerType>();
4095      return this.numTP;
4096    }
4097
4098    /**
4099     * @return Returns a reference to <code>this</code> for easy method chaining
4100     */
4101    public MolecularSequenceQualityRocComponent setNumTP(List<IntegerType> theNumTP) {
4102      this.numTP = theNumTP;
4103      return this;
4104    }
4105
4106    public boolean hasNumTP() {
4107      if (this.numTP == null)
4108        return false;
4109      for (IntegerType item : this.numTP)
4110        if (!item.isEmpty())
4111          return true;
4112      return false;
4113    }
4114
4115    /**
4116     * @return {@link #numTP} (The number of true positives if the GQ score
4117     *         threshold was set to "score" field value.)
4118     */
4119    public IntegerType addNumTPElement() {// 2
4120      IntegerType t = new IntegerType();
4121      if (this.numTP == null)
4122        this.numTP = new ArrayList<IntegerType>();
4123      this.numTP.add(t);
4124      return t;
4125    }
4126
4127    /**
4128     * @param value {@link #numTP} (The number of true positives if the GQ score
4129     *              threshold was set to "score" field value.)
4130     */
4131    public MolecularSequenceQualityRocComponent addNumTP(int value) { // 1
4132      IntegerType t = new IntegerType();
4133      t.setValue(value);
4134      if (this.numTP == null)
4135        this.numTP = new ArrayList<IntegerType>();
4136      this.numTP.add(t);
4137      return this;
4138    }
4139
4140    /**
4141     * @param value {@link #numTP} (The number of true positives if the GQ score
4142     *              threshold was set to "score" field value.)
4143     */
4144    public boolean hasNumTP(int value) {
4145      if (this.numTP == null)
4146        return false;
4147      for (IntegerType v : this.numTP)
4148        if (v.getValue().equals(value)) // integer
4149          return true;
4150      return false;
4151    }
4152
4153    /**
4154     * @return {@link #numFP} (The number of false positives if the GQ score
4155     *         threshold was set to "score" field value.)
4156     */
4157    public List<IntegerType> getNumFP() {
4158      if (this.numFP == null)
4159        this.numFP = new ArrayList<IntegerType>();
4160      return this.numFP;
4161    }
4162
4163    /**
4164     * @return Returns a reference to <code>this</code> for easy method chaining
4165     */
4166    public MolecularSequenceQualityRocComponent setNumFP(List<IntegerType> theNumFP) {
4167      this.numFP = theNumFP;
4168      return this;
4169    }
4170
4171    public boolean hasNumFP() {
4172      if (this.numFP == null)
4173        return false;
4174      for (IntegerType item : this.numFP)
4175        if (!item.isEmpty())
4176          return true;
4177      return false;
4178    }
4179
4180    /**
4181     * @return {@link #numFP} (The number of false positives if the GQ score
4182     *         threshold was set to "score" field value.)
4183     */
4184    public IntegerType addNumFPElement() {// 2
4185      IntegerType t = new IntegerType();
4186      if (this.numFP == null)
4187        this.numFP = new ArrayList<IntegerType>();
4188      this.numFP.add(t);
4189      return t;
4190    }
4191
4192    /**
4193     * @param value {@link #numFP} (The number of false positives if the GQ score
4194     *              threshold was set to "score" field value.)
4195     */
4196    public MolecularSequenceQualityRocComponent addNumFP(int value) { // 1
4197      IntegerType t = new IntegerType();
4198      t.setValue(value);
4199      if (this.numFP == null)
4200        this.numFP = new ArrayList<IntegerType>();
4201      this.numFP.add(t);
4202      return this;
4203    }
4204
4205    /**
4206     * @param value {@link #numFP} (The number of false positives if the GQ score
4207     *              threshold was set to "score" field value.)
4208     */
4209    public boolean hasNumFP(int value) {
4210      if (this.numFP == null)
4211        return false;
4212      for (IntegerType v : this.numFP)
4213        if (v.getValue().equals(value)) // integer
4214          return true;
4215      return false;
4216    }
4217
4218    /**
4219     * @return {@link #numFN} (The number of false negatives if the GQ score
4220     *         threshold was set to "score" field value.)
4221     */
4222    public List<IntegerType> getNumFN() {
4223      if (this.numFN == null)
4224        this.numFN = new ArrayList<IntegerType>();
4225      return this.numFN;
4226    }
4227
4228    /**
4229     * @return Returns a reference to <code>this</code> for easy method chaining
4230     */
4231    public MolecularSequenceQualityRocComponent setNumFN(List<IntegerType> theNumFN) {
4232      this.numFN = theNumFN;
4233      return this;
4234    }
4235
4236    public boolean hasNumFN() {
4237      if (this.numFN == null)
4238        return false;
4239      for (IntegerType item : this.numFN)
4240        if (!item.isEmpty())
4241          return true;
4242      return false;
4243    }
4244
4245    /**
4246     * @return {@link #numFN} (The number of false negatives if the GQ score
4247     *         threshold was set to "score" field value.)
4248     */
4249    public IntegerType addNumFNElement() {// 2
4250      IntegerType t = new IntegerType();
4251      if (this.numFN == null)
4252        this.numFN = new ArrayList<IntegerType>();
4253      this.numFN.add(t);
4254      return t;
4255    }
4256
4257    /**
4258     * @param value {@link #numFN} (The number of false negatives if the GQ score
4259     *              threshold was set to "score" field value.)
4260     */
4261    public MolecularSequenceQualityRocComponent addNumFN(int value) { // 1
4262      IntegerType t = new IntegerType();
4263      t.setValue(value);
4264      if (this.numFN == null)
4265        this.numFN = new ArrayList<IntegerType>();
4266      this.numFN.add(t);
4267      return this;
4268    }
4269
4270    /**
4271     * @param value {@link #numFN} (The number of false negatives if the GQ score
4272     *              threshold was set to "score" field value.)
4273     */
4274    public boolean hasNumFN(int value) {
4275      if (this.numFN == null)
4276        return false;
4277      for (IntegerType v : this.numFN)
4278        if (v.getValue().equals(value)) // integer
4279          return true;
4280      return false;
4281    }
4282
4283    /**
4284     * @return {@link #precision} (Calculated precision if the GQ score threshold
4285     *         was set to "score" field value.)
4286     */
4287    public List<DecimalType> getPrecision() {
4288      if (this.precision == null)
4289        this.precision = new ArrayList<DecimalType>();
4290      return this.precision;
4291    }
4292
4293    /**
4294     * @return Returns a reference to <code>this</code> for easy method chaining
4295     */
4296    public MolecularSequenceQualityRocComponent setPrecision(List<DecimalType> thePrecision) {
4297      this.precision = thePrecision;
4298      return this;
4299    }
4300
4301    public boolean hasPrecision() {
4302      if (this.precision == null)
4303        return false;
4304      for (DecimalType item : this.precision)
4305        if (!item.isEmpty())
4306          return true;
4307      return false;
4308    }
4309
4310    /**
4311     * @return {@link #precision} (Calculated precision if the GQ score threshold
4312     *         was set to "score" field value.)
4313     */
4314    public DecimalType addPrecisionElement() {// 2
4315      DecimalType t = new DecimalType();
4316      if (this.precision == null)
4317        this.precision = new ArrayList<DecimalType>();
4318      this.precision.add(t);
4319      return t;
4320    }
4321
4322    /**
4323     * @param value {@link #precision} (Calculated precision if the GQ score
4324     *              threshold was set to "score" field value.)
4325     */
4326    public MolecularSequenceQualityRocComponent addPrecision(BigDecimal value) { // 1
4327      DecimalType t = new DecimalType();
4328      t.setValue(value);
4329      if (this.precision == null)
4330        this.precision = new ArrayList<DecimalType>();
4331      this.precision.add(t);
4332      return this;
4333    }
4334
4335    /**
4336     * @param value {@link #precision} (Calculated precision if the GQ score
4337     *              threshold was set to "score" field value.)
4338     */
4339    public boolean hasPrecision(BigDecimal value) {
4340      if (this.precision == null)
4341        return false;
4342      for (DecimalType v : this.precision)
4343        if (v.getValue().equals(value)) // decimal
4344          return true;
4345      return false;
4346    }
4347
4348    /**
4349     * @return {@link #sensitivity} (Calculated sensitivity if the GQ score
4350     *         threshold was set to "score" field value.)
4351     */
4352    public List<DecimalType> getSensitivity() {
4353      if (this.sensitivity == null)
4354        this.sensitivity = new ArrayList<DecimalType>();
4355      return this.sensitivity;
4356    }
4357
4358    /**
4359     * @return Returns a reference to <code>this</code> for easy method chaining
4360     */
4361    public MolecularSequenceQualityRocComponent setSensitivity(List<DecimalType> theSensitivity) {
4362      this.sensitivity = theSensitivity;
4363      return this;
4364    }
4365
4366    public boolean hasSensitivity() {
4367      if (this.sensitivity == null)
4368        return false;
4369      for (DecimalType item : this.sensitivity)
4370        if (!item.isEmpty())
4371          return true;
4372      return false;
4373    }
4374
4375    /**
4376     * @return {@link #sensitivity} (Calculated sensitivity if the GQ score
4377     *         threshold was set to "score" field value.)
4378     */
4379    public DecimalType addSensitivityElement() {// 2
4380      DecimalType t = new DecimalType();
4381      if (this.sensitivity == null)
4382        this.sensitivity = new ArrayList<DecimalType>();
4383      this.sensitivity.add(t);
4384      return t;
4385    }
4386
4387    /**
4388     * @param value {@link #sensitivity} (Calculated sensitivity if the GQ score
4389     *              threshold was set to "score" field value.)
4390     */
4391    public MolecularSequenceQualityRocComponent addSensitivity(BigDecimal value) { // 1
4392      DecimalType t = new DecimalType();
4393      t.setValue(value);
4394      if (this.sensitivity == null)
4395        this.sensitivity = new ArrayList<DecimalType>();
4396      this.sensitivity.add(t);
4397      return this;
4398    }
4399
4400    /**
4401     * @param value {@link #sensitivity} (Calculated sensitivity if the GQ score
4402     *              threshold was set to "score" field value.)
4403     */
4404    public boolean hasSensitivity(BigDecimal value) {
4405      if (this.sensitivity == null)
4406        return false;
4407      for (DecimalType v : this.sensitivity)
4408        if (v.getValue().equals(value)) // decimal
4409          return true;
4410      return false;
4411    }
4412
4413    /**
4414     * @return {@link #fMeasure} (Calculated fScore if the GQ score threshold was
4415     *         set to "score" field value.)
4416     */
4417    public List<DecimalType> getFMeasure() {
4418      if (this.fMeasure == null)
4419        this.fMeasure = new ArrayList<DecimalType>();
4420      return this.fMeasure;
4421    }
4422
4423    /**
4424     * @return Returns a reference to <code>this</code> for easy method chaining
4425     */
4426    public MolecularSequenceQualityRocComponent setFMeasure(List<DecimalType> theFMeasure) {
4427      this.fMeasure = theFMeasure;
4428      return this;
4429    }
4430
4431    public boolean hasFMeasure() {
4432      if (this.fMeasure == null)
4433        return false;
4434      for (DecimalType item : this.fMeasure)
4435        if (!item.isEmpty())
4436          return true;
4437      return false;
4438    }
4439
4440    /**
4441     * @return {@link #fMeasure} (Calculated fScore if the GQ score threshold was
4442     *         set to "score" field value.)
4443     */
4444    public DecimalType addFMeasureElement() {// 2
4445      DecimalType t = new DecimalType();
4446      if (this.fMeasure == null)
4447        this.fMeasure = new ArrayList<DecimalType>();
4448      this.fMeasure.add(t);
4449      return t;
4450    }
4451
4452    /**
4453     * @param value {@link #fMeasure} (Calculated fScore if the GQ score threshold
4454     *              was set to "score" field value.)
4455     */
4456    public MolecularSequenceQualityRocComponent addFMeasure(BigDecimal value) { // 1
4457      DecimalType t = new DecimalType();
4458      t.setValue(value);
4459      if (this.fMeasure == null)
4460        this.fMeasure = new ArrayList<DecimalType>();
4461      this.fMeasure.add(t);
4462      return this;
4463    }
4464
4465    /**
4466     * @param value {@link #fMeasure} (Calculated fScore if the GQ score threshold
4467     *              was set to "score" field value.)
4468     */
4469    public boolean hasFMeasure(BigDecimal value) {
4470      if (this.fMeasure == null)
4471        return false;
4472      for (DecimalType v : this.fMeasure)
4473        if (v.getValue().equals(value)) // decimal
4474          return true;
4475      return false;
4476    }
4477
4478    protected void listChildren(List<Property> children) {
4479      super.listChildren(children);
4480      children.add(new Property("score", "integer",
4481          "Invidual data point representing the GQ (genotype quality) score threshold.", 0, java.lang.Integer.MAX_VALUE,
4482          score));
4483      children.add(new Property("numTP", "integer",
4484          "The number of true positives if the GQ score threshold was set to \"score\" field value.", 0,
4485          java.lang.Integer.MAX_VALUE, numTP));
4486      children.add(new Property("numFP", "integer",
4487          "The number of false positives if the GQ score threshold was set to \"score\" field value.", 0,
4488          java.lang.Integer.MAX_VALUE, numFP));
4489      children.add(new Property("numFN", "integer",
4490          "The number of false negatives if the GQ score threshold was set to \"score\" field value.", 0,
4491          java.lang.Integer.MAX_VALUE, numFN));
4492      children.add(new Property("precision", "decimal",
4493          "Calculated precision if the GQ score threshold was set to \"score\" field value.", 0,
4494          java.lang.Integer.MAX_VALUE, precision));
4495      children.add(new Property("sensitivity", "decimal",
4496          "Calculated sensitivity if the GQ score threshold was set to \"score\" field value.", 0,
4497          java.lang.Integer.MAX_VALUE, sensitivity));
4498      children.add(new Property("fMeasure", "decimal",
4499          "Calculated fScore if the GQ score threshold was set to \"score\" field value.", 0,
4500          java.lang.Integer.MAX_VALUE, fMeasure));
4501    }
4502
4503    @Override
4504    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4505      switch (_hash) {
4506      case 109264530:
4507        /* score */ return new Property("score", "integer",
4508            "Invidual data point representing the GQ (genotype quality) score threshold.", 0,
4509            java.lang.Integer.MAX_VALUE, score);
4510      case 105180290:
4511        /* numTP */ return new Property("numTP", "integer",
4512            "The number of true positives if the GQ score threshold was set to \"score\" field value.", 0,
4513            java.lang.Integer.MAX_VALUE, numTP);
4514      case 105179856:
4515        /* numFP */ return new Property("numFP", "integer",
4516            "The number of false positives if the GQ score threshold was set to \"score\" field value.", 0,
4517            java.lang.Integer.MAX_VALUE, numFP);
4518      case 105179854:
4519        /* numFN */ return new Property("numFN", "integer",
4520            "The number of false negatives if the GQ score threshold was set to \"score\" field value.", 0,
4521            java.lang.Integer.MAX_VALUE, numFN);
4522      case -1376177026:
4523        /* precision */ return new Property("precision", "decimal",
4524            "Calculated precision if the GQ score threshold was set to \"score\" field value.", 0,
4525            java.lang.Integer.MAX_VALUE, precision);
4526      case 564403871:
4527        /* sensitivity */ return new Property("sensitivity", "decimal",
4528            "Calculated sensitivity if the GQ score threshold was set to \"score\" field value.", 0,
4529            java.lang.Integer.MAX_VALUE, sensitivity);
4530      case -18997736:
4531        /* fMeasure */ return new Property("fMeasure", "decimal",
4532            "Calculated fScore if the GQ score threshold was set to \"score\" field value.", 0,
4533            java.lang.Integer.MAX_VALUE, fMeasure);
4534      default:
4535        return super.getNamedProperty(_hash, _name, _checkValid);
4536      }
4537
4538    }
4539
4540    @Override
4541    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4542      switch (hash) {
4543      case 109264530:
4544        /* score */ return this.score == null ? new Base[0] : this.score.toArray(new Base[this.score.size()]); // IntegerType
4545      case 105180290:
4546        /* numTP */ return this.numTP == null ? new Base[0] : this.numTP.toArray(new Base[this.numTP.size()]); // IntegerType
4547      case 105179856:
4548        /* numFP */ return this.numFP == null ? new Base[0] : this.numFP.toArray(new Base[this.numFP.size()]); // IntegerType
4549      case 105179854:
4550        /* numFN */ return this.numFN == null ? new Base[0] : this.numFN.toArray(new Base[this.numFN.size()]); // IntegerType
4551      case -1376177026:
4552        /* precision */ return this.precision == null ? new Base[0]
4553            : this.precision.toArray(new Base[this.precision.size()]); // DecimalType
4554      case 564403871:
4555        /* sensitivity */ return this.sensitivity == null ? new Base[0]
4556            : this.sensitivity.toArray(new Base[this.sensitivity.size()]); // DecimalType
4557      case -18997736:
4558        /* fMeasure */ return this.fMeasure == null ? new Base[0]
4559            : this.fMeasure.toArray(new Base[this.fMeasure.size()]); // DecimalType
4560      default:
4561        return super.getProperty(hash, name, checkValid);
4562      }
4563
4564    }
4565
4566    @Override
4567    public Base setProperty(int hash, String name, Base value) throws FHIRException {
4568      switch (hash) {
4569      case 109264530: // score
4570        this.getScore().add(castToInteger(value)); // IntegerType
4571        return value;
4572      case 105180290: // numTP
4573        this.getNumTP().add(castToInteger(value)); // IntegerType
4574        return value;
4575      case 105179856: // numFP
4576        this.getNumFP().add(castToInteger(value)); // IntegerType
4577        return value;
4578      case 105179854: // numFN
4579        this.getNumFN().add(castToInteger(value)); // IntegerType
4580        return value;
4581      case -1376177026: // precision
4582        this.getPrecision().add(castToDecimal(value)); // DecimalType
4583        return value;
4584      case 564403871: // sensitivity
4585        this.getSensitivity().add(castToDecimal(value)); // DecimalType
4586        return value;
4587      case -18997736: // fMeasure
4588        this.getFMeasure().add(castToDecimal(value)); // DecimalType
4589        return value;
4590      default:
4591        return super.setProperty(hash, name, value);
4592      }
4593
4594    }
4595
4596    @Override
4597    public Base setProperty(String name, Base value) throws FHIRException {
4598      if (name.equals("score")) {
4599        this.getScore().add(castToInteger(value));
4600      } else if (name.equals("numTP")) {
4601        this.getNumTP().add(castToInteger(value));
4602      } else if (name.equals("numFP")) {
4603        this.getNumFP().add(castToInteger(value));
4604      } else if (name.equals("numFN")) {
4605        this.getNumFN().add(castToInteger(value));
4606      } else if (name.equals("precision")) {
4607        this.getPrecision().add(castToDecimal(value));
4608      } else if (name.equals("sensitivity")) {
4609        this.getSensitivity().add(castToDecimal(value));
4610      } else if (name.equals("fMeasure")) {
4611        this.getFMeasure().add(castToDecimal(value));
4612      } else
4613        return super.setProperty(name, value);
4614      return value;
4615    }
4616
4617  @Override
4618  public void removeChild(String name, Base value) throws FHIRException {
4619      if (name.equals("score")) {
4620        this.getScore().remove(castToInteger(value));
4621      } else if (name.equals("numTP")) {
4622        this.getNumTP().remove(castToInteger(value));
4623      } else if (name.equals("numFP")) {
4624        this.getNumFP().remove(castToInteger(value));
4625      } else if (name.equals("numFN")) {
4626        this.getNumFN().remove(castToInteger(value));
4627      } else if (name.equals("precision")) {
4628        this.getPrecision().remove(castToDecimal(value));
4629      } else if (name.equals("sensitivity")) {
4630        this.getSensitivity().remove(castToDecimal(value));
4631      } else if (name.equals("fMeasure")) {
4632        this.getFMeasure().remove(castToDecimal(value));
4633      } else
4634        super.removeChild(name, value);
4635      
4636    }
4637
4638    @Override
4639    public Base makeProperty(int hash, String name) throws FHIRException {
4640      switch (hash) {
4641      case 109264530:
4642        return addScoreElement();
4643      case 105180290:
4644        return addNumTPElement();
4645      case 105179856:
4646        return addNumFPElement();
4647      case 105179854:
4648        return addNumFNElement();
4649      case -1376177026:
4650        return addPrecisionElement();
4651      case 564403871:
4652        return addSensitivityElement();
4653      case -18997736:
4654        return addFMeasureElement();
4655      default:
4656        return super.makeProperty(hash, name);
4657      }
4658
4659    }
4660
4661    @Override
4662    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4663      switch (hash) {
4664      case 109264530:
4665        /* score */ return new String[] { "integer" };
4666      case 105180290:
4667        /* numTP */ return new String[] { "integer" };
4668      case 105179856:
4669        /* numFP */ return new String[] { "integer" };
4670      case 105179854:
4671        /* numFN */ return new String[] { "integer" };
4672      case -1376177026:
4673        /* precision */ return new String[] { "decimal" };
4674      case 564403871:
4675        /* sensitivity */ return new String[] { "decimal" };
4676      case -18997736:
4677        /* fMeasure */ return new String[] { "decimal" };
4678      default:
4679        return super.getTypesForProperty(hash, name);
4680      }
4681
4682    }
4683
4684    @Override
4685    public Base addChild(String name) throws FHIRException {
4686      if (name.equals("score")) {
4687        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.score");
4688      } else if (name.equals("numTP")) {
4689        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.numTP");
4690      } else if (name.equals("numFP")) {
4691        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.numFP");
4692      } else if (name.equals("numFN")) {
4693        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.numFN");
4694      } else if (name.equals("precision")) {
4695        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.precision");
4696      } else if (name.equals("sensitivity")) {
4697        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.sensitivity");
4698      } else if (name.equals("fMeasure")) {
4699        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.fMeasure");
4700      } else
4701        return super.addChild(name);
4702    }
4703
4704    public MolecularSequenceQualityRocComponent copy() {
4705      MolecularSequenceQualityRocComponent dst = new MolecularSequenceQualityRocComponent();
4706      copyValues(dst);
4707      return dst;
4708    }
4709
4710    public void copyValues(MolecularSequenceQualityRocComponent dst) {
4711      super.copyValues(dst);
4712      if (score != null) {
4713        dst.score = new ArrayList<IntegerType>();
4714        for (IntegerType i : score)
4715          dst.score.add(i.copy());
4716      }
4717      ;
4718      if (numTP != null) {
4719        dst.numTP = new ArrayList<IntegerType>();
4720        for (IntegerType i : numTP)
4721          dst.numTP.add(i.copy());
4722      }
4723      ;
4724      if (numFP != null) {
4725        dst.numFP = new ArrayList<IntegerType>();
4726        for (IntegerType i : numFP)
4727          dst.numFP.add(i.copy());
4728      }
4729      ;
4730      if (numFN != null) {
4731        dst.numFN = new ArrayList<IntegerType>();
4732        for (IntegerType i : numFN)
4733          dst.numFN.add(i.copy());
4734      }
4735      ;
4736      if (precision != null) {
4737        dst.precision = new ArrayList<DecimalType>();
4738        for (DecimalType i : precision)
4739          dst.precision.add(i.copy());
4740      }
4741      ;
4742      if (sensitivity != null) {
4743        dst.sensitivity = new ArrayList<DecimalType>();
4744        for (DecimalType i : sensitivity)
4745          dst.sensitivity.add(i.copy());
4746      }
4747      ;
4748      if (fMeasure != null) {
4749        dst.fMeasure = new ArrayList<DecimalType>();
4750        for (DecimalType i : fMeasure)
4751          dst.fMeasure.add(i.copy());
4752      }
4753      ;
4754    }
4755
4756    @Override
4757    public boolean equalsDeep(Base other_) {
4758      if (!super.equalsDeep(other_))
4759        return false;
4760      if (!(other_ instanceof MolecularSequenceQualityRocComponent))
4761        return false;
4762      MolecularSequenceQualityRocComponent o = (MolecularSequenceQualityRocComponent) other_;
4763      return compareDeep(score, o.score, true) && compareDeep(numTP, o.numTP, true) && compareDeep(numFP, o.numFP, true)
4764          && compareDeep(numFN, o.numFN, true) && compareDeep(precision, o.precision, true)
4765          && compareDeep(sensitivity, o.sensitivity, true) && compareDeep(fMeasure, o.fMeasure, true);
4766    }
4767
4768    @Override
4769    public boolean equalsShallow(Base other_) {
4770      if (!super.equalsShallow(other_))
4771        return false;
4772      if (!(other_ instanceof MolecularSequenceQualityRocComponent))
4773        return false;
4774      MolecularSequenceQualityRocComponent o = (MolecularSequenceQualityRocComponent) other_;
4775      return compareValues(score, o.score, true) && compareValues(numTP, o.numTP, true)
4776          && compareValues(numFP, o.numFP, true) && compareValues(numFN, o.numFN, true)
4777          && compareValues(precision, o.precision, true) && compareValues(sensitivity, o.sensitivity, true)
4778          && compareValues(fMeasure, o.fMeasure, true);
4779    }
4780
4781    public boolean isEmpty() {
4782      return super.isEmpty()
4783          && ca.uhn.fhir.util.ElementUtil.isEmpty(score, numTP, numFP, numFN, precision, sensitivity, fMeasure);
4784    }
4785
4786    public String fhirType() {
4787      return "MolecularSequence.quality.roc";
4788
4789    }
4790
4791  }
4792
4793  @Block()
4794  public static class MolecularSequenceRepositoryComponent extends BackboneElement implements IBaseBackboneElement {
4795    /**
4796     * Click and see / RESTful API / Need login to see / RESTful API with
4797     * authentication / Other ways to see resource.
4798     */
4799    @Child(name = "type", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
4800    @Description(shortDefinition = "directlink | openapi | login | oauth | other", formalDefinition = "Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.")
4801    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/repository-type")
4802    protected Enumeration<RepositoryType> type;
4803
4804    /**
4805     * URI of an external repository which contains further details about the
4806     * genetics data.
4807     */
4808    @Child(name = "url", type = { UriType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
4809    @Description(shortDefinition = "URI of the repository", formalDefinition = "URI of an external repository which contains further details about the genetics data.")
4810    protected UriType url;
4811
4812    /**
4813     * URI of an external repository which contains further details about the
4814     * genetics data.
4815     */
4816    @Child(name = "name", type = { StringType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
4817    @Description(shortDefinition = "Repository's name", formalDefinition = "URI of an external repository which contains further details about the genetics data.")
4818    protected StringType name;
4819
4820    /**
4821     * Id of the variant in this external repository. The server will understand how
4822     * to use this id to call for more info about datasets in external repository.
4823     */
4824    @Child(name = "datasetId", type = {
4825        StringType.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
4826    @Description(shortDefinition = "Id of the dataset that used to call for dataset in repository", formalDefinition = "Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository.")
4827    protected StringType datasetId;
4828
4829    /**
4830     * Id of the variantset in this external repository. The server will understand
4831     * how to use this id to call for more info about variantsets in external
4832     * repository.
4833     */
4834    @Child(name = "variantsetId", type = {
4835        StringType.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
4836    @Description(shortDefinition = "Id of the variantset that used to call for variantset in repository", formalDefinition = "Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository.")
4837    protected StringType variantsetId;
4838
4839    /**
4840     * Id of the read in this external repository.
4841     */
4842    @Child(name = "readsetId", type = {
4843        StringType.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
4844    @Description(shortDefinition = "Id of the read", formalDefinition = "Id of the read in this external repository.")
4845    protected StringType readsetId;
4846
4847    private static final long serialVersionUID = -899243265L;
4848
4849    /**
4850     * Constructor
4851     */
4852    public MolecularSequenceRepositoryComponent() {
4853      super();
4854    }
4855
4856    /**
4857     * Constructor
4858     */
4859    public MolecularSequenceRepositoryComponent(Enumeration<RepositoryType> type) {
4860      super();
4861      this.type = type;
4862    }
4863
4864    /**
4865     * @return {@link #type} (Click and see / RESTful API / Need login to see /
4866     *         RESTful API with authentication / Other ways to see resource.). This
4867     *         is the underlying object with id, value and extensions. The accessor
4868     *         "getType" gives direct access to the value
4869     */
4870    public Enumeration<RepositoryType> getTypeElement() {
4871      if (this.type == null)
4872        if (Configuration.errorOnAutoCreate())
4873          throw new Error("Attempt to auto-create MolecularSequenceRepositoryComponent.type");
4874        else if (Configuration.doAutoCreate())
4875          this.type = new Enumeration<RepositoryType>(new RepositoryTypeEnumFactory()); // bb
4876      return this.type;
4877    }
4878
4879    public boolean hasTypeElement() {
4880      return this.type != null && !this.type.isEmpty();
4881    }
4882
4883    public boolean hasType() {
4884      return this.type != null && !this.type.isEmpty();
4885    }
4886
4887    /**
4888     * @param value {@link #type} (Click and see / RESTful API / Need login to see /
4889     *              RESTful API with authentication / Other ways to see resource.).
4890     *              This is the underlying object with id, value and extensions. The
4891     *              accessor "getType" gives direct access to the value
4892     */
4893    public MolecularSequenceRepositoryComponent setTypeElement(Enumeration<RepositoryType> value) {
4894      this.type = value;
4895      return this;
4896    }
4897
4898    /**
4899     * @return Click and see / RESTful API / Need login to see / RESTful API with
4900     *         authentication / Other ways to see resource.
4901     */
4902    public RepositoryType getType() {
4903      return this.type == null ? null : this.type.getValue();
4904    }
4905
4906    /**
4907     * @param value Click and see / RESTful API / Need login to see / RESTful API
4908     *              with authentication / Other ways to see resource.
4909     */
4910    public MolecularSequenceRepositoryComponent setType(RepositoryType value) {
4911      if (this.type == null)
4912        this.type = new Enumeration<RepositoryType>(new RepositoryTypeEnumFactory());
4913      this.type.setValue(value);
4914      return this;
4915    }
4916
4917    /**
4918     * @return {@link #url} (URI of an external repository which contains further
4919     *         details about the genetics data.). This is the underlying object with
4920     *         id, value and extensions. The accessor "getUrl" gives direct access
4921     *         to the value
4922     */
4923    public UriType getUrlElement() {
4924      if (this.url == null)
4925        if (Configuration.errorOnAutoCreate())
4926          throw new Error("Attempt to auto-create MolecularSequenceRepositoryComponent.url");
4927        else if (Configuration.doAutoCreate())
4928          this.url = new UriType(); // bb
4929      return this.url;
4930    }
4931
4932    public boolean hasUrlElement() {
4933      return this.url != null && !this.url.isEmpty();
4934    }
4935
4936    public boolean hasUrl() {
4937      return this.url != null && !this.url.isEmpty();
4938    }
4939
4940    /**
4941     * @param value {@link #url} (URI of an external repository which contains
4942     *              further details about the genetics data.). This is the
4943     *              underlying object with id, value and extensions. The accessor
4944     *              "getUrl" gives direct access to the value
4945     */
4946    public MolecularSequenceRepositoryComponent setUrlElement(UriType value) {
4947      this.url = value;
4948      return this;
4949    }
4950
4951    /**
4952     * @return URI of an external repository which contains further details about
4953     *         the genetics data.
4954     */
4955    public String getUrl() {
4956      return this.url == null ? null : this.url.getValue();
4957    }
4958
4959    /**
4960     * @param value URI of an external repository which contains further details
4961     *              about the genetics data.
4962     */
4963    public MolecularSequenceRepositoryComponent setUrl(String value) {
4964      if (Utilities.noString(value))
4965        this.url = null;
4966      else {
4967        if (this.url == null)
4968          this.url = new UriType();
4969        this.url.setValue(value);
4970      }
4971      return this;
4972    }
4973
4974    /**
4975     * @return {@link #name} (URI of an external repository which contains further
4976     *         details about the genetics data.). This is the underlying object with
4977     *         id, value and extensions. The accessor "getName" gives direct access
4978     *         to the value
4979     */
4980    public StringType getNameElement() {
4981      if (this.name == null)
4982        if (Configuration.errorOnAutoCreate())
4983          throw new Error("Attempt to auto-create MolecularSequenceRepositoryComponent.name");
4984        else if (Configuration.doAutoCreate())
4985          this.name = new StringType(); // bb
4986      return this.name;
4987    }
4988
4989    public boolean hasNameElement() {
4990      return this.name != null && !this.name.isEmpty();
4991    }
4992
4993    public boolean hasName() {
4994      return this.name != null && !this.name.isEmpty();
4995    }
4996
4997    /**
4998     * @param value {@link #name} (URI of an external repository which contains
4999     *              further details about the genetics data.). This is the
5000     *              underlying object with id, value and extensions. The accessor
5001     *              "getName" gives direct access to the value
5002     */
5003    public MolecularSequenceRepositoryComponent setNameElement(StringType value) {
5004      this.name = value;
5005      return this;
5006    }
5007
5008    /**
5009     * @return URI of an external repository which contains further details about
5010     *         the genetics data.
5011     */
5012    public String getName() {
5013      return this.name == null ? null : this.name.getValue();
5014    }
5015
5016    /**
5017     * @param value URI of an external repository which contains further details
5018     *              about the genetics data.
5019     */
5020    public MolecularSequenceRepositoryComponent setName(String value) {
5021      if (Utilities.noString(value))
5022        this.name = null;
5023      else {
5024        if (this.name == null)
5025          this.name = new StringType();
5026        this.name.setValue(value);
5027      }
5028      return this;
5029    }
5030
5031    /**
5032     * @return {@link #datasetId} (Id of the variant in this external repository.
5033     *         The server will understand how to use this id to call for more info
5034     *         about datasets in external repository.). This is the underlying
5035     *         object with id, value and extensions. The accessor "getDatasetId"
5036     *         gives direct access to the value
5037     */
5038    public StringType getDatasetIdElement() {
5039      if (this.datasetId == null)
5040        if (Configuration.errorOnAutoCreate())
5041          throw new Error("Attempt to auto-create MolecularSequenceRepositoryComponent.datasetId");
5042        else if (Configuration.doAutoCreate())
5043          this.datasetId = new StringType(); // bb
5044      return this.datasetId;
5045    }
5046
5047    public boolean hasDatasetIdElement() {
5048      return this.datasetId != null && !this.datasetId.isEmpty();
5049    }
5050
5051    public boolean hasDatasetId() {
5052      return this.datasetId != null && !this.datasetId.isEmpty();
5053    }
5054
5055    /**
5056     * @param value {@link #datasetId} (Id of the variant in this external
5057     *              repository. The server will understand how to use this id to
5058     *              call for more info about datasets in external repository.). This
5059     *              is the underlying object with id, value and extensions. The
5060     *              accessor "getDatasetId" gives direct access to the value
5061     */
5062    public MolecularSequenceRepositoryComponent setDatasetIdElement(StringType value) {
5063      this.datasetId = value;
5064      return this;
5065    }
5066
5067    /**
5068     * @return Id of the variant in this external repository. The server will
5069     *         understand how to use this id to call for more info about datasets in
5070     *         external repository.
5071     */
5072    public String getDatasetId() {
5073      return this.datasetId == null ? null : this.datasetId.getValue();
5074    }
5075
5076    /**
5077     * @param value Id of the variant in this external repository. The server will
5078     *              understand how to use this id to call for more info about
5079     *              datasets in external repository.
5080     */
5081    public MolecularSequenceRepositoryComponent setDatasetId(String value) {
5082      if (Utilities.noString(value))
5083        this.datasetId = null;
5084      else {
5085        if (this.datasetId == null)
5086          this.datasetId = new StringType();
5087        this.datasetId.setValue(value);
5088      }
5089      return this;
5090    }
5091
5092    /**
5093     * @return {@link #variantsetId} (Id of the variantset in this external
5094     *         repository. The server will understand how to use this id to call for
5095     *         more info about variantsets in external repository.). This is the
5096     *         underlying object with id, value and extensions. The accessor
5097     *         "getVariantsetId" gives direct access to the value
5098     */
5099    public StringType getVariantsetIdElement() {
5100      if (this.variantsetId == null)
5101        if (Configuration.errorOnAutoCreate())
5102          throw new Error("Attempt to auto-create MolecularSequenceRepositoryComponent.variantsetId");
5103        else if (Configuration.doAutoCreate())
5104          this.variantsetId = new StringType(); // bb
5105      return this.variantsetId;
5106    }
5107
5108    public boolean hasVariantsetIdElement() {
5109      return this.variantsetId != null && !this.variantsetId.isEmpty();
5110    }
5111
5112    public boolean hasVariantsetId() {
5113      return this.variantsetId != null && !this.variantsetId.isEmpty();
5114    }
5115
5116    /**
5117     * @param value {@link #variantsetId} (Id of the variantset in this external
5118     *              repository. The server will understand how to use this id to
5119     *              call for more info about variantsets in external repository.).
5120     *              This is the underlying object with id, value and extensions. The
5121     *              accessor "getVariantsetId" gives direct access to the value
5122     */
5123    public MolecularSequenceRepositoryComponent setVariantsetIdElement(StringType value) {
5124      this.variantsetId = value;
5125      return this;
5126    }
5127
5128    /**
5129     * @return Id of the variantset in this external repository. The server will
5130     *         understand how to use this id to call for more info about variantsets
5131     *         in external repository.
5132     */
5133    public String getVariantsetId() {
5134      return this.variantsetId == null ? null : this.variantsetId.getValue();
5135    }
5136
5137    /**
5138     * @param value Id of the variantset in this external repository. The server
5139     *              will understand how to use this id to call for more info about
5140     *              variantsets in external repository.
5141     */
5142    public MolecularSequenceRepositoryComponent setVariantsetId(String value) {
5143      if (Utilities.noString(value))
5144        this.variantsetId = null;
5145      else {
5146        if (this.variantsetId == null)
5147          this.variantsetId = new StringType();
5148        this.variantsetId.setValue(value);
5149      }
5150      return this;
5151    }
5152
5153    /**
5154     * @return {@link #readsetId} (Id of the read in this external repository.).
5155     *         This is the underlying object with id, value and extensions. The
5156     *         accessor "getReadsetId" gives direct access to the value
5157     */
5158    public StringType getReadsetIdElement() {
5159      if (this.readsetId == null)
5160        if (Configuration.errorOnAutoCreate())
5161          throw new Error("Attempt to auto-create MolecularSequenceRepositoryComponent.readsetId");
5162        else if (Configuration.doAutoCreate())
5163          this.readsetId = new StringType(); // bb
5164      return this.readsetId;
5165    }
5166
5167    public boolean hasReadsetIdElement() {
5168      return this.readsetId != null && !this.readsetId.isEmpty();
5169    }
5170
5171    public boolean hasReadsetId() {
5172      return this.readsetId != null && !this.readsetId.isEmpty();
5173    }
5174
5175    /**
5176     * @param value {@link #readsetId} (Id of the read in this external
5177     *              repository.). This is the underlying object with id, value and
5178     *              extensions. The accessor "getReadsetId" gives direct access to
5179     *              the value
5180     */
5181    public MolecularSequenceRepositoryComponent setReadsetIdElement(StringType value) {
5182      this.readsetId = value;
5183      return this;
5184    }
5185
5186    /**
5187     * @return Id of the read in this external repository.
5188     */
5189    public String getReadsetId() {
5190      return this.readsetId == null ? null : this.readsetId.getValue();
5191    }
5192
5193    /**
5194     * @param value Id of the read in this external repository.
5195     */
5196    public MolecularSequenceRepositoryComponent setReadsetId(String value) {
5197      if (Utilities.noString(value))
5198        this.readsetId = null;
5199      else {
5200        if (this.readsetId == null)
5201          this.readsetId = new StringType();
5202        this.readsetId.setValue(value);
5203      }
5204      return this;
5205    }
5206
5207    protected void listChildren(List<Property> children) {
5208      super.listChildren(children);
5209      children.add(new Property("type", "code",
5210          "Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.",
5211          0, 1, type));
5212      children.add(new Property("url", "uri",
5213          "URI of an external repository which contains further details about the genetics data.", 0, 1, url));
5214      children.add(new Property("name", "string",
5215          "URI of an external repository which contains further details about the genetics data.", 0, 1, name));
5216      children.add(new Property("datasetId", "string",
5217          "Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository.",
5218          0, 1, datasetId));
5219      children.add(new Property("variantsetId", "string",
5220          "Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository.",
5221          0, 1, variantsetId));
5222      children.add(new Property("readsetId", "string", "Id of the read in this external repository.", 0, 1, readsetId));
5223    }
5224
5225    @Override
5226    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5227      switch (_hash) {
5228      case 3575610:
5229        /* type */ return new Property("type", "code",
5230            "Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.",
5231            0, 1, type);
5232      case 116079:
5233        /* url */ return new Property("url", "uri",
5234            "URI of an external repository which contains further details about the genetics data.", 0, 1, url);
5235      case 3373707:
5236        /* name */ return new Property("name", "string",
5237            "URI of an external repository which contains further details about the genetics data.", 0, 1, name);
5238      case -345342029:
5239        /* datasetId */ return new Property("datasetId", "string",
5240            "Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository.",
5241            0, 1, datasetId);
5242      case 1929752504:
5243        /* variantsetId */ return new Property("variantsetId", "string",
5244            "Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository.",
5245            0, 1, variantsetId);
5246      case -1095407289:
5247        /* readsetId */ return new Property("readsetId", "string", "Id of the read in this external repository.", 0, 1,
5248            readsetId);
5249      default:
5250        return super.getNamedProperty(_hash, _name, _checkValid);
5251      }
5252
5253    }
5254
5255    @Override
5256    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5257      switch (hash) {
5258      case 3575610:
5259        /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // Enumeration<RepositoryType>
5260      case 116079:
5261        /* url */ return this.url == null ? new Base[0] : new Base[] { this.url }; // UriType
5262      case 3373707:
5263        /* name */ return this.name == null ? new Base[0] : new Base[] { this.name }; // StringType
5264      case -345342029:
5265        /* datasetId */ return this.datasetId == null ? new Base[0] : new Base[] { this.datasetId }; // StringType
5266      case 1929752504:
5267        /* variantsetId */ return this.variantsetId == null ? new Base[0] : new Base[] { this.variantsetId }; // StringType
5268      case -1095407289:
5269        /* readsetId */ return this.readsetId == null ? new Base[0] : new Base[] { this.readsetId }; // StringType
5270      default:
5271        return super.getProperty(hash, name, checkValid);
5272      }
5273
5274    }
5275
5276    @Override
5277    public Base setProperty(int hash, String name, Base value) throws FHIRException {
5278      switch (hash) {
5279      case 3575610: // type
5280        value = new RepositoryTypeEnumFactory().fromType(castToCode(value));
5281        this.type = (Enumeration) value; // Enumeration<RepositoryType>
5282        return value;
5283      case 116079: // url
5284        this.url = castToUri(value); // UriType
5285        return value;
5286      case 3373707: // name
5287        this.name = castToString(value); // StringType
5288        return value;
5289      case -345342029: // datasetId
5290        this.datasetId = castToString(value); // StringType
5291        return value;
5292      case 1929752504: // variantsetId
5293        this.variantsetId = castToString(value); // StringType
5294        return value;
5295      case -1095407289: // readsetId
5296        this.readsetId = castToString(value); // StringType
5297        return value;
5298      default:
5299        return super.setProperty(hash, name, value);
5300      }
5301
5302    }
5303
5304    @Override
5305    public Base setProperty(String name, Base value) throws FHIRException {
5306      if (name.equals("type")) {
5307        value = new RepositoryTypeEnumFactory().fromType(castToCode(value));
5308        this.type = (Enumeration) value; // Enumeration<RepositoryType>
5309      } else if (name.equals("url")) {
5310        this.url = castToUri(value); // UriType
5311      } else if (name.equals("name")) {
5312        this.name = castToString(value); // StringType
5313      } else if (name.equals("datasetId")) {
5314        this.datasetId = castToString(value); // StringType
5315      } else if (name.equals("variantsetId")) {
5316        this.variantsetId = castToString(value); // StringType
5317      } else if (name.equals("readsetId")) {
5318        this.readsetId = castToString(value); // StringType
5319      } else
5320        return super.setProperty(name, value);
5321      return value;
5322    }
5323
5324  @Override
5325  public void removeChild(String name, Base value) throws FHIRException {
5326      if (name.equals("type")) {
5327        this.type = null;
5328      } else if (name.equals("url")) {
5329        this.url = null;
5330      } else if (name.equals("name")) {
5331        this.name = null;
5332      } else if (name.equals("datasetId")) {
5333        this.datasetId = null;
5334      } else if (name.equals("variantsetId")) {
5335        this.variantsetId = null;
5336      } else if (name.equals("readsetId")) {
5337        this.readsetId = null;
5338      } else
5339        super.removeChild(name, value);
5340      
5341    }
5342
5343    @Override
5344    public Base makeProperty(int hash, String name) throws FHIRException {
5345      switch (hash) {
5346      case 3575610:
5347        return getTypeElement();
5348      case 116079:
5349        return getUrlElement();
5350      case 3373707:
5351        return getNameElement();
5352      case -345342029:
5353        return getDatasetIdElement();
5354      case 1929752504:
5355        return getVariantsetIdElement();
5356      case -1095407289:
5357        return getReadsetIdElement();
5358      default:
5359        return super.makeProperty(hash, name);
5360      }
5361
5362    }
5363
5364    @Override
5365    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5366      switch (hash) {
5367      case 3575610:
5368        /* type */ return new String[] { "code" };
5369      case 116079:
5370        /* url */ return new String[] { "uri" };
5371      case 3373707:
5372        /* name */ return new String[] { "string" };
5373      case -345342029:
5374        /* datasetId */ return new String[] { "string" };
5375      case 1929752504:
5376        /* variantsetId */ return new String[] { "string" };
5377      case -1095407289:
5378        /* readsetId */ return new String[] { "string" };
5379      default:
5380        return super.getTypesForProperty(hash, name);
5381      }
5382
5383    }
5384
5385    @Override
5386    public Base addChild(String name) throws FHIRException {
5387      if (name.equals("type")) {
5388        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.type");
5389      } else if (name.equals("url")) {
5390        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.url");
5391      } else if (name.equals("name")) {
5392        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.name");
5393      } else if (name.equals("datasetId")) {
5394        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.datasetId");
5395      } else if (name.equals("variantsetId")) {
5396        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.variantsetId");
5397      } else if (name.equals("readsetId")) {
5398        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.readsetId");
5399      } else
5400        return super.addChild(name);
5401    }
5402
5403    public MolecularSequenceRepositoryComponent copy() {
5404      MolecularSequenceRepositoryComponent dst = new MolecularSequenceRepositoryComponent();
5405      copyValues(dst);
5406      return dst;
5407    }
5408
5409    public void copyValues(MolecularSequenceRepositoryComponent dst) {
5410      super.copyValues(dst);
5411      dst.type = type == null ? null : type.copy();
5412      dst.url = url == null ? null : url.copy();
5413      dst.name = name == null ? null : name.copy();
5414      dst.datasetId = datasetId == null ? null : datasetId.copy();
5415      dst.variantsetId = variantsetId == null ? null : variantsetId.copy();
5416      dst.readsetId = readsetId == null ? null : readsetId.copy();
5417    }
5418
5419    @Override
5420    public boolean equalsDeep(Base other_) {
5421      if (!super.equalsDeep(other_))
5422        return false;
5423      if (!(other_ instanceof MolecularSequenceRepositoryComponent))
5424        return false;
5425      MolecularSequenceRepositoryComponent o = (MolecularSequenceRepositoryComponent) other_;
5426      return compareDeep(type, o.type, true) && compareDeep(url, o.url, true) && compareDeep(name, o.name, true)
5427          && compareDeep(datasetId, o.datasetId, true) && compareDeep(variantsetId, o.variantsetId, true)
5428          && compareDeep(readsetId, o.readsetId, true);
5429    }
5430
5431    @Override
5432    public boolean equalsShallow(Base other_) {
5433      if (!super.equalsShallow(other_))
5434        return false;
5435      if (!(other_ instanceof MolecularSequenceRepositoryComponent))
5436        return false;
5437      MolecularSequenceRepositoryComponent o = (MolecularSequenceRepositoryComponent) other_;
5438      return compareValues(type, o.type, true) && compareValues(url, o.url, true) && compareValues(name, o.name, true)
5439          && compareValues(datasetId, o.datasetId, true) && compareValues(variantsetId, o.variantsetId, true)
5440          && compareValues(readsetId, o.readsetId, true);
5441    }
5442
5443    public boolean isEmpty() {
5444      return super.isEmpty()
5445          && ca.uhn.fhir.util.ElementUtil.isEmpty(type, url, name, datasetId, variantsetId, readsetId);
5446    }
5447
5448    public String fhirType() {
5449      return "MolecularSequence.repository";
5450
5451    }
5452
5453  }
5454
5455  @Block()
5456  public static class MolecularSequenceStructureVariantComponent extends BackboneElement
5457      implements IBaseBackboneElement {
5458    /**
5459     * Information about chromosome structure variation DNA change type.
5460     */
5461    @Child(name = "variantType", type = {
5462        CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
5463    @Description(shortDefinition = "Structural variant change type", formalDefinition = "Information about chromosome structure variation DNA change type.")
5464    protected CodeableConcept variantType;
5465
5466    /**
5467     * Used to indicate if the outer and inner start-end values have the same
5468     * meaning.
5469     */
5470    @Child(name = "exact", type = { BooleanType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
5471    @Description(shortDefinition = "Does the structural variant have base pair resolution breakpoints?", formalDefinition = "Used to indicate if the outer and inner start-end values have the same meaning.")
5472    protected BooleanType exact;
5473
5474    /**
5475     * Length of the variant chromosome.
5476     */
5477    @Child(name = "length", type = { IntegerType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
5478    @Description(shortDefinition = "Structural variant length", formalDefinition = "Length of the variant chromosome.")
5479    protected IntegerType length;
5480
5481    /**
5482     * Structural variant outer.
5483     */
5484    @Child(name = "outer", type = {}, order = 4, min = 0, max = 1, modifier = false, summary = true)
5485    @Description(shortDefinition = "Structural variant outer", formalDefinition = "Structural variant outer.")
5486    protected MolecularSequenceStructureVariantOuterComponent outer;
5487
5488    /**
5489     * Structural variant inner.
5490     */
5491    @Child(name = "inner", type = {}, order = 5, min = 0, max = 1, modifier = false, summary = true)
5492    @Description(shortDefinition = "Structural variant inner", formalDefinition = "Structural variant inner.")
5493    protected MolecularSequenceStructureVariantInnerComponent inner;
5494
5495    private static final long serialVersionUID = -1943515207L;
5496
5497    /**
5498     * Constructor
5499     */
5500    public MolecularSequenceStructureVariantComponent() {
5501      super();
5502    }
5503
5504    /**
5505     * @return {@link #variantType} (Information about chromosome structure
5506     *         variation DNA change type.)
5507     */
5508    public CodeableConcept getVariantType() {
5509      if (this.variantType == null)
5510        if (Configuration.errorOnAutoCreate())
5511          throw new Error("Attempt to auto-create MolecularSequenceStructureVariantComponent.variantType");
5512        else if (Configuration.doAutoCreate())
5513          this.variantType = new CodeableConcept(); // cc
5514      return this.variantType;
5515    }
5516
5517    public boolean hasVariantType() {
5518      return this.variantType != null && !this.variantType.isEmpty();
5519    }
5520
5521    /**
5522     * @param value {@link #variantType} (Information about chromosome structure
5523     *              variation DNA change type.)
5524     */
5525    public MolecularSequenceStructureVariantComponent setVariantType(CodeableConcept value) {
5526      this.variantType = value;
5527      return this;
5528    }
5529
5530    /**
5531     * @return {@link #exact} (Used to indicate if the outer and inner start-end
5532     *         values have the same meaning.). This is the underlying object with
5533     *         id, value and extensions. The accessor "getExact" gives direct access
5534     *         to the value
5535     */
5536    public BooleanType getExactElement() {
5537      if (this.exact == null)
5538        if (Configuration.errorOnAutoCreate())
5539          throw new Error("Attempt to auto-create MolecularSequenceStructureVariantComponent.exact");
5540        else if (Configuration.doAutoCreate())
5541          this.exact = new BooleanType(); // bb
5542      return this.exact;
5543    }
5544
5545    public boolean hasExactElement() {
5546      return this.exact != null && !this.exact.isEmpty();
5547    }
5548
5549    public boolean hasExact() {
5550      return this.exact != null && !this.exact.isEmpty();
5551    }
5552
5553    /**
5554     * @param value {@link #exact} (Used to indicate if the outer and inner
5555     *              start-end values have the same meaning.). This is the underlying
5556     *              object with id, value and extensions. The accessor "getExact"
5557     *              gives direct access to the value
5558     */
5559    public MolecularSequenceStructureVariantComponent setExactElement(BooleanType value) {
5560      this.exact = value;
5561      return this;
5562    }
5563
5564    /**
5565     * @return Used to indicate if the outer and inner start-end values have the
5566     *         same meaning.
5567     */
5568    public boolean getExact() {
5569      return this.exact == null || this.exact.isEmpty() ? false : this.exact.getValue();
5570    }
5571
5572    /**
5573     * @param value Used to indicate if the outer and inner start-end values have
5574     *              the same meaning.
5575     */
5576    public MolecularSequenceStructureVariantComponent setExact(boolean value) {
5577      if (this.exact == null)
5578        this.exact = new BooleanType();
5579      this.exact.setValue(value);
5580      return this;
5581    }
5582
5583    /**
5584     * @return {@link #length} (Length of the variant chromosome.). This is the
5585     *         underlying object with id, value and extensions. The accessor
5586     *         "getLength" gives direct access to the value
5587     */
5588    public IntegerType getLengthElement() {
5589      if (this.length == null)
5590        if (Configuration.errorOnAutoCreate())
5591          throw new Error("Attempt to auto-create MolecularSequenceStructureVariantComponent.length");
5592        else if (Configuration.doAutoCreate())
5593          this.length = new IntegerType(); // bb
5594      return this.length;
5595    }
5596
5597    public boolean hasLengthElement() {
5598      return this.length != null && !this.length.isEmpty();
5599    }
5600
5601    public boolean hasLength() {
5602      return this.length != null && !this.length.isEmpty();
5603    }
5604
5605    /**
5606     * @param value {@link #length} (Length of the variant chromosome.). This is the
5607     *              underlying object with id, value and extensions. The accessor
5608     *              "getLength" gives direct access to the value
5609     */
5610    public MolecularSequenceStructureVariantComponent setLengthElement(IntegerType value) {
5611      this.length = value;
5612      return this;
5613    }
5614
5615    /**
5616     * @return Length of the variant chromosome.
5617     */
5618    public int getLength() {
5619      return this.length == null || this.length.isEmpty() ? 0 : this.length.getValue();
5620    }
5621
5622    /**
5623     * @param value Length of the variant chromosome.
5624     */
5625    public MolecularSequenceStructureVariantComponent setLength(int value) {
5626      if (this.length == null)
5627        this.length = new IntegerType();
5628      this.length.setValue(value);
5629      return this;
5630    }
5631
5632    /**
5633     * @return {@link #outer} (Structural variant outer.)
5634     */
5635    public MolecularSequenceStructureVariantOuterComponent getOuter() {
5636      if (this.outer == null)
5637        if (Configuration.errorOnAutoCreate())
5638          throw new Error("Attempt to auto-create MolecularSequenceStructureVariantComponent.outer");
5639        else if (Configuration.doAutoCreate())
5640          this.outer = new MolecularSequenceStructureVariantOuterComponent(); // cc
5641      return this.outer;
5642    }
5643
5644    public boolean hasOuter() {
5645      return this.outer != null && !this.outer.isEmpty();
5646    }
5647
5648    /**
5649     * @param value {@link #outer} (Structural variant outer.)
5650     */
5651    public MolecularSequenceStructureVariantComponent setOuter(MolecularSequenceStructureVariantOuterComponent value) {
5652      this.outer = value;
5653      return this;
5654    }
5655
5656    /**
5657     * @return {@link #inner} (Structural variant inner.)
5658     */
5659    public MolecularSequenceStructureVariantInnerComponent getInner() {
5660      if (this.inner == null)
5661        if (Configuration.errorOnAutoCreate())
5662          throw new Error("Attempt to auto-create MolecularSequenceStructureVariantComponent.inner");
5663        else if (Configuration.doAutoCreate())
5664          this.inner = new MolecularSequenceStructureVariantInnerComponent(); // cc
5665      return this.inner;
5666    }
5667
5668    public boolean hasInner() {
5669      return this.inner != null && !this.inner.isEmpty();
5670    }
5671
5672    /**
5673     * @param value {@link #inner} (Structural variant inner.)
5674     */
5675    public MolecularSequenceStructureVariantComponent setInner(MolecularSequenceStructureVariantInnerComponent value) {
5676      this.inner = value;
5677      return this;
5678    }
5679
5680    protected void listChildren(List<Property> children) {
5681      super.listChildren(children);
5682      children.add(new Property("variantType", "CodeableConcept",
5683          "Information about chromosome structure variation DNA change type.", 0, 1, variantType));
5684      children.add(new Property("exact", "boolean",
5685          "Used to indicate if the outer and inner start-end values have the same meaning.", 0, 1, exact));
5686      children.add(new Property("length", "integer", "Length of the variant chromosome.", 0, 1, length));
5687      children.add(new Property("outer", "", "Structural variant outer.", 0, 1, outer));
5688      children.add(new Property("inner", "", "Structural variant inner.", 0, 1, inner));
5689    }
5690
5691    @Override
5692    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5693      switch (_hash) {
5694      case -1601222305:
5695        /* variantType */ return new Property("variantType", "CodeableConcept",
5696            "Information about chromosome structure variation DNA change type.", 0, 1, variantType);
5697      case 96946943:
5698        /* exact */ return new Property("exact", "boolean",
5699            "Used to indicate if the outer and inner start-end values have the same meaning.", 0, 1, exact);
5700      case -1106363674:
5701        /* length */ return new Property("length", "integer", "Length of the variant chromosome.", 0, 1, length);
5702      case 106111099:
5703        /* outer */ return new Property("outer", "", "Structural variant outer.", 0, 1, outer);
5704      case 100355670:
5705        /* inner */ return new Property("inner", "", "Structural variant inner.", 0, 1, inner);
5706      default:
5707        return super.getNamedProperty(_hash, _name, _checkValid);
5708      }
5709
5710    }
5711
5712    @Override
5713    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5714      switch (hash) {
5715      case -1601222305:
5716        /* variantType */ return this.variantType == null ? new Base[0] : new Base[] { this.variantType }; // CodeableConcept
5717      case 96946943:
5718        /* exact */ return this.exact == null ? new Base[0] : new Base[] { this.exact }; // BooleanType
5719      case -1106363674:
5720        /* length */ return this.length == null ? new Base[0] : new Base[] { this.length }; // IntegerType
5721      case 106111099:
5722        /* outer */ return this.outer == null ? new Base[0] : new Base[] { this.outer }; // MolecularSequenceStructureVariantOuterComponent
5723      case 100355670:
5724        /* inner */ return this.inner == null ? new Base[0] : new Base[] { this.inner }; // MolecularSequenceStructureVariantInnerComponent
5725      default:
5726        return super.getProperty(hash, name, checkValid);
5727      }
5728
5729    }
5730
5731    @Override
5732    public Base setProperty(int hash, String name, Base value) throws FHIRException {
5733      switch (hash) {
5734      case -1601222305: // variantType
5735        this.variantType = castToCodeableConcept(value); // CodeableConcept
5736        return value;
5737      case 96946943: // exact
5738        this.exact = castToBoolean(value); // BooleanType
5739        return value;
5740      case -1106363674: // length
5741        this.length = castToInteger(value); // IntegerType
5742        return value;
5743      case 106111099: // outer
5744        this.outer = (MolecularSequenceStructureVariantOuterComponent) value; // MolecularSequenceStructureVariantOuterComponent
5745        return value;
5746      case 100355670: // inner
5747        this.inner = (MolecularSequenceStructureVariantInnerComponent) value; // MolecularSequenceStructureVariantInnerComponent
5748        return value;
5749      default:
5750        return super.setProperty(hash, name, value);
5751      }
5752
5753    }
5754
5755    @Override
5756    public Base setProperty(String name, Base value) throws FHIRException {
5757      if (name.equals("variantType")) {
5758        this.variantType = castToCodeableConcept(value); // CodeableConcept
5759      } else if (name.equals("exact")) {
5760        this.exact = castToBoolean(value); // BooleanType
5761      } else if (name.equals("length")) {
5762        this.length = castToInteger(value); // IntegerType
5763      } else if (name.equals("outer")) {
5764        this.outer = (MolecularSequenceStructureVariantOuterComponent) value; // MolecularSequenceStructureVariantOuterComponent
5765      } else if (name.equals("inner")) {
5766        this.inner = (MolecularSequenceStructureVariantInnerComponent) value; // MolecularSequenceStructureVariantInnerComponent
5767      } else
5768        return super.setProperty(name, value);
5769      return value;
5770    }
5771
5772  @Override
5773  public void removeChild(String name, Base value) throws FHIRException {
5774      if (name.equals("variantType")) {
5775        this.variantType = null;
5776      } else if (name.equals("exact")) {
5777        this.exact = null;
5778      } else if (name.equals("length")) {
5779        this.length = null;
5780      } else if (name.equals("outer")) {
5781        this.outer = (MolecularSequenceStructureVariantOuterComponent) value; // MolecularSequenceStructureVariantOuterComponent
5782      } else if (name.equals("inner")) {
5783        this.inner = (MolecularSequenceStructureVariantInnerComponent) value; // MolecularSequenceStructureVariantInnerComponent
5784      } else
5785        super.removeChild(name, value);
5786      
5787    }
5788
5789    @Override
5790    public Base makeProperty(int hash, String name) throws FHIRException {
5791      switch (hash) {
5792      case -1601222305:
5793        return getVariantType();
5794      case 96946943:
5795        return getExactElement();
5796      case -1106363674:
5797        return getLengthElement();
5798      case 106111099:
5799        return getOuter();
5800      case 100355670:
5801        return getInner();
5802      default:
5803        return super.makeProperty(hash, name);
5804      }
5805
5806    }
5807
5808    @Override
5809    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5810      switch (hash) {
5811      case -1601222305:
5812        /* variantType */ return new String[] { "CodeableConcept" };
5813      case 96946943:
5814        /* exact */ return new String[] { "boolean" };
5815      case -1106363674:
5816        /* length */ return new String[] { "integer" };
5817      case 106111099:
5818        /* outer */ return new String[] {};
5819      case 100355670:
5820        /* inner */ return new String[] {};
5821      default:
5822        return super.getTypesForProperty(hash, name);
5823      }
5824
5825    }
5826
5827    @Override
5828    public Base addChild(String name) throws FHIRException {
5829      if (name.equals("variantType")) {
5830        this.variantType = new CodeableConcept();
5831        return this.variantType;
5832      } else if (name.equals("exact")) {
5833        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.exact");
5834      } else if (name.equals("length")) {
5835        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.length");
5836      } else if (name.equals("outer")) {
5837        this.outer = new MolecularSequenceStructureVariantOuterComponent();
5838        return this.outer;
5839      } else if (name.equals("inner")) {
5840        this.inner = new MolecularSequenceStructureVariantInnerComponent();
5841        return this.inner;
5842      } else
5843        return super.addChild(name);
5844    }
5845
5846    public MolecularSequenceStructureVariantComponent copy() {
5847      MolecularSequenceStructureVariantComponent dst = new MolecularSequenceStructureVariantComponent();
5848      copyValues(dst);
5849      return dst;
5850    }
5851
5852    public void copyValues(MolecularSequenceStructureVariantComponent dst) {
5853      super.copyValues(dst);
5854      dst.variantType = variantType == null ? null : variantType.copy();
5855      dst.exact = exact == null ? null : exact.copy();
5856      dst.length = length == null ? null : length.copy();
5857      dst.outer = outer == null ? null : outer.copy();
5858      dst.inner = inner == null ? null : inner.copy();
5859    }
5860
5861    @Override
5862    public boolean equalsDeep(Base other_) {
5863      if (!super.equalsDeep(other_))
5864        return false;
5865      if (!(other_ instanceof MolecularSequenceStructureVariantComponent))
5866        return false;
5867      MolecularSequenceStructureVariantComponent o = (MolecularSequenceStructureVariantComponent) other_;
5868      return compareDeep(variantType, o.variantType, true) && compareDeep(exact, o.exact, true)
5869          && compareDeep(length, o.length, true) && compareDeep(outer, o.outer, true)
5870          && compareDeep(inner, o.inner, true);
5871    }
5872
5873    @Override
5874    public boolean equalsShallow(Base other_) {
5875      if (!super.equalsShallow(other_))
5876        return false;
5877      if (!(other_ instanceof MolecularSequenceStructureVariantComponent))
5878        return false;
5879      MolecularSequenceStructureVariantComponent o = (MolecularSequenceStructureVariantComponent) other_;
5880      return compareValues(exact, o.exact, true) && compareValues(length, o.length, true);
5881    }
5882
5883    public boolean isEmpty() {
5884      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(variantType, exact, length, outer, inner);
5885    }
5886
5887    public String fhirType() {
5888      return "MolecularSequence.structureVariant";
5889
5890    }
5891
5892  }
5893
5894  @Block()
5895  public static class MolecularSequenceStructureVariantOuterComponent extends BackboneElement
5896      implements IBaseBackboneElement {
5897    /**
5898     * Structural variant outer start. If the coordinate system is either 0-based or
5899     * 1-based, then start position is inclusive.
5900     */
5901    @Child(name = "start", type = { IntegerType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
5902    @Description(shortDefinition = "Structural variant outer start", formalDefinition = "Structural variant outer start. If the coordinate system is either 0-based or 1-based, then start position is inclusive.")
5903    protected IntegerType start;
5904
5905    /**
5906     * Structural variant outer end. If the coordinate system is 0-based then end is
5907     * exclusive and does not include the last position. If the coordinate system is
5908     * 1-base, then end is inclusive and includes the last position.
5909     */
5910    @Child(name = "end", type = { IntegerType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
5911    @Description(shortDefinition = "Structural variant outer end", formalDefinition = "Structural variant outer end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.")
5912    protected IntegerType end;
5913
5914    private static final long serialVersionUID = -1798864889L;
5915
5916    /**
5917     * Constructor
5918     */
5919    public MolecularSequenceStructureVariantOuterComponent() {
5920      super();
5921    }
5922
5923    /**
5924     * @return {@link #start} (Structural variant outer start. If the coordinate
5925     *         system is either 0-based or 1-based, then start position is
5926     *         inclusive.). This is the underlying object with id, value and
5927     *         extensions. The accessor "getStart" gives direct access to the value
5928     */
5929    public IntegerType getStartElement() {
5930      if (this.start == null)
5931        if (Configuration.errorOnAutoCreate())
5932          throw new Error("Attempt to auto-create MolecularSequenceStructureVariantOuterComponent.start");
5933        else if (Configuration.doAutoCreate())
5934          this.start = new IntegerType(); // bb
5935      return this.start;
5936    }
5937
5938    public boolean hasStartElement() {
5939      return this.start != null && !this.start.isEmpty();
5940    }
5941
5942    public boolean hasStart() {
5943      return this.start != null && !this.start.isEmpty();
5944    }
5945
5946    /**
5947     * @param value {@link #start} (Structural variant outer start. If the
5948     *              coordinate system is either 0-based or 1-based, then start
5949     *              position is inclusive.). This is the underlying object with id,
5950     *              value and extensions. The accessor "getStart" gives direct
5951     *              access to the value
5952     */
5953    public MolecularSequenceStructureVariantOuterComponent setStartElement(IntegerType value) {
5954      this.start = value;
5955      return this;
5956    }
5957
5958    /**
5959     * @return Structural variant outer start. If the coordinate system is either
5960     *         0-based or 1-based, then start position is inclusive.
5961     */
5962    public int getStart() {
5963      return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
5964    }
5965
5966    /**
5967     * @param value Structural variant outer start. If the coordinate system is
5968     *              either 0-based or 1-based, then start position is inclusive.
5969     */
5970    public MolecularSequenceStructureVariantOuterComponent setStart(int value) {
5971      if (this.start == null)
5972        this.start = new IntegerType();
5973      this.start.setValue(value);
5974      return this;
5975    }
5976
5977    /**
5978     * @return {@link #end} (Structural variant outer end. If the coordinate system
5979     *         is 0-based then end is exclusive and does not include the last
5980     *         position. If the coordinate system is 1-base, then end is inclusive
5981     *         and includes the last position.). This is the underlying object with
5982     *         id, value and extensions. The accessor "getEnd" gives direct access
5983     *         to the value
5984     */
5985    public IntegerType getEndElement() {
5986      if (this.end == null)
5987        if (Configuration.errorOnAutoCreate())
5988          throw new Error("Attempt to auto-create MolecularSequenceStructureVariantOuterComponent.end");
5989        else if (Configuration.doAutoCreate())
5990          this.end = new IntegerType(); // bb
5991      return this.end;
5992    }
5993
5994    public boolean hasEndElement() {
5995      return this.end != null && !this.end.isEmpty();
5996    }
5997
5998    public boolean hasEnd() {
5999      return this.end != null && !this.end.isEmpty();
6000    }
6001
6002    /**
6003     * @param value {@link #end} (Structural variant outer end. If the coordinate
6004     *              system is 0-based then end is exclusive and does not include the
6005     *              last position. If the coordinate system is 1-base, then end is
6006     *              inclusive and includes the last position.). This is the
6007     *              underlying object with id, value and extensions. The accessor
6008     *              "getEnd" gives direct access to the value
6009     */
6010    public MolecularSequenceStructureVariantOuterComponent setEndElement(IntegerType value) {
6011      this.end = value;
6012      return this;
6013    }
6014
6015    /**
6016     * @return Structural variant outer end. If the coordinate system is 0-based
6017     *         then end is exclusive and does not include the last position. If the
6018     *         coordinate system is 1-base, then end is inclusive and includes the
6019     *         last position.
6020     */
6021    public int getEnd() {
6022      return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
6023    }
6024
6025    /**
6026     * @param value Structural variant outer end. If the coordinate system is
6027     *              0-based then end is exclusive and does not include the last
6028     *              position. If the coordinate system is 1-base, then end is
6029     *              inclusive and includes the last position.
6030     */
6031    public MolecularSequenceStructureVariantOuterComponent setEnd(int value) {
6032      if (this.end == null)
6033        this.end = new IntegerType();
6034      this.end.setValue(value);
6035      return this;
6036    }
6037
6038    protected void listChildren(List<Property> children) {
6039      super.listChildren(children);
6040      children.add(new Property("start", "integer",
6041          "Structural variant outer start. If the coordinate system is either 0-based or 1-based, then start position is inclusive.",
6042          0, 1, start));
6043      children.add(new Property("end", "integer",
6044          "Structural variant outer end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.",
6045          0, 1, end));
6046    }
6047
6048    @Override
6049    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6050      switch (_hash) {
6051      case 109757538:
6052        /* start */ return new Property("start", "integer",
6053            "Structural variant outer start. If the coordinate system is either 0-based or 1-based, then start position is inclusive.",
6054            0, 1, start);
6055      case 100571:
6056        /* end */ return new Property("end", "integer",
6057            "Structural variant outer end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.",
6058            0, 1, end);
6059      default:
6060        return super.getNamedProperty(_hash, _name, _checkValid);
6061      }
6062
6063    }
6064
6065    @Override
6066    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6067      switch (hash) {
6068      case 109757538:
6069        /* start */ return this.start == null ? new Base[0] : new Base[] { this.start }; // IntegerType
6070      case 100571:
6071        /* end */ return this.end == null ? new Base[0] : new Base[] { this.end }; // IntegerType
6072      default:
6073        return super.getProperty(hash, name, checkValid);
6074      }
6075
6076    }
6077
6078    @Override
6079    public Base setProperty(int hash, String name, Base value) throws FHIRException {
6080      switch (hash) {
6081      case 109757538: // start
6082        this.start = castToInteger(value); // IntegerType
6083        return value;
6084      case 100571: // end
6085        this.end = castToInteger(value); // IntegerType
6086        return value;
6087      default:
6088        return super.setProperty(hash, name, value);
6089      }
6090
6091    }
6092
6093    @Override
6094    public Base setProperty(String name, Base value) throws FHIRException {
6095      if (name.equals("start")) {
6096        this.start = castToInteger(value); // IntegerType
6097      } else if (name.equals("end")) {
6098        this.end = castToInteger(value); // IntegerType
6099      } else
6100        return super.setProperty(name, value);
6101      return value;
6102    }
6103
6104  @Override
6105  public void removeChild(String name, Base value) throws FHIRException {
6106      if (name.equals("start")) {
6107        this.start = null;
6108      } else if (name.equals("end")) {
6109        this.end = null;
6110      } else
6111        super.removeChild(name, value);
6112      
6113    }
6114
6115    @Override
6116    public Base makeProperty(int hash, String name) throws FHIRException {
6117      switch (hash) {
6118      case 109757538:
6119        return getStartElement();
6120      case 100571:
6121        return getEndElement();
6122      default:
6123        return super.makeProperty(hash, name);
6124      }
6125
6126    }
6127
6128    @Override
6129    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6130      switch (hash) {
6131      case 109757538:
6132        /* start */ return new String[] { "integer" };
6133      case 100571:
6134        /* end */ return new String[] { "integer" };
6135      default:
6136        return super.getTypesForProperty(hash, name);
6137      }
6138
6139    }
6140
6141    @Override
6142    public Base addChild(String name) throws FHIRException {
6143      if (name.equals("start")) {
6144        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.start");
6145      } else if (name.equals("end")) {
6146        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.end");
6147      } else
6148        return super.addChild(name);
6149    }
6150
6151    public MolecularSequenceStructureVariantOuterComponent copy() {
6152      MolecularSequenceStructureVariantOuterComponent dst = new MolecularSequenceStructureVariantOuterComponent();
6153      copyValues(dst);
6154      return dst;
6155    }
6156
6157    public void copyValues(MolecularSequenceStructureVariantOuterComponent dst) {
6158      super.copyValues(dst);
6159      dst.start = start == null ? null : start.copy();
6160      dst.end = end == null ? null : end.copy();
6161    }
6162
6163    @Override
6164    public boolean equalsDeep(Base other_) {
6165      if (!super.equalsDeep(other_))
6166        return false;
6167      if (!(other_ instanceof MolecularSequenceStructureVariantOuterComponent))
6168        return false;
6169      MolecularSequenceStructureVariantOuterComponent o = (MolecularSequenceStructureVariantOuterComponent) other_;
6170      return compareDeep(start, o.start, true) && compareDeep(end, o.end, true);
6171    }
6172
6173    @Override
6174    public boolean equalsShallow(Base other_) {
6175      if (!super.equalsShallow(other_))
6176        return false;
6177      if (!(other_ instanceof MolecularSequenceStructureVariantOuterComponent))
6178        return false;
6179      MolecularSequenceStructureVariantOuterComponent o = (MolecularSequenceStructureVariantOuterComponent) other_;
6180      return compareValues(start, o.start, true) && compareValues(end, o.end, true);
6181    }
6182
6183    public boolean isEmpty() {
6184      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(start, end);
6185    }
6186
6187    public String fhirType() {
6188      return "MolecularSequence.structureVariant.outer";
6189
6190    }
6191
6192  }
6193
6194  @Block()
6195  public static class MolecularSequenceStructureVariantInnerComponent extends BackboneElement
6196      implements IBaseBackboneElement {
6197    /**
6198     * Structural variant inner start. If the coordinate system is either 0-based or
6199     * 1-based, then start position is inclusive.
6200     */
6201    @Child(name = "start", type = { IntegerType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
6202    @Description(shortDefinition = "Structural variant inner start", formalDefinition = "Structural variant inner start. If the coordinate system is either 0-based or 1-based, then start position is inclusive.")
6203    protected IntegerType start;
6204
6205    /**
6206     * Structural variant inner end. If the coordinate system is 0-based then end is
6207     * exclusive and does not include the last position. If the coordinate system is
6208     * 1-base, then end is inclusive and includes the last position.
6209     */
6210    @Child(name = "end", type = { IntegerType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
6211    @Description(shortDefinition = "Structural variant inner end", formalDefinition = "Structural variant inner end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.")
6212    protected IntegerType end;
6213
6214    private static final long serialVersionUID = -1798864889L;
6215
6216    /**
6217     * Constructor
6218     */
6219    public MolecularSequenceStructureVariantInnerComponent() {
6220      super();
6221    }
6222
6223    /**
6224     * @return {@link #start} (Structural variant inner start. If the coordinate
6225     *         system is either 0-based or 1-based, then start position is
6226     *         inclusive.). This is the underlying object with id, value and
6227     *         extensions. The accessor "getStart" gives direct access to the value
6228     */
6229    public IntegerType getStartElement() {
6230      if (this.start == null)
6231        if (Configuration.errorOnAutoCreate())
6232          throw new Error("Attempt to auto-create MolecularSequenceStructureVariantInnerComponent.start");
6233        else if (Configuration.doAutoCreate())
6234          this.start = new IntegerType(); // bb
6235      return this.start;
6236    }
6237
6238    public boolean hasStartElement() {
6239      return this.start != null && !this.start.isEmpty();
6240    }
6241
6242    public boolean hasStart() {
6243      return this.start != null && !this.start.isEmpty();
6244    }
6245
6246    /**
6247     * @param value {@link #start} (Structural variant inner start. If the
6248     *              coordinate system is either 0-based or 1-based, then start
6249     *              position is inclusive.). This is the underlying object with id,
6250     *              value and extensions. The accessor "getStart" gives direct
6251     *              access to the value
6252     */
6253    public MolecularSequenceStructureVariantInnerComponent setStartElement(IntegerType value) {
6254      this.start = value;
6255      return this;
6256    }
6257
6258    /**
6259     * @return Structural variant inner start. If the coordinate system is either
6260     *         0-based or 1-based, then start position is inclusive.
6261     */
6262    public int getStart() {
6263      return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
6264    }
6265
6266    /**
6267     * @param value Structural variant inner start. If the coordinate system is
6268     *              either 0-based or 1-based, then start position is inclusive.
6269     */
6270    public MolecularSequenceStructureVariantInnerComponent setStart(int value) {
6271      if (this.start == null)
6272        this.start = new IntegerType();
6273      this.start.setValue(value);
6274      return this;
6275    }
6276
6277    /**
6278     * @return {@link #end} (Structural variant inner end. If the coordinate system
6279     *         is 0-based then end is exclusive and does not include the last
6280     *         position. If the coordinate system is 1-base, then end is inclusive
6281     *         and includes the last position.). This is the underlying object with
6282     *         id, value and extensions. The accessor "getEnd" gives direct access
6283     *         to the value
6284     */
6285    public IntegerType getEndElement() {
6286      if (this.end == null)
6287        if (Configuration.errorOnAutoCreate())
6288          throw new Error("Attempt to auto-create MolecularSequenceStructureVariantInnerComponent.end");
6289        else if (Configuration.doAutoCreate())
6290          this.end = new IntegerType(); // bb
6291      return this.end;
6292    }
6293
6294    public boolean hasEndElement() {
6295      return this.end != null && !this.end.isEmpty();
6296    }
6297
6298    public boolean hasEnd() {
6299      return this.end != null && !this.end.isEmpty();
6300    }
6301
6302    /**
6303     * @param value {@link #end} (Structural variant inner end. If the coordinate
6304     *              system is 0-based then end is exclusive and does not include the
6305     *              last position. If the coordinate system is 1-base, then end is
6306     *              inclusive and includes the last position.). This is the
6307     *              underlying object with id, value and extensions. The accessor
6308     *              "getEnd" gives direct access to the value
6309     */
6310    public MolecularSequenceStructureVariantInnerComponent setEndElement(IntegerType value) {
6311      this.end = value;
6312      return this;
6313    }
6314
6315    /**
6316     * @return Structural variant inner end. If the coordinate system is 0-based
6317     *         then end is exclusive and does not include the last position. If the
6318     *         coordinate system is 1-base, then end is inclusive and includes the
6319     *         last position.
6320     */
6321    public int getEnd() {
6322      return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
6323    }
6324
6325    /**
6326     * @param value Structural variant inner end. If the coordinate system is
6327     *              0-based then end is exclusive and does not include the last
6328     *              position. If the coordinate system is 1-base, then end is
6329     *              inclusive and includes the last position.
6330     */
6331    public MolecularSequenceStructureVariantInnerComponent setEnd(int value) {
6332      if (this.end == null)
6333        this.end = new IntegerType();
6334      this.end.setValue(value);
6335      return this;
6336    }
6337
6338    protected void listChildren(List<Property> children) {
6339      super.listChildren(children);
6340      children.add(new Property("start", "integer",
6341          "Structural variant inner start. If the coordinate system is either 0-based or 1-based, then start position is inclusive.",
6342          0, 1, start));
6343      children.add(new Property("end", "integer",
6344          "Structural variant inner end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.",
6345          0, 1, end));
6346    }
6347
6348    @Override
6349    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6350      switch (_hash) {
6351      case 109757538:
6352        /* start */ return new Property("start", "integer",
6353            "Structural variant inner start. If the coordinate system is either 0-based or 1-based, then start position is inclusive.",
6354            0, 1, start);
6355      case 100571:
6356        /* end */ return new Property("end", "integer",
6357            "Structural variant inner end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.",
6358            0, 1, end);
6359      default:
6360        return super.getNamedProperty(_hash, _name, _checkValid);
6361      }
6362
6363    }
6364
6365    @Override
6366    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6367      switch (hash) {
6368      case 109757538:
6369        /* start */ return this.start == null ? new Base[0] : new Base[] { this.start }; // IntegerType
6370      case 100571:
6371        /* end */ return this.end == null ? new Base[0] : new Base[] { this.end }; // IntegerType
6372      default:
6373        return super.getProperty(hash, name, checkValid);
6374      }
6375
6376    }
6377
6378    @Override
6379    public Base setProperty(int hash, String name, Base value) throws FHIRException {
6380      switch (hash) {
6381      case 109757538: // start
6382        this.start = castToInteger(value); // IntegerType
6383        return value;
6384      case 100571: // end
6385        this.end = castToInteger(value); // IntegerType
6386        return value;
6387      default:
6388        return super.setProperty(hash, name, value);
6389      }
6390
6391    }
6392
6393    @Override
6394    public Base setProperty(String name, Base value) throws FHIRException {
6395      if (name.equals("start")) {
6396        this.start = castToInteger(value); // IntegerType
6397      } else if (name.equals("end")) {
6398        this.end = castToInteger(value); // IntegerType
6399      } else
6400        return super.setProperty(name, value);
6401      return value;
6402    }
6403
6404  @Override
6405  public void removeChild(String name, Base value) throws FHIRException {
6406      if (name.equals("start")) {
6407        this.start = null;
6408      } else if (name.equals("end")) {
6409        this.end = null;
6410      } else
6411        super.removeChild(name, value);
6412      
6413    }
6414
6415    @Override
6416    public Base makeProperty(int hash, String name) throws FHIRException {
6417      switch (hash) {
6418      case 109757538:
6419        return getStartElement();
6420      case 100571:
6421        return getEndElement();
6422      default:
6423        return super.makeProperty(hash, name);
6424      }
6425
6426    }
6427
6428    @Override
6429    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6430      switch (hash) {
6431      case 109757538:
6432        /* start */ return new String[] { "integer" };
6433      case 100571:
6434        /* end */ return new String[] { "integer" };
6435      default:
6436        return super.getTypesForProperty(hash, name);
6437      }
6438
6439    }
6440
6441    @Override
6442    public Base addChild(String name) throws FHIRException {
6443      if (name.equals("start")) {
6444        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.start");
6445      } else if (name.equals("end")) {
6446        throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.end");
6447      } else
6448        return super.addChild(name);
6449    }
6450
6451    public MolecularSequenceStructureVariantInnerComponent copy() {
6452      MolecularSequenceStructureVariantInnerComponent dst = new MolecularSequenceStructureVariantInnerComponent();
6453      copyValues(dst);
6454      return dst;
6455    }
6456
6457    public void copyValues(MolecularSequenceStructureVariantInnerComponent dst) {
6458      super.copyValues(dst);
6459      dst.start = start == null ? null : start.copy();
6460      dst.end = end == null ? null : end.copy();
6461    }
6462
6463    @Override
6464    public boolean equalsDeep(Base other_) {
6465      if (!super.equalsDeep(other_))
6466        return false;
6467      if (!(other_ instanceof MolecularSequenceStructureVariantInnerComponent))
6468        return false;
6469      MolecularSequenceStructureVariantInnerComponent o = (MolecularSequenceStructureVariantInnerComponent) other_;
6470      return compareDeep(start, o.start, true) && compareDeep(end, o.end, true);
6471    }
6472
6473    @Override
6474    public boolean equalsShallow(Base other_) {
6475      if (!super.equalsShallow(other_))
6476        return false;
6477      if (!(other_ instanceof MolecularSequenceStructureVariantInnerComponent))
6478        return false;
6479      MolecularSequenceStructureVariantInnerComponent o = (MolecularSequenceStructureVariantInnerComponent) other_;
6480      return compareValues(start, o.start, true) && compareValues(end, o.end, true);
6481    }
6482
6483    public boolean isEmpty() {
6484      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(start, end);
6485    }
6486
6487    public String fhirType() {
6488      return "MolecularSequence.structureVariant.inner";
6489
6490    }
6491
6492  }
6493
6494  /**
6495   * A unique identifier for this particular sequence instance. This is a
6496   * FHIR-defined id.
6497   */
6498  @Child(name = "identifier", type = {
6499      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
6500  @Description(shortDefinition = "Unique ID for this particular sequence. This is a FHIR-defined id", formalDefinition = "A unique identifier for this particular sequence instance. This is a FHIR-defined id.")
6501  protected List<Identifier> identifier;
6502
6503  /**
6504   * Amino Acid Sequence/ DNA Sequence / RNA Sequence.
6505   */
6506  @Child(name = "type", type = { CodeType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
6507  @Description(shortDefinition = "aa | dna | rna", formalDefinition = "Amino Acid Sequence/ DNA Sequence / RNA Sequence.")
6508  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/sequence-type")
6509  protected Enumeration<SequenceType> type;
6510
6511  /**
6512   * Whether the sequence is numbered starting at 0 (0-based numbering or
6513   * coordinates, inclusive start, exclusive end) or starting at 1 (1-based
6514   * numbering, inclusive start and inclusive end).
6515   */
6516  @Child(name = "coordinateSystem", type = {
6517      IntegerType.class }, order = 2, min = 1, max = 1, modifier = false, summary = true)
6518  @Description(shortDefinition = "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)", formalDefinition = "Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end).")
6519  protected IntegerType coordinateSystem;
6520
6521  /**
6522   * The patient whose sequencing results are described by this resource.
6523   */
6524  @Child(name = "patient", type = { Patient.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
6525  @Description(shortDefinition = "Who and/or what this is about", formalDefinition = "The patient whose sequencing results are described by this resource.")
6526  protected Reference patient;
6527
6528  /**
6529   * The actual object that is the target of the reference (The patient whose
6530   * sequencing results are described by this resource.)
6531   */
6532  protected Patient patientTarget;
6533
6534  /**
6535   * Specimen used for sequencing.
6536   */
6537  @Child(name = "specimen", type = { Specimen.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
6538  @Description(shortDefinition = "Specimen used for sequencing", formalDefinition = "Specimen used for sequencing.")
6539  protected Reference specimen;
6540
6541  /**
6542   * The actual object that is the target of the reference (Specimen used for
6543   * sequencing.)
6544   */
6545  protected Specimen specimenTarget;
6546
6547  /**
6548   * The method for sequencing, for example, chip information.
6549   */
6550  @Child(name = "device", type = { Device.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
6551  @Description(shortDefinition = "The method for sequencing", formalDefinition = "The method for sequencing, for example, chip information.")
6552  protected Reference device;
6553
6554  /**
6555   * The actual object that is the target of the reference (The method for
6556   * sequencing, for example, chip information.)
6557   */
6558  protected Device deviceTarget;
6559
6560  /**
6561   * The organization or lab that should be responsible for this result.
6562   */
6563  @Child(name = "performer", type = {
6564      Organization.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
6565  @Description(shortDefinition = "Who should be responsible for test result", formalDefinition = "The organization or lab that should be responsible for this result.")
6566  protected Reference performer;
6567
6568  /**
6569   * The actual object that is the target of the reference (The organization or
6570   * lab that should be responsible for this result.)
6571   */
6572  protected Organization performerTarget;
6573
6574  /**
6575   * The number of copies of the sequence of interest. (RNASeq).
6576   */
6577  @Child(name = "quantity", type = { Quantity.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
6578  @Description(shortDefinition = "The number of copies of the sequence of interest.  (RNASeq)", formalDefinition = "The number of copies of the sequence of interest. (RNASeq).")
6579  protected Quantity quantity;
6580
6581  /**
6582   * A sequence that is used as a reference to describe variants that are present
6583   * in a sequence analyzed.
6584   */
6585  @Child(name = "referenceSeq", type = {}, order = 8, min = 0, max = 1, modifier = false, summary = true)
6586  @Description(shortDefinition = "A sequence used as reference", formalDefinition = "A sequence that is used as a reference to describe variants that are present in a sequence analyzed.")
6587  protected MolecularSequenceReferenceSeqComponent referenceSeq;
6588
6589  /**
6590   * The definition of variant here originates from Sequence ontology
6591   * ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)).
6592   * This element can represent amino acid or nucleic sequence change(including
6593   * insertion,deletion,SNP,etc.) It can represent some complex mutation or
6594   * segment variation with the assist of CIGAR string.
6595   */
6596  @Child(name = "variant", type = {}, order = 9, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
6597  @Description(shortDefinition = "Variant in sequence", formalDefinition = "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.")
6598  protected List<MolecularSequenceVariantComponent> variant;
6599
6600  /**
6601   * Sequence that was observed. It is the result marked by referenceSeq along
6602   * with variant records on referenceSeq. This shall start from
6603   * referenceSeq.windowStart and end by referenceSeq.windowEnd.
6604   */
6605  @Child(name = "observedSeq", type = {
6606      StringType.class }, order = 10, min = 0, max = 1, modifier = false, summary = true)
6607  @Description(shortDefinition = "Sequence that was observed", formalDefinition = "Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall start from referenceSeq.windowStart and end by referenceSeq.windowEnd.")
6608  protected StringType observedSeq;
6609
6610  /**
6611   * An experimental feature attribute that defines the quality of the feature in
6612   * a quantitative way, such as a phred quality score
6613   * ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)).
6614   */
6615  @Child(name = "quality", type = {}, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
6616  @Description(shortDefinition = "An set of value as quality of sequence", formalDefinition = "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)).")
6617  protected List<MolecularSequenceQualityComponent> quality;
6618
6619  /**
6620   * Coverage (read depth or depth) is the average number of reads representing a
6621   * given nucleotide in the reconstructed sequence.
6622   */
6623  @Child(name = "readCoverage", type = {
6624      IntegerType.class }, order = 12, min = 0, max = 1, modifier = false, summary = true)
6625  @Description(shortDefinition = "Average number of reads representing a given nucleotide in the reconstructed sequence", formalDefinition = "Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.")
6626  protected IntegerType readCoverage;
6627
6628  /**
6629   * Configurations of the external repository. The repository shall store
6630   * target's observedSeq or records related with target's observedSeq.
6631   */
6632  @Child(name = "repository", type = {}, order = 13, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
6633  @Description(shortDefinition = "External repository which contains detailed report related with observedSeq in this resource", formalDefinition = "Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.")
6634  protected List<MolecularSequenceRepositoryComponent> repository;
6635
6636  /**
6637   * Pointer to next atomic sequence which at most contains one variant.
6638   */
6639  @Child(name = "pointer", type = {
6640      MolecularSequence.class }, order = 14, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
6641  @Description(shortDefinition = "Pointer to next atomic sequence", formalDefinition = "Pointer to next atomic sequence which at most contains one variant.")
6642  protected List<Reference> pointer;
6643  /**
6644   * The actual objects that are the target of the reference (Pointer to next
6645   * atomic sequence which at most contains one variant.)
6646   */
6647  protected List<MolecularSequence> pointerTarget;
6648
6649  /**
6650   * Information about chromosome structure variation.
6651   */
6652  @Child(name = "structureVariant", type = {}, order = 15, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
6653  @Description(shortDefinition = "Structural variant", formalDefinition = "Information about chromosome structure variation.")
6654  protected List<MolecularSequenceStructureVariantComponent> structureVariant;
6655
6656  private static final long serialVersionUID = -1541133500L;
6657
6658  /**
6659   * Constructor
6660   */
6661  public MolecularSequence() {
6662    super();
6663  }
6664
6665  /**
6666   * Constructor
6667   */
6668  public MolecularSequence(IntegerType coordinateSystem) {
6669    super();
6670    this.coordinateSystem = coordinateSystem;
6671  }
6672
6673  /**
6674   * @return {@link #identifier} (A unique identifier for this particular sequence
6675   *         instance. This is a FHIR-defined id.)
6676   */
6677  public List<Identifier> getIdentifier() {
6678    if (this.identifier == null)
6679      this.identifier = new ArrayList<Identifier>();
6680    return this.identifier;
6681  }
6682
6683  /**
6684   * @return Returns a reference to <code>this</code> for easy method chaining
6685   */
6686  public MolecularSequence setIdentifier(List<Identifier> theIdentifier) {
6687    this.identifier = theIdentifier;
6688    return this;
6689  }
6690
6691  public boolean hasIdentifier() {
6692    if (this.identifier == null)
6693      return false;
6694    for (Identifier item : this.identifier)
6695      if (!item.isEmpty())
6696        return true;
6697    return false;
6698  }
6699
6700  public Identifier addIdentifier() { // 3
6701    Identifier t = new Identifier();
6702    if (this.identifier == null)
6703      this.identifier = new ArrayList<Identifier>();
6704    this.identifier.add(t);
6705    return t;
6706  }
6707
6708  public MolecularSequence addIdentifier(Identifier t) { // 3
6709    if (t == null)
6710      return this;
6711    if (this.identifier == null)
6712      this.identifier = new ArrayList<Identifier>();
6713    this.identifier.add(t);
6714    return this;
6715  }
6716
6717  /**
6718   * @return The first repetition of repeating field {@link #identifier}, creating
6719   *         it if it does not already exist
6720   */
6721  public Identifier getIdentifierFirstRep() {
6722    if (getIdentifier().isEmpty()) {
6723      addIdentifier();
6724    }
6725    return getIdentifier().get(0);
6726  }
6727
6728  /**
6729   * @return {@link #type} (Amino Acid Sequence/ DNA Sequence / RNA Sequence.).
6730   *         This is the underlying object with id, value and extensions. The
6731   *         accessor "getType" gives direct access to the value
6732   */
6733  public Enumeration<SequenceType> getTypeElement() {
6734    if (this.type == null)
6735      if (Configuration.errorOnAutoCreate())
6736        throw new Error("Attempt to auto-create MolecularSequence.type");
6737      else if (Configuration.doAutoCreate())
6738        this.type = new Enumeration<SequenceType>(new SequenceTypeEnumFactory()); // bb
6739    return this.type;
6740  }
6741
6742  public boolean hasTypeElement() {
6743    return this.type != null && !this.type.isEmpty();
6744  }
6745
6746  public boolean hasType() {
6747    return this.type != null && !this.type.isEmpty();
6748  }
6749
6750  /**
6751   * @param value {@link #type} (Amino Acid Sequence/ DNA Sequence / RNA
6752   *              Sequence.). This is the underlying object with id, value and
6753   *              extensions. The accessor "getType" gives direct access to the
6754   *              value
6755   */
6756  public MolecularSequence setTypeElement(Enumeration<SequenceType> value) {
6757    this.type = value;
6758    return this;
6759  }
6760
6761  /**
6762   * @return Amino Acid Sequence/ DNA Sequence / RNA Sequence.
6763   */
6764  public SequenceType getType() {
6765    return this.type == null ? null : this.type.getValue();
6766  }
6767
6768  /**
6769   * @param value Amino Acid Sequence/ DNA Sequence / RNA Sequence.
6770   */
6771  public MolecularSequence setType(SequenceType value) {
6772    if (value == null)
6773      this.type = null;
6774    else {
6775      if (this.type == null)
6776        this.type = new Enumeration<SequenceType>(new SequenceTypeEnumFactory());
6777      this.type.setValue(value);
6778    }
6779    return this;
6780  }
6781
6782  /**
6783   * @return {@link #coordinateSystem} (Whether the sequence is numbered starting
6784   *         at 0 (0-based numbering or coordinates, inclusive start, exclusive
6785   *         end) or starting at 1 (1-based numbering, inclusive start and
6786   *         inclusive end).). This is the underlying object with id, value and
6787   *         extensions. The accessor "getCoordinateSystem" gives direct access to
6788   *         the value
6789   */
6790  public IntegerType getCoordinateSystemElement() {
6791    if (this.coordinateSystem == null)
6792      if (Configuration.errorOnAutoCreate())
6793        throw new Error("Attempt to auto-create MolecularSequence.coordinateSystem");
6794      else if (Configuration.doAutoCreate())
6795        this.coordinateSystem = new IntegerType(); // bb
6796    return this.coordinateSystem;
6797  }
6798
6799  public boolean hasCoordinateSystemElement() {
6800    return this.coordinateSystem != null && !this.coordinateSystem.isEmpty();
6801  }
6802
6803  public boolean hasCoordinateSystem() {
6804    return this.coordinateSystem != null && !this.coordinateSystem.isEmpty();
6805  }
6806
6807  /**
6808   * @param value {@link #coordinateSystem} (Whether the sequence is numbered
6809   *              starting at 0 (0-based numbering or coordinates, inclusive
6810   *              start, exclusive end) or starting at 1 (1-based numbering,
6811   *              inclusive start and inclusive end).). This is the underlying
6812   *              object with id, value and extensions. The accessor
6813   *              "getCoordinateSystem" gives direct access to the value
6814   */
6815  public MolecularSequence setCoordinateSystemElement(IntegerType value) {
6816    this.coordinateSystem = value;
6817    return this;
6818  }
6819
6820  /**
6821   * @return Whether the sequence is numbered starting at 0 (0-based numbering or
6822   *         coordinates, inclusive start, exclusive end) or starting at 1
6823   *         (1-based numbering, inclusive start and inclusive end).
6824   */
6825  public int getCoordinateSystem() {
6826    return this.coordinateSystem == null || this.coordinateSystem.isEmpty() ? 0 : this.coordinateSystem.getValue();
6827  }
6828
6829  /**
6830   * @param value Whether the sequence is numbered starting at 0 (0-based
6831   *              numbering or coordinates, inclusive start, exclusive end) or
6832   *              starting at 1 (1-based numbering, inclusive start and inclusive
6833   *              end).
6834   */
6835  public MolecularSequence setCoordinateSystem(int value) {
6836    if (this.coordinateSystem == null)
6837      this.coordinateSystem = new IntegerType();
6838    this.coordinateSystem.setValue(value);
6839    return this;
6840  }
6841
6842  /**
6843   * @return {@link #patient} (The patient whose sequencing results are described
6844   *         by this resource.)
6845   */
6846  public Reference getPatient() {
6847    if (this.patient == null)
6848      if (Configuration.errorOnAutoCreate())
6849        throw new Error("Attempt to auto-create MolecularSequence.patient");
6850      else if (Configuration.doAutoCreate())
6851        this.patient = new Reference(); // cc
6852    return this.patient;
6853  }
6854
6855  public boolean hasPatient() {
6856    return this.patient != null && !this.patient.isEmpty();
6857  }
6858
6859  /**
6860   * @param value {@link #patient} (The patient whose sequencing results are
6861   *              described by this resource.)
6862   */
6863  public MolecularSequence setPatient(Reference value) {
6864    this.patient = value;
6865    return this;
6866  }
6867
6868  /**
6869   * @return {@link #patient} The actual object that is the target of the
6870   *         reference. The reference library doesn't populate this, but you can
6871   *         use it to hold the resource if you resolve it. (The patient whose
6872   *         sequencing results are described by this resource.)
6873   */
6874  public Patient getPatientTarget() {
6875    if (this.patientTarget == null)
6876      if (Configuration.errorOnAutoCreate())
6877        throw new Error("Attempt to auto-create MolecularSequence.patient");
6878      else if (Configuration.doAutoCreate())
6879        this.patientTarget = new Patient(); // aa
6880    return this.patientTarget;
6881  }
6882
6883  /**
6884   * @param value {@link #patient} The actual object that is the target of the
6885   *              reference. The reference library doesn't use these, but you can
6886   *              use it to hold the resource if you resolve it. (The patient
6887   *              whose sequencing results are described by this resource.)
6888   */
6889  public MolecularSequence setPatientTarget(Patient value) {
6890    this.patientTarget = value;
6891    return this;
6892  }
6893
6894  /**
6895   * @return {@link #specimen} (Specimen used for sequencing.)
6896   */
6897  public Reference getSpecimen() {
6898    if (this.specimen == null)
6899      if (Configuration.errorOnAutoCreate())
6900        throw new Error("Attempt to auto-create MolecularSequence.specimen");
6901      else if (Configuration.doAutoCreate())
6902        this.specimen = new Reference(); // cc
6903    return this.specimen;
6904  }
6905
6906  public boolean hasSpecimen() {
6907    return this.specimen != null && !this.specimen.isEmpty();
6908  }
6909
6910  /**
6911   * @param value {@link #specimen} (Specimen used for sequencing.)
6912   */
6913  public MolecularSequence setSpecimen(Reference value) {
6914    this.specimen = value;
6915    return this;
6916  }
6917
6918  /**
6919   * @return {@link #specimen} The actual object that is the target of the
6920   *         reference. The reference library doesn't populate this, but you can
6921   *         use it to hold the resource if you resolve it. (Specimen used for
6922   *         sequencing.)
6923   */
6924  public Specimen getSpecimenTarget() {
6925    if (this.specimenTarget == null)
6926      if (Configuration.errorOnAutoCreate())
6927        throw new Error("Attempt to auto-create MolecularSequence.specimen");
6928      else if (Configuration.doAutoCreate())
6929        this.specimenTarget = new Specimen(); // aa
6930    return this.specimenTarget;
6931  }
6932
6933  /**
6934   * @param value {@link #specimen} The actual object that is the target of the
6935   *              reference. The reference library doesn't use these, but you can
6936   *              use it to hold the resource if you resolve it. (Specimen used
6937   *              for sequencing.)
6938   */
6939  public MolecularSequence setSpecimenTarget(Specimen value) {
6940    this.specimenTarget = value;
6941    return this;
6942  }
6943
6944  /**
6945   * @return {@link #device} (The method for sequencing, for example, chip
6946   *         information.)
6947   */
6948  public Reference getDevice() {
6949    if (this.device == null)
6950      if (Configuration.errorOnAutoCreate())
6951        throw new Error("Attempt to auto-create MolecularSequence.device");
6952      else if (Configuration.doAutoCreate())
6953        this.device = new Reference(); // cc
6954    return this.device;
6955  }
6956
6957  public boolean hasDevice() {
6958    return this.device != null && !this.device.isEmpty();
6959  }
6960
6961  /**
6962   * @param value {@link #device} (The method for sequencing, for example, chip
6963   *              information.)
6964   */
6965  public MolecularSequence setDevice(Reference value) {
6966    this.device = value;
6967    return this;
6968  }
6969
6970  /**
6971   * @return {@link #device} The actual object that is the target of the
6972   *         reference. The reference library doesn't populate this, but you can
6973   *         use it to hold the resource if you resolve it. (The method for
6974   *         sequencing, for example, chip information.)
6975   */
6976  public Device getDeviceTarget() {
6977    if (this.deviceTarget == null)
6978      if (Configuration.errorOnAutoCreate())
6979        throw new Error("Attempt to auto-create MolecularSequence.device");
6980      else if (Configuration.doAutoCreate())
6981        this.deviceTarget = new Device(); // aa
6982    return this.deviceTarget;
6983  }
6984
6985  /**
6986   * @param value {@link #device} The actual object that is the target of the
6987   *              reference. The reference library doesn't use these, but you can
6988   *              use it to hold the resource if you resolve it. (The method for
6989   *              sequencing, for example, chip information.)
6990   */
6991  public MolecularSequence setDeviceTarget(Device value) {
6992    this.deviceTarget = value;
6993    return this;
6994  }
6995
6996  /**
6997   * @return {@link #performer} (The organization or lab that should be
6998   *         responsible for this result.)
6999   */
7000  public Reference getPerformer() {
7001    if (this.performer == null)
7002      if (Configuration.errorOnAutoCreate())
7003        throw new Error("Attempt to auto-create MolecularSequence.performer");
7004      else if (Configuration.doAutoCreate())
7005        this.performer = new Reference(); // cc
7006    return this.performer;
7007  }
7008
7009  public boolean hasPerformer() {
7010    return this.performer != null && !this.performer.isEmpty();
7011  }
7012
7013  /**
7014   * @param value {@link #performer} (The organization or lab that should be
7015   *              responsible for this result.)
7016   */
7017  public MolecularSequence setPerformer(Reference value) {
7018    this.performer = value;
7019    return this;
7020  }
7021
7022  /**
7023   * @return {@link #performer} The actual object that is the target of the
7024   *         reference. The reference library doesn't populate this, but you can
7025   *         use it to hold the resource if you resolve it. (The organization or
7026   *         lab that should be responsible for this result.)
7027   */
7028  public Organization getPerformerTarget() {
7029    if (this.performerTarget == null)
7030      if (Configuration.errorOnAutoCreate())
7031        throw new Error("Attempt to auto-create MolecularSequence.performer");
7032      else if (Configuration.doAutoCreate())
7033        this.performerTarget = new Organization(); // aa
7034    return this.performerTarget;
7035  }
7036
7037  /**
7038   * @param value {@link #performer} The actual object that is the target of the
7039   *              reference. The reference library doesn't use these, but you can
7040   *              use it to hold the resource if you resolve it. (The organization
7041   *              or lab that should be responsible for this result.)
7042   */
7043  public MolecularSequence setPerformerTarget(Organization value) {
7044    this.performerTarget = value;
7045    return this;
7046  }
7047
7048  /**
7049   * @return {@link #quantity} (The number of copies of the sequence of interest.
7050   *         (RNASeq).)
7051   */
7052  public Quantity getQuantity() {
7053    if (this.quantity == null)
7054      if (Configuration.errorOnAutoCreate())
7055        throw new Error("Attempt to auto-create MolecularSequence.quantity");
7056      else if (Configuration.doAutoCreate())
7057        this.quantity = new Quantity(); // cc
7058    return this.quantity;
7059  }
7060
7061  public boolean hasQuantity() {
7062    return this.quantity != null && !this.quantity.isEmpty();
7063  }
7064
7065  /**
7066   * @param value {@link #quantity} (The number of copies of the sequence of
7067   *              interest. (RNASeq).)
7068   */
7069  public MolecularSequence setQuantity(Quantity value) {
7070    this.quantity = value;
7071    return this;
7072  }
7073
7074  /**
7075   * @return {@link #referenceSeq} (A sequence that is used as a reference to
7076   *         describe variants that are present in a sequence analyzed.)
7077   */
7078  public MolecularSequenceReferenceSeqComponent getReferenceSeq() {
7079    if (this.referenceSeq == null)
7080      if (Configuration.errorOnAutoCreate())
7081        throw new Error("Attempt to auto-create MolecularSequence.referenceSeq");
7082      else if (Configuration.doAutoCreate())
7083        this.referenceSeq = new MolecularSequenceReferenceSeqComponent(); // cc
7084    return this.referenceSeq;
7085  }
7086
7087  public boolean hasReferenceSeq() {
7088    return this.referenceSeq != null && !this.referenceSeq.isEmpty();
7089  }
7090
7091  /**
7092   * @param value {@link #referenceSeq} (A sequence that is used as a reference to
7093   *              describe variants that are present in a sequence analyzed.)
7094   */
7095  public MolecularSequence setReferenceSeq(MolecularSequenceReferenceSeqComponent value) {
7096    this.referenceSeq = value;
7097    return this;
7098  }
7099
7100  /**
7101   * @return {@link #variant} (The definition of variant here originates from
7102   *         Sequence ontology
7103   *         ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)).
7104   *         This element can represent amino acid or nucleic sequence
7105   *         change(including insertion,deletion,SNP,etc.) It can represent some
7106   *         complex mutation or segment variation with the assist of CIGAR
7107   *         string.)
7108   */
7109  public List<MolecularSequenceVariantComponent> getVariant() {
7110    if (this.variant == null)
7111      this.variant = new ArrayList<MolecularSequenceVariantComponent>();
7112    return this.variant;
7113  }
7114
7115  /**
7116   * @return Returns a reference to <code>this</code> for easy method chaining
7117   */
7118  public MolecularSequence setVariant(List<MolecularSequenceVariantComponent> theVariant) {
7119    this.variant = theVariant;
7120    return this;
7121  }
7122
7123  public boolean hasVariant() {
7124    if (this.variant == null)
7125      return false;
7126    for (MolecularSequenceVariantComponent item : this.variant)
7127      if (!item.isEmpty())
7128        return true;
7129    return false;
7130  }
7131
7132  public MolecularSequenceVariantComponent addVariant() { // 3
7133    MolecularSequenceVariantComponent t = new MolecularSequenceVariantComponent();
7134    if (this.variant == null)
7135      this.variant = new ArrayList<MolecularSequenceVariantComponent>();
7136    this.variant.add(t);
7137    return t;
7138  }
7139
7140  public MolecularSequence addVariant(MolecularSequenceVariantComponent t) { // 3
7141    if (t == null)
7142      return this;
7143    if (this.variant == null)
7144      this.variant = new ArrayList<MolecularSequenceVariantComponent>();
7145    this.variant.add(t);
7146    return this;
7147  }
7148
7149  /**
7150   * @return The first repetition of repeating field {@link #variant}, creating it
7151   *         if it does not already exist
7152   */
7153  public MolecularSequenceVariantComponent getVariantFirstRep() {
7154    if (getVariant().isEmpty()) {
7155      addVariant();
7156    }
7157    return getVariant().get(0);
7158  }
7159
7160  /**
7161   * @return {@link #observedSeq} (Sequence that was observed. It is the result
7162   *         marked by referenceSeq along with variant records on referenceSeq.
7163   *         This shall start from referenceSeq.windowStart and end by
7164   *         referenceSeq.windowEnd.). This is the underlying object with id,
7165   *         value and extensions. The accessor "getObservedSeq" gives direct
7166   *         access to the value
7167   */
7168  public StringType getObservedSeqElement() {
7169    if (this.observedSeq == null)
7170      if (Configuration.errorOnAutoCreate())
7171        throw new Error("Attempt to auto-create MolecularSequence.observedSeq");
7172      else if (Configuration.doAutoCreate())
7173        this.observedSeq = new StringType(); // bb
7174    return this.observedSeq;
7175  }
7176
7177  public boolean hasObservedSeqElement() {
7178    return this.observedSeq != null && !this.observedSeq.isEmpty();
7179  }
7180
7181  public boolean hasObservedSeq() {
7182    return this.observedSeq != null && !this.observedSeq.isEmpty();
7183  }
7184
7185  /**
7186   * @param value {@link #observedSeq} (Sequence that was observed. It is the
7187   *              result marked by referenceSeq along with variant records on
7188   *              referenceSeq. This shall start from referenceSeq.windowStart and
7189   *              end by referenceSeq.windowEnd.). This is the underlying object
7190   *              with id, value and extensions. The accessor "getObservedSeq"
7191   *              gives direct access to the value
7192   */
7193  public MolecularSequence setObservedSeqElement(StringType value) {
7194    this.observedSeq = value;
7195    return this;
7196  }
7197
7198  /**
7199   * @return Sequence that was observed. It is the result marked by referenceSeq
7200   *         along with variant records on referenceSeq. This shall start from
7201   *         referenceSeq.windowStart and end by referenceSeq.windowEnd.
7202   */
7203  public String getObservedSeq() {
7204    return this.observedSeq == null ? null : this.observedSeq.getValue();
7205  }
7206
7207  /**
7208   * @param value Sequence that was observed. It is the result marked by
7209   *              referenceSeq along with variant records on referenceSeq. This
7210   *              shall start from referenceSeq.windowStart and end by
7211   *              referenceSeq.windowEnd.
7212   */
7213  public MolecularSequence setObservedSeq(String value) {
7214    if (Utilities.noString(value))
7215      this.observedSeq = null;
7216    else {
7217      if (this.observedSeq == null)
7218        this.observedSeq = new StringType();
7219      this.observedSeq.setValue(value);
7220    }
7221    return this;
7222  }
7223
7224  /**
7225   * @return {@link #quality} (An experimental feature attribute that defines the
7226   *         quality of the feature in a quantitative way, such as a phred quality
7227   *         score
7228   *         ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)).)
7229   */
7230  public List<MolecularSequenceQualityComponent> getQuality() {
7231    if (this.quality == null)
7232      this.quality = new ArrayList<MolecularSequenceQualityComponent>();
7233    return this.quality;
7234  }
7235
7236  /**
7237   * @return Returns a reference to <code>this</code> for easy method chaining
7238   */
7239  public MolecularSequence setQuality(List<MolecularSequenceQualityComponent> theQuality) {
7240    this.quality = theQuality;
7241    return this;
7242  }
7243
7244  public boolean hasQuality() {
7245    if (this.quality == null)
7246      return false;
7247    for (MolecularSequenceQualityComponent item : this.quality)
7248      if (!item.isEmpty())
7249        return true;
7250    return false;
7251  }
7252
7253  public MolecularSequenceQualityComponent addQuality() { // 3
7254    MolecularSequenceQualityComponent t = new MolecularSequenceQualityComponent();
7255    if (this.quality == null)
7256      this.quality = new ArrayList<MolecularSequenceQualityComponent>();
7257    this.quality.add(t);
7258    return t;
7259  }
7260
7261  public MolecularSequence addQuality(MolecularSequenceQualityComponent t) { // 3
7262    if (t == null)
7263      return this;
7264    if (this.quality == null)
7265      this.quality = new ArrayList<MolecularSequenceQualityComponent>();
7266    this.quality.add(t);
7267    return this;
7268  }
7269
7270  /**
7271   * @return The first repetition of repeating field {@link #quality}, creating it
7272   *         if it does not already exist
7273   */
7274  public MolecularSequenceQualityComponent getQualityFirstRep() {
7275    if (getQuality().isEmpty()) {
7276      addQuality();
7277    }
7278    return getQuality().get(0);
7279  }
7280
7281  /**
7282   * @return {@link #readCoverage} (Coverage (read depth or depth) is the average
7283   *         number of reads representing a given nucleotide in the reconstructed
7284   *         sequence.). This is the underlying object with id, value and
7285   *         extensions. The accessor "getReadCoverage" gives direct access to the
7286   *         value
7287   */
7288  public IntegerType getReadCoverageElement() {
7289    if (this.readCoverage == null)
7290      if (Configuration.errorOnAutoCreate())
7291        throw new Error("Attempt to auto-create MolecularSequence.readCoverage");
7292      else if (Configuration.doAutoCreate())
7293        this.readCoverage = new IntegerType(); // bb
7294    return this.readCoverage;
7295  }
7296
7297  public boolean hasReadCoverageElement() {
7298    return this.readCoverage != null && !this.readCoverage.isEmpty();
7299  }
7300
7301  public boolean hasReadCoverage() {
7302    return this.readCoverage != null && !this.readCoverage.isEmpty();
7303  }
7304
7305  /**
7306   * @param value {@link #readCoverage} (Coverage (read depth or depth) is the
7307   *              average number of reads representing a given nucleotide in the
7308   *              reconstructed sequence.). This is the underlying object with id,
7309   *              value and extensions. The accessor "getReadCoverage" gives
7310   *              direct access to the value
7311   */
7312  public MolecularSequence setReadCoverageElement(IntegerType value) {
7313    this.readCoverage = value;
7314    return this;
7315  }
7316
7317  /**
7318   * @return Coverage (read depth or depth) is the average number of reads
7319   *         representing a given nucleotide in the reconstructed sequence.
7320   */
7321  public int getReadCoverage() {
7322    return this.readCoverage == null || this.readCoverage.isEmpty() ? 0 : this.readCoverage.getValue();
7323  }
7324
7325  /**
7326   * @param value Coverage (read depth or depth) is the average number of reads
7327   *              representing a given nucleotide in the reconstructed sequence.
7328   */
7329  public MolecularSequence setReadCoverage(int value) {
7330    if (this.readCoverage == null)
7331      this.readCoverage = new IntegerType();
7332    this.readCoverage.setValue(value);
7333    return this;
7334  }
7335
7336  /**
7337   * @return {@link #repository} (Configurations of the external repository. The
7338   *         repository shall store target's observedSeq or records related with
7339   *         target's observedSeq.)
7340   */
7341  public List<MolecularSequenceRepositoryComponent> getRepository() {
7342    if (this.repository == null)
7343      this.repository = new ArrayList<MolecularSequenceRepositoryComponent>();
7344    return this.repository;
7345  }
7346
7347  /**
7348   * @return Returns a reference to <code>this</code> for easy method chaining
7349   */
7350  public MolecularSequence setRepository(List<MolecularSequenceRepositoryComponent> theRepository) {
7351    this.repository = theRepository;
7352    return this;
7353  }
7354
7355  public boolean hasRepository() {
7356    if (this.repository == null)
7357      return false;
7358    for (MolecularSequenceRepositoryComponent item : this.repository)
7359      if (!item.isEmpty())
7360        return true;
7361    return false;
7362  }
7363
7364  public MolecularSequenceRepositoryComponent addRepository() { // 3
7365    MolecularSequenceRepositoryComponent t = new MolecularSequenceRepositoryComponent();
7366    if (this.repository == null)
7367      this.repository = new ArrayList<MolecularSequenceRepositoryComponent>();
7368    this.repository.add(t);
7369    return t;
7370  }
7371
7372  public MolecularSequence addRepository(MolecularSequenceRepositoryComponent t) { // 3
7373    if (t == null)
7374      return this;
7375    if (this.repository == null)
7376      this.repository = new ArrayList<MolecularSequenceRepositoryComponent>();
7377    this.repository.add(t);
7378    return this;
7379  }
7380
7381  /**
7382   * @return The first repetition of repeating field {@link #repository}, creating
7383   *         it if it does not already exist
7384   */
7385  public MolecularSequenceRepositoryComponent getRepositoryFirstRep() {
7386    if (getRepository().isEmpty()) {
7387      addRepository();
7388    }
7389    return getRepository().get(0);
7390  }
7391
7392  /**
7393   * @return {@link #pointer} (Pointer to next atomic sequence which at most
7394   *         contains one variant.)
7395   */
7396  public List<Reference> getPointer() {
7397    if (this.pointer == null)
7398      this.pointer = new ArrayList<Reference>();
7399    return this.pointer;
7400  }
7401
7402  /**
7403   * @return Returns a reference to <code>this</code> for easy method chaining
7404   */
7405  public MolecularSequence setPointer(List<Reference> thePointer) {
7406    this.pointer = thePointer;
7407    return this;
7408  }
7409
7410  public boolean hasPointer() {
7411    if (this.pointer == null)
7412      return false;
7413    for (Reference item : this.pointer)
7414      if (!item.isEmpty())
7415        return true;
7416    return false;
7417  }
7418
7419  public Reference addPointer() { // 3
7420    Reference t = new Reference();
7421    if (this.pointer == null)
7422      this.pointer = new ArrayList<Reference>();
7423    this.pointer.add(t);
7424    return t;
7425  }
7426
7427  public MolecularSequence addPointer(Reference t) { // 3
7428    if (t == null)
7429      return this;
7430    if (this.pointer == null)
7431      this.pointer = new ArrayList<Reference>();
7432    this.pointer.add(t);
7433    return this;
7434  }
7435
7436  /**
7437   * @return The first repetition of repeating field {@link #pointer}, creating it
7438   *         if it does not already exist
7439   */
7440  public Reference getPointerFirstRep() {
7441    if (getPointer().isEmpty()) {
7442      addPointer();
7443    }
7444    return getPointer().get(0);
7445  }
7446
7447  /**
7448   * @deprecated Use Reference#setResource(IBaseResource) instead
7449   */
7450  @Deprecated
7451  public List<MolecularSequence> getPointerTarget() {
7452    if (this.pointerTarget == null)
7453      this.pointerTarget = new ArrayList<MolecularSequence>();
7454    return this.pointerTarget;
7455  }
7456
7457  /**
7458   * @deprecated Use Reference#setResource(IBaseResource) instead
7459   */
7460  @Deprecated
7461  public MolecularSequence addPointerTarget() {
7462    MolecularSequence r = new MolecularSequence();
7463    if (this.pointerTarget == null)
7464      this.pointerTarget = new ArrayList<MolecularSequence>();
7465    this.pointerTarget.add(r);
7466    return r;
7467  }
7468
7469  /**
7470   * @return {@link #structureVariant} (Information about chromosome structure
7471   *         variation.)
7472   */
7473  public List<MolecularSequenceStructureVariantComponent> getStructureVariant() {
7474    if (this.structureVariant == null)
7475      this.structureVariant = new ArrayList<MolecularSequenceStructureVariantComponent>();
7476    return this.structureVariant;
7477  }
7478
7479  /**
7480   * @return Returns a reference to <code>this</code> for easy method chaining
7481   */
7482  public MolecularSequence setStructureVariant(List<MolecularSequenceStructureVariantComponent> theStructureVariant) {
7483    this.structureVariant = theStructureVariant;
7484    return this;
7485  }
7486
7487  public boolean hasStructureVariant() {
7488    if (this.structureVariant == null)
7489      return false;
7490    for (MolecularSequenceStructureVariantComponent item : this.structureVariant)
7491      if (!item.isEmpty())
7492        return true;
7493    return false;
7494  }
7495
7496  public MolecularSequenceStructureVariantComponent addStructureVariant() { // 3
7497    MolecularSequenceStructureVariantComponent t = new MolecularSequenceStructureVariantComponent();
7498    if (this.structureVariant == null)
7499      this.structureVariant = new ArrayList<MolecularSequenceStructureVariantComponent>();
7500    this.structureVariant.add(t);
7501    return t;
7502  }
7503
7504  public MolecularSequence addStructureVariant(MolecularSequenceStructureVariantComponent t) { // 3
7505    if (t == null)
7506      return this;
7507    if (this.structureVariant == null)
7508      this.structureVariant = new ArrayList<MolecularSequenceStructureVariantComponent>();
7509    this.structureVariant.add(t);
7510    return this;
7511  }
7512
7513  /**
7514   * @return The first repetition of repeating field {@link #structureVariant},
7515   *         creating it if it does not already exist
7516   */
7517  public MolecularSequenceStructureVariantComponent getStructureVariantFirstRep() {
7518    if (getStructureVariant().isEmpty()) {
7519      addStructureVariant();
7520    }
7521    return getStructureVariant().get(0);
7522  }
7523
7524  protected void listChildren(List<Property> children) {
7525    super.listChildren(children);
7526    children.add(new Property("identifier", "Identifier",
7527        "A unique identifier for this particular sequence instance. This is a FHIR-defined id.", 0,
7528        java.lang.Integer.MAX_VALUE, identifier));
7529    children.add(new Property("type", "code", "Amino Acid Sequence/ DNA Sequence / RNA Sequence.", 0, 1, type));
7530    children.add(new Property("coordinateSystem", "integer",
7531        "Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end).",
7532        0, 1, coordinateSystem));
7533    children.add(new Property("patient", "Reference(Patient)",
7534        "The patient whose sequencing results are described by this resource.", 0, 1, patient));
7535    children.add(new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, 1, specimen));
7536    children.add(new Property("device", "Reference(Device)",
7537        "The method for sequencing, for example, chip information.", 0, 1, device));
7538    children.add(new Property("performer", "Reference(Organization)",
7539        "The organization or lab that should be responsible for this result.", 0, 1, performer));
7540    children.add(new Property("quantity", "Quantity", "The number of copies of the sequence of interest. (RNASeq).", 0,
7541        1, quantity));
7542    children.add(new Property("referenceSeq", "",
7543        "A sequence that is used as a reference to describe variants that are present in a sequence analyzed.", 0, 1,
7544        referenceSeq));
7545    children.add(new Property("variant", "",
7546        "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.",
7547        0, java.lang.Integer.MAX_VALUE, variant));
7548    children.add(new Property("observedSeq", "string",
7549        "Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall start from referenceSeq.windowStart and end by referenceSeq.windowEnd.",
7550        0, 1, observedSeq));
7551    children.add(new Property("quality", "",
7552        "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)).",
7553        0, java.lang.Integer.MAX_VALUE, quality));
7554    children.add(new Property("readCoverage", "integer",
7555        "Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.",
7556        0, 1, readCoverage));
7557    children.add(new Property("repository", "",
7558        "Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.",
7559        0, java.lang.Integer.MAX_VALUE, repository));
7560    children.add(new Property("pointer", "Reference(MolecularSequence)",
7561        "Pointer to next atomic sequence which at most contains one variant.", 0, java.lang.Integer.MAX_VALUE,
7562        pointer));
7563    children.add(new Property("structureVariant", "", "Information about chromosome structure variation.", 0,
7564        java.lang.Integer.MAX_VALUE, structureVariant));
7565  }
7566
7567  @Override
7568  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7569    switch (_hash) {
7570    case -1618432855:
7571      /* identifier */ return new Property("identifier", "Identifier",
7572          "A unique identifier for this particular sequence instance. This is a FHIR-defined id.", 0,
7573          java.lang.Integer.MAX_VALUE, identifier);
7574    case 3575610:
7575      /* type */ return new Property("type", "code", "Amino Acid Sequence/ DNA Sequence / RNA Sequence.", 0, 1, type);
7576    case 354212295:
7577      /* coordinateSystem */ return new Property("coordinateSystem", "integer",
7578          "Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end).",
7579          0, 1, coordinateSystem);
7580    case -791418107:
7581      /* patient */ return new Property("patient", "Reference(Patient)",
7582          "The patient whose sequencing results are described by this resource.", 0, 1, patient);
7583    case -2132868344:
7584      /* specimen */ return new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, 1,
7585          specimen);
7586    case -1335157162:
7587      /* device */ return new Property("device", "Reference(Device)",
7588          "The method for sequencing, for example, chip information.", 0, 1, device);
7589    case 481140686:
7590      /* performer */ return new Property("performer", "Reference(Organization)",
7591          "The organization or lab that should be responsible for this result.", 0, 1, performer);
7592    case -1285004149:
7593      /* quantity */ return new Property("quantity", "Quantity",
7594          "The number of copies of the sequence of interest. (RNASeq).", 0, 1, quantity);
7595    case -502547180:
7596      /* referenceSeq */ return new Property("referenceSeq", "",
7597          "A sequence that is used as a reference to describe variants that are present in a sequence analyzed.", 0, 1,
7598          referenceSeq);
7599    case 236785797:
7600      /* variant */ return new Property("variant", "",
7601          "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.",
7602          0, java.lang.Integer.MAX_VALUE, variant);
7603    case 125541495:
7604      /* observedSeq */ return new Property("observedSeq", "string",
7605          "Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall start from referenceSeq.windowStart and end by referenceSeq.windowEnd.",
7606          0, 1, observedSeq);
7607    case 651215103:
7608      /* quality */ return new Property("quality", "",
7609          "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)).",
7610          0, java.lang.Integer.MAX_VALUE, quality);
7611    case -1798816354:
7612      /* readCoverage */ return new Property("readCoverage", "integer",
7613          "Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.",
7614          0, 1, readCoverage);
7615    case 1950800714:
7616      /* repository */ return new Property("repository", "",
7617          "Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.",
7618          0, java.lang.Integer.MAX_VALUE, repository);
7619    case -400605635:
7620      /* pointer */ return new Property("pointer", "Reference(MolecularSequence)",
7621          "Pointer to next atomic sequence which at most contains one variant.", 0, java.lang.Integer.MAX_VALUE,
7622          pointer);
7623    case 757269394:
7624      /* structureVariant */ return new Property("structureVariant", "",
7625          "Information about chromosome structure variation.", 0, java.lang.Integer.MAX_VALUE, structureVariant);
7626    default:
7627      return super.getNamedProperty(_hash, _name, _checkValid);
7628    }
7629
7630  }
7631
7632  @Override
7633  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7634    switch (hash) {
7635    case -1618432855:
7636      /* identifier */ return this.identifier == null ? new Base[0]
7637          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
7638    case 3575610:
7639      /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // Enumeration<SequenceType>
7640    case 354212295:
7641      /* coordinateSystem */ return this.coordinateSystem == null ? new Base[0] : new Base[] { this.coordinateSystem }; // IntegerType
7642    case -791418107:
7643      /* patient */ return this.patient == null ? new Base[0] : new Base[] { this.patient }; // Reference
7644    case -2132868344:
7645      /* specimen */ return this.specimen == null ? new Base[0] : new Base[] { this.specimen }; // Reference
7646    case -1335157162:
7647      /* device */ return this.device == null ? new Base[0] : new Base[] { this.device }; // Reference
7648    case 481140686:
7649      /* performer */ return this.performer == null ? new Base[0] : new Base[] { this.performer }; // Reference
7650    case -1285004149:
7651      /* quantity */ return this.quantity == null ? new Base[0] : new Base[] { this.quantity }; // Quantity
7652    case -502547180:
7653      /* referenceSeq */ return this.referenceSeq == null ? new Base[0] : new Base[] { this.referenceSeq }; // MolecularSequenceReferenceSeqComponent
7654    case 236785797:
7655      /* variant */ return this.variant == null ? new Base[0] : this.variant.toArray(new Base[this.variant.size()]); // MolecularSequenceVariantComponent
7656    case 125541495:
7657      /* observedSeq */ return this.observedSeq == null ? new Base[0] : new Base[] { this.observedSeq }; // StringType
7658    case 651215103:
7659      /* quality */ return this.quality == null ? new Base[0] : this.quality.toArray(new Base[this.quality.size()]); // MolecularSequenceQualityComponent
7660    case -1798816354:
7661      /* readCoverage */ return this.readCoverage == null ? new Base[0] : new Base[] { this.readCoverage }; // IntegerType
7662    case 1950800714:
7663      /* repository */ return this.repository == null ? new Base[0]
7664          : this.repository.toArray(new Base[this.repository.size()]); // MolecularSequenceRepositoryComponent
7665    case -400605635:
7666      /* pointer */ return this.pointer == null ? new Base[0] : this.pointer.toArray(new Base[this.pointer.size()]); // Reference
7667    case 757269394:
7668      /* structureVariant */ return this.structureVariant == null ? new Base[0]
7669          : this.structureVariant.toArray(new Base[this.structureVariant.size()]); // MolecularSequenceStructureVariantComponent
7670    default:
7671      return super.getProperty(hash, name, checkValid);
7672    }
7673
7674  }
7675
7676  @Override
7677  public Base setProperty(int hash, String name, Base value) throws FHIRException {
7678    switch (hash) {
7679    case -1618432855: // identifier
7680      this.getIdentifier().add(castToIdentifier(value)); // Identifier
7681      return value;
7682    case 3575610: // type
7683      value = new SequenceTypeEnumFactory().fromType(castToCode(value));
7684      this.type = (Enumeration) value; // Enumeration<SequenceType>
7685      return value;
7686    case 354212295: // coordinateSystem
7687      this.coordinateSystem = castToInteger(value); // IntegerType
7688      return value;
7689    case -791418107: // patient
7690      this.patient = castToReference(value); // Reference
7691      return value;
7692    case -2132868344: // specimen
7693      this.specimen = castToReference(value); // Reference
7694      return value;
7695    case -1335157162: // device
7696      this.device = castToReference(value); // Reference
7697      return value;
7698    case 481140686: // performer
7699      this.performer = castToReference(value); // Reference
7700      return value;
7701    case -1285004149: // quantity
7702      this.quantity = castToQuantity(value); // Quantity
7703      return value;
7704    case -502547180: // referenceSeq
7705      this.referenceSeq = (MolecularSequenceReferenceSeqComponent) value; // MolecularSequenceReferenceSeqComponent
7706      return value;
7707    case 236785797: // variant
7708      this.getVariant().add((MolecularSequenceVariantComponent) value); // MolecularSequenceVariantComponent
7709      return value;
7710    case 125541495: // observedSeq
7711      this.observedSeq = castToString(value); // StringType
7712      return value;
7713    case 651215103: // quality
7714      this.getQuality().add((MolecularSequenceQualityComponent) value); // MolecularSequenceQualityComponent
7715      return value;
7716    case -1798816354: // readCoverage
7717      this.readCoverage = castToInteger(value); // IntegerType
7718      return value;
7719    case 1950800714: // repository
7720      this.getRepository().add((MolecularSequenceRepositoryComponent) value); // MolecularSequenceRepositoryComponent
7721      return value;
7722    case -400605635: // pointer
7723      this.getPointer().add(castToReference(value)); // Reference
7724      return value;
7725    case 757269394: // structureVariant
7726      this.getStructureVariant().add((MolecularSequenceStructureVariantComponent) value); // MolecularSequenceStructureVariantComponent
7727      return value;
7728    default:
7729      return super.setProperty(hash, name, value);
7730    }
7731
7732  }
7733
7734  @Override
7735  public Base setProperty(String name, Base value) throws FHIRException {
7736    if (name.equals("identifier")) {
7737      this.getIdentifier().add(castToIdentifier(value));
7738    } else if (name.equals("type")) {
7739      value = new SequenceTypeEnumFactory().fromType(castToCode(value));
7740      this.type = (Enumeration) value; // Enumeration<SequenceType>
7741    } else if (name.equals("coordinateSystem")) {
7742      this.coordinateSystem = castToInteger(value); // IntegerType
7743    } else if (name.equals("patient")) {
7744      this.patient = castToReference(value); // Reference
7745    } else if (name.equals("specimen")) {
7746      this.specimen = castToReference(value); // Reference
7747    } else if (name.equals("device")) {
7748      this.device = castToReference(value); // Reference
7749    } else if (name.equals("performer")) {
7750      this.performer = castToReference(value); // Reference
7751    } else if (name.equals("quantity")) {
7752      this.quantity = castToQuantity(value); // Quantity
7753    } else if (name.equals("referenceSeq")) {
7754      this.referenceSeq = (MolecularSequenceReferenceSeqComponent) value; // MolecularSequenceReferenceSeqComponent
7755    } else if (name.equals("variant")) {
7756      this.getVariant().add((MolecularSequenceVariantComponent) value);
7757    } else if (name.equals("observedSeq")) {
7758      this.observedSeq = castToString(value); // StringType
7759    } else if (name.equals("quality")) {
7760      this.getQuality().add((MolecularSequenceQualityComponent) value);
7761    } else if (name.equals("readCoverage")) {
7762      this.readCoverage = castToInteger(value); // IntegerType
7763    } else if (name.equals("repository")) {
7764      this.getRepository().add((MolecularSequenceRepositoryComponent) value);
7765    } else if (name.equals("pointer")) {
7766      this.getPointer().add(castToReference(value));
7767    } else if (name.equals("structureVariant")) {
7768      this.getStructureVariant().add((MolecularSequenceStructureVariantComponent) value);
7769    } else
7770      return super.setProperty(name, value);
7771    return value;
7772  }
7773
7774  @Override
7775  public void removeChild(String name, Base value) throws FHIRException {
7776    if (name.equals("identifier")) {
7777      this.getIdentifier().remove(castToIdentifier(value));
7778    } else if (name.equals("type")) {
7779      this.type = null;
7780    } else if (name.equals("coordinateSystem")) {
7781      this.coordinateSystem = null;
7782    } else if (name.equals("patient")) {
7783      this.patient = null;
7784    } else if (name.equals("specimen")) {
7785      this.specimen = null;
7786    } else if (name.equals("device")) {
7787      this.device = null;
7788    } else if (name.equals("performer")) {
7789      this.performer = null;
7790    } else if (name.equals("quantity")) {
7791      this.quantity = null;
7792    } else if (name.equals("referenceSeq")) {
7793      this.referenceSeq = (MolecularSequenceReferenceSeqComponent) value; // MolecularSequenceReferenceSeqComponent
7794    } else if (name.equals("variant")) {
7795      this.getVariant().remove((MolecularSequenceVariantComponent) value);
7796    } else if (name.equals("observedSeq")) {
7797      this.observedSeq = null;
7798    } else if (name.equals("quality")) {
7799      this.getQuality().remove((MolecularSequenceQualityComponent) value);
7800    } else if (name.equals("readCoverage")) {
7801      this.readCoverage = null;
7802    } else if (name.equals("repository")) {
7803      this.getRepository().remove((MolecularSequenceRepositoryComponent) value);
7804    } else if (name.equals("pointer")) {
7805      this.getPointer().remove(castToReference(value));
7806    } else if (name.equals("structureVariant")) {
7807      this.getStructureVariant().remove((MolecularSequenceStructureVariantComponent) value);
7808    } else
7809      super.removeChild(name, value);
7810    
7811  }
7812
7813  @Override
7814  public Base makeProperty(int hash, String name) throws FHIRException {
7815    switch (hash) {
7816    case -1618432855:
7817      return addIdentifier();
7818    case 3575610:
7819      return getTypeElement();
7820    case 354212295:
7821      return getCoordinateSystemElement();
7822    case -791418107:
7823      return getPatient();
7824    case -2132868344:
7825      return getSpecimen();
7826    case -1335157162:
7827      return getDevice();
7828    case 481140686:
7829      return getPerformer();
7830    case -1285004149:
7831      return getQuantity();
7832    case -502547180:
7833      return getReferenceSeq();
7834    case 236785797:
7835      return addVariant();
7836    case 125541495:
7837      return getObservedSeqElement();
7838    case 651215103:
7839      return addQuality();
7840    case -1798816354:
7841      return getReadCoverageElement();
7842    case 1950800714:
7843      return addRepository();
7844    case -400605635:
7845      return addPointer();
7846    case 757269394:
7847      return addStructureVariant();
7848    default:
7849      return super.makeProperty(hash, name);
7850    }
7851
7852  }
7853
7854  @Override
7855  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7856    switch (hash) {
7857    case -1618432855:
7858      /* identifier */ return new String[] { "Identifier" };
7859    case 3575610:
7860      /* type */ return new String[] { "code" };
7861    case 354212295:
7862      /* coordinateSystem */ return new String[] { "integer" };
7863    case -791418107:
7864      /* patient */ return new String[] { "Reference" };
7865    case -2132868344:
7866      /* specimen */ return new String[] { "Reference" };
7867    case -1335157162:
7868      /* device */ return new String[] { "Reference" };
7869    case 481140686:
7870      /* performer */ return new String[] { "Reference" };
7871    case -1285004149:
7872      /* quantity */ return new String[] { "Quantity" };
7873    case -502547180:
7874      /* referenceSeq */ return new String[] {};
7875    case 236785797:
7876      /* variant */ return new String[] {};
7877    case 125541495:
7878      /* observedSeq */ return new String[] { "string" };
7879    case 651215103:
7880      /* quality */ return new String[] {};
7881    case -1798816354:
7882      /* readCoverage */ return new String[] { "integer" };
7883    case 1950800714:
7884      /* repository */ return new String[] {};
7885    case -400605635:
7886      /* pointer */ return new String[] { "Reference" };
7887    case 757269394:
7888      /* structureVariant */ return new String[] {};
7889    default:
7890      return super.getTypesForProperty(hash, name);
7891    }
7892
7893  }
7894
7895  @Override
7896  public Base addChild(String name) throws FHIRException {
7897    if (name.equals("identifier")) {
7898      return addIdentifier();
7899    } else if (name.equals("type")) {
7900      throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.type");
7901    } else if (name.equals("coordinateSystem")) {
7902      throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.coordinateSystem");
7903    } else if (name.equals("patient")) {
7904      this.patient = new Reference();
7905      return this.patient;
7906    } else if (name.equals("specimen")) {
7907      this.specimen = new Reference();
7908      return this.specimen;
7909    } else if (name.equals("device")) {
7910      this.device = new Reference();
7911      return this.device;
7912    } else if (name.equals("performer")) {
7913      this.performer = new Reference();
7914      return this.performer;
7915    } else if (name.equals("quantity")) {
7916      this.quantity = new Quantity();
7917      return this.quantity;
7918    } else if (name.equals("referenceSeq")) {
7919      this.referenceSeq = new MolecularSequenceReferenceSeqComponent();
7920      return this.referenceSeq;
7921    } else if (name.equals("variant")) {
7922      return addVariant();
7923    } else if (name.equals("observedSeq")) {
7924      throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.observedSeq");
7925    } else if (name.equals("quality")) {
7926      return addQuality();
7927    } else if (name.equals("readCoverage")) {
7928      throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.readCoverage");
7929    } else if (name.equals("repository")) {
7930      return addRepository();
7931    } else if (name.equals("pointer")) {
7932      return addPointer();
7933    } else if (name.equals("structureVariant")) {
7934      return addStructureVariant();
7935    } else
7936      return super.addChild(name);
7937  }
7938
7939  public String fhirType() {
7940    return "MolecularSequence";
7941
7942  }
7943
7944  public MolecularSequence copy() {
7945    MolecularSequence dst = new MolecularSequence();
7946    copyValues(dst);
7947    return dst;
7948  }
7949
7950  public void copyValues(MolecularSequence dst) {
7951    super.copyValues(dst);
7952    if (identifier != null) {
7953      dst.identifier = new ArrayList<Identifier>();
7954      for (Identifier i : identifier)
7955        dst.identifier.add(i.copy());
7956    }
7957    ;
7958    dst.type = type == null ? null : type.copy();
7959    dst.coordinateSystem = coordinateSystem == null ? null : coordinateSystem.copy();
7960    dst.patient = patient == null ? null : patient.copy();
7961    dst.specimen = specimen == null ? null : specimen.copy();
7962    dst.device = device == null ? null : device.copy();
7963    dst.performer = performer == null ? null : performer.copy();
7964    dst.quantity = quantity == null ? null : quantity.copy();
7965    dst.referenceSeq = referenceSeq == null ? null : referenceSeq.copy();
7966    if (variant != null) {
7967      dst.variant = new ArrayList<MolecularSequenceVariantComponent>();
7968      for (MolecularSequenceVariantComponent i : variant)
7969        dst.variant.add(i.copy());
7970    }
7971    ;
7972    dst.observedSeq = observedSeq == null ? null : observedSeq.copy();
7973    if (quality != null) {
7974      dst.quality = new ArrayList<MolecularSequenceQualityComponent>();
7975      for (MolecularSequenceQualityComponent i : quality)
7976        dst.quality.add(i.copy());
7977    }
7978    ;
7979    dst.readCoverage = readCoverage == null ? null : readCoverage.copy();
7980    if (repository != null) {
7981      dst.repository = new ArrayList<MolecularSequenceRepositoryComponent>();
7982      for (MolecularSequenceRepositoryComponent i : repository)
7983        dst.repository.add(i.copy());
7984    }
7985    ;
7986    if (pointer != null) {
7987      dst.pointer = new ArrayList<Reference>();
7988      for (Reference i : pointer)
7989        dst.pointer.add(i.copy());
7990    }
7991    ;
7992    if (structureVariant != null) {
7993      dst.structureVariant = new ArrayList<MolecularSequenceStructureVariantComponent>();
7994      for (MolecularSequenceStructureVariantComponent i : structureVariant)
7995        dst.structureVariant.add(i.copy());
7996    }
7997    ;
7998  }
7999
8000  protected MolecularSequence typedCopy() {
8001    return copy();
8002  }
8003
8004  @Override
8005  public boolean equalsDeep(Base other_) {
8006    if (!super.equalsDeep(other_))
8007      return false;
8008    if (!(other_ instanceof MolecularSequence))
8009      return false;
8010    MolecularSequence o = (MolecularSequence) other_;
8011    return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true)
8012        && compareDeep(coordinateSystem, o.coordinateSystem, true) && compareDeep(patient, o.patient, true)
8013        && compareDeep(specimen, o.specimen, true) && compareDeep(device, o.device, true)
8014        && compareDeep(performer, o.performer, true) && compareDeep(quantity, o.quantity, true)
8015        && compareDeep(referenceSeq, o.referenceSeq, true) && compareDeep(variant, o.variant, true)
8016        && compareDeep(observedSeq, o.observedSeq, true) && compareDeep(quality, o.quality, true)
8017        && compareDeep(readCoverage, o.readCoverage, true) && compareDeep(repository, o.repository, true)
8018        && compareDeep(pointer, o.pointer, true) && compareDeep(structureVariant, o.structureVariant, true);
8019  }
8020
8021  @Override
8022  public boolean equalsShallow(Base other_) {
8023    if (!super.equalsShallow(other_))
8024      return false;
8025    if (!(other_ instanceof MolecularSequence))
8026      return false;
8027    MolecularSequence o = (MolecularSequence) other_;
8028    return compareValues(type, o.type, true) && compareValues(coordinateSystem, o.coordinateSystem, true)
8029        && compareValues(observedSeq, o.observedSeq, true) && compareValues(readCoverage, o.readCoverage, true);
8030  }
8031
8032  public boolean isEmpty() {
8033    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, coordinateSystem, patient,
8034        specimen, device, performer, quantity, referenceSeq, variant, observedSeq, quality, readCoverage, repository,
8035        pointer, structureVariant);
8036  }
8037
8038  @Override
8039  public ResourceType getResourceType() {
8040    return ResourceType.MolecularSequence;
8041  }
8042
8043  /**
8044   * Search parameter: <b>identifier</b>
8045   * <p>
8046   * Description: <b>The unique identity for a particular sequence</b><br>
8047   * Type: <b>token</b><br>
8048   * Path: <b>MolecularSequence.identifier</b><br>
8049   * </p>
8050   */
8051  @SearchParamDefinition(name = "identifier", path = "MolecularSequence.identifier", description = "The unique identity for a particular sequence", type = "token")
8052  public static final String SP_IDENTIFIER = "identifier";
8053  /**
8054   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
8055   * <p>
8056   * Description: <b>The unique identity for a particular sequence</b><br>
8057   * Type: <b>token</b><br>
8058   * Path: <b>MolecularSequence.identifier</b><br>
8059   * </p>
8060   */
8061  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
8062      SP_IDENTIFIER);
8063
8064  /**
8065   * Search parameter: <b>referenceseqid-variant-coordinate</b>
8066   * <p>
8067   * Description: <b>Search parameter by reference sequence and variant
8068   * coordinate. This will refer to part of a locus or part of a gene where search
8069   * region will be represented in 1-based system. Since the coordinateSystem can
8070   * either be 0-based or 1-based, this search query will include the result of
8071   * both coordinateSystem that contains the equivalent segment of the gene or
8072   * whole genome sequence. For example, a search for sequence can be represented
8073   * as `referenceSeqId-variant-coordinate=NC_000001.11$lt345$gt123`, this means
8074   * it will search for the MolecularSequence resource with variants on
8075   * NC_000001.11 and with position >123 and <345, where in 1-based system
8076   * resource, all strings within region NC_000001.11:124-344 will be revealed,
8077   * while in 0-based system resource, all strings within region
8078   * NC_000001.11:123-344 will be revealed. You may want to check detail about
8079   * 0-based v.s. 1-based above.</b><br>
8080   * Type: <b>composite</b><br>
8081   * Path: <b></b><br>
8082   * </p>
8083   */
8084  @SearchParamDefinition(name = "referenceseqid-variant-coordinate", path = "MolecularSequence.variant", description = "Search parameter by reference sequence and variant coordinate. This will refer to part of a locus or part of a gene where search region will be represented in 1-based system. Since the coordinateSystem can either be 0-based or 1-based, this search query will include the result of both coordinateSystem that contains the equivalent segment of the gene or whole genome sequence. For example, a search for sequence can be represented as `referenceSeqId-variant-coordinate=NC_000001.11$lt345$gt123`, this means it will search for the MolecularSequence resource with variants on NC_000001.11 and with position >123 and <345, where in 1-based system resource, all strings within region NC_000001.11:124-344 will be revealed, while in 0-based system resource, all strings within region NC_000001.11:123-344 will be revealed. You may want to check detail about 0-based v.s. 1-based above.", type = "composite", compositeOf = {
8085      "referenceseqid", "variant-start" })
8086  public static final String SP_REFERENCESEQID_VARIANT_COORDINATE = "referenceseqid-variant-coordinate";
8087  /**
8088   * <b>Fluent Client</b> search parameter constant for
8089   * <b>referenceseqid-variant-coordinate</b>
8090   * <p>
8091   * Description: <b>Search parameter by reference sequence and variant
8092   * coordinate. This will refer to part of a locus or part of a gene where search
8093   * region will be represented in 1-based system. Since the coordinateSystem can
8094   * either be 0-based or 1-based, this search query will include the result of
8095   * both coordinateSystem that contains the equivalent segment of the gene or
8096   * whole genome sequence. For example, a search for sequence can be represented
8097   * as `referenceSeqId-variant-coordinate=NC_000001.11$lt345$gt123`, this means
8098   * it will search for the MolecularSequence resource with variants on
8099   * NC_000001.11 and with position >123 and <345, where in 1-based system
8100   * resource, all strings within region NC_000001.11:124-344 will be revealed,
8101   * while in 0-based system resource, all strings within region
8102   * NC_000001.11:123-344 will be revealed. You may want to check detail about
8103   * 0-based v.s. 1-based above.</b><br>
8104   * Type: <b>composite</b><br>
8105   * Path: <b></b><br>
8106   * </p>
8107   */
8108  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.NumberClientParam> REFERENCESEQID_VARIANT_COORDINATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.NumberClientParam>(
8109      SP_REFERENCESEQID_VARIANT_COORDINATE);
8110
8111  /**
8112   * Search parameter: <b>chromosome</b>
8113   * <p>
8114   * Description: <b>Chromosome number of the reference sequence</b><br>
8115   * Type: <b>token</b><br>
8116   * Path: <b>MolecularSequence.referenceSeq.chromosome</b><br>
8117   * </p>
8118   */
8119  @SearchParamDefinition(name = "chromosome", path = "MolecularSequence.referenceSeq.chromosome", description = "Chromosome number of the reference sequence", type = "token")
8120  public static final String SP_CHROMOSOME = "chromosome";
8121  /**
8122   * <b>Fluent Client</b> search parameter constant for <b>chromosome</b>
8123   * <p>
8124   * Description: <b>Chromosome number of the reference sequence</b><br>
8125   * Type: <b>token</b><br>
8126   * Path: <b>MolecularSequence.referenceSeq.chromosome</b><br>
8127   * </p>
8128   */
8129  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHROMOSOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(
8130      SP_CHROMOSOME);
8131
8132  /**
8133   * Search parameter: <b>window-end</b>
8134   * <p>
8135   * Description: <b>End position (0-based exclusive, which menas the acid at this
8136   * position will not be included, 1-based inclusive, which means the acid at
8137   * this position will be included) of the reference sequence.</b><br>
8138   * Type: <b>number</b><br>
8139   * Path: <b>MolecularSequence.referenceSeq.windowEnd</b><br>
8140   * </p>
8141   */
8142  @SearchParamDefinition(name = "window-end", path = "MolecularSequence.referenceSeq.windowEnd", description = "End position (0-based exclusive, which menas the acid at this position will not be included, 1-based inclusive, which means the acid at this position will be included) of the reference sequence.", type = "number")
8143  public static final String SP_WINDOW_END = "window-end";
8144  /**
8145   * <b>Fluent Client</b> search parameter constant for <b>window-end</b>
8146   * <p>
8147   * Description: <b>End position (0-based exclusive, which menas the acid at this
8148   * position will not be included, 1-based inclusive, which means the acid at
8149   * this position will be included) of the reference sequence.</b><br>
8150   * Type: <b>number</b><br>
8151   * Path: <b>MolecularSequence.referenceSeq.windowEnd</b><br>
8152   * </p>
8153   */
8154  public static final ca.uhn.fhir.rest.gclient.NumberClientParam WINDOW_END = new ca.uhn.fhir.rest.gclient.NumberClientParam(
8155      SP_WINDOW_END);
8156
8157  /**
8158   * Search parameter: <b>type</b>
8159   * <p>
8160   * Description: <b>Amino Acid Sequence/ DNA Sequence / RNA Sequence</b><br>
8161   * Type: <b>token</b><br>
8162   * Path: <b>MolecularSequence.type</b><br>
8163   * </p>
8164   */
8165  @SearchParamDefinition(name = "type", path = "MolecularSequence.type", description = "Amino Acid Sequence/ DNA Sequence / RNA Sequence", type = "token")
8166  public static final String SP_TYPE = "type";
8167  /**
8168   * <b>Fluent Client</b> search parameter constant for <b>type</b>
8169   * <p>
8170   * Description: <b>Amino Acid Sequence/ DNA Sequence / RNA Sequence</b><br>
8171   * Type: <b>token</b><br>
8172   * Path: <b>MolecularSequence.type</b><br>
8173   * </p>
8174   */
8175  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
8176      SP_TYPE);
8177
8178  /**
8179   * Search parameter: <b>window-start</b>
8180   * <p>
8181   * Description: <b>Start position (0-based inclusive, 1-based inclusive, that
8182   * means the nucleic acid or amino acid at this position will be included) of
8183   * the reference sequence.</b><br>
8184   * Type: <b>number</b><br>
8185   * Path: <b>MolecularSequence.referenceSeq.windowStart</b><br>
8186   * </p>
8187   */
8188  @SearchParamDefinition(name = "window-start", path = "MolecularSequence.referenceSeq.windowStart", description = "Start position (0-based inclusive, 1-based inclusive, that means the nucleic acid or amino acid at this position will be included) of the reference sequence.", type = "number")
8189  public static final String SP_WINDOW_START = "window-start";
8190  /**
8191   * <b>Fluent Client</b> search parameter constant for <b>window-start</b>
8192   * <p>
8193   * Description: <b>Start position (0-based inclusive, 1-based inclusive, that
8194   * means the nucleic acid or amino acid at this position will be included) of
8195   * the reference sequence.</b><br>
8196   * Type: <b>number</b><br>
8197   * Path: <b>MolecularSequence.referenceSeq.windowStart</b><br>
8198   * </p>
8199   */
8200  public static final ca.uhn.fhir.rest.gclient.NumberClientParam WINDOW_START = new ca.uhn.fhir.rest.gclient.NumberClientParam(
8201      SP_WINDOW_START);
8202
8203  /**
8204   * Search parameter: <b>variant-end</b>
8205   * <p>
8206   * Description: <b>End position (0-based exclusive, which menas the acid at this
8207   * position will not be included, 1-based inclusive, which means the acid at
8208   * this position will be included) of the variant.</b><br>
8209   * Type: <b>number</b><br>
8210   * Path: <b>MolecularSequence.variant.end</b><br>
8211   * </p>
8212   */
8213  @SearchParamDefinition(name = "variant-end", path = "MolecularSequence.variant.end", description = "End position (0-based exclusive, which menas the acid at this position will not be included, 1-based inclusive, which means the acid at this position will be included) of the variant.", type = "number")
8214  public static final String SP_VARIANT_END = "variant-end";
8215  /**
8216   * <b>Fluent Client</b> search parameter constant for <b>variant-end</b>
8217   * <p>
8218   * Description: <b>End position (0-based exclusive, which menas the acid at this
8219   * position will not be included, 1-based inclusive, which means the acid at
8220   * this position will be included) of the variant.</b><br>
8221   * Type: <b>number</b><br>
8222   * Path: <b>MolecularSequence.variant.end</b><br>
8223   * </p>
8224   */
8225  public static final ca.uhn.fhir.rest.gclient.NumberClientParam VARIANT_END = new ca.uhn.fhir.rest.gclient.NumberClientParam(
8226      SP_VARIANT_END);
8227
8228  /**
8229   * Search parameter: <b>chromosome-variant-coordinate</b>
8230   * <p>
8231   * Description: <b>Search parameter by chromosome and variant coordinate. This
8232   * will refer to part of a locus or part of a gene where search region will be
8233   * represented in 1-based system. Since the coordinateSystem can either be
8234   * 0-based or 1-based, this search query will include the result of both
8235   * coordinateSystem that contains the equivalent segment of the gene or whole
8236   * genome sequence. For example, a search for sequence can be represented as
8237   * `chromosome-variant-coordinate=1$lt345$gt123`, this means it will search for
8238   * the MolecularSequence resource with variants on chromosome 1 and with
8239   * position >123 and <345, where in 1-based system resource, all strings within
8240   * region 1:124-344 will be revealed, while in 0-based system resource, all
8241   * strings within region 1:123-344 will be revealed. You may want to check
8242   * detail about 0-based v.s. 1-based above.</b><br>
8243   * Type: <b>composite</b><br>
8244   * Path: <b></b><br>
8245   * </p>
8246   */
8247  @SearchParamDefinition(name = "chromosome-variant-coordinate", path = "MolecularSequence.variant", description = "Search parameter by chromosome and variant coordinate. This will refer to part of a locus or part of a gene where search region will be represented in 1-based system. Since the coordinateSystem can either be 0-based or 1-based, this search query will include the result of both coordinateSystem that contains the equivalent segment of the gene or whole genome sequence. For example, a search for sequence can be represented as `chromosome-variant-coordinate=1$lt345$gt123`, this means it will search for the MolecularSequence resource with variants on chromosome 1 and with position >123 and <345, where in 1-based system resource, all strings within region 1:124-344 will be revealed, while in 0-based system resource, all strings within region 1:123-344 will be revealed. You may want to check detail about 0-based v.s. 1-based above.", type = "composite", compositeOf = {
8248      "chromosome", "variant-start" })
8249  public static final String SP_CHROMOSOME_VARIANT_COORDINATE = "chromosome-variant-coordinate";
8250  /**
8251   * <b>Fluent Client</b> search parameter constant for
8252   * <b>chromosome-variant-coordinate</b>
8253   * <p>
8254   * Description: <b>Search parameter by chromosome and variant coordinate. This
8255   * will refer to part of a locus or part of a gene where search region will be
8256   * represented in 1-based system. Since the coordinateSystem can either be
8257   * 0-based or 1-based, this search query will include the result of both
8258   * coordinateSystem that contains the equivalent segment of the gene or whole
8259   * genome sequence. For example, a search for sequence can be represented as
8260   * `chromosome-variant-coordinate=1$lt345$gt123`, this means it will search for
8261   * the MolecularSequence resource with variants on chromosome 1 and with
8262   * position >123 and <345, where in 1-based system resource, all strings within
8263   * region 1:124-344 will be revealed, while in 0-based system resource, all
8264   * strings within region 1:123-344 will be revealed. You may want to check
8265   * detail about 0-based v.s. 1-based above.</b><br>
8266   * Type: <b>composite</b><br>
8267   * Path: <b></b><br>
8268   * </p>
8269   */
8270  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.NumberClientParam> CHROMOSOME_VARIANT_COORDINATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.NumberClientParam>(
8271      SP_CHROMOSOME_VARIANT_COORDINATE);
8272
8273  /**
8274   * Search parameter: <b>patient</b>
8275   * <p>
8276   * Description: <b>The subject that the observation is about</b><br>
8277   * Type: <b>reference</b><br>
8278   * Path: <b>MolecularSequence.patient</b><br>
8279   * </p>
8280   */
8281  @SearchParamDefinition(name = "patient", path = "MolecularSequence.patient", description = "The subject that the observation is about", type = "reference", providesMembershipIn = {
8282      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient") }, target = { Patient.class })
8283  public static final String SP_PATIENT = "patient";
8284  /**
8285   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
8286   * <p>
8287   * Description: <b>The subject that the observation is about</b><br>
8288   * Type: <b>reference</b><br>
8289   * Path: <b>MolecularSequence.patient</b><br>
8290   * </p>
8291   */
8292  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
8293      SP_PATIENT);
8294
8295  /**
8296   * Constant for fluent queries to be used to add include statements. Specifies
8297   * the path value of "<b>MolecularSequence:patient</b>".
8298   */
8299  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include(
8300      "MolecularSequence:patient").toLocked();
8301
8302  /**
8303   * Search parameter: <b>variant-start</b>
8304   * <p>
8305   * Description: <b>Start position (0-based inclusive, 1-based inclusive, that
8306   * means the nucleic acid or amino acid at this position will be included) of
8307   * the variant.</b><br>
8308   * Type: <b>number</b><br>
8309   * Path: <b>MolecularSequence.variant.start</b><br>
8310   * </p>
8311   */
8312  @SearchParamDefinition(name = "variant-start", path = "MolecularSequence.variant.start", description = "Start position (0-based inclusive, 1-based inclusive, that means the nucleic acid or amino acid at this position will be included) of the variant.", type = "number")
8313  public static final String SP_VARIANT_START = "variant-start";
8314  /**
8315   * <b>Fluent Client</b> search parameter constant for <b>variant-start</b>
8316   * <p>
8317   * Description: <b>Start position (0-based inclusive, 1-based inclusive, that
8318   * means the nucleic acid or amino acid at this position will be included) of
8319   * the variant.</b><br>
8320   * Type: <b>number</b><br>
8321   * Path: <b>MolecularSequence.variant.start</b><br>
8322   * </p>
8323   */
8324  public static final ca.uhn.fhir.rest.gclient.NumberClientParam VARIANT_START = new ca.uhn.fhir.rest.gclient.NumberClientParam(
8325      SP_VARIANT_START);
8326
8327  /**
8328   * Search parameter: <b>chromosome-window-coordinate</b>
8329   * <p>
8330   * Description: <b>Search parameter by chromosome and window. This will refer to
8331   * part of a locus or part of a gene where search region will be represented in
8332   * 1-based system. Since the coordinateSystem can either be 0-based or 1-based,
8333   * this search query will include the result of both coordinateSystem that
8334   * contains the equivalent segment of the gene or whole genome sequence. For
8335   * example, a search for sequence can be represented as
8336   * `chromosome-window-coordinate=1$lt345$gt123`, this means it will search for
8337   * the MolecularSequence resource with a window on chromosome 1 and with
8338   * position >123 and <345, where in 1-based system resource, all strings within
8339   * region 1:124-344 will be revealed, while in 0-based system resource, all
8340   * strings within region 1:123-344 will be revealed. You may want to check
8341   * detail about 0-based v.s. 1-based above.</b><br>
8342   * Type: <b>composite</b><br>
8343   * Path: <b></b><br>
8344   * </p>
8345   */
8346  @SearchParamDefinition(name = "chromosome-window-coordinate", path = "MolecularSequence.referenceSeq", description = "Search parameter by chromosome and window. This will refer to part of a locus or part of a gene where search region will be represented in 1-based system. Since the coordinateSystem can either be 0-based or 1-based, this search query will include the result of both coordinateSystem that contains the equivalent segment of the gene or whole genome sequence. For example, a search for sequence can be represented as `chromosome-window-coordinate=1$lt345$gt123`, this means it will search for the MolecularSequence resource with a window on chromosome 1 and with position >123 and <345, where in 1-based system resource, all strings within region 1:124-344 will be revealed, while in 0-based system resource, all strings within region 1:123-344 will be revealed. You may want to check detail about 0-based v.s. 1-based above.", type = "composite", compositeOf = {
8347      "chromosome", "window-start" })
8348  public static final String SP_CHROMOSOME_WINDOW_COORDINATE = "chromosome-window-coordinate";
8349  /**
8350   * <b>Fluent Client</b> search parameter constant for
8351   * <b>chromosome-window-coordinate</b>
8352   * <p>
8353   * Description: <b>Search parameter by chromosome and window. This will refer to
8354   * part of a locus or part of a gene where search region will be represented in
8355   * 1-based system. Since the coordinateSystem can either be 0-based or 1-based,
8356   * this search query will include the result of both coordinateSystem that
8357   * contains the equivalent segment of the gene or whole genome sequence. For
8358   * example, a search for sequence can be represented as
8359   * `chromosome-window-coordinate=1$lt345$gt123`, this means it will search for
8360   * the MolecularSequence resource with a window on chromosome 1 and with
8361   * position >123 and <345, where in 1-based system resource, all strings within
8362   * region 1:124-344 will be revealed, while in 0-based system resource, all
8363   * strings within region 1:123-344 will be revealed. You may want to check
8364   * detail about 0-based v.s. 1-based above.</b><br>
8365   * Type: <b>composite</b><br>
8366   * Path: <b></b><br>
8367   * </p>
8368   */
8369  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.NumberClientParam> CHROMOSOME_WINDOW_COORDINATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.NumberClientParam>(
8370      SP_CHROMOSOME_WINDOW_COORDINATE);
8371
8372  /**
8373   * Search parameter: <b>referenceseqid-window-coordinate</b>
8374   * <p>
8375   * Description: <b>Search parameter by reference sequence and window. This will
8376   * refer to part of a locus or part of a gene where search region will be
8377   * represented in 1-based system. Since the coordinateSystem can either be
8378   * 0-based or 1-based, this search query will include the result of both
8379   * coordinateSystem that contains the equivalent segment of the gene or whole
8380   * genome sequence. For example, a search for sequence can be represented as
8381   * `referenceSeqId-window-coordinate=NC_000001.11$lt345$gt123`, this means it
8382   * will search for the MolecularSequence resource with a window on NC_000001.11
8383   * and with position >123 and <345, where in 1-based system resource, all
8384   * strings within region NC_000001.11:124-344 will be revealed, while in 0-based
8385   * system resource, all strings within region NC_000001.11:123-344 will be
8386   * revealed. You may want to check detail about 0-based v.s. 1-based
8387   * above.</b><br>
8388   * Type: <b>composite</b><br>
8389   * Path: <b></b><br>
8390   * </p>
8391   */
8392  @SearchParamDefinition(name = "referenceseqid-window-coordinate", path = "MolecularSequence.referenceSeq", description = "Search parameter by reference sequence and window. This will refer to part of a locus or part of a gene where search region will be represented in 1-based system. Since the coordinateSystem can either be 0-based or 1-based, this search query will include the result of both coordinateSystem that contains the equivalent segment of the gene or whole genome sequence. For example, a search for sequence can be represented as `referenceSeqId-window-coordinate=NC_000001.11$lt345$gt123`, this means it will search for the MolecularSequence resource with a window on NC_000001.11 and with position >123 and <345, where in 1-based system resource, all strings within region NC_000001.11:124-344 will be revealed, while in 0-based system resource, all strings within region NC_000001.11:123-344 will be revealed. You may want to check detail about 0-based v.s. 1-based above.", type = "composite", compositeOf = {
8393      "referenceseqid", "window-start" })
8394  public static final String SP_REFERENCESEQID_WINDOW_COORDINATE = "referenceseqid-window-coordinate";
8395  /**
8396   * <b>Fluent Client</b> search parameter constant for
8397   * <b>referenceseqid-window-coordinate</b>
8398   * <p>
8399   * Description: <b>Search parameter by reference sequence and window. This will
8400   * refer to part of a locus or part of a gene where search region will be
8401   * represented in 1-based system. Since the coordinateSystem can either be
8402   * 0-based or 1-based, this search query will include the result of both
8403   * coordinateSystem that contains the equivalent segment of the gene or whole
8404   * genome sequence. For example, a search for sequence can be represented as
8405   * `referenceSeqId-window-coordinate=NC_000001.11$lt345$gt123`, this means it
8406   * will search for the MolecularSequence resource with a window on NC_000001.11
8407   * and with position >123 and <345, where in 1-based system resource, all
8408   * strings within region NC_000001.11:124-344 will be revealed, while in 0-based
8409   * system resource, all strings within region NC_000001.11:123-344 will be
8410   * revealed. You may want to check detail about 0-based v.s. 1-based
8411   * above.</b><br>
8412   * Type: <b>composite</b><br>
8413   * Path: <b></b><br>
8414   * </p>
8415   */
8416  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.NumberClientParam> REFERENCESEQID_WINDOW_COORDINATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.NumberClientParam>(
8417      SP_REFERENCESEQID_WINDOW_COORDINATE);
8418
8419  /**
8420   * Search parameter: <b>referenceseqid</b>
8421   * <p>
8422   * Description: <b>Reference Sequence of the sequence</b><br>
8423   * Type: <b>token</b><br>
8424   * Path: <b>MolecularSequence.referenceSeq.referenceSeqId</b><br>
8425   * </p>
8426   */
8427  @SearchParamDefinition(name = "referenceseqid", path = "MolecularSequence.referenceSeq.referenceSeqId", description = "Reference Sequence of the sequence", type = "token")
8428  public static final String SP_REFERENCESEQID = "referenceseqid";
8429  /**
8430   * <b>Fluent Client</b> search parameter constant for <b>referenceseqid</b>
8431   * <p>
8432   * Description: <b>Reference Sequence of the sequence</b><br>
8433   * Type: <b>token</b><br>
8434   * Path: <b>MolecularSequence.referenceSeq.referenceSeqId</b><br>
8435   * </p>
8436   */
8437  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REFERENCESEQID = new ca.uhn.fhir.rest.gclient.TokenClientParam(
8438      SP_REFERENCESEQID);
8439
8440}