001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0
033
034import java.util.*;
035
036import java.math.*;
037import org.hl7.fhir.utilities.Utilities;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046/**
047 * Raw data describing a biological sequence.
048 */
049@ResourceDef(name="Sequence", profile="http://hl7.org/fhir/StructureDefinition/Sequence")
050public class Sequence extends DomainResource {
051
052    public enum SequenceType {
053        /**
054         * Amino acid sequence.
055         */
056        AA, 
057        /**
058         * DNA Sequence.
059         */
060        DNA, 
061        /**
062         * RNA Sequence.
063         */
064        RNA, 
065        /**
066         * added to help the parsers with the generic types
067         */
068        NULL;
069        public static SequenceType fromCode(String codeString) throws FHIRException {
070            if (codeString == null || "".equals(codeString))
071                return null;
072        if ("aa".equals(codeString))
073          return AA;
074        if ("dna".equals(codeString))
075          return DNA;
076        if ("rna".equals(codeString))
077          return RNA;
078        if (Configuration.isAcceptInvalidEnums())
079          return null;
080        else
081          throw new FHIRException("Unknown SequenceType code '"+codeString+"'");
082        }
083        public String toCode() {
084          switch (this) {
085            case AA: return "aa";
086            case DNA: return "dna";
087            case RNA: return "rna";
088            default: return "?";
089          }
090        }
091        public String getSystem() {
092          switch (this) {
093            case AA: return "http://hl7.org/fhir/sequence-type";
094            case DNA: return "http://hl7.org/fhir/sequence-type";
095            case RNA: return "http://hl7.org/fhir/sequence-type";
096            default: return "?";
097          }
098        }
099        public String getDefinition() {
100          switch (this) {
101            case AA: return "Amino acid sequence.";
102            case DNA: return "DNA Sequence.";
103            case RNA: return "RNA Sequence.";
104            default: return "?";
105          }
106        }
107        public String getDisplay() {
108          switch (this) {
109            case AA: return "AA Sequence";
110            case DNA: return "DNA Sequence";
111            case RNA: return "RNA Sequence";
112            default: return "?";
113          }
114        }
115    }
116
117  public static class SequenceTypeEnumFactory implements EnumFactory<SequenceType> {
118    public SequenceType fromCode(String codeString) throws IllegalArgumentException {
119      if (codeString == null || "".equals(codeString))
120            if (codeString == null || "".equals(codeString))
121                return null;
122        if ("aa".equals(codeString))
123          return SequenceType.AA;
124        if ("dna".equals(codeString))
125          return SequenceType.DNA;
126        if ("rna".equals(codeString))
127          return SequenceType.RNA;
128        throw new IllegalArgumentException("Unknown SequenceType code '"+codeString+"'");
129        }
130        public Enumeration<SequenceType> fromType(Base code) throws FHIRException {
131          if (code == null)
132            return null;
133          if (code.isEmpty())
134            return new Enumeration<SequenceType>(this);
135          String codeString = ((PrimitiveType) code).asStringValue();
136          if (codeString == null || "".equals(codeString))
137            return null;
138        if ("aa".equals(codeString))
139          return new Enumeration<SequenceType>(this, SequenceType.AA);
140        if ("dna".equals(codeString))
141          return new Enumeration<SequenceType>(this, SequenceType.DNA);
142        if ("rna".equals(codeString))
143          return new Enumeration<SequenceType>(this, SequenceType.RNA);
144        throw new FHIRException("Unknown SequenceType code '"+codeString+"'");
145        }
146    public String toCode(SequenceType code) {
147      if (code == SequenceType.AA)
148        return "aa";
149      if (code == SequenceType.DNA)
150        return "dna";
151      if (code == SequenceType.RNA)
152        return "rna";
153      return "?";
154      }
155    public String toSystem(SequenceType code) {
156      return code.getSystem();
157      }
158    }
159
160    public enum OrientationType {
161        /**
162         * Sense orientation of reference sequence.
163         */
164        SENSE, 
165        /**
166         * Antisense orientation of reference sequence.
167         */
168        ANTISENSE, 
169        /**
170         * added to help the parsers with the generic types
171         */
172        NULL;
173        public static OrientationType fromCode(String codeString) throws FHIRException {
174            if (codeString == null || "".equals(codeString))
175                return null;
176        if ("sense".equals(codeString))
177          return SENSE;
178        if ("antisense".equals(codeString))
179          return ANTISENSE;
180        if (Configuration.isAcceptInvalidEnums())
181          return null;
182        else
183          throw new FHIRException("Unknown OrientationType code '"+codeString+"'");
184        }
185        public String toCode() {
186          switch (this) {
187            case SENSE: return "sense";
188            case ANTISENSE: return "antisense";
189            default: return "?";
190          }
191        }
192        public String getSystem() {
193          switch (this) {
194            case SENSE: return "http://hl7.org/fhir/orientation-type";
195            case ANTISENSE: return "http://hl7.org/fhir/orientation-type";
196            default: return "?";
197          }
198        }
199        public String getDefinition() {
200          switch (this) {
201            case SENSE: return "Sense orientation of reference sequence.";
202            case ANTISENSE: return "Antisense orientation of reference sequence.";
203            default: return "?";
204          }
205        }
206        public String getDisplay() {
207          switch (this) {
208            case SENSE: return "Sense orientation of referenceSeq";
209            case ANTISENSE: return "Antisense orientation of referenceSeq";
210            default: return "?";
211          }
212        }
213    }
214
215  public static class OrientationTypeEnumFactory implements EnumFactory<OrientationType> {
216    public OrientationType fromCode(String codeString) throws IllegalArgumentException {
217      if (codeString == null || "".equals(codeString))
218            if (codeString == null || "".equals(codeString))
219                return null;
220        if ("sense".equals(codeString))
221          return OrientationType.SENSE;
222        if ("antisense".equals(codeString))
223          return OrientationType.ANTISENSE;
224        throw new IllegalArgumentException("Unknown OrientationType code '"+codeString+"'");
225        }
226        public Enumeration<OrientationType> fromType(Base code) throws FHIRException {
227          if (code == null)
228            return null;
229          if (code.isEmpty())
230            return new Enumeration<OrientationType>(this);
231          String codeString = ((PrimitiveType) code).asStringValue();
232          if (codeString == null || "".equals(codeString))
233            return null;
234        if ("sense".equals(codeString))
235          return new Enumeration<OrientationType>(this, OrientationType.SENSE);
236        if ("antisense".equals(codeString))
237          return new Enumeration<OrientationType>(this, OrientationType.ANTISENSE);
238        throw new FHIRException("Unknown OrientationType code '"+codeString+"'");
239        }
240    public String toCode(OrientationType code) {
241      if (code == OrientationType.SENSE)
242        return "sense";
243      if (code == OrientationType.ANTISENSE)
244        return "antisense";
245      return "?";
246      }
247    public String toSystem(OrientationType code) {
248      return code.getSystem();
249      }
250    }
251
252    public enum StrandType {
253        /**
254         * Watson strand of reference sequence.
255         */
256        WATSON, 
257        /**
258         * Crick strand of reference sequence.
259         */
260        CRICK, 
261        /**
262         * added to help the parsers with the generic types
263         */
264        NULL;
265        public static StrandType fromCode(String codeString) throws FHIRException {
266            if (codeString == null || "".equals(codeString))
267                return null;
268        if ("watson".equals(codeString))
269          return WATSON;
270        if ("crick".equals(codeString))
271          return CRICK;
272        if (Configuration.isAcceptInvalidEnums())
273          return null;
274        else
275          throw new FHIRException("Unknown StrandType code '"+codeString+"'");
276        }
277        public String toCode() {
278          switch (this) {
279            case WATSON: return "watson";
280            case CRICK: return "crick";
281            default: return "?";
282          }
283        }
284        public String getSystem() {
285          switch (this) {
286            case WATSON: return "http://hl7.org/fhir/strand-type";
287            case CRICK: return "http://hl7.org/fhir/strand-type";
288            default: return "?";
289          }
290        }
291        public String getDefinition() {
292          switch (this) {
293            case WATSON: return "Watson strand of reference sequence.";
294            case CRICK: return "Crick strand of reference sequence.";
295            default: return "?";
296          }
297        }
298        public String getDisplay() {
299          switch (this) {
300            case WATSON: return "Watson strand of referenceSeq";
301            case CRICK: return "Crick strand of referenceSeq";
302            default: return "?";
303          }
304        }
305    }
306
307  public static class StrandTypeEnumFactory implements EnumFactory<StrandType> {
308    public StrandType fromCode(String codeString) throws IllegalArgumentException {
309      if (codeString == null || "".equals(codeString))
310            if (codeString == null || "".equals(codeString))
311                return null;
312        if ("watson".equals(codeString))
313          return StrandType.WATSON;
314        if ("crick".equals(codeString))
315          return StrandType.CRICK;
316        throw new IllegalArgumentException("Unknown StrandType code '"+codeString+"'");
317        }
318        public Enumeration<StrandType> fromType(Base code) throws FHIRException {
319          if (code == null)
320            return null;
321          if (code.isEmpty())
322            return new Enumeration<StrandType>(this);
323          String codeString = ((PrimitiveType) code).asStringValue();
324          if (codeString == null || "".equals(codeString))
325            return null;
326        if ("watson".equals(codeString))
327          return new Enumeration<StrandType>(this, StrandType.WATSON);
328        if ("crick".equals(codeString))
329          return new Enumeration<StrandType>(this, StrandType.CRICK);
330        throw new FHIRException("Unknown StrandType code '"+codeString+"'");
331        }
332    public String toCode(StrandType code) {
333      if (code == StrandType.WATSON)
334        return "watson";
335      if (code == StrandType.CRICK)
336        return "crick";
337      return "?";
338      }
339    public String toSystem(StrandType code) {
340      return code.getSystem();
341      }
342    }
343
344    public enum QualityType {
345        /**
346         * INDEL Comparison.
347         */
348        INDEL, 
349        /**
350         * SNP Comparison.
351         */
352        SNP, 
353        /**
354         * UNKNOWN Comparison.
355         */
356        UNKNOWN, 
357        /**
358         * added to help the parsers with the generic types
359         */
360        NULL;
361        public static QualityType fromCode(String codeString) throws FHIRException {
362            if (codeString == null || "".equals(codeString))
363                return null;
364        if ("indel".equals(codeString))
365          return INDEL;
366        if ("snp".equals(codeString))
367          return SNP;
368        if ("unknown".equals(codeString))
369          return UNKNOWN;
370        if (Configuration.isAcceptInvalidEnums())
371          return null;
372        else
373          throw new FHIRException("Unknown QualityType code '"+codeString+"'");
374        }
375        public String toCode() {
376          switch (this) {
377            case INDEL: return "indel";
378            case SNP: return "snp";
379            case UNKNOWN: return "unknown";
380            default: return "?";
381          }
382        }
383        public String getSystem() {
384          switch (this) {
385            case INDEL: return "http://hl7.org/fhir/quality-type";
386            case SNP: return "http://hl7.org/fhir/quality-type";
387            case UNKNOWN: return "http://hl7.org/fhir/quality-type";
388            default: return "?";
389          }
390        }
391        public String getDefinition() {
392          switch (this) {
393            case INDEL: return "INDEL Comparison.";
394            case SNP: return "SNP Comparison.";
395            case UNKNOWN: return "UNKNOWN Comparison.";
396            default: return "?";
397          }
398        }
399        public String getDisplay() {
400          switch (this) {
401            case INDEL: return "INDEL Comparison";
402            case SNP: return "SNP Comparison";
403            case UNKNOWN: return "UNKNOWN Comparison";
404            default: return "?";
405          }
406        }
407    }
408
409  public static class QualityTypeEnumFactory implements EnumFactory<QualityType> {
410    public QualityType fromCode(String codeString) throws IllegalArgumentException {
411      if (codeString == null || "".equals(codeString))
412            if (codeString == null || "".equals(codeString))
413                return null;
414        if ("indel".equals(codeString))
415          return QualityType.INDEL;
416        if ("snp".equals(codeString))
417          return QualityType.SNP;
418        if ("unknown".equals(codeString))
419          return QualityType.UNKNOWN;
420        throw new IllegalArgumentException("Unknown QualityType code '"+codeString+"'");
421        }
422        public Enumeration<QualityType> fromType(Base code) throws FHIRException {
423          if (code == null)
424            return null;
425          if (code.isEmpty())
426            return new Enumeration<QualityType>(this);
427          String codeString = ((PrimitiveType) code).asStringValue();
428          if (codeString == null || "".equals(codeString))
429            return null;
430        if ("indel".equals(codeString))
431          return new Enumeration<QualityType>(this, QualityType.INDEL);
432        if ("snp".equals(codeString))
433          return new Enumeration<QualityType>(this, QualityType.SNP);
434        if ("unknown".equals(codeString))
435          return new Enumeration<QualityType>(this, QualityType.UNKNOWN);
436        throw new FHIRException("Unknown QualityType code '"+codeString+"'");
437        }
438    public String toCode(QualityType code) {
439      if (code == QualityType.INDEL)
440        return "indel";
441      if (code == QualityType.SNP)
442        return "snp";
443      if (code == QualityType.UNKNOWN)
444        return "unknown";
445      return "?";
446      }
447    public String toSystem(QualityType code) {
448      return code.getSystem();
449      }
450    }
451
452    public enum RepositoryType {
453        /**
454         * When URL is clicked, the resource can be seen directly (by webpage or by download link format).
455         */
456        DIRECTLINK, 
457        /**
458         * 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).
459         */
460        OPENAPI, 
461        /**
462         * When logged into the website, the resource can be seen.
463         */
464        LOGIN, 
465        /**
466         * When logged in and  follow the API in the website related with URL, the resource can be seen.
467         */
468        OAUTH, 
469        /**
470         * Some other complicated or particular way to get resource from URL.
471         */
472        OTHER, 
473        /**
474         * added to help the parsers with the generic types
475         */
476        NULL;
477        public static RepositoryType fromCode(String codeString) throws FHIRException {
478            if (codeString == null || "".equals(codeString))
479                return null;
480        if ("directlink".equals(codeString))
481          return DIRECTLINK;
482        if ("openapi".equals(codeString))
483          return OPENAPI;
484        if ("login".equals(codeString))
485          return LOGIN;
486        if ("oauth".equals(codeString))
487          return OAUTH;
488        if ("other".equals(codeString))
489          return OTHER;
490        if (Configuration.isAcceptInvalidEnums())
491          return null;
492        else
493          throw new FHIRException("Unknown RepositoryType code '"+codeString+"'");
494        }
495        public String toCode() {
496          switch (this) {
497            case DIRECTLINK: return "directlink";
498            case OPENAPI: return "openapi";
499            case LOGIN: return "login";
500            case OAUTH: return "oauth";
501            case OTHER: return "other";
502            default: return "?";
503          }
504        }
505        public String getSystem() {
506          switch (this) {
507            case DIRECTLINK: return "http://hl7.org/fhir/repository-type";
508            case OPENAPI: return "http://hl7.org/fhir/repository-type";
509            case LOGIN: return "http://hl7.org/fhir/repository-type";
510            case OAUTH: return "http://hl7.org/fhir/repository-type";
511            case OTHER: return "http://hl7.org/fhir/repository-type";
512            default: return "?";
513          }
514        }
515        public String getDefinition() {
516          switch (this) {
517            case DIRECTLINK: return "When URL is clicked, the resource can be seen directly (by webpage or by download link format).";
518            case OPENAPI: 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).";
519            case LOGIN: return "When logged into the website, the resource can be seen.";
520            case OAUTH: return "When logged in and  follow the API in the website related with URL, the resource can be seen.";
521            case OTHER: return "Some other complicated or particular way to get resource from URL.";
522            default: return "?";
523          }
524        }
525        public String getDisplay() {
526          switch (this) {
527            case DIRECTLINK: return "Click and see";
528            case OPENAPI: return "The URL is the RESTful or other kind of API that can access to the result.";
529            case LOGIN: return "Result cannot be access unless an account is logged in";
530            case OAUTH: return "Result need to be fetched with API and need LOGIN( or cookies are required when visiting the link of resource)";
531            case OTHER: return "Some other complicated or particular way to get resource from URL.";
532            default: return "?";
533          }
534        }
535    }
536
537  public static class RepositoryTypeEnumFactory implements EnumFactory<RepositoryType> {
538    public RepositoryType fromCode(String codeString) throws IllegalArgumentException {
539      if (codeString == null || "".equals(codeString))
540            if (codeString == null || "".equals(codeString))
541                return null;
542        if ("directlink".equals(codeString))
543          return RepositoryType.DIRECTLINK;
544        if ("openapi".equals(codeString))
545          return RepositoryType.OPENAPI;
546        if ("login".equals(codeString))
547          return RepositoryType.LOGIN;
548        if ("oauth".equals(codeString))
549          return RepositoryType.OAUTH;
550        if ("other".equals(codeString))
551          return RepositoryType.OTHER;
552        throw new IllegalArgumentException("Unknown RepositoryType code '"+codeString+"'");
553        }
554        public Enumeration<RepositoryType> fromType(Base code) throws FHIRException {
555          if (code == null)
556            return null;
557          if (code.isEmpty())
558            return new Enumeration<RepositoryType>(this);
559          String codeString = ((PrimitiveType) code).asStringValue();
560          if (codeString == null || "".equals(codeString))
561            return null;
562        if ("directlink".equals(codeString))
563          return new Enumeration<RepositoryType>(this, RepositoryType.DIRECTLINK);
564        if ("openapi".equals(codeString))
565          return new Enumeration<RepositoryType>(this, RepositoryType.OPENAPI);
566        if ("login".equals(codeString))
567          return new Enumeration<RepositoryType>(this, RepositoryType.LOGIN);
568        if ("oauth".equals(codeString))
569          return new Enumeration<RepositoryType>(this, RepositoryType.OAUTH);
570        if ("other".equals(codeString))
571          return new Enumeration<RepositoryType>(this, RepositoryType.OTHER);
572        throw new FHIRException("Unknown RepositoryType code '"+codeString+"'");
573        }
574    public String toCode(RepositoryType code) {
575      if (code == RepositoryType.DIRECTLINK)
576        return "directlink";
577      if (code == RepositoryType.OPENAPI)
578        return "openapi";
579      if (code == RepositoryType.LOGIN)
580        return "login";
581      if (code == RepositoryType.OAUTH)
582        return "oauth";
583      if (code == RepositoryType.OTHER)
584        return "other";
585      return "?";
586      }
587    public String toSystem(RepositoryType code) {
588      return code.getSystem();
589      }
590    }
591
592    @Block()
593    public static class SequenceReferenceSeqComponent extends BackboneElement implements IBaseBackboneElement {
594        /**
595         * 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)).
596         */
597        @Child(name = "chromosome", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
598        @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))." )
599        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/chromosome-human")
600        protected CodeableConcept chromosome;
601
602        /**
603         * 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.
604         */
605        @Child(name = "genomeBuild", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
606        @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." )
607        protected StringType genomeBuild;
608
609        /**
610         * 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.
611         */
612        @Child(name = "orientation", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
613        @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." )
614        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/orientation-type")
615        protected Enumeration<OrientationType> orientation;
616
617        /**
618         * Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.
619         */
620        @Child(name = "referenceSeqId", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
621        @Description(shortDefinition="Reference identifier", formalDefinition="Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences." )
622        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-referenceSeq")
623        protected CodeableConcept referenceSeqId;
624
625        /**
626         * A Pointer to another Sequence entity as reference sequence.
627         */
628        @Child(name = "referenceSeqPointer", type = {Sequence.class}, order=5, min=0, max=1, modifier=false, summary=true)
629        @Description(shortDefinition="A Pointer to another Sequence entity as reference sequence", formalDefinition="A Pointer to another Sequence entity as reference sequence." )
630        protected Reference referenceSeqPointer;
631
632        /**
633         * The actual object that is the target of the reference (A Pointer to another Sequence entity as reference sequence.)
634         */
635        protected Sequence referenceSeqPointerTarget;
636
637        /**
638         * A string like "ACGT".
639         */
640        @Child(name = "referenceSeqString", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
641        @Description(shortDefinition="A string to represent reference sequence", formalDefinition="A string like \"ACGT\"." )
642        protected StringType referenceSeqString;
643
644        /**
645         * 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.
646         */
647        @Child(name = "strand", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
648        @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." )
649        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/strand-type")
650        protected Enumeration<StrandType> strand;
651
652        /**
653         * 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.
654         */
655        @Child(name = "windowStart", type = {IntegerType.class}, order=8, min=1, max=1, modifier=false, summary=true)
656        @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." )
657        protected IntegerType windowStart;
658
659        /**
660         * End position of the window on the reference sequence. If the coordinate system is 0-based then end is 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.
661         */
662        @Child(name = "windowEnd", type = {IntegerType.class}, order=9, min=1, max=1, modifier=false, summary=true)
663        @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 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." )
664        protected IntegerType windowEnd;
665
666        private static final long serialVersionUID = 1368245163L;
667
668    /**
669     * Constructor
670     */
671      public SequenceReferenceSeqComponent() {
672        super();
673      }
674
675    /**
676     * Constructor
677     */
678      public SequenceReferenceSeqComponent(IntegerType windowStart, IntegerType windowEnd) {
679        super();
680        this.windowStart = windowStart;
681        this.windowEnd = windowEnd;
682      }
683
684        /**
685         * @return {@link #chromosome} (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)).)
686         */
687        public CodeableConcept getChromosome() { 
688          if (this.chromosome == null)
689            if (Configuration.errorOnAutoCreate())
690              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.chromosome");
691            else if (Configuration.doAutoCreate())
692              this.chromosome = new CodeableConcept(); // cc
693          return this.chromosome;
694        }
695
696        public boolean hasChromosome() { 
697          return this.chromosome != null && !this.chromosome.isEmpty();
698        }
699
700        /**
701         * @param value {@link #chromosome} (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)).)
702         */
703        public SequenceReferenceSeqComponent setChromosome(CodeableConcept value) { 
704          this.chromosome = value;
705          return this;
706        }
707
708        /**
709         * @return {@link #genomeBuild} (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.). This is the underlying object with id, value and extensions. The accessor "getGenomeBuild" gives direct access to the value
710         */
711        public StringType getGenomeBuildElement() { 
712          if (this.genomeBuild == null)
713            if (Configuration.errorOnAutoCreate())
714              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.genomeBuild");
715            else if (Configuration.doAutoCreate())
716              this.genomeBuild = new StringType(); // bb
717          return this.genomeBuild;
718        }
719
720        public boolean hasGenomeBuildElement() { 
721          return this.genomeBuild != null && !this.genomeBuild.isEmpty();
722        }
723
724        public boolean hasGenomeBuild() { 
725          return this.genomeBuild != null && !this.genomeBuild.isEmpty();
726        }
727
728        /**
729         * @param value {@link #genomeBuild} (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.). This is the underlying object with id, value and extensions. The accessor "getGenomeBuild" gives direct access to the value
730         */
731        public SequenceReferenceSeqComponent setGenomeBuildElement(StringType value) { 
732          this.genomeBuild = value;
733          return this;
734        }
735
736        /**
737         * @return 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.
738         */
739        public String getGenomeBuild() { 
740          return this.genomeBuild == null ? null : this.genomeBuild.getValue();
741        }
742
743        /**
744         * @param value 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.
745         */
746        public SequenceReferenceSeqComponent setGenomeBuild(String value) { 
747          if (Utilities.noString(value))
748            this.genomeBuild = null;
749          else {
750            if (this.genomeBuild == null)
751              this.genomeBuild = new StringType();
752            this.genomeBuild.setValue(value);
753          }
754          return this;
755        }
756
757        /**
758         * @return {@link #orientation} (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.). This is the underlying object with id, value and extensions. The accessor "getOrientation" gives direct access to the value
759         */
760        public Enumeration<OrientationType> getOrientationElement() { 
761          if (this.orientation == null)
762            if (Configuration.errorOnAutoCreate())
763              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.orientation");
764            else if (Configuration.doAutoCreate())
765              this.orientation = new Enumeration<OrientationType>(new OrientationTypeEnumFactory()); // bb
766          return this.orientation;
767        }
768
769        public boolean hasOrientationElement() { 
770          return this.orientation != null && !this.orientation.isEmpty();
771        }
772
773        public boolean hasOrientation() { 
774          return this.orientation != null && !this.orientation.isEmpty();
775        }
776
777        /**
778         * @param value {@link #orientation} (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.). This is the underlying object with id, value and extensions. The accessor "getOrientation" gives direct access to the value
779         */
780        public SequenceReferenceSeqComponent setOrientationElement(Enumeration<OrientationType> value) { 
781          this.orientation = value;
782          return this;
783        }
784
785        /**
786         * @return 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.
787         */
788        public OrientationType getOrientation() { 
789          return this.orientation == null ? null : this.orientation.getValue();
790        }
791
792        /**
793         * @param value 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.
794         */
795        public SequenceReferenceSeqComponent setOrientation(OrientationType value) { 
796          if (value == null)
797            this.orientation = null;
798          else {
799            if (this.orientation == null)
800              this.orientation = new Enumeration<OrientationType>(new OrientationTypeEnumFactory());
801            this.orientation.setValue(value);
802          }
803          return this;
804        }
805
806        /**
807         * @return {@link #referenceSeqId} (Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.)
808         */
809        public CodeableConcept getReferenceSeqId() { 
810          if (this.referenceSeqId == null)
811            if (Configuration.errorOnAutoCreate())
812              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqId");
813            else if (Configuration.doAutoCreate())
814              this.referenceSeqId = new CodeableConcept(); // cc
815          return this.referenceSeqId;
816        }
817
818        public boolean hasReferenceSeqId() { 
819          return this.referenceSeqId != null && !this.referenceSeqId.isEmpty();
820        }
821
822        /**
823         * @param value {@link #referenceSeqId} (Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.)
824         */
825        public SequenceReferenceSeqComponent setReferenceSeqId(CodeableConcept value) { 
826          this.referenceSeqId = value;
827          return this;
828        }
829
830        /**
831         * @return {@link #referenceSeqPointer} (A Pointer to another Sequence entity as reference sequence.)
832         */
833        public Reference getReferenceSeqPointer() { 
834          if (this.referenceSeqPointer == null)
835            if (Configuration.errorOnAutoCreate())
836              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqPointer");
837            else if (Configuration.doAutoCreate())
838              this.referenceSeqPointer = new Reference(); // cc
839          return this.referenceSeqPointer;
840        }
841
842        public boolean hasReferenceSeqPointer() { 
843          return this.referenceSeqPointer != null && !this.referenceSeqPointer.isEmpty();
844        }
845
846        /**
847         * @param value {@link #referenceSeqPointer} (A Pointer to another Sequence entity as reference sequence.)
848         */
849        public SequenceReferenceSeqComponent setReferenceSeqPointer(Reference value) { 
850          this.referenceSeqPointer = value;
851          return this;
852        }
853
854        /**
855         * @return {@link #referenceSeqPointer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A Pointer to another Sequence entity as reference sequence.)
856         */
857        public Sequence getReferenceSeqPointerTarget() { 
858          if (this.referenceSeqPointerTarget == null)
859            if (Configuration.errorOnAutoCreate())
860              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqPointer");
861            else if (Configuration.doAutoCreate())
862              this.referenceSeqPointerTarget = new Sequence(); // aa
863          return this.referenceSeqPointerTarget;
864        }
865
866        /**
867         * @param value {@link #referenceSeqPointer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A Pointer to another Sequence entity as reference sequence.)
868         */
869        public SequenceReferenceSeqComponent setReferenceSeqPointerTarget(Sequence value) { 
870          this.referenceSeqPointerTarget = value;
871          return this;
872        }
873
874        /**
875         * @return {@link #referenceSeqString} (A string like "ACGT".). This is the underlying object with id, value and extensions. The accessor "getReferenceSeqString" gives direct access to the value
876         */
877        public StringType getReferenceSeqStringElement() { 
878          if (this.referenceSeqString == null)
879            if (Configuration.errorOnAutoCreate())
880              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqString");
881            else if (Configuration.doAutoCreate())
882              this.referenceSeqString = new StringType(); // bb
883          return this.referenceSeqString;
884        }
885
886        public boolean hasReferenceSeqStringElement() { 
887          return this.referenceSeqString != null && !this.referenceSeqString.isEmpty();
888        }
889
890        public boolean hasReferenceSeqString() { 
891          return this.referenceSeqString != null && !this.referenceSeqString.isEmpty();
892        }
893
894        /**
895         * @param value {@link #referenceSeqString} (A string like "ACGT".). This is the underlying object with id, value and extensions. The accessor "getReferenceSeqString" gives direct access to the value
896         */
897        public SequenceReferenceSeqComponent setReferenceSeqStringElement(StringType value) { 
898          this.referenceSeqString = value;
899          return this;
900        }
901
902        /**
903         * @return A string like "ACGT".
904         */
905        public String getReferenceSeqString() { 
906          return this.referenceSeqString == null ? null : this.referenceSeqString.getValue();
907        }
908
909        /**
910         * @param value A string like "ACGT".
911         */
912        public SequenceReferenceSeqComponent setReferenceSeqString(String value) { 
913          if (Utilities.noString(value))
914            this.referenceSeqString = null;
915          else {
916            if (this.referenceSeqString == null)
917              this.referenceSeqString = new StringType();
918            this.referenceSeqString.setValue(value);
919          }
920          return this;
921        }
922
923        /**
924         * @return {@link #strand} (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.). This is the underlying object with id, value and extensions. The accessor "getStrand" gives direct access to the value
925         */
926        public Enumeration<StrandType> getStrandElement() { 
927          if (this.strand == null)
928            if (Configuration.errorOnAutoCreate())
929              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.strand");
930            else if (Configuration.doAutoCreate())
931              this.strand = new Enumeration<StrandType>(new StrandTypeEnumFactory()); // bb
932          return this.strand;
933        }
934
935        public boolean hasStrandElement() { 
936          return this.strand != null && !this.strand.isEmpty();
937        }
938
939        public boolean hasStrand() { 
940          return this.strand != null && !this.strand.isEmpty();
941        }
942
943        /**
944         * @param value {@link #strand} (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.). This is the underlying object with id, value and extensions. The accessor "getStrand" gives direct access to the value
945         */
946        public SequenceReferenceSeqComponent setStrandElement(Enumeration<StrandType> value) { 
947          this.strand = value;
948          return this;
949        }
950
951        /**
952         * @return 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.
953         */
954        public StrandType getStrand() { 
955          return this.strand == null ? null : this.strand.getValue();
956        }
957
958        /**
959         * @param value 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.
960         */
961        public SequenceReferenceSeqComponent setStrand(StrandType value) { 
962          if (value == null)
963            this.strand = null;
964          else {
965            if (this.strand == null)
966              this.strand = new Enumeration<StrandType>(new StrandTypeEnumFactory());
967            this.strand.setValue(value);
968          }
969          return this;
970        }
971
972        /**
973         * @return {@link #windowStart} (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.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value
974         */
975        public IntegerType getWindowStartElement() { 
976          if (this.windowStart == null)
977            if (Configuration.errorOnAutoCreate())
978              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.windowStart");
979            else if (Configuration.doAutoCreate())
980              this.windowStart = new IntegerType(); // bb
981          return this.windowStart;
982        }
983
984        public boolean hasWindowStartElement() { 
985          return this.windowStart != null && !this.windowStart.isEmpty();
986        }
987
988        public boolean hasWindowStart() { 
989          return this.windowStart != null && !this.windowStart.isEmpty();
990        }
991
992        /**
993         * @param value {@link #windowStart} (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.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value
994         */
995        public SequenceReferenceSeqComponent setWindowStartElement(IntegerType value) { 
996          this.windowStart = value;
997          return this;
998        }
999
1000        /**
1001         * @return 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.
1002         */
1003        public int getWindowStart() { 
1004          return this.windowStart == null || this.windowStart.isEmpty() ? 0 : this.windowStart.getValue();
1005        }
1006
1007        /**
1008         * @param value 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.
1009         */
1010        public SequenceReferenceSeqComponent setWindowStart(int value) { 
1011            if (this.windowStart == null)
1012              this.windowStart = new IntegerType();
1013            this.windowStart.setValue(value);
1014          return this;
1015        }
1016
1017        /**
1018         * @return {@link #windowEnd} (End position of the window on the reference sequence. If the coordinate system is 0-based then end is 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.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value
1019         */
1020        public IntegerType getWindowEndElement() { 
1021          if (this.windowEnd == null)
1022            if (Configuration.errorOnAutoCreate())
1023              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.windowEnd");
1024            else if (Configuration.doAutoCreate())
1025              this.windowEnd = new IntegerType(); // bb
1026          return this.windowEnd;
1027        }
1028
1029        public boolean hasWindowEndElement() { 
1030          return this.windowEnd != null && !this.windowEnd.isEmpty();
1031        }
1032
1033        public boolean hasWindowEnd() { 
1034          return this.windowEnd != null && !this.windowEnd.isEmpty();
1035        }
1036
1037        /**
1038         * @param value {@link #windowEnd} (End position of the window on the reference sequence. If the coordinate system is 0-based then end is 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.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value
1039         */
1040        public SequenceReferenceSeqComponent setWindowEndElement(IntegerType value) { 
1041          this.windowEnd = value;
1042          return this;
1043        }
1044
1045        /**
1046         * @return End position of the window on the reference sequence. If the coordinate system is 0-based then end is 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.
1047         */
1048        public int getWindowEnd() { 
1049          return this.windowEnd == null || this.windowEnd.isEmpty() ? 0 : this.windowEnd.getValue();
1050        }
1051
1052        /**
1053         * @param value End position of the window on the reference sequence. If the coordinate system is 0-based then end is 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.
1054         */
1055        public SequenceReferenceSeqComponent setWindowEnd(int value) { 
1056            if (this.windowEnd == null)
1057              this.windowEnd = new IntegerType();
1058            this.windowEnd.setValue(value);
1059          return this;
1060        }
1061
1062        protected void listChildren(List<Property> children) {
1063          super.listChildren(children);
1064          children.add(new Property("chromosome", "CodeableConcept", "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)).", 0, 1, chromosome));
1065          children.add(new Property("genomeBuild", "string", "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.", 0, 1, genomeBuild));
1066          children.add(new Property("orientation", "code", "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.", 0, 1, orientation));
1067          children.add(new Property("referenceSeqId", "CodeableConcept", "Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.", 0, 1, referenceSeqId));
1068          children.add(new Property("referenceSeqPointer", "Reference(Sequence)", "A Pointer to another Sequence entity as reference sequence.", 0, 1, referenceSeqPointer));
1069          children.add(new Property("referenceSeqString", "string", "A string like \"ACGT\".", 0, 1, referenceSeqString));
1070          children.add(new Property("strand", "code", "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.", 0, 1, strand));
1071          children.add(new Property("windowStart", "integer", "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.", 0, 1, windowStart));
1072          children.add(new Property("windowEnd", "integer", "End position of the window on the reference sequence. If the coordinate system is 0-based then end is 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.", 0, 1, windowEnd));
1073        }
1074
1075        @Override
1076        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1077          switch (_hash) {
1078          case -1499470472: /*chromosome*/  return new Property("chromosome", "CodeableConcept", "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)).", 0, 1, chromosome);
1079          case 1061239735: /*genomeBuild*/  return new Property("genomeBuild", "string", "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.", 0, 1, genomeBuild);
1080          case -1439500848: /*orientation*/  return new Property("orientation", "code", "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.", 0, 1, orientation);
1081          case -1911500465: /*referenceSeqId*/  return new Property("referenceSeqId", "CodeableConcept", "Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.", 0, 1, referenceSeqId);
1082          case 1923414665: /*referenceSeqPointer*/  return new Property("referenceSeqPointer", "Reference(Sequence)", "A Pointer to another Sequence entity as reference sequence.", 0, 1, referenceSeqPointer);
1083          case -1648301499: /*referenceSeqString*/  return new Property("referenceSeqString", "string", "A string like \"ACGT\".", 0, 1, referenceSeqString);
1084          case -891993594: /*strand*/  return new Property("strand", "code", "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.", 0, 1, strand);
1085          case 1903685202: /*windowStart*/  return new Property("windowStart", "integer", "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.", 0, 1, windowStart);
1086          case -217026869: /*windowEnd*/  return new Property("windowEnd", "integer", "End position of the window on the reference sequence. If the coordinate system is 0-based then end is 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.", 0, 1, windowEnd);
1087          default: return super.getNamedProperty(_hash, _name, _checkValid);
1088          }
1089
1090        }
1091
1092      @Override
1093      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1094        switch (hash) {
1095        case -1499470472: /*chromosome*/ return this.chromosome == null ? new Base[0] : new Base[] {this.chromosome}; // CodeableConcept
1096        case 1061239735: /*genomeBuild*/ return this.genomeBuild == null ? new Base[0] : new Base[] {this.genomeBuild}; // StringType
1097        case -1439500848: /*orientation*/ return this.orientation == null ? new Base[0] : new Base[] {this.orientation}; // Enumeration<OrientationType>
1098        case -1911500465: /*referenceSeqId*/ return this.referenceSeqId == null ? new Base[0] : new Base[] {this.referenceSeqId}; // CodeableConcept
1099        case 1923414665: /*referenceSeqPointer*/ return this.referenceSeqPointer == null ? new Base[0] : new Base[] {this.referenceSeqPointer}; // Reference
1100        case -1648301499: /*referenceSeqString*/ return this.referenceSeqString == null ? new Base[0] : new Base[] {this.referenceSeqString}; // StringType
1101        case -891993594: /*strand*/ return this.strand == null ? new Base[0] : new Base[] {this.strand}; // Enumeration<StrandType>
1102        case 1903685202: /*windowStart*/ return this.windowStart == null ? new Base[0] : new Base[] {this.windowStart}; // IntegerType
1103        case -217026869: /*windowEnd*/ return this.windowEnd == null ? new Base[0] : new Base[] {this.windowEnd}; // IntegerType
1104        default: return super.getProperty(hash, name, checkValid);
1105        }
1106
1107      }
1108
1109      @Override
1110      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1111        switch (hash) {
1112        case -1499470472: // chromosome
1113          this.chromosome = castToCodeableConcept(value); // CodeableConcept
1114          return value;
1115        case 1061239735: // genomeBuild
1116          this.genomeBuild = castToString(value); // StringType
1117          return value;
1118        case -1439500848: // orientation
1119          value = new OrientationTypeEnumFactory().fromType(castToCode(value));
1120          this.orientation = (Enumeration) value; // Enumeration<OrientationType>
1121          return value;
1122        case -1911500465: // referenceSeqId
1123          this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept
1124          return value;
1125        case 1923414665: // referenceSeqPointer
1126          this.referenceSeqPointer = castToReference(value); // Reference
1127          return value;
1128        case -1648301499: // referenceSeqString
1129          this.referenceSeqString = castToString(value); // StringType
1130          return value;
1131        case -891993594: // strand
1132          value = new StrandTypeEnumFactory().fromType(castToCode(value));
1133          this.strand = (Enumeration) value; // Enumeration<StrandType>
1134          return value;
1135        case 1903685202: // windowStart
1136          this.windowStart = castToInteger(value); // IntegerType
1137          return value;
1138        case -217026869: // windowEnd
1139          this.windowEnd = castToInteger(value); // IntegerType
1140          return value;
1141        default: return super.setProperty(hash, name, value);
1142        }
1143
1144      }
1145
1146      @Override
1147      public Base setProperty(String name, Base value) throws FHIRException {
1148        if (name.equals("chromosome")) {
1149          this.chromosome = castToCodeableConcept(value); // CodeableConcept
1150        } else if (name.equals("genomeBuild")) {
1151          this.genomeBuild = castToString(value); // StringType
1152        } else if (name.equals("orientation")) {
1153          value = new OrientationTypeEnumFactory().fromType(castToCode(value));
1154          this.orientation = (Enumeration) value; // Enumeration<OrientationType>
1155        } else if (name.equals("referenceSeqId")) {
1156          this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept
1157        } else if (name.equals("referenceSeqPointer")) {
1158          this.referenceSeqPointer = castToReference(value); // Reference
1159        } else if (name.equals("referenceSeqString")) {
1160          this.referenceSeqString = castToString(value); // StringType
1161        } else if (name.equals("strand")) {
1162          value = new StrandTypeEnumFactory().fromType(castToCode(value));
1163          this.strand = (Enumeration) value; // Enumeration<StrandType>
1164        } else if (name.equals("windowStart")) {
1165          this.windowStart = castToInteger(value); // IntegerType
1166        } else if (name.equals("windowEnd")) {
1167          this.windowEnd = castToInteger(value); // IntegerType
1168        } else
1169          return super.setProperty(name, value);
1170        return value;
1171      }
1172
1173      @Override
1174      public Base makeProperty(int hash, String name) throws FHIRException {
1175        switch (hash) {
1176        case -1499470472:  return getChromosome(); 
1177        case 1061239735:  return getGenomeBuildElement();
1178        case -1439500848:  return getOrientationElement();
1179        case -1911500465:  return getReferenceSeqId(); 
1180        case 1923414665:  return getReferenceSeqPointer(); 
1181        case -1648301499:  return getReferenceSeqStringElement();
1182        case -891993594:  return getStrandElement();
1183        case 1903685202:  return getWindowStartElement();
1184        case -217026869:  return getWindowEndElement();
1185        default: return super.makeProperty(hash, name);
1186        }
1187
1188      }
1189
1190      @Override
1191      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1192        switch (hash) {
1193        case -1499470472: /*chromosome*/ return new String[] {"CodeableConcept"};
1194        case 1061239735: /*genomeBuild*/ return new String[] {"string"};
1195        case -1439500848: /*orientation*/ return new String[] {"code"};
1196        case -1911500465: /*referenceSeqId*/ return new String[] {"CodeableConcept"};
1197        case 1923414665: /*referenceSeqPointer*/ return new String[] {"Reference"};
1198        case -1648301499: /*referenceSeqString*/ return new String[] {"string"};
1199        case -891993594: /*strand*/ return new String[] {"code"};
1200        case 1903685202: /*windowStart*/ return new String[] {"integer"};
1201        case -217026869: /*windowEnd*/ return new String[] {"integer"};
1202        default: return super.getTypesForProperty(hash, name);
1203        }
1204
1205      }
1206
1207      @Override
1208      public Base addChild(String name) throws FHIRException {
1209        if (name.equals("chromosome")) {
1210          this.chromosome = new CodeableConcept();
1211          return this.chromosome;
1212        }
1213        else if (name.equals("genomeBuild")) {
1214          throw new FHIRException("Cannot call addChild on a primitive type Sequence.genomeBuild");
1215        }
1216        else if (name.equals("orientation")) {
1217          throw new FHIRException("Cannot call addChild on a primitive type Sequence.orientation");
1218        }
1219        else if (name.equals("referenceSeqId")) {
1220          this.referenceSeqId = new CodeableConcept();
1221          return this.referenceSeqId;
1222        }
1223        else if (name.equals("referenceSeqPointer")) {
1224          this.referenceSeqPointer = new Reference();
1225          return this.referenceSeqPointer;
1226        }
1227        else if (name.equals("referenceSeqString")) {
1228          throw new FHIRException("Cannot call addChild on a primitive type Sequence.referenceSeqString");
1229        }
1230        else if (name.equals("strand")) {
1231          throw new FHIRException("Cannot call addChild on a primitive type Sequence.strand");
1232        }
1233        else if (name.equals("windowStart")) {
1234          throw new FHIRException("Cannot call addChild on a primitive type Sequence.windowStart");
1235        }
1236        else if (name.equals("windowEnd")) {
1237          throw new FHIRException("Cannot call addChild on a primitive type Sequence.windowEnd");
1238        }
1239        else
1240          return super.addChild(name);
1241      }
1242
1243      public SequenceReferenceSeqComponent copy() {
1244        SequenceReferenceSeqComponent dst = new SequenceReferenceSeqComponent();
1245        copyValues(dst);
1246        dst.chromosome = chromosome == null ? null : chromosome.copy();
1247        dst.genomeBuild = genomeBuild == null ? null : genomeBuild.copy();
1248        dst.orientation = orientation == null ? null : orientation.copy();
1249        dst.referenceSeqId = referenceSeqId == null ? null : referenceSeqId.copy();
1250        dst.referenceSeqPointer = referenceSeqPointer == null ? null : referenceSeqPointer.copy();
1251        dst.referenceSeqString = referenceSeqString == null ? null : referenceSeqString.copy();
1252        dst.strand = strand == null ? null : strand.copy();
1253        dst.windowStart = windowStart == null ? null : windowStart.copy();
1254        dst.windowEnd = windowEnd == null ? null : windowEnd.copy();
1255        return dst;
1256      }
1257
1258      @Override
1259      public boolean equalsDeep(Base other_) {
1260        if (!super.equalsDeep(other_))
1261          return false;
1262        if (!(other_ instanceof SequenceReferenceSeqComponent))
1263          return false;
1264        SequenceReferenceSeqComponent o = (SequenceReferenceSeqComponent) other_;
1265        return compareDeep(chromosome, o.chromosome, true) && compareDeep(genomeBuild, o.genomeBuild, true)
1266           && compareDeep(orientation, o.orientation, true) && compareDeep(referenceSeqId, o.referenceSeqId, true)
1267           && compareDeep(referenceSeqPointer, o.referenceSeqPointer, true) && compareDeep(referenceSeqString, o.referenceSeqString, true)
1268           && compareDeep(strand, o.strand, true) && compareDeep(windowStart, o.windowStart, true) && compareDeep(windowEnd, o.windowEnd, true)
1269          ;
1270      }
1271
1272      @Override
1273      public boolean equalsShallow(Base other_) {
1274        if (!super.equalsShallow(other_))
1275          return false;
1276        if (!(other_ instanceof SequenceReferenceSeqComponent))
1277          return false;
1278        SequenceReferenceSeqComponent o = (SequenceReferenceSeqComponent) other_;
1279        return compareValues(genomeBuild, o.genomeBuild, true) && compareValues(orientation, o.orientation, true)
1280           && compareValues(referenceSeqString, o.referenceSeqString, true) && compareValues(strand, o.strand, true)
1281           && compareValues(windowStart, o.windowStart, true) && compareValues(windowEnd, o.windowEnd, true);
1282      }
1283
1284      public boolean isEmpty() {
1285        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(chromosome, genomeBuild, orientation
1286          , referenceSeqId, referenceSeqPointer, referenceSeqString, strand, windowStart, windowEnd
1287          );
1288      }
1289
1290  public String fhirType() {
1291    return "Sequence.referenceSeq";
1292
1293  }
1294
1295  }
1296
1297    @Block()
1298    public static class SequenceVariantComponent extends BackboneElement implements IBaseBackboneElement {
1299        /**
1300         * 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.
1301         */
1302        @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1303        @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." )
1304        protected IntegerType start;
1305
1306        /**
1307         * End position of the variant on the reference sequence.If the coordinate system is 0-based then end is 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.
1308         */
1309        @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1310        @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 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." )
1311        protected IntegerType end;
1312
1313        /**
1314         * 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.
1315         */
1316        @Child(name = "observedAllele", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1317        @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." )
1318        protected StringType observedAllele;
1319
1320        /**
1321         * 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.
1322         */
1323        @Child(name = "referenceAllele", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1324        @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." )
1325        protected StringType referenceAllele;
1326
1327        /**
1328         * 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).
1329         */
1330        @Child(name = "cigar", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
1331        @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)." )
1332        protected StringType cigar;
1333
1334        /**
1335         * A pointer to an Observation containing variant information.
1336         */
1337        @Child(name = "variantPointer", type = {Observation.class}, order=6, min=0, max=1, modifier=false, summary=true)
1338        @Description(shortDefinition="Pointer to observed variant information", formalDefinition="A pointer to an Observation containing variant information." )
1339        protected Reference variantPointer;
1340
1341        /**
1342         * The actual object that is the target of the reference (A pointer to an Observation containing variant information.)
1343         */
1344        protected Observation variantPointerTarget;
1345
1346        private static final long serialVersionUID = 105611837L;
1347
1348    /**
1349     * Constructor
1350     */
1351      public SequenceVariantComponent() {
1352        super();
1353      }
1354
1355        /**
1356         * @return {@link #start} (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.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
1357         */
1358        public IntegerType getStartElement() { 
1359          if (this.start == null)
1360            if (Configuration.errorOnAutoCreate())
1361              throw new Error("Attempt to auto-create SequenceVariantComponent.start");
1362            else if (Configuration.doAutoCreate())
1363              this.start = new IntegerType(); // bb
1364          return this.start;
1365        }
1366
1367        public boolean hasStartElement() { 
1368          return this.start != null && !this.start.isEmpty();
1369        }
1370
1371        public boolean hasStart() { 
1372          return this.start != null && !this.start.isEmpty();
1373        }
1374
1375        /**
1376         * @param value {@link #start} (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.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
1377         */
1378        public SequenceVariantComponent setStartElement(IntegerType value) { 
1379          this.start = value;
1380          return this;
1381        }
1382
1383        /**
1384         * @return 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.
1385         */
1386        public int getStart() { 
1387          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
1388        }
1389
1390        /**
1391         * @param value 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.
1392         */
1393        public SequenceVariantComponent setStart(int value) { 
1394            if (this.start == null)
1395              this.start = new IntegerType();
1396            this.start.setValue(value);
1397          return this;
1398        }
1399
1400        /**
1401         * @return {@link #end} (End position of the variant on the reference sequence.If the coordinate system is 0-based then end is 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.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
1402         */
1403        public IntegerType getEndElement() { 
1404          if (this.end == null)
1405            if (Configuration.errorOnAutoCreate())
1406              throw new Error("Attempt to auto-create SequenceVariantComponent.end");
1407            else if (Configuration.doAutoCreate())
1408              this.end = new IntegerType(); // bb
1409          return this.end;
1410        }
1411
1412        public boolean hasEndElement() { 
1413          return this.end != null && !this.end.isEmpty();
1414        }
1415
1416        public boolean hasEnd() { 
1417          return this.end != null && !this.end.isEmpty();
1418        }
1419
1420        /**
1421         * @param value {@link #end} (End position of the variant on the reference sequence.If the coordinate system is 0-based then end is 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.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
1422         */
1423        public SequenceVariantComponent setEndElement(IntegerType value) { 
1424          this.end = value;
1425          return this;
1426        }
1427
1428        /**
1429         * @return End position of the variant on the reference sequence.If the coordinate system is 0-based then end is 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.
1430         */
1431        public int getEnd() { 
1432          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
1433        }
1434
1435        /**
1436         * @param value End position of the variant on the reference sequence.If the coordinate system is 0-based then end is 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.
1437         */
1438        public SequenceVariantComponent setEnd(int value) { 
1439            if (this.end == null)
1440              this.end = new IntegerType();
1441            this.end.setValue(value);
1442          return this;
1443        }
1444
1445        /**
1446         * @return {@link #observedAllele} (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.). This is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value
1447         */
1448        public StringType getObservedAlleleElement() { 
1449          if (this.observedAllele == null)
1450            if (Configuration.errorOnAutoCreate())
1451              throw new Error("Attempt to auto-create SequenceVariantComponent.observedAllele");
1452            else if (Configuration.doAutoCreate())
1453              this.observedAllele = new StringType(); // bb
1454          return this.observedAllele;
1455        }
1456
1457        public boolean hasObservedAlleleElement() { 
1458          return this.observedAllele != null && !this.observedAllele.isEmpty();
1459        }
1460
1461        public boolean hasObservedAllele() { 
1462          return this.observedAllele != null && !this.observedAllele.isEmpty();
1463        }
1464
1465        /**
1466         * @param value {@link #observedAllele} (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.). This is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value
1467         */
1468        public SequenceVariantComponent setObservedAlleleElement(StringType value) { 
1469          this.observedAllele = value;
1470          return this;
1471        }
1472
1473        /**
1474         * @return 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.
1475         */
1476        public String getObservedAllele() { 
1477          return this.observedAllele == null ? null : this.observedAllele.getValue();
1478        }
1479
1480        /**
1481         * @param value 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.
1482         */
1483        public SequenceVariantComponent setObservedAllele(String value) { 
1484          if (Utilities.noString(value))
1485            this.observedAllele = null;
1486          else {
1487            if (this.observedAllele == null)
1488              this.observedAllele = new StringType();
1489            this.observedAllele.setValue(value);
1490          }
1491          return this;
1492        }
1493
1494        /**
1495         * @return {@link #referenceAllele} (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.). This is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value
1496         */
1497        public StringType getReferenceAlleleElement() { 
1498          if (this.referenceAllele == null)
1499            if (Configuration.errorOnAutoCreate())
1500              throw new Error("Attempt to auto-create SequenceVariantComponent.referenceAllele");
1501            else if (Configuration.doAutoCreate())
1502              this.referenceAllele = new StringType(); // bb
1503          return this.referenceAllele;
1504        }
1505
1506        public boolean hasReferenceAlleleElement() { 
1507          return this.referenceAllele != null && !this.referenceAllele.isEmpty();
1508        }
1509
1510        public boolean hasReferenceAllele() { 
1511          return this.referenceAllele != null && !this.referenceAllele.isEmpty();
1512        }
1513
1514        /**
1515         * @param value {@link #referenceAllele} (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.). This is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value
1516         */
1517        public SequenceVariantComponent setReferenceAlleleElement(StringType value) { 
1518          this.referenceAllele = value;
1519          return this;
1520        }
1521
1522        /**
1523         * @return 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.
1524         */
1525        public String getReferenceAllele() { 
1526          return this.referenceAllele == null ? null : this.referenceAllele.getValue();
1527        }
1528
1529        /**
1530         * @param value 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.
1531         */
1532        public SequenceVariantComponent setReferenceAllele(String value) { 
1533          if (Utilities.noString(value))
1534            this.referenceAllele = null;
1535          else {
1536            if (this.referenceAllele == null)
1537              this.referenceAllele = new StringType();
1538            this.referenceAllele.setValue(value);
1539          }
1540          return this;
1541        }
1542
1543        /**
1544         * @return {@link #cigar} (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).). This is the underlying object with id, value and extensions. The accessor "getCigar" gives direct access to the value
1545         */
1546        public StringType getCigarElement() { 
1547          if (this.cigar == null)
1548            if (Configuration.errorOnAutoCreate())
1549              throw new Error("Attempt to auto-create SequenceVariantComponent.cigar");
1550            else if (Configuration.doAutoCreate())
1551              this.cigar = new StringType(); // bb
1552          return this.cigar;
1553        }
1554
1555        public boolean hasCigarElement() { 
1556          return this.cigar != null && !this.cigar.isEmpty();
1557        }
1558
1559        public boolean hasCigar() { 
1560          return this.cigar != null && !this.cigar.isEmpty();
1561        }
1562
1563        /**
1564         * @param value {@link #cigar} (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).). This is the underlying object with id, value and extensions. The accessor "getCigar" gives direct access to the value
1565         */
1566        public SequenceVariantComponent setCigarElement(StringType value) { 
1567          this.cigar = value;
1568          return this;
1569        }
1570
1571        /**
1572         * @return 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).
1573         */
1574        public String getCigar() { 
1575          return this.cigar == null ? null : this.cigar.getValue();
1576        }
1577
1578        /**
1579         * @param value 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).
1580         */
1581        public SequenceVariantComponent setCigar(String value) { 
1582          if (Utilities.noString(value))
1583            this.cigar = null;
1584          else {
1585            if (this.cigar == null)
1586              this.cigar = new StringType();
1587            this.cigar.setValue(value);
1588          }
1589          return this;
1590        }
1591
1592        /**
1593         * @return {@link #variantPointer} (A pointer to an Observation containing variant information.)
1594         */
1595        public Reference getVariantPointer() { 
1596          if (this.variantPointer == null)
1597            if (Configuration.errorOnAutoCreate())
1598              throw new Error("Attempt to auto-create SequenceVariantComponent.variantPointer");
1599            else if (Configuration.doAutoCreate())
1600              this.variantPointer = new Reference(); // cc
1601          return this.variantPointer;
1602        }
1603
1604        public boolean hasVariantPointer() { 
1605          return this.variantPointer != null && !this.variantPointer.isEmpty();
1606        }
1607
1608        /**
1609         * @param value {@link #variantPointer} (A pointer to an Observation containing variant information.)
1610         */
1611        public SequenceVariantComponent setVariantPointer(Reference value) { 
1612          this.variantPointer = value;
1613          return this;
1614        }
1615
1616        /**
1617         * @return {@link #variantPointer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A pointer to an Observation containing variant information.)
1618         */
1619        public Observation getVariantPointerTarget() { 
1620          if (this.variantPointerTarget == null)
1621            if (Configuration.errorOnAutoCreate())
1622              throw new Error("Attempt to auto-create SequenceVariantComponent.variantPointer");
1623            else if (Configuration.doAutoCreate())
1624              this.variantPointerTarget = new Observation(); // aa
1625          return this.variantPointerTarget;
1626        }
1627
1628        /**
1629         * @param value {@link #variantPointer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A pointer to an Observation containing variant information.)
1630         */
1631        public SequenceVariantComponent setVariantPointerTarget(Observation value) { 
1632          this.variantPointerTarget = value;
1633          return this;
1634        }
1635
1636        protected void listChildren(List<Property> children) {
1637          super.listChildren(children);
1638          children.add(new Property("start", "integer", "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.", 0, 1, start));
1639          children.add(new Property("end", "integer", "End position of the variant on the reference sequence.If the coordinate system is 0-based then end is 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.", 0, 1, end));
1640          children.add(new Property("observedAllele", "string", "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.", 0, 1, observedAllele));
1641          children.add(new Property("referenceAllele", "string", "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.", 0, 1, referenceAllele));
1642          children.add(new Property("cigar", "string", "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).", 0, 1, cigar));
1643          children.add(new Property("variantPointer", "Reference(Observation)", "A pointer to an Observation containing variant information.", 0, 1, variantPointer));
1644        }
1645
1646        @Override
1647        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1648          switch (_hash) {
1649          case 109757538: /*start*/  return new Property("start", "integer", "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.", 0, 1, start);
1650          case 100571: /*end*/  return new Property("end", "integer", "End position of the variant on the reference sequence.If the coordinate system is 0-based then end is 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.", 0, 1, end);
1651          case -1418745787: /*observedAllele*/  return new Property("observedAllele", "string", "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.", 0, 1, observedAllele);
1652          case 364045960: /*referenceAllele*/  return new Property("referenceAllele", "string", "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.", 0, 1, referenceAllele);
1653          case 94658738: /*cigar*/  return new Property("cigar", "string", "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).", 0, 1, cigar);
1654          case -1654319624: /*variantPointer*/  return new Property("variantPointer", "Reference(Observation)", "A pointer to an Observation containing variant information.", 0, 1, variantPointer);
1655          default: return super.getNamedProperty(_hash, _name, _checkValid);
1656          }
1657
1658        }
1659
1660      @Override
1661      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1662        switch (hash) {
1663        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
1664        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
1665        case -1418745787: /*observedAllele*/ return this.observedAllele == null ? new Base[0] : new Base[] {this.observedAllele}; // StringType
1666        case 364045960: /*referenceAllele*/ return this.referenceAllele == null ? new Base[0] : new Base[] {this.referenceAllele}; // StringType
1667        case 94658738: /*cigar*/ return this.cigar == null ? new Base[0] : new Base[] {this.cigar}; // StringType
1668        case -1654319624: /*variantPointer*/ return this.variantPointer == null ? new Base[0] : new Base[] {this.variantPointer}; // Reference
1669        default: return super.getProperty(hash, name, checkValid);
1670        }
1671
1672      }
1673
1674      @Override
1675      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1676        switch (hash) {
1677        case 109757538: // start
1678          this.start = castToInteger(value); // IntegerType
1679          return value;
1680        case 100571: // end
1681          this.end = castToInteger(value); // IntegerType
1682          return value;
1683        case -1418745787: // observedAllele
1684          this.observedAllele = castToString(value); // StringType
1685          return value;
1686        case 364045960: // referenceAllele
1687          this.referenceAllele = castToString(value); // StringType
1688          return value;
1689        case 94658738: // cigar
1690          this.cigar = castToString(value); // StringType
1691          return value;
1692        case -1654319624: // variantPointer
1693          this.variantPointer = castToReference(value); // Reference
1694          return value;
1695        default: return super.setProperty(hash, name, value);
1696        }
1697
1698      }
1699
1700      @Override
1701      public Base setProperty(String name, Base value) throws FHIRException {
1702        if (name.equals("start")) {
1703          this.start = castToInteger(value); // IntegerType
1704        } else if (name.equals("end")) {
1705          this.end = castToInteger(value); // IntegerType
1706        } else if (name.equals("observedAllele")) {
1707          this.observedAllele = castToString(value); // StringType
1708        } else if (name.equals("referenceAllele")) {
1709          this.referenceAllele = castToString(value); // StringType
1710        } else if (name.equals("cigar")) {
1711          this.cigar = castToString(value); // StringType
1712        } else if (name.equals("variantPointer")) {
1713          this.variantPointer = castToReference(value); // Reference
1714        } else
1715          return super.setProperty(name, value);
1716        return value;
1717      }
1718
1719      @Override
1720      public Base makeProperty(int hash, String name) throws FHIRException {
1721        switch (hash) {
1722        case 109757538:  return getStartElement();
1723        case 100571:  return getEndElement();
1724        case -1418745787:  return getObservedAlleleElement();
1725        case 364045960:  return getReferenceAlleleElement();
1726        case 94658738:  return getCigarElement();
1727        case -1654319624:  return getVariantPointer(); 
1728        default: return super.makeProperty(hash, name);
1729        }
1730
1731      }
1732
1733      @Override
1734      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1735        switch (hash) {
1736        case 109757538: /*start*/ return new String[] {"integer"};
1737        case 100571: /*end*/ return new String[] {"integer"};
1738        case -1418745787: /*observedAllele*/ return new String[] {"string"};
1739        case 364045960: /*referenceAllele*/ return new String[] {"string"};
1740        case 94658738: /*cigar*/ return new String[] {"string"};
1741        case -1654319624: /*variantPointer*/ return new String[] {"Reference"};
1742        default: return super.getTypesForProperty(hash, name);
1743        }
1744
1745      }
1746
1747      @Override
1748      public Base addChild(String name) throws FHIRException {
1749        if (name.equals("start")) {
1750          throw new FHIRException("Cannot call addChild on a primitive type Sequence.start");
1751        }
1752        else if (name.equals("end")) {
1753          throw new FHIRException("Cannot call addChild on a primitive type Sequence.end");
1754        }
1755        else if (name.equals("observedAllele")) {
1756          throw new FHIRException("Cannot call addChild on a primitive type Sequence.observedAllele");
1757        }
1758        else if (name.equals("referenceAllele")) {
1759          throw new FHIRException("Cannot call addChild on a primitive type Sequence.referenceAllele");
1760        }
1761        else if (name.equals("cigar")) {
1762          throw new FHIRException("Cannot call addChild on a primitive type Sequence.cigar");
1763        }
1764        else if (name.equals("variantPointer")) {
1765          this.variantPointer = new Reference();
1766          return this.variantPointer;
1767        }
1768        else
1769          return super.addChild(name);
1770      }
1771
1772      public SequenceVariantComponent copy() {
1773        SequenceVariantComponent dst = new SequenceVariantComponent();
1774        copyValues(dst);
1775        dst.start = start == null ? null : start.copy();
1776        dst.end = end == null ? null : end.copy();
1777        dst.observedAllele = observedAllele == null ? null : observedAllele.copy();
1778        dst.referenceAllele = referenceAllele == null ? null : referenceAllele.copy();
1779        dst.cigar = cigar == null ? null : cigar.copy();
1780        dst.variantPointer = variantPointer == null ? null : variantPointer.copy();
1781        return dst;
1782      }
1783
1784      @Override
1785      public boolean equalsDeep(Base other_) {
1786        if (!super.equalsDeep(other_))
1787          return false;
1788        if (!(other_ instanceof SequenceVariantComponent))
1789          return false;
1790        SequenceVariantComponent o = (SequenceVariantComponent) other_;
1791        return compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(observedAllele, o.observedAllele, true)
1792           && compareDeep(referenceAllele, o.referenceAllele, true) && compareDeep(cigar, o.cigar, true) && compareDeep(variantPointer, o.variantPointer, true)
1793          ;
1794      }
1795
1796      @Override
1797      public boolean equalsShallow(Base other_) {
1798        if (!super.equalsShallow(other_))
1799          return false;
1800        if (!(other_ instanceof SequenceVariantComponent))
1801          return false;
1802        SequenceVariantComponent o = (SequenceVariantComponent) other_;
1803        return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(observedAllele, o.observedAllele, true)
1804           && compareValues(referenceAllele, o.referenceAllele, true) && compareValues(cigar, o.cigar, true);
1805      }
1806
1807      public boolean isEmpty() {
1808        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(start, end, observedAllele
1809          , referenceAllele, cigar, variantPointer);
1810      }
1811
1812  public String fhirType() {
1813    return "Sequence.variant";
1814
1815  }
1816
1817  }
1818
1819    @Block()
1820    public static class SequenceQualityComponent extends BackboneElement implements IBaseBackboneElement {
1821        /**
1822         * INDEL / SNP / Undefined variant.
1823         */
1824        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1825        @Description(shortDefinition="indel | snp | unknown", formalDefinition="INDEL / SNP / Undefined variant." )
1826        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/quality-type")
1827        protected Enumeration<QualityType> type;
1828
1829        /**
1830         * Gold standard sequence used for comparing against.
1831         */
1832        @Child(name = "standardSequence", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1833        @Description(shortDefinition="Standard sequence for comparison", formalDefinition="Gold standard sequence used for comparing against." )
1834        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-quality-standardSequence")
1835        protected CodeableConcept standardSequence;
1836
1837        /**
1838         * Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.
1839         */
1840        @Child(name = "start", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1841        @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." )
1842        protected IntegerType start;
1843
1844        /**
1845         * End position of the sequence.If the coordinate system is 0-based then end is 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.
1846         */
1847        @Child(name = "end", type = {IntegerType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1848        @Description(shortDefinition="End position of the sequence", formalDefinition="End position of the sequence.If the coordinate system is 0-based then end is 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." )
1849        protected IntegerType end;
1850
1851        /**
1852         * The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).
1853         */
1854        @Child(name = "score", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=true)
1855        @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))." )
1856        protected Quantity score;
1857
1858        /**
1859         * Which method is used to get sequence quality.
1860         */
1861        @Child(name = "method", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
1862        @Description(shortDefinition="Method to get quality", formalDefinition="Which method is used to get sequence quality." )
1863        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-quality-method")
1864        protected CodeableConcept method;
1865
1866        /**
1867         * 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.
1868         */
1869        @Child(name = "truthTP", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1870        @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." )
1871        protected DecimalType truthTP;
1872
1873        /**
1874         * 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.
1875         */
1876        @Child(name = "queryTP", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true)
1877        @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." )
1878        protected DecimalType queryTP;
1879
1880        /**
1881         * 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.
1882         */
1883        @Child(name = "truthFN", type = {DecimalType.class}, order=9, min=0, max=1, modifier=false, summary=true)
1884        @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." )
1885        protected DecimalType truthFN;
1886
1887        /**
1888         * 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.
1889         */
1890        @Child(name = "queryFP", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true)
1891        @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." )
1892        protected DecimalType queryFP;
1893
1894        /**
1895         * 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).
1896         */
1897        @Child(name = "gtFP", type = {DecimalType.class}, order=11, min=0, max=1, modifier=false, summary=true)
1898        @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)." )
1899        protected DecimalType gtFP;
1900
1901        /**
1902         * QUERY.TP / (QUERY.TP + QUERY.FP).
1903         */
1904        @Child(name = "precision", type = {DecimalType.class}, order=12, min=0, max=1, modifier=false, summary=true)
1905        @Description(shortDefinition="Precision of comparison", formalDefinition="QUERY.TP / (QUERY.TP + QUERY.FP)." )
1906        protected DecimalType precision;
1907
1908        /**
1909         * TRUTH.TP / (TRUTH.TP + TRUTH.FN).
1910         */
1911        @Child(name = "recall", type = {DecimalType.class}, order=13, min=0, max=1, modifier=false, summary=true)
1912        @Description(shortDefinition="Recall of comparison", formalDefinition="TRUTH.TP / (TRUTH.TP + TRUTH.FN)." )
1913        protected DecimalType recall;
1914
1915        /**
1916         * Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).
1917         */
1918        @Child(name = "fScore", type = {DecimalType.class}, order=14, min=0, max=1, modifier=false, summary=true)
1919        @Description(shortDefinition="F-score", formalDefinition="Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall)." )
1920        protected DecimalType fScore;
1921
1922        /**
1923         * Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff.
1924         */
1925        @Child(name = "roc", type = {}, order=15, min=0, max=1, modifier=false, summary=true)
1926        @Description(shortDefinition="Receiver Operator Characteristic (ROC) Curve", formalDefinition="Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff." )
1927        protected SequenceQualityRocComponent roc;
1928
1929        private static final long serialVersionUID = 147678016L;
1930
1931    /**
1932     * Constructor
1933     */
1934      public SequenceQualityComponent() {
1935        super();
1936      }
1937
1938    /**
1939     * Constructor
1940     */
1941      public SequenceQualityComponent(Enumeration<QualityType> type) {
1942        super();
1943        this.type = type;
1944      }
1945
1946        /**
1947         * @return {@link #type} (INDEL / SNP / Undefined variant.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1948         */
1949        public Enumeration<QualityType> getTypeElement() { 
1950          if (this.type == null)
1951            if (Configuration.errorOnAutoCreate())
1952              throw new Error("Attempt to auto-create SequenceQualityComponent.type");
1953            else if (Configuration.doAutoCreate())
1954              this.type = new Enumeration<QualityType>(new QualityTypeEnumFactory()); // bb
1955          return this.type;
1956        }
1957
1958        public boolean hasTypeElement() { 
1959          return this.type != null && !this.type.isEmpty();
1960        }
1961
1962        public boolean hasType() { 
1963          return this.type != null && !this.type.isEmpty();
1964        }
1965
1966        /**
1967         * @param value {@link #type} (INDEL / SNP / Undefined variant.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1968         */
1969        public SequenceQualityComponent setTypeElement(Enumeration<QualityType> value) { 
1970          this.type = value;
1971          return this;
1972        }
1973
1974        /**
1975         * @return INDEL / SNP / Undefined variant.
1976         */
1977        public QualityType getType() { 
1978          return this.type == null ? null : this.type.getValue();
1979        }
1980
1981        /**
1982         * @param value INDEL / SNP / Undefined variant.
1983         */
1984        public SequenceQualityComponent setType(QualityType value) { 
1985            if (this.type == null)
1986              this.type = new Enumeration<QualityType>(new QualityTypeEnumFactory());
1987            this.type.setValue(value);
1988          return this;
1989        }
1990
1991        /**
1992         * @return {@link #standardSequence} (Gold standard sequence used for comparing against.)
1993         */
1994        public CodeableConcept getStandardSequence() { 
1995          if (this.standardSequence == null)
1996            if (Configuration.errorOnAutoCreate())
1997              throw new Error("Attempt to auto-create SequenceQualityComponent.standardSequence");
1998            else if (Configuration.doAutoCreate())
1999              this.standardSequence = new CodeableConcept(); // cc
2000          return this.standardSequence;
2001        }
2002
2003        public boolean hasStandardSequence() { 
2004          return this.standardSequence != null && !this.standardSequence.isEmpty();
2005        }
2006
2007        /**
2008         * @param value {@link #standardSequence} (Gold standard sequence used for comparing against.)
2009         */
2010        public SequenceQualityComponent setStandardSequence(CodeableConcept value) { 
2011          this.standardSequence = value;
2012          return this;
2013        }
2014
2015        /**
2016         * @return {@link #start} (Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
2017         */
2018        public IntegerType getStartElement() { 
2019          if (this.start == null)
2020            if (Configuration.errorOnAutoCreate())
2021              throw new Error("Attempt to auto-create SequenceQualityComponent.start");
2022            else if (Configuration.doAutoCreate())
2023              this.start = new IntegerType(); // bb
2024          return this.start;
2025        }
2026
2027        public boolean hasStartElement() { 
2028          return this.start != null && !this.start.isEmpty();
2029        }
2030
2031        public boolean hasStart() { 
2032          return this.start != null && !this.start.isEmpty();
2033        }
2034
2035        /**
2036         * @param value {@link #start} (Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
2037         */
2038        public SequenceQualityComponent setStartElement(IntegerType value) { 
2039          this.start = value;
2040          return this;
2041        }
2042
2043        /**
2044         * @return Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.
2045         */
2046        public int getStart() { 
2047          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
2048        }
2049
2050        /**
2051         * @param value Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.
2052         */
2053        public SequenceQualityComponent setStart(int value) { 
2054            if (this.start == null)
2055              this.start = new IntegerType();
2056            this.start.setValue(value);
2057          return this;
2058        }
2059
2060        /**
2061         * @return {@link #end} (End position of the sequence.If the coordinate system is 0-based then end is 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.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
2062         */
2063        public IntegerType getEndElement() { 
2064          if (this.end == null)
2065            if (Configuration.errorOnAutoCreate())
2066              throw new Error("Attempt to auto-create SequenceQualityComponent.end");
2067            else if (Configuration.doAutoCreate())
2068              this.end = new IntegerType(); // bb
2069          return this.end;
2070        }
2071
2072        public boolean hasEndElement() { 
2073          return this.end != null && !this.end.isEmpty();
2074        }
2075
2076        public boolean hasEnd() { 
2077          return this.end != null && !this.end.isEmpty();
2078        }
2079
2080        /**
2081         * @param value {@link #end} (End position of the sequence.If the coordinate system is 0-based then end is 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.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
2082         */
2083        public SequenceQualityComponent setEndElement(IntegerType value) { 
2084          this.end = value;
2085          return this;
2086        }
2087
2088        /**
2089         * @return End position of the sequence.If the coordinate system is 0-based then end is 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.
2090         */
2091        public int getEnd() { 
2092          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
2093        }
2094
2095        /**
2096         * @param value End position of the sequence.If the coordinate system is 0-based then end is 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.
2097         */
2098        public SequenceQualityComponent setEnd(int value) { 
2099            if (this.end == null)
2100              this.end = new IntegerType();
2101            this.end.setValue(value);
2102          return this;
2103        }
2104
2105        /**
2106         * @return {@link #score} (The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).)
2107         */
2108        public Quantity getScore() { 
2109          if (this.score == null)
2110            if (Configuration.errorOnAutoCreate())
2111              throw new Error("Attempt to auto-create SequenceQualityComponent.score");
2112            else if (Configuration.doAutoCreate())
2113              this.score = new Quantity(); // cc
2114          return this.score;
2115        }
2116
2117        public boolean hasScore() { 
2118          return this.score != null && !this.score.isEmpty();
2119        }
2120
2121        /**
2122         * @param value {@link #score} (The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).)
2123         */
2124        public SequenceQualityComponent setScore(Quantity value) { 
2125          this.score = value;
2126          return this;
2127        }
2128
2129        /**
2130         * @return {@link #method} (Which method is used to get sequence quality.)
2131         */
2132        public CodeableConcept getMethod() { 
2133          if (this.method == null)
2134            if (Configuration.errorOnAutoCreate())
2135              throw new Error("Attempt to auto-create SequenceQualityComponent.method");
2136            else if (Configuration.doAutoCreate())
2137              this.method = new CodeableConcept(); // cc
2138          return this.method;
2139        }
2140
2141        public boolean hasMethod() { 
2142          return this.method != null && !this.method.isEmpty();
2143        }
2144
2145        /**
2146         * @param value {@link #method} (Which method is used to get sequence quality.)
2147         */
2148        public SequenceQualityComponent setMethod(CodeableConcept value) { 
2149          this.method = value;
2150          return this;
2151        }
2152
2153        /**
2154         * @return {@link #truthTP} (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.). This is the underlying object with id, value and extensions. The accessor "getTruthTP" gives direct access to the value
2155         */
2156        public DecimalType getTruthTPElement() { 
2157          if (this.truthTP == null)
2158            if (Configuration.errorOnAutoCreate())
2159              throw new Error("Attempt to auto-create SequenceQualityComponent.truthTP");
2160            else if (Configuration.doAutoCreate())
2161              this.truthTP = new DecimalType(); // bb
2162          return this.truthTP;
2163        }
2164
2165        public boolean hasTruthTPElement() { 
2166          return this.truthTP != null && !this.truthTP.isEmpty();
2167        }
2168
2169        public boolean hasTruthTP() { 
2170          return this.truthTP != null && !this.truthTP.isEmpty();
2171        }
2172
2173        /**
2174         * @param value {@link #truthTP} (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.). This is the underlying object with id, value and extensions. The accessor "getTruthTP" gives direct access to the value
2175         */
2176        public SequenceQualityComponent setTruthTPElement(DecimalType value) { 
2177          this.truthTP = value;
2178          return this;
2179        }
2180
2181        /**
2182         * @return 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.
2183         */
2184        public BigDecimal getTruthTP() { 
2185          return this.truthTP == null ? null : this.truthTP.getValue();
2186        }
2187
2188        /**
2189         * @param value 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.
2190         */
2191        public SequenceQualityComponent setTruthTP(BigDecimal value) { 
2192          if (value == null)
2193            this.truthTP = null;
2194          else {
2195            if (this.truthTP == null)
2196              this.truthTP = new DecimalType();
2197            this.truthTP.setValue(value);
2198          }
2199          return this;
2200        }
2201
2202        /**
2203         * @param value 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.
2204         */
2205        public SequenceQualityComponent setTruthTP(long value) { 
2206              this.truthTP = new DecimalType();
2207            this.truthTP.setValue(value);
2208          return this;
2209        }
2210
2211        /**
2212         * @param value 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.
2213         */
2214        public SequenceQualityComponent setTruthTP(double value) { 
2215              this.truthTP = new DecimalType();
2216            this.truthTP.setValue(value);
2217          return this;
2218        }
2219
2220        /**
2221         * @return {@link #queryTP} (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.). This is the underlying object with id, value and extensions. The accessor "getQueryTP" gives direct access to the value
2222         */
2223        public DecimalType getQueryTPElement() { 
2224          if (this.queryTP == null)
2225            if (Configuration.errorOnAutoCreate())
2226              throw new Error("Attempt to auto-create SequenceQualityComponent.queryTP");
2227            else if (Configuration.doAutoCreate())
2228              this.queryTP = new DecimalType(); // bb
2229          return this.queryTP;
2230        }
2231
2232        public boolean hasQueryTPElement() { 
2233          return this.queryTP != null && !this.queryTP.isEmpty();
2234        }
2235
2236        public boolean hasQueryTP() { 
2237          return this.queryTP != null && !this.queryTP.isEmpty();
2238        }
2239
2240        /**
2241         * @param value {@link #queryTP} (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.). This is the underlying object with id, value and extensions. The accessor "getQueryTP" gives direct access to the value
2242         */
2243        public SequenceQualityComponent setQueryTPElement(DecimalType value) { 
2244          this.queryTP = value;
2245          return this;
2246        }
2247
2248        /**
2249         * @return 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.
2250         */
2251        public BigDecimal getQueryTP() { 
2252          return this.queryTP == null ? null : this.queryTP.getValue();
2253        }
2254
2255        /**
2256         * @param value 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.
2257         */
2258        public SequenceQualityComponent setQueryTP(BigDecimal value) { 
2259          if (value == null)
2260            this.queryTP = null;
2261          else {
2262            if (this.queryTP == null)
2263              this.queryTP = new DecimalType();
2264            this.queryTP.setValue(value);
2265          }
2266          return this;
2267        }
2268
2269        /**
2270         * @param value 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.
2271         */
2272        public SequenceQualityComponent setQueryTP(long value) { 
2273              this.queryTP = new DecimalType();
2274            this.queryTP.setValue(value);
2275          return this;
2276        }
2277
2278        /**
2279         * @param value 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.
2280         */
2281        public SequenceQualityComponent setQueryTP(double value) { 
2282              this.queryTP = new DecimalType();
2283            this.queryTP.setValue(value);
2284          return this;
2285        }
2286
2287        /**
2288         * @return {@link #truthFN} (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.). This is the underlying object with id, value and extensions. The accessor "getTruthFN" gives direct access to the value
2289         */
2290        public DecimalType getTruthFNElement() { 
2291          if (this.truthFN == null)
2292            if (Configuration.errorOnAutoCreate())
2293              throw new Error("Attempt to auto-create SequenceQualityComponent.truthFN");
2294            else if (Configuration.doAutoCreate())
2295              this.truthFN = new DecimalType(); // bb
2296          return this.truthFN;
2297        }
2298
2299        public boolean hasTruthFNElement() { 
2300          return this.truthFN != null && !this.truthFN.isEmpty();
2301        }
2302
2303        public boolean hasTruthFN() { 
2304          return this.truthFN != null && !this.truthFN.isEmpty();
2305        }
2306
2307        /**
2308         * @param value {@link #truthFN} (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.). This is the underlying object with id, value and extensions. The accessor "getTruthFN" gives direct access to the value
2309         */
2310        public SequenceQualityComponent setTruthFNElement(DecimalType value) { 
2311          this.truthFN = value;
2312          return this;
2313        }
2314
2315        /**
2316         * @return 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.
2317         */
2318        public BigDecimal getTruthFN() { 
2319          return this.truthFN == null ? null : this.truthFN.getValue();
2320        }
2321
2322        /**
2323         * @param value 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.
2324         */
2325        public SequenceQualityComponent setTruthFN(BigDecimal value) { 
2326          if (value == null)
2327            this.truthFN = null;
2328          else {
2329            if (this.truthFN == null)
2330              this.truthFN = new DecimalType();
2331            this.truthFN.setValue(value);
2332          }
2333          return this;
2334        }
2335
2336        /**
2337         * @param value 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.
2338         */
2339        public SequenceQualityComponent setTruthFN(long value) { 
2340              this.truthFN = new DecimalType();
2341            this.truthFN.setValue(value);
2342          return this;
2343        }
2344
2345        /**
2346         * @param value 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.
2347         */
2348        public SequenceQualityComponent setTruthFN(double value) { 
2349              this.truthFN = new DecimalType();
2350            this.truthFN.setValue(value);
2351          return this;
2352        }
2353
2354        /**
2355         * @return {@link #queryFP} (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.). This is the underlying object with id, value and extensions. The accessor "getQueryFP" gives direct access to the value
2356         */
2357        public DecimalType getQueryFPElement() { 
2358          if (this.queryFP == null)
2359            if (Configuration.errorOnAutoCreate())
2360              throw new Error("Attempt to auto-create SequenceQualityComponent.queryFP");
2361            else if (Configuration.doAutoCreate())
2362              this.queryFP = new DecimalType(); // bb
2363          return this.queryFP;
2364        }
2365
2366        public boolean hasQueryFPElement() { 
2367          return this.queryFP != null && !this.queryFP.isEmpty();
2368        }
2369
2370        public boolean hasQueryFP() { 
2371          return this.queryFP != null && !this.queryFP.isEmpty();
2372        }
2373
2374        /**
2375         * @param value {@link #queryFP} (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.). This is the underlying object with id, value and extensions. The accessor "getQueryFP" gives direct access to the value
2376         */
2377        public SequenceQualityComponent setQueryFPElement(DecimalType value) { 
2378          this.queryFP = value;
2379          return this;
2380        }
2381
2382        /**
2383         * @return 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.
2384         */
2385        public BigDecimal getQueryFP() { 
2386          return this.queryFP == null ? null : this.queryFP.getValue();
2387        }
2388
2389        /**
2390         * @param value 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.
2391         */
2392        public SequenceQualityComponent setQueryFP(BigDecimal value) { 
2393          if (value == null)
2394            this.queryFP = null;
2395          else {
2396            if (this.queryFP == null)
2397              this.queryFP = new DecimalType();
2398            this.queryFP.setValue(value);
2399          }
2400          return this;
2401        }
2402
2403        /**
2404         * @param value 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.
2405         */
2406        public SequenceQualityComponent setQueryFP(long value) { 
2407              this.queryFP = new DecimalType();
2408            this.queryFP.setValue(value);
2409          return this;
2410        }
2411
2412        /**
2413         * @param value 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.
2414         */
2415        public SequenceQualityComponent setQueryFP(double value) { 
2416              this.queryFP = new DecimalType();
2417            this.queryFP.setValue(value);
2418          return this;
2419        }
2420
2421        /**
2422         * @return {@link #gtFP} (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).). This is the underlying object with id, value and extensions. The accessor "getGtFP" gives direct access to the value
2423         */
2424        public DecimalType getGtFPElement() { 
2425          if (this.gtFP == null)
2426            if (Configuration.errorOnAutoCreate())
2427              throw new Error("Attempt to auto-create SequenceQualityComponent.gtFP");
2428            else if (Configuration.doAutoCreate())
2429              this.gtFP = new DecimalType(); // bb
2430          return this.gtFP;
2431        }
2432
2433        public boolean hasGtFPElement() { 
2434          return this.gtFP != null && !this.gtFP.isEmpty();
2435        }
2436
2437        public boolean hasGtFP() { 
2438          return this.gtFP != null && !this.gtFP.isEmpty();
2439        }
2440
2441        /**
2442         * @param value {@link #gtFP} (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).). This is the underlying object with id, value and extensions. The accessor "getGtFP" gives direct access to the value
2443         */
2444        public SequenceQualityComponent setGtFPElement(DecimalType value) { 
2445          this.gtFP = value;
2446          return this;
2447        }
2448
2449        /**
2450         * @return 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).
2451         */
2452        public BigDecimal getGtFP() { 
2453          return this.gtFP == null ? null : this.gtFP.getValue();
2454        }
2455
2456        /**
2457         * @param value 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).
2458         */
2459        public SequenceQualityComponent setGtFP(BigDecimal value) { 
2460          if (value == null)
2461            this.gtFP = null;
2462          else {
2463            if (this.gtFP == null)
2464              this.gtFP = new DecimalType();
2465            this.gtFP.setValue(value);
2466          }
2467          return this;
2468        }
2469
2470        /**
2471         * @param value 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).
2472         */
2473        public SequenceQualityComponent setGtFP(long value) { 
2474              this.gtFP = new DecimalType();
2475            this.gtFP.setValue(value);
2476          return this;
2477        }
2478
2479        /**
2480         * @param value 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).
2481         */
2482        public SequenceQualityComponent setGtFP(double value) { 
2483              this.gtFP = new DecimalType();
2484            this.gtFP.setValue(value);
2485          return this;
2486        }
2487
2488        /**
2489         * @return {@link #precision} (QUERY.TP / (QUERY.TP + QUERY.FP).). This is the underlying object with id, value and extensions. The accessor "getPrecision" gives direct access to the value
2490         */
2491        public DecimalType getPrecisionElement() { 
2492          if (this.precision == null)
2493            if (Configuration.errorOnAutoCreate())
2494              throw new Error("Attempt to auto-create SequenceQualityComponent.precision");
2495            else if (Configuration.doAutoCreate())
2496              this.precision = new DecimalType(); // bb
2497          return this.precision;
2498        }
2499
2500        public boolean hasPrecisionElement() { 
2501          return this.precision != null && !this.precision.isEmpty();
2502        }
2503
2504        public boolean hasPrecision() { 
2505          return this.precision != null && !this.precision.isEmpty();
2506        }
2507
2508        /**
2509         * @param value {@link #precision} (QUERY.TP / (QUERY.TP + QUERY.FP).). This is the underlying object with id, value and extensions. The accessor "getPrecision" gives direct access to the value
2510         */
2511        public SequenceQualityComponent setPrecisionElement(DecimalType value) { 
2512          this.precision = value;
2513          return this;
2514        }
2515
2516        /**
2517         * @return QUERY.TP / (QUERY.TP + QUERY.FP).
2518         */
2519        public BigDecimal getPrecision() { 
2520          return this.precision == null ? null : this.precision.getValue();
2521        }
2522
2523        /**
2524         * @param value QUERY.TP / (QUERY.TP + QUERY.FP).
2525         */
2526        public SequenceQualityComponent setPrecision(BigDecimal value) { 
2527          if (value == null)
2528            this.precision = null;
2529          else {
2530            if (this.precision == null)
2531              this.precision = new DecimalType();
2532            this.precision.setValue(value);
2533          }
2534          return this;
2535        }
2536
2537        /**
2538         * @param value QUERY.TP / (QUERY.TP + QUERY.FP).
2539         */
2540        public SequenceQualityComponent setPrecision(long value) { 
2541              this.precision = new DecimalType();
2542            this.precision.setValue(value);
2543          return this;
2544        }
2545
2546        /**
2547         * @param value QUERY.TP / (QUERY.TP + QUERY.FP).
2548         */
2549        public SequenceQualityComponent setPrecision(double value) { 
2550              this.precision = new DecimalType();
2551            this.precision.setValue(value);
2552          return this;
2553        }
2554
2555        /**
2556         * @return {@link #recall} (TRUTH.TP / (TRUTH.TP + TRUTH.FN).). This is the underlying object with id, value and extensions. The accessor "getRecall" gives direct access to the value
2557         */
2558        public DecimalType getRecallElement() { 
2559          if (this.recall == null)
2560            if (Configuration.errorOnAutoCreate())
2561              throw new Error("Attempt to auto-create SequenceQualityComponent.recall");
2562            else if (Configuration.doAutoCreate())
2563              this.recall = new DecimalType(); // bb
2564          return this.recall;
2565        }
2566
2567        public boolean hasRecallElement() { 
2568          return this.recall != null && !this.recall.isEmpty();
2569        }
2570
2571        public boolean hasRecall() { 
2572          return this.recall != null && !this.recall.isEmpty();
2573        }
2574
2575        /**
2576         * @param value {@link #recall} (TRUTH.TP / (TRUTH.TP + TRUTH.FN).). This is the underlying object with id, value and extensions. The accessor "getRecall" gives direct access to the value
2577         */
2578        public SequenceQualityComponent setRecallElement(DecimalType value) { 
2579          this.recall = value;
2580          return this;
2581        }
2582
2583        /**
2584         * @return TRUTH.TP / (TRUTH.TP + TRUTH.FN).
2585         */
2586        public BigDecimal getRecall() { 
2587          return this.recall == null ? null : this.recall.getValue();
2588        }
2589
2590        /**
2591         * @param value TRUTH.TP / (TRUTH.TP + TRUTH.FN).
2592         */
2593        public SequenceQualityComponent setRecall(BigDecimal value) { 
2594          if (value == null)
2595            this.recall = null;
2596          else {
2597            if (this.recall == null)
2598              this.recall = new DecimalType();
2599            this.recall.setValue(value);
2600          }
2601          return this;
2602        }
2603
2604        /**
2605         * @param value TRUTH.TP / (TRUTH.TP + TRUTH.FN).
2606         */
2607        public SequenceQualityComponent setRecall(long value) { 
2608              this.recall = new DecimalType();
2609            this.recall.setValue(value);
2610          return this;
2611        }
2612
2613        /**
2614         * @param value TRUTH.TP / (TRUTH.TP + TRUTH.FN).
2615         */
2616        public SequenceQualityComponent setRecall(double value) { 
2617              this.recall = new DecimalType();
2618            this.recall.setValue(value);
2619          return this;
2620        }
2621
2622        /**
2623         * @return {@link #fScore} (Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).). This is the underlying object with id, value and extensions. The accessor "getFScore" gives direct access to the value
2624         */
2625        public DecimalType getFScoreElement() { 
2626          if (this.fScore == null)
2627            if (Configuration.errorOnAutoCreate())
2628              throw new Error("Attempt to auto-create SequenceQualityComponent.fScore");
2629            else if (Configuration.doAutoCreate())
2630              this.fScore = new DecimalType(); // bb
2631          return this.fScore;
2632        }
2633
2634        public boolean hasFScoreElement() { 
2635          return this.fScore != null && !this.fScore.isEmpty();
2636        }
2637
2638        public boolean hasFScore() { 
2639          return this.fScore != null && !this.fScore.isEmpty();
2640        }
2641
2642        /**
2643         * @param value {@link #fScore} (Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).). This is the underlying object with id, value and extensions. The accessor "getFScore" gives direct access to the value
2644         */
2645        public SequenceQualityComponent setFScoreElement(DecimalType value) { 
2646          this.fScore = value;
2647          return this;
2648        }
2649
2650        /**
2651         * @return Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).
2652         */
2653        public BigDecimal getFScore() { 
2654          return this.fScore == null ? null : this.fScore.getValue();
2655        }
2656
2657        /**
2658         * @param value Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).
2659         */
2660        public SequenceQualityComponent setFScore(BigDecimal value) { 
2661          if (value == null)
2662            this.fScore = null;
2663          else {
2664            if (this.fScore == null)
2665              this.fScore = new DecimalType();
2666            this.fScore.setValue(value);
2667          }
2668          return this;
2669        }
2670
2671        /**
2672         * @param value Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).
2673         */
2674        public SequenceQualityComponent setFScore(long value) { 
2675              this.fScore = new DecimalType();
2676            this.fScore.setValue(value);
2677          return this;
2678        }
2679
2680        /**
2681         * @param value Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).
2682         */
2683        public SequenceQualityComponent setFScore(double value) { 
2684              this.fScore = new DecimalType();
2685            this.fScore.setValue(value);
2686          return this;
2687        }
2688
2689        /**
2690         * @return {@link #roc} (Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff.)
2691         */
2692        public SequenceQualityRocComponent getRoc() { 
2693          if (this.roc == null)
2694            if (Configuration.errorOnAutoCreate())
2695              throw new Error("Attempt to auto-create SequenceQualityComponent.roc");
2696            else if (Configuration.doAutoCreate())
2697              this.roc = new SequenceQualityRocComponent(); // cc
2698          return this.roc;
2699        }
2700
2701        public boolean hasRoc() { 
2702          return this.roc != null && !this.roc.isEmpty();
2703        }
2704
2705        /**
2706         * @param value {@link #roc} (Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff.)
2707         */
2708        public SequenceQualityComponent setRoc(SequenceQualityRocComponent value) { 
2709          this.roc = value;
2710          return this;
2711        }
2712
2713        protected void listChildren(List<Property> children) {
2714          super.listChildren(children);
2715          children.add(new Property("type", "code", "INDEL / SNP / Undefined variant.", 0, 1, type));
2716          children.add(new Property("standardSequence", "CodeableConcept", "Gold standard sequence used for comparing against.", 0, 1, standardSequence));
2717          children.add(new Property("start", "integer", "Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, 1, start));
2718          children.add(new Property("end", "integer", "End position of the sequence.If the coordinate system is 0-based then end is 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.", 0, 1, end));
2719          children.add(new Property("score", "Quantity", "The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).", 0, 1, score));
2720          children.add(new Property("method", "CodeableConcept", "Which method is used to get sequence quality.", 0, 1, method));
2721          children.add(new Property("truthTP", "decimal", "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.", 0, 1, truthTP));
2722          children.add(new Property("queryTP", "decimal", "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.", 0, 1, queryTP));
2723          children.add(new Property("truthFN", "decimal", "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.", 0, 1, truthFN));
2724          children.add(new Property("queryFP", "decimal", "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.", 0, 1, queryFP));
2725          children.add(new Property("gtFP", "decimal", "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).", 0, 1, gtFP));
2726          children.add(new Property("precision", "decimal", "QUERY.TP / (QUERY.TP + QUERY.FP).", 0, 1, precision));
2727          children.add(new Property("recall", "decimal", "TRUTH.TP / (TRUTH.TP + TRUTH.FN).", 0, 1, recall));
2728          children.add(new Property("fScore", "decimal", "Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).", 0, 1, fScore));
2729          children.add(new Property("roc", "", "Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff.", 0, 1, roc));
2730        }
2731
2732        @Override
2733        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2734          switch (_hash) {
2735          case 3575610: /*type*/  return new Property("type", "code", "INDEL / SNP / Undefined variant.", 0, 1, type);
2736          case -1861227106: /*standardSequence*/  return new Property("standardSequence", "CodeableConcept", "Gold standard sequence used for comparing against.", 0, 1, standardSequence);
2737          case 109757538: /*start*/  return new Property("start", "integer", "Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, 1, start);
2738          case 100571: /*end*/  return new Property("end", "integer", "End position of the sequence.If the coordinate system is 0-based then end is 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.", 0, 1, end);
2739          case 109264530: /*score*/  return new Property("score", "Quantity", "The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).", 0, 1, score);
2740          case -1077554975: /*method*/  return new Property("method", "CodeableConcept", "Which method is used to get sequence quality.", 0, 1, method);
2741          case -1048421849: /*truthTP*/  return new Property("truthTP", "decimal", "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.", 0, 1, truthTP);
2742          case 655102276: /*queryTP*/  return new Property("queryTP", "decimal", "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.", 0, 1, queryTP);
2743          case -1048422285: /*truthFN*/  return new Property("truthFN", "decimal", "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.", 0, 1, truthFN);
2744          case 655101842: /*queryFP*/  return new Property("queryFP", "decimal", "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.", 0, 1, queryFP);
2745          case 3182199: /*gtFP*/  return new Property("gtFP", "decimal", "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).", 0, 1, gtFP);
2746          case -1376177026: /*precision*/  return new Property("precision", "decimal", "QUERY.TP / (QUERY.TP + QUERY.FP).", 0, 1, precision);
2747          case -934922479: /*recall*/  return new Property("recall", "decimal", "TRUTH.TP / (TRUTH.TP + TRUTH.FN).", 0, 1, recall);
2748          case -1295082036: /*fScore*/  return new Property("fScore", "decimal", "Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).", 0, 1, fScore);
2749          case 113094: /*roc*/  return new Property("roc", "", "Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff.", 0, 1, roc);
2750          default: return super.getNamedProperty(_hash, _name, _checkValid);
2751          }
2752
2753        }
2754
2755      @Override
2756      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2757        switch (hash) {
2758        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<QualityType>
2759        case -1861227106: /*standardSequence*/ return this.standardSequence == null ? new Base[0] : new Base[] {this.standardSequence}; // CodeableConcept
2760        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
2761        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
2762        case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // Quantity
2763        case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept
2764        case -1048421849: /*truthTP*/ return this.truthTP == null ? new Base[0] : new Base[] {this.truthTP}; // DecimalType
2765        case 655102276: /*queryTP*/ return this.queryTP == null ? new Base[0] : new Base[] {this.queryTP}; // DecimalType
2766        case -1048422285: /*truthFN*/ return this.truthFN == null ? new Base[0] : new Base[] {this.truthFN}; // DecimalType
2767        case 655101842: /*queryFP*/ return this.queryFP == null ? new Base[0] : new Base[] {this.queryFP}; // DecimalType
2768        case 3182199: /*gtFP*/ return this.gtFP == null ? new Base[0] : new Base[] {this.gtFP}; // DecimalType
2769        case -1376177026: /*precision*/ return this.precision == null ? new Base[0] : new Base[] {this.precision}; // DecimalType
2770        case -934922479: /*recall*/ return this.recall == null ? new Base[0] : new Base[] {this.recall}; // DecimalType
2771        case -1295082036: /*fScore*/ return this.fScore == null ? new Base[0] : new Base[] {this.fScore}; // DecimalType
2772        case 113094: /*roc*/ return this.roc == null ? new Base[0] : new Base[] {this.roc}; // SequenceQualityRocComponent
2773        default: return super.getProperty(hash, name, checkValid);
2774        }
2775
2776      }
2777
2778      @Override
2779      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2780        switch (hash) {
2781        case 3575610: // type
2782          value = new QualityTypeEnumFactory().fromType(castToCode(value));
2783          this.type = (Enumeration) value; // Enumeration<QualityType>
2784          return value;
2785        case -1861227106: // standardSequence
2786          this.standardSequence = castToCodeableConcept(value); // CodeableConcept
2787          return value;
2788        case 109757538: // start
2789          this.start = castToInteger(value); // IntegerType
2790          return value;
2791        case 100571: // end
2792          this.end = castToInteger(value); // IntegerType
2793          return value;
2794        case 109264530: // score
2795          this.score = castToQuantity(value); // Quantity
2796          return value;
2797        case -1077554975: // method
2798          this.method = castToCodeableConcept(value); // CodeableConcept
2799          return value;
2800        case -1048421849: // truthTP
2801          this.truthTP = castToDecimal(value); // DecimalType
2802          return value;
2803        case 655102276: // queryTP
2804          this.queryTP = castToDecimal(value); // DecimalType
2805          return value;
2806        case -1048422285: // truthFN
2807          this.truthFN = castToDecimal(value); // DecimalType
2808          return value;
2809        case 655101842: // queryFP
2810          this.queryFP = castToDecimal(value); // DecimalType
2811          return value;
2812        case 3182199: // gtFP
2813          this.gtFP = castToDecimal(value); // DecimalType
2814          return value;
2815        case -1376177026: // precision
2816          this.precision = castToDecimal(value); // DecimalType
2817          return value;
2818        case -934922479: // recall
2819          this.recall = castToDecimal(value); // DecimalType
2820          return value;
2821        case -1295082036: // fScore
2822          this.fScore = castToDecimal(value); // DecimalType
2823          return value;
2824        case 113094: // roc
2825          this.roc = (SequenceQualityRocComponent) value; // SequenceQualityRocComponent
2826          return value;
2827        default: return super.setProperty(hash, name, value);
2828        }
2829
2830      }
2831
2832      @Override
2833      public Base setProperty(String name, Base value) throws FHIRException {
2834        if (name.equals("type")) {
2835          value = new QualityTypeEnumFactory().fromType(castToCode(value));
2836          this.type = (Enumeration) value; // Enumeration<QualityType>
2837        } else if (name.equals("standardSequence")) {
2838          this.standardSequence = castToCodeableConcept(value); // CodeableConcept
2839        } else if (name.equals("start")) {
2840          this.start = castToInteger(value); // IntegerType
2841        } else if (name.equals("end")) {
2842          this.end = castToInteger(value); // IntegerType
2843        } else if (name.equals("score")) {
2844          this.score = castToQuantity(value); // Quantity
2845        } else if (name.equals("method")) {
2846          this.method = castToCodeableConcept(value); // CodeableConcept
2847        } else if (name.equals("truthTP")) {
2848          this.truthTP = castToDecimal(value); // DecimalType
2849        } else if (name.equals("queryTP")) {
2850          this.queryTP = castToDecimal(value); // DecimalType
2851        } else if (name.equals("truthFN")) {
2852          this.truthFN = castToDecimal(value); // DecimalType
2853        } else if (name.equals("queryFP")) {
2854          this.queryFP = castToDecimal(value); // DecimalType
2855        } else if (name.equals("gtFP")) {
2856          this.gtFP = castToDecimal(value); // DecimalType
2857        } else if (name.equals("precision")) {
2858          this.precision = castToDecimal(value); // DecimalType
2859        } else if (name.equals("recall")) {
2860          this.recall = castToDecimal(value); // DecimalType
2861        } else if (name.equals("fScore")) {
2862          this.fScore = castToDecimal(value); // DecimalType
2863        } else if (name.equals("roc")) {
2864          this.roc = (SequenceQualityRocComponent) value; // SequenceQualityRocComponent
2865        } else
2866          return super.setProperty(name, value);
2867        return value;
2868      }
2869
2870      @Override
2871      public Base makeProperty(int hash, String name) throws FHIRException {
2872        switch (hash) {
2873        case 3575610:  return getTypeElement();
2874        case -1861227106:  return getStandardSequence(); 
2875        case 109757538:  return getStartElement();
2876        case 100571:  return getEndElement();
2877        case 109264530:  return getScore(); 
2878        case -1077554975:  return getMethod(); 
2879        case -1048421849:  return getTruthTPElement();
2880        case 655102276:  return getQueryTPElement();
2881        case -1048422285:  return getTruthFNElement();
2882        case 655101842:  return getQueryFPElement();
2883        case 3182199:  return getGtFPElement();
2884        case -1376177026:  return getPrecisionElement();
2885        case -934922479:  return getRecallElement();
2886        case -1295082036:  return getFScoreElement();
2887        case 113094:  return getRoc(); 
2888        default: return super.makeProperty(hash, name);
2889        }
2890
2891      }
2892
2893      @Override
2894      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2895        switch (hash) {
2896        case 3575610: /*type*/ return new String[] {"code"};
2897        case -1861227106: /*standardSequence*/ return new String[] {"CodeableConcept"};
2898        case 109757538: /*start*/ return new String[] {"integer"};
2899        case 100571: /*end*/ return new String[] {"integer"};
2900        case 109264530: /*score*/ return new String[] {"Quantity"};
2901        case -1077554975: /*method*/ return new String[] {"CodeableConcept"};
2902        case -1048421849: /*truthTP*/ return new String[] {"decimal"};
2903        case 655102276: /*queryTP*/ return new String[] {"decimal"};
2904        case -1048422285: /*truthFN*/ return new String[] {"decimal"};
2905        case 655101842: /*queryFP*/ return new String[] {"decimal"};
2906        case 3182199: /*gtFP*/ return new String[] {"decimal"};
2907        case -1376177026: /*precision*/ return new String[] {"decimal"};
2908        case -934922479: /*recall*/ return new String[] {"decimal"};
2909        case -1295082036: /*fScore*/ return new String[] {"decimal"};
2910        case 113094: /*roc*/ return new String[] {};
2911        default: return super.getTypesForProperty(hash, name);
2912        }
2913
2914      }
2915
2916      @Override
2917      public Base addChild(String name) throws FHIRException {
2918        if (name.equals("type")) {
2919          throw new FHIRException("Cannot call addChild on a primitive type Sequence.type");
2920        }
2921        else if (name.equals("standardSequence")) {
2922          this.standardSequence = new CodeableConcept();
2923          return this.standardSequence;
2924        }
2925        else if (name.equals("start")) {
2926          throw new FHIRException("Cannot call addChild on a primitive type Sequence.start");
2927        }
2928        else if (name.equals("end")) {
2929          throw new FHIRException("Cannot call addChild on a primitive type Sequence.end");
2930        }
2931        else if (name.equals("score")) {
2932          this.score = new Quantity();
2933          return this.score;
2934        }
2935        else if (name.equals("method")) {
2936          this.method = new CodeableConcept();
2937          return this.method;
2938        }
2939        else if (name.equals("truthTP")) {
2940          throw new FHIRException("Cannot call addChild on a primitive type Sequence.truthTP");
2941        }
2942        else if (name.equals("queryTP")) {
2943          throw new FHIRException("Cannot call addChild on a primitive type Sequence.queryTP");
2944        }
2945        else if (name.equals("truthFN")) {
2946          throw new FHIRException("Cannot call addChild on a primitive type Sequence.truthFN");
2947        }
2948        else if (name.equals("queryFP")) {
2949          throw new FHIRException("Cannot call addChild on a primitive type Sequence.queryFP");
2950        }
2951        else if (name.equals("gtFP")) {
2952          throw new FHIRException("Cannot call addChild on a primitive type Sequence.gtFP");
2953        }
2954        else if (name.equals("precision")) {
2955          throw new FHIRException("Cannot call addChild on a primitive type Sequence.precision");
2956        }
2957        else if (name.equals("recall")) {
2958          throw new FHIRException("Cannot call addChild on a primitive type Sequence.recall");
2959        }
2960        else if (name.equals("fScore")) {
2961          throw new FHIRException("Cannot call addChild on a primitive type Sequence.fScore");
2962        }
2963        else if (name.equals("roc")) {
2964          this.roc = new SequenceQualityRocComponent();
2965          return this.roc;
2966        }
2967        else
2968          return super.addChild(name);
2969      }
2970
2971      public SequenceQualityComponent copy() {
2972        SequenceQualityComponent dst = new SequenceQualityComponent();
2973        copyValues(dst);
2974        dst.type = type == null ? null : type.copy();
2975        dst.standardSequence = standardSequence == null ? null : standardSequence.copy();
2976        dst.start = start == null ? null : start.copy();
2977        dst.end = end == null ? null : end.copy();
2978        dst.score = score == null ? null : score.copy();
2979        dst.method = method == null ? null : method.copy();
2980        dst.truthTP = truthTP == null ? null : truthTP.copy();
2981        dst.queryTP = queryTP == null ? null : queryTP.copy();
2982        dst.truthFN = truthFN == null ? null : truthFN.copy();
2983        dst.queryFP = queryFP == null ? null : queryFP.copy();
2984        dst.gtFP = gtFP == null ? null : gtFP.copy();
2985        dst.precision = precision == null ? null : precision.copy();
2986        dst.recall = recall == null ? null : recall.copy();
2987        dst.fScore = fScore == null ? null : fScore.copy();
2988        dst.roc = roc == null ? null : roc.copy();
2989        return dst;
2990      }
2991
2992      @Override
2993      public boolean equalsDeep(Base other_) {
2994        if (!super.equalsDeep(other_))
2995          return false;
2996        if (!(other_ instanceof SequenceQualityComponent))
2997          return false;
2998        SequenceQualityComponent o = (SequenceQualityComponent) other_;
2999        return compareDeep(type, o.type, true) && compareDeep(standardSequence, o.standardSequence, true)
3000           && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(score, o.score, true)
3001           && compareDeep(method, o.method, true) && compareDeep(truthTP, o.truthTP, true) && compareDeep(queryTP, o.queryTP, true)
3002           && compareDeep(truthFN, o.truthFN, true) && compareDeep(queryFP, o.queryFP, true) && compareDeep(gtFP, o.gtFP, true)
3003           && compareDeep(precision, o.precision, true) && compareDeep(recall, o.recall, true) && compareDeep(fScore, o.fScore, true)
3004           && compareDeep(roc, o.roc, true);
3005      }
3006
3007      @Override
3008      public boolean equalsShallow(Base other_) {
3009        if (!super.equalsShallow(other_))
3010          return false;
3011        if (!(other_ instanceof SequenceQualityComponent))
3012          return false;
3013        SequenceQualityComponent o = (SequenceQualityComponent) other_;
3014        return compareValues(type, o.type, true) && compareValues(start, o.start, true) && compareValues(end, o.end, true)
3015           && compareValues(truthTP, o.truthTP, true) && compareValues(queryTP, o.queryTP, true) && compareValues(truthFN, o.truthFN, true)
3016           && compareValues(queryFP, o.queryFP, true) && compareValues(gtFP, o.gtFP, true) && compareValues(precision, o.precision, true)
3017           && compareValues(recall, o.recall, true) && compareValues(fScore, o.fScore, true);
3018      }
3019
3020      public boolean isEmpty() {
3021        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, standardSequence, start
3022          , end, score, method, truthTP, queryTP, truthFN, queryFP, gtFP, precision
3023          , recall, fScore, roc);
3024      }
3025
3026  public String fhirType() {
3027    return "Sequence.quality";
3028
3029  }
3030
3031  }
3032
3033    @Block()
3034    public static class SequenceQualityRocComponent extends BackboneElement implements IBaseBackboneElement {
3035        /**
3036         * Invidual data point representing the GQ (genotype quality) score threshold.
3037         */
3038        @Child(name = "score", type = {IntegerType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3039        @Description(shortDefinition="Genotype quality score", formalDefinition="Invidual data point representing the GQ (genotype quality) score threshold." )
3040        protected List<IntegerType> score;
3041
3042        /**
3043         * The number of true positives if the GQ score threshold was set to "score" field value.
3044         */
3045        @Child(name = "numTP", type = {IntegerType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3046        @Description(shortDefinition="Roc score true positive numbers", formalDefinition="The number of true positives if the GQ score threshold was set to \"score\" field value." )
3047        protected List<IntegerType> numTP;
3048
3049        /**
3050         * The number of false positives if the GQ score threshold was set to "score" field value.
3051         */
3052        @Child(name = "numFP", type = {IntegerType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3053        @Description(shortDefinition="Roc score false positive numbers", formalDefinition="The number of false positives if the GQ score threshold was set to \"score\" field value." )
3054        protected List<IntegerType> numFP;
3055
3056        /**
3057         * The number of false negatives if the GQ score threshold was set to "score" field value.
3058         */
3059        @Child(name = "numFN", type = {IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3060        @Description(shortDefinition="Roc score false negative numbers", formalDefinition="The number of false negatives if the GQ score threshold was set to \"score\" field value." )
3061        protected List<IntegerType> numFN;
3062
3063        /**
3064         * Calculated precision if the GQ score threshold was set to "score" field value.
3065         */
3066        @Child(name = "precision", type = {DecimalType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3067        @Description(shortDefinition="Precision of the GQ score", formalDefinition="Calculated precision if the GQ score threshold was set to \"score\" field value." )
3068        protected List<DecimalType> precision;
3069
3070        /**
3071         * Calculated sensitivity if the GQ score threshold was set to "score" field value.
3072         */
3073        @Child(name = "sensitivity", type = {DecimalType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3074        @Description(shortDefinition="Sensitivity of the GQ score", formalDefinition="Calculated sensitivity if the GQ score threshold was set to \"score\" field value." )
3075        protected List<DecimalType> sensitivity;
3076
3077        /**
3078         * Calculated fScore if the GQ score threshold was set to "score" field value.
3079         */
3080        @Child(name = "fMeasure", type = {DecimalType.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3081        @Description(shortDefinition="FScore of the GQ score", formalDefinition="Calculated fScore if the GQ score threshold was set to \"score\" field value." )
3082        protected List<DecimalType> fMeasure;
3083
3084        private static final long serialVersionUID = 1923392132L;
3085
3086    /**
3087     * Constructor
3088     */
3089      public SequenceQualityRocComponent() {
3090        super();
3091      }
3092
3093        /**
3094         * @return {@link #score} (Invidual data point representing the GQ (genotype quality) score threshold.)
3095         */
3096        public List<IntegerType> getScore() { 
3097          if (this.score == null)
3098            this.score = new ArrayList<IntegerType>();
3099          return this.score;
3100        }
3101
3102        /**
3103         * @return Returns a reference to <code>this</code> for easy method chaining
3104         */
3105        public SequenceQualityRocComponent setScore(List<IntegerType> theScore) { 
3106          this.score = theScore;
3107          return this;
3108        }
3109
3110        public boolean hasScore() { 
3111          if (this.score == null)
3112            return false;
3113          for (IntegerType item : this.score)
3114            if (!item.isEmpty())
3115              return true;
3116          return false;
3117        }
3118
3119        /**
3120         * @return {@link #score} (Invidual data point representing the GQ (genotype quality) score threshold.)
3121         */
3122        public IntegerType addScoreElement() {//2 
3123          IntegerType t = new IntegerType();
3124          if (this.score == null)
3125            this.score = new ArrayList<IntegerType>();
3126          this.score.add(t);
3127          return t;
3128        }
3129
3130        /**
3131         * @param value {@link #score} (Invidual data point representing the GQ (genotype quality) score threshold.)
3132         */
3133        public SequenceQualityRocComponent addScore(int value) { //1
3134          IntegerType t = new IntegerType();
3135          t.setValue(value);
3136          if (this.score == null)
3137            this.score = new ArrayList<IntegerType>();
3138          this.score.add(t);
3139          return this;
3140        }
3141
3142        /**
3143         * @param value {@link #score} (Invidual data point representing the GQ (genotype quality) score threshold.)
3144         */
3145        public boolean hasScore(int value) { 
3146          if (this.score == null)
3147            return false;
3148          for (IntegerType v : this.score)
3149            if (v.getValue().equals(value)) // integer
3150              return true;
3151          return false;
3152        }
3153
3154        /**
3155         * @return {@link #numTP} (The number of true positives if the GQ score threshold was set to "score" field value.)
3156         */
3157        public List<IntegerType> getNumTP() { 
3158          if (this.numTP == null)
3159            this.numTP = new ArrayList<IntegerType>();
3160          return this.numTP;
3161        }
3162
3163        /**
3164         * @return Returns a reference to <code>this</code> for easy method chaining
3165         */
3166        public SequenceQualityRocComponent setNumTP(List<IntegerType> theNumTP) { 
3167          this.numTP = theNumTP;
3168          return this;
3169        }
3170
3171        public boolean hasNumTP() { 
3172          if (this.numTP == null)
3173            return false;
3174          for (IntegerType item : this.numTP)
3175            if (!item.isEmpty())
3176              return true;
3177          return false;
3178        }
3179
3180        /**
3181         * @return {@link #numTP} (The number of true positives if the GQ score threshold was set to "score" field value.)
3182         */
3183        public IntegerType addNumTPElement() {//2 
3184          IntegerType t = new IntegerType();
3185          if (this.numTP == null)
3186            this.numTP = new ArrayList<IntegerType>();
3187          this.numTP.add(t);
3188          return t;
3189        }
3190
3191        /**
3192         * @param value {@link #numTP} (The number of true positives if the GQ score threshold was set to "score" field value.)
3193         */
3194        public SequenceQualityRocComponent addNumTP(int value) { //1
3195          IntegerType t = new IntegerType();
3196          t.setValue(value);
3197          if (this.numTP == null)
3198            this.numTP = new ArrayList<IntegerType>();
3199          this.numTP.add(t);
3200          return this;
3201        }
3202
3203        /**
3204         * @param value {@link #numTP} (The number of true positives if the GQ score threshold was set to "score" field value.)
3205         */
3206        public boolean hasNumTP(int value) { 
3207          if (this.numTP == null)
3208            return false;
3209          for (IntegerType v : this.numTP)
3210            if (v.getValue().equals(value)) // integer
3211              return true;
3212          return false;
3213        }
3214
3215        /**
3216         * @return {@link #numFP} (The number of false positives if the GQ score threshold was set to "score" field value.)
3217         */
3218        public List<IntegerType> getNumFP() { 
3219          if (this.numFP == null)
3220            this.numFP = new ArrayList<IntegerType>();
3221          return this.numFP;
3222        }
3223
3224        /**
3225         * @return Returns a reference to <code>this</code> for easy method chaining
3226         */
3227        public SequenceQualityRocComponent setNumFP(List<IntegerType> theNumFP) { 
3228          this.numFP = theNumFP;
3229          return this;
3230        }
3231
3232        public boolean hasNumFP() { 
3233          if (this.numFP == null)
3234            return false;
3235          for (IntegerType item : this.numFP)
3236            if (!item.isEmpty())
3237              return true;
3238          return false;
3239        }
3240
3241        /**
3242         * @return {@link #numFP} (The number of false positives if the GQ score threshold was set to "score" field value.)
3243         */
3244        public IntegerType addNumFPElement() {//2 
3245          IntegerType t = new IntegerType();
3246          if (this.numFP == null)
3247            this.numFP = new ArrayList<IntegerType>();
3248          this.numFP.add(t);
3249          return t;
3250        }
3251
3252        /**
3253         * @param value {@link #numFP} (The number of false positives if the GQ score threshold was set to "score" field value.)
3254         */
3255        public SequenceQualityRocComponent addNumFP(int value) { //1
3256          IntegerType t = new IntegerType();
3257          t.setValue(value);
3258          if (this.numFP == null)
3259            this.numFP = new ArrayList<IntegerType>();
3260          this.numFP.add(t);
3261          return this;
3262        }
3263
3264        /**
3265         * @param value {@link #numFP} (The number of false positives if the GQ score threshold was set to "score" field value.)
3266         */
3267        public boolean hasNumFP(int value) { 
3268          if (this.numFP == null)
3269            return false;
3270          for (IntegerType v : this.numFP)
3271            if (v.getValue().equals(value)) // integer
3272              return true;
3273          return false;
3274        }
3275
3276        /**
3277         * @return {@link #numFN} (The number of false negatives if the GQ score threshold was set to "score" field value.)
3278         */
3279        public List<IntegerType> getNumFN() { 
3280          if (this.numFN == null)
3281            this.numFN = new ArrayList<IntegerType>();
3282          return this.numFN;
3283        }
3284
3285        /**
3286         * @return Returns a reference to <code>this</code> for easy method chaining
3287         */
3288        public SequenceQualityRocComponent setNumFN(List<IntegerType> theNumFN) { 
3289          this.numFN = theNumFN;
3290          return this;
3291        }
3292
3293        public boolean hasNumFN() { 
3294          if (this.numFN == null)
3295            return false;
3296          for (IntegerType item : this.numFN)
3297            if (!item.isEmpty())
3298              return true;
3299          return false;
3300        }
3301
3302        /**
3303         * @return {@link #numFN} (The number of false negatives if the GQ score threshold was set to "score" field value.)
3304         */
3305        public IntegerType addNumFNElement() {//2 
3306          IntegerType t = new IntegerType();
3307          if (this.numFN == null)
3308            this.numFN = new ArrayList<IntegerType>();
3309          this.numFN.add(t);
3310          return t;
3311        }
3312
3313        /**
3314         * @param value {@link #numFN} (The number of false negatives if the GQ score threshold was set to "score" field value.)
3315         */
3316        public SequenceQualityRocComponent addNumFN(int value) { //1
3317          IntegerType t = new IntegerType();
3318          t.setValue(value);
3319          if (this.numFN == null)
3320            this.numFN = new ArrayList<IntegerType>();
3321          this.numFN.add(t);
3322          return this;
3323        }
3324
3325        /**
3326         * @param value {@link #numFN} (The number of false negatives if the GQ score threshold was set to "score" field value.)
3327         */
3328        public boolean hasNumFN(int value) { 
3329          if (this.numFN == null)
3330            return false;
3331          for (IntegerType v : this.numFN)
3332            if (v.getValue().equals(value)) // integer
3333              return true;
3334          return false;
3335        }
3336
3337        /**
3338         * @return {@link #precision} (Calculated precision if the GQ score threshold was set to "score" field value.)
3339         */
3340        public List<DecimalType> getPrecision() { 
3341          if (this.precision == null)
3342            this.precision = new ArrayList<DecimalType>();
3343          return this.precision;
3344        }
3345
3346        /**
3347         * @return Returns a reference to <code>this</code> for easy method chaining
3348         */
3349        public SequenceQualityRocComponent setPrecision(List<DecimalType> thePrecision) { 
3350          this.precision = thePrecision;
3351          return this;
3352        }
3353
3354        public boolean hasPrecision() { 
3355          if (this.precision == null)
3356            return false;
3357          for (DecimalType item : this.precision)
3358            if (!item.isEmpty())
3359              return true;
3360          return false;
3361        }
3362
3363        /**
3364         * @return {@link #precision} (Calculated precision if the GQ score threshold was set to "score" field value.)
3365         */
3366        public DecimalType addPrecisionElement() {//2 
3367          DecimalType t = new DecimalType();
3368          if (this.precision == null)
3369            this.precision = new ArrayList<DecimalType>();
3370          this.precision.add(t);
3371          return t;
3372        }
3373
3374        /**
3375         * @param value {@link #precision} (Calculated precision if the GQ score threshold was set to "score" field value.)
3376         */
3377        public SequenceQualityRocComponent addPrecision(BigDecimal value) { //1
3378          DecimalType t = new DecimalType();
3379          t.setValue(value);
3380          if (this.precision == null)
3381            this.precision = new ArrayList<DecimalType>();
3382          this.precision.add(t);
3383          return this;
3384        }
3385
3386        /**
3387         * @param value {@link #precision} (Calculated precision if the GQ score threshold was set to "score" field value.)
3388         */
3389        public boolean hasPrecision(BigDecimal value) { 
3390          if (this.precision == null)
3391            return false;
3392          for (DecimalType v : this.precision)
3393            if (v.getValue().equals(value)) // decimal
3394              return true;
3395          return false;
3396        }
3397
3398        /**
3399         * @return {@link #sensitivity} (Calculated sensitivity if the GQ score threshold was set to "score" field value.)
3400         */
3401        public List<DecimalType> getSensitivity() { 
3402          if (this.sensitivity == null)
3403            this.sensitivity = new ArrayList<DecimalType>();
3404          return this.sensitivity;
3405        }
3406
3407        /**
3408         * @return Returns a reference to <code>this</code> for easy method chaining
3409         */
3410        public SequenceQualityRocComponent setSensitivity(List<DecimalType> theSensitivity) { 
3411          this.sensitivity = theSensitivity;
3412          return this;
3413        }
3414
3415        public boolean hasSensitivity() { 
3416          if (this.sensitivity == null)
3417            return false;
3418          for (DecimalType item : this.sensitivity)
3419            if (!item.isEmpty())
3420              return true;
3421          return false;
3422        }
3423
3424        /**
3425         * @return {@link #sensitivity} (Calculated sensitivity if the GQ score threshold was set to "score" field value.)
3426         */
3427        public DecimalType addSensitivityElement() {//2 
3428          DecimalType t = new DecimalType();
3429          if (this.sensitivity == null)
3430            this.sensitivity = new ArrayList<DecimalType>();
3431          this.sensitivity.add(t);
3432          return t;
3433        }
3434
3435        /**
3436         * @param value {@link #sensitivity} (Calculated sensitivity if the GQ score threshold was set to "score" field value.)
3437         */
3438        public SequenceQualityRocComponent addSensitivity(BigDecimal value) { //1
3439          DecimalType t = new DecimalType();
3440          t.setValue(value);
3441          if (this.sensitivity == null)
3442            this.sensitivity = new ArrayList<DecimalType>();
3443          this.sensitivity.add(t);
3444          return this;
3445        }
3446
3447        /**
3448         * @param value {@link #sensitivity} (Calculated sensitivity if the GQ score threshold was set to "score" field value.)
3449         */
3450        public boolean hasSensitivity(BigDecimal value) { 
3451          if (this.sensitivity == null)
3452            return false;
3453          for (DecimalType v : this.sensitivity)
3454            if (v.getValue().equals(value)) // decimal
3455              return true;
3456          return false;
3457        }
3458
3459        /**
3460         * @return {@link #fMeasure} (Calculated fScore if the GQ score threshold was set to "score" field value.)
3461         */
3462        public List<DecimalType> getFMeasure() { 
3463          if (this.fMeasure == null)
3464            this.fMeasure = new ArrayList<DecimalType>();
3465          return this.fMeasure;
3466        }
3467
3468        /**
3469         * @return Returns a reference to <code>this</code> for easy method chaining
3470         */
3471        public SequenceQualityRocComponent setFMeasure(List<DecimalType> theFMeasure) { 
3472          this.fMeasure = theFMeasure;
3473          return this;
3474        }
3475
3476        public boolean hasFMeasure() { 
3477          if (this.fMeasure == null)
3478            return false;
3479          for (DecimalType item : this.fMeasure)
3480            if (!item.isEmpty())
3481              return true;
3482          return false;
3483        }
3484
3485        /**
3486         * @return {@link #fMeasure} (Calculated fScore if the GQ score threshold was set to "score" field value.)
3487         */
3488        public DecimalType addFMeasureElement() {//2 
3489          DecimalType t = new DecimalType();
3490          if (this.fMeasure == null)
3491            this.fMeasure = new ArrayList<DecimalType>();
3492          this.fMeasure.add(t);
3493          return t;
3494        }
3495
3496        /**
3497         * @param value {@link #fMeasure} (Calculated fScore if the GQ score threshold was set to "score" field value.)
3498         */
3499        public SequenceQualityRocComponent addFMeasure(BigDecimal value) { //1
3500          DecimalType t = new DecimalType();
3501          t.setValue(value);
3502          if (this.fMeasure == null)
3503            this.fMeasure = new ArrayList<DecimalType>();
3504          this.fMeasure.add(t);
3505          return this;
3506        }
3507
3508        /**
3509         * @param value {@link #fMeasure} (Calculated fScore if the GQ score threshold was set to "score" field value.)
3510         */
3511        public boolean hasFMeasure(BigDecimal value) { 
3512          if (this.fMeasure == null)
3513            return false;
3514          for (DecimalType v : this.fMeasure)
3515            if (v.getValue().equals(value)) // decimal
3516              return true;
3517          return false;
3518        }
3519
3520        protected void listChildren(List<Property> children) {
3521          super.listChildren(children);
3522          children.add(new Property("score", "integer", "Invidual data point representing the GQ (genotype quality) score threshold.", 0, java.lang.Integer.MAX_VALUE, score));
3523          children.add(new Property("numTP", "integer", "The number of true positives if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, numTP));
3524          children.add(new Property("numFP", "integer", "The number of false positives if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, numFP));
3525          children.add(new Property("numFN", "integer", "The number of false negatives if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, numFN));
3526          children.add(new Property("precision", "decimal", "Calculated precision if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, precision));
3527          children.add(new Property("sensitivity", "decimal", "Calculated sensitivity if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, sensitivity));
3528          children.add(new Property("fMeasure", "decimal", "Calculated fScore if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, fMeasure));
3529        }
3530
3531        @Override
3532        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3533          switch (_hash) {
3534          case 109264530: /*score*/  return new Property("score", "integer", "Invidual data point representing the GQ (genotype quality) score threshold.", 0, java.lang.Integer.MAX_VALUE, score);
3535          case 105180290: /*numTP*/  return new Property("numTP", "integer", "The number of true positives if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, numTP);
3536          case 105179856: /*numFP*/  return new Property("numFP", "integer", "The number of false positives if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, numFP);
3537          case 105179854: /*numFN*/  return new Property("numFN", "integer", "The number of false negatives if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, numFN);
3538          case -1376177026: /*precision*/  return new Property("precision", "decimal", "Calculated precision if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, precision);
3539          case 564403871: /*sensitivity*/  return new Property("sensitivity", "decimal", "Calculated sensitivity if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, sensitivity);
3540          case -18997736: /*fMeasure*/  return new Property("fMeasure", "decimal", "Calculated fScore if the GQ score threshold was set to \"score\" field value.", 0, java.lang.Integer.MAX_VALUE, fMeasure);
3541          default: return super.getNamedProperty(_hash, _name, _checkValid);
3542          }
3543
3544        }
3545
3546      @Override
3547      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3548        switch (hash) {
3549        case 109264530: /*score*/ return this.score == null ? new Base[0] : this.score.toArray(new Base[this.score.size()]); // IntegerType
3550        case 105180290: /*numTP*/ return this.numTP == null ? new Base[0] : this.numTP.toArray(new Base[this.numTP.size()]); // IntegerType
3551        case 105179856: /*numFP*/ return this.numFP == null ? new Base[0] : this.numFP.toArray(new Base[this.numFP.size()]); // IntegerType
3552        case 105179854: /*numFN*/ return this.numFN == null ? new Base[0] : this.numFN.toArray(new Base[this.numFN.size()]); // IntegerType
3553        case -1376177026: /*precision*/ return this.precision == null ? new Base[0] : this.precision.toArray(new Base[this.precision.size()]); // DecimalType
3554        case 564403871: /*sensitivity*/ return this.sensitivity == null ? new Base[0] : this.sensitivity.toArray(new Base[this.sensitivity.size()]); // DecimalType
3555        case -18997736: /*fMeasure*/ return this.fMeasure == null ? new Base[0] : this.fMeasure.toArray(new Base[this.fMeasure.size()]); // DecimalType
3556        default: return super.getProperty(hash, name, checkValid);
3557        }
3558
3559      }
3560
3561      @Override
3562      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3563        switch (hash) {
3564        case 109264530: // score
3565          this.getScore().add(castToInteger(value)); // IntegerType
3566          return value;
3567        case 105180290: // numTP
3568          this.getNumTP().add(castToInteger(value)); // IntegerType
3569          return value;
3570        case 105179856: // numFP
3571          this.getNumFP().add(castToInteger(value)); // IntegerType
3572          return value;
3573        case 105179854: // numFN
3574          this.getNumFN().add(castToInteger(value)); // IntegerType
3575          return value;
3576        case -1376177026: // precision
3577          this.getPrecision().add(castToDecimal(value)); // DecimalType
3578          return value;
3579        case 564403871: // sensitivity
3580          this.getSensitivity().add(castToDecimal(value)); // DecimalType
3581          return value;
3582        case -18997736: // fMeasure
3583          this.getFMeasure().add(castToDecimal(value)); // DecimalType
3584          return value;
3585        default: return super.setProperty(hash, name, value);
3586        }
3587
3588      }
3589
3590      @Override
3591      public Base setProperty(String name, Base value) throws FHIRException {
3592        if (name.equals("score")) {
3593          this.getScore().add(castToInteger(value));
3594        } else if (name.equals("numTP")) {
3595          this.getNumTP().add(castToInteger(value));
3596        } else if (name.equals("numFP")) {
3597          this.getNumFP().add(castToInteger(value));
3598        } else if (name.equals("numFN")) {
3599          this.getNumFN().add(castToInteger(value));
3600        } else if (name.equals("precision")) {
3601          this.getPrecision().add(castToDecimal(value));
3602        } else if (name.equals("sensitivity")) {
3603          this.getSensitivity().add(castToDecimal(value));
3604        } else if (name.equals("fMeasure")) {
3605          this.getFMeasure().add(castToDecimal(value));
3606        } else
3607          return super.setProperty(name, value);
3608        return value;
3609      }
3610
3611      @Override
3612      public Base makeProperty(int hash, String name) throws FHIRException {
3613        switch (hash) {
3614        case 109264530:  return addScoreElement();
3615        case 105180290:  return addNumTPElement();
3616        case 105179856:  return addNumFPElement();
3617        case 105179854:  return addNumFNElement();
3618        case -1376177026:  return addPrecisionElement();
3619        case 564403871:  return addSensitivityElement();
3620        case -18997736:  return addFMeasureElement();
3621        default: return super.makeProperty(hash, name);
3622        }
3623
3624      }
3625
3626      @Override
3627      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3628        switch (hash) {
3629        case 109264530: /*score*/ return new String[] {"integer"};
3630        case 105180290: /*numTP*/ return new String[] {"integer"};
3631        case 105179856: /*numFP*/ return new String[] {"integer"};
3632        case 105179854: /*numFN*/ return new String[] {"integer"};
3633        case -1376177026: /*precision*/ return new String[] {"decimal"};
3634        case 564403871: /*sensitivity*/ return new String[] {"decimal"};
3635        case -18997736: /*fMeasure*/ return new String[] {"decimal"};
3636        default: return super.getTypesForProperty(hash, name);
3637        }
3638
3639      }
3640
3641      @Override
3642      public Base addChild(String name) throws FHIRException {
3643        if (name.equals("score")) {
3644          throw new FHIRException("Cannot call addChild on a primitive type Sequence.score");
3645        }
3646        else if (name.equals("numTP")) {
3647          throw new FHIRException("Cannot call addChild on a primitive type Sequence.numTP");
3648        }
3649        else if (name.equals("numFP")) {
3650          throw new FHIRException("Cannot call addChild on a primitive type Sequence.numFP");
3651        }
3652        else if (name.equals("numFN")) {
3653          throw new FHIRException("Cannot call addChild on a primitive type Sequence.numFN");
3654        }
3655        else if (name.equals("precision")) {
3656          throw new FHIRException("Cannot call addChild on a primitive type Sequence.precision");
3657        }
3658        else if (name.equals("sensitivity")) {
3659          throw new FHIRException("Cannot call addChild on a primitive type Sequence.sensitivity");
3660        }
3661        else if (name.equals("fMeasure")) {
3662          throw new FHIRException("Cannot call addChild on a primitive type Sequence.fMeasure");
3663        }
3664        else
3665          return super.addChild(name);
3666      }
3667
3668      public SequenceQualityRocComponent copy() {
3669        SequenceQualityRocComponent dst = new SequenceQualityRocComponent();
3670        copyValues(dst);
3671        if (score != null) {
3672          dst.score = new ArrayList<IntegerType>();
3673          for (IntegerType i : score)
3674            dst.score.add(i.copy());
3675        };
3676        if (numTP != null) {
3677          dst.numTP = new ArrayList<IntegerType>();
3678          for (IntegerType i : numTP)
3679            dst.numTP.add(i.copy());
3680        };
3681        if (numFP != null) {
3682          dst.numFP = new ArrayList<IntegerType>();
3683          for (IntegerType i : numFP)
3684            dst.numFP.add(i.copy());
3685        };
3686        if (numFN != null) {
3687          dst.numFN = new ArrayList<IntegerType>();
3688          for (IntegerType i : numFN)
3689            dst.numFN.add(i.copy());
3690        };
3691        if (precision != null) {
3692          dst.precision = new ArrayList<DecimalType>();
3693          for (DecimalType i : precision)
3694            dst.precision.add(i.copy());
3695        };
3696        if (sensitivity != null) {
3697          dst.sensitivity = new ArrayList<DecimalType>();
3698          for (DecimalType i : sensitivity)
3699            dst.sensitivity.add(i.copy());
3700        };
3701        if (fMeasure != null) {
3702          dst.fMeasure = new ArrayList<DecimalType>();
3703          for (DecimalType i : fMeasure)
3704            dst.fMeasure.add(i.copy());
3705        };
3706        return dst;
3707      }
3708
3709      @Override
3710      public boolean equalsDeep(Base other_) {
3711        if (!super.equalsDeep(other_))
3712          return false;
3713        if (!(other_ instanceof SequenceQualityRocComponent))
3714          return false;
3715        SequenceQualityRocComponent o = (SequenceQualityRocComponent) other_;
3716        return compareDeep(score, o.score, true) && compareDeep(numTP, o.numTP, true) && compareDeep(numFP, o.numFP, true)
3717           && compareDeep(numFN, o.numFN, true) && compareDeep(precision, o.precision, true) && compareDeep(sensitivity, o.sensitivity, true)
3718           && compareDeep(fMeasure, o.fMeasure, true);
3719      }
3720
3721      @Override
3722      public boolean equalsShallow(Base other_) {
3723        if (!super.equalsShallow(other_))
3724          return false;
3725        if (!(other_ instanceof SequenceQualityRocComponent))
3726          return false;
3727        SequenceQualityRocComponent o = (SequenceQualityRocComponent) other_;
3728        return compareValues(score, o.score, true) && compareValues(numTP, o.numTP, true) && compareValues(numFP, o.numFP, true)
3729           && compareValues(numFN, o.numFN, true) && compareValues(precision, o.precision, true) && compareValues(sensitivity, o.sensitivity, true)
3730           && compareValues(fMeasure, o.fMeasure, true);
3731      }
3732
3733      public boolean isEmpty() {
3734        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(score, numTP, numFP, numFN
3735          , precision, sensitivity, fMeasure);
3736      }
3737
3738  public String fhirType() {
3739    return "Sequence.quality.roc";
3740
3741  }
3742
3743  }
3744
3745    @Block()
3746    public static class SequenceRepositoryComponent extends BackboneElement implements IBaseBackboneElement {
3747        /**
3748         * Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.
3749         */
3750        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
3751        @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." )
3752        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/repository-type")
3753        protected Enumeration<RepositoryType> type;
3754
3755        /**
3756         * URI of an external repository which contains further details about the genetics data.
3757         */
3758        @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
3759        @Description(shortDefinition="URI of the repository", formalDefinition="URI of an external repository which contains further details about the genetics data." )
3760        protected UriType url;
3761
3762        /**
3763         * URI of an external repository which contains further details about the genetics data.
3764         */
3765        @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
3766        @Description(shortDefinition="Repository's name", formalDefinition="URI of an external repository which contains further details about the genetics data." )
3767        protected StringType name;
3768
3769        /**
3770         * 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.
3771         */
3772        @Child(name = "datasetId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
3773        @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." )
3774        protected StringType datasetId;
3775
3776        /**
3777         * 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.
3778         */
3779        @Child(name = "variantsetId", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
3780        @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." )
3781        protected StringType variantsetId;
3782
3783        /**
3784         * Id of the read in this external repository.
3785         */
3786        @Child(name = "readsetId", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
3787        @Description(shortDefinition="Id of the read", formalDefinition="Id of the read in this external repository." )
3788        protected StringType readsetId;
3789
3790        private static final long serialVersionUID = -899243265L;
3791
3792    /**
3793     * Constructor
3794     */
3795      public SequenceRepositoryComponent() {
3796        super();
3797      }
3798
3799    /**
3800     * Constructor
3801     */
3802      public SequenceRepositoryComponent(Enumeration<RepositoryType> type) {
3803        super();
3804        this.type = type;
3805      }
3806
3807        /**
3808         * @return {@link #type} (Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3809         */
3810        public Enumeration<RepositoryType> getTypeElement() { 
3811          if (this.type == null)
3812            if (Configuration.errorOnAutoCreate())
3813              throw new Error("Attempt to auto-create SequenceRepositoryComponent.type");
3814            else if (Configuration.doAutoCreate())
3815              this.type = new Enumeration<RepositoryType>(new RepositoryTypeEnumFactory()); // bb
3816          return this.type;
3817        }
3818
3819        public boolean hasTypeElement() { 
3820          return this.type != null && !this.type.isEmpty();
3821        }
3822
3823        public boolean hasType() { 
3824          return this.type != null && !this.type.isEmpty();
3825        }
3826
3827        /**
3828         * @param value {@link #type} (Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3829         */
3830        public SequenceRepositoryComponent setTypeElement(Enumeration<RepositoryType> value) { 
3831          this.type = value;
3832          return this;
3833        }
3834
3835        /**
3836         * @return Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.
3837         */
3838        public RepositoryType getType() { 
3839          return this.type == null ? null : this.type.getValue();
3840        }
3841
3842        /**
3843         * @param value Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.
3844         */
3845        public SequenceRepositoryComponent setType(RepositoryType value) { 
3846            if (this.type == null)
3847              this.type = new Enumeration<RepositoryType>(new RepositoryTypeEnumFactory());
3848            this.type.setValue(value);
3849          return this;
3850        }
3851
3852        /**
3853         * @return {@link #url} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
3854         */
3855        public UriType getUrlElement() { 
3856          if (this.url == null)
3857            if (Configuration.errorOnAutoCreate())
3858              throw new Error("Attempt to auto-create SequenceRepositoryComponent.url");
3859            else if (Configuration.doAutoCreate())
3860              this.url = new UriType(); // bb
3861          return this.url;
3862        }
3863
3864        public boolean hasUrlElement() { 
3865          return this.url != null && !this.url.isEmpty();
3866        }
3867
3868        public boolean hasUrl() { 
3869          return this.url != null && !this.url.isEmpty();
3870        }
3871
3872        /**
3873         * @param value {@link #url} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
3874         */
3875        public SequenceRepositoryComponent setUrlElement(UriType value) { 
3876          this.url = value;
3877          return this;
3878        }
3879
3880        /**
3881         * @return URI of an external repository which contains further details about the genetics data.
3882         */
3883        public String getUrl() { 
3884          return this.url == null ? null : this.url.getValue();
3885        }
3886
3887        /**
3888         * @param value URI of an external repository which contains further details about the genetics data.
3889         */
3890        public SequenceRepositoryComponent setUrl(String value) { 
3891          if (Utilities.noString(value))
3892            this.url = null;
3893          else {
3894            if (this.url == null)
3895              this.url = new UriType();
3896            this.url.setValue(value);
3897          }
3898          return this;
3899        }
3900
3901        /**
3902         * @return {@link #name} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3903         */
3904        public StringType getNameElement() { 
3905          if (this.name == null)
3906            if (Configuration.errorOnAutoCreate())
3907              throw new Error("Attempt to auto-create SequenceRepositoryComponent.name");
3908            else if (Configuration.doAutoCreate())
3909              this.name = new StringType(); // bb
3910          return this.name;
3911        }
3912
3913        public boolean hasNameElement() { 
3914          return this.name != null && !this.name.isEmpty();
3915        }
3916
3917        public boolean hasName() { 
3918          return this.name != null && !this.name.isEmpty();
3919        }
3920
3921        /**
3922         * @param value {@link #name} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3923         */
3924        public SequenceRepositoryComponent setNameElement(StringType value) { 
3925          this.name = value;
3926          return this;
3927        }
3928
3929        /**
3930         * @return URI of an external repository which contains further details about the genetics data.
3931         */
3932        public String getName() { 
3933          return this.name == null ? null : this.name.getValue();
3934        }
3935
3936        /**
3937         * @param value URI of an external repository which contains further details about the genetics data.
3938         */
3939        public SequenceRepositoryComponent setName(String value) { 
3940          if (Utilities.noString(value))
3941            this.name = null;
3942          else {
3943            if (this.name == null)
3944              this.name = new StringType();
3945            this.name.setValue(value);
3946          }
3947          return this;
3948        }
3949
3950        /**
3951         * @return {@link #datasetId} (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.). This is the underlying object with id, value and extensions. The accessor "getDatasetId" gives direct access to the value
3952         */
3953        public StringType getDatasetIdElement() { 
3954          if (this.datasetId == null)
3955            if (Configuration.errorOnAutoCreate())
3956              throw new Error("Attempt to auto-create SequenceRepositoryComponent.datasetId");
3957            else if (Configuration.doAutoCreate())
3958              this.datasetId = new StringType(); // bb
3959          return this.datasetId;
3960        }
3961
3962        public boolean hasDatasetIdElement() { 
3963          return this.datasetId != null && !this.datasetId.isEmpty();
3964        }
3965
3966        public boolean hasDatasetId() { 
3967          return this.datasetId != null && !this.datasetId.isEmpty();
3968        }
3969
3970        /**
3971         * @param value {@link #datasetId} (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.). This is the underlying object with id, value and extensions. The accessor "getDatasetId" gives direct access to the value
3972         */
3973        public SequenceRepositoryComponent setDatasetIdElement(StringType value) { 
3974          this.datasetId = value;
3975          return this;
3976        }
3977
3978        /**
3979         * @return 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.
3980         */
3981        public String getDatasetId() { 
3982          return this.datasetId == null ? null : this.datasetId.getValue();
3983        }
3984
3985        /**
3986         * @param value 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.
3987         */
3988        public SequenceRepositoryComponent setDatasetId(String value) { 
3989          if (Utilities.noString(value))
3990            this.datasetId = null;
3991          else {
3992            if (this.datasetId == null)
3993              this.datasetId = new StringType();
3994            this.datasetId.setValue(value);
3995          }
3996          return this;
3997        }
3998
3999        /**
4000         * @return {@link #variantsetId} (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.). This is the underlying object with id, value and extensions. The accessor "getVariantsetId" gives direct access to the value
4001         */
4002        public StringType getVariantsetIdElement() { 
4003          if (this.variantsetId == null)
4004            if (Configuration.errorOnAutoCreate())
4005              throw new Error("Attempt to auto-create SequenceRepositoryComponent.variantsetId");
4006            else if (Configuration.doAutoCreate())
4007              this.variantsetId = new StringType(); // bb
4008          return this.variantsetId;
4009        }
4010
4011        public boolean hasVariantsetIdElement() { 
4012          return this.variantsetId != null && !this.variantsetId.isEmpty();
4013        }
4014
4015        public boolean hasVariantsetId() { 
4016          return this.variantsetId != null && !this.variantsetId.isEmpty();
4017        }
4018
4019        /**
4020         * @param value {@link #variantsetId} (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.). This is the underlying object with id, value and extensions. The accessor "getVariantsetId" gives direct access to the value
4021         */
4022        public SequenceRepositoryComponent setVariantsetIdElement(StringType value) { 
4023          this.variantsetId = value;
4024          return this;
4025        }
4026
4027        /**
4028         * @return 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.
4029         */
4030        public String getVariantsetId() { 
4031          return this.variantsetId == null ? null : this.variantsetId.getValue();
4032        }
4033
4034        /**
4035         * @param value 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.
4036         */
4037        public SequenceRepositoryComponent setVariantsetId(String value) { 
4038          if (Utilities.noString(value))
4039            this.variantsetId = null;
4040          else {
4041            if (this.variantsetId == null)
4042              this.variantsetId = new StringType();
4043            this.variantsetId.setValue(value);
4044          }
4045          return this;
4046        }
4047
4048        /**
4049         * @return {@link #readsetId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadsetId" gives direct access to the value
4050         */
4051        public StringType getReadsetIdElement() { 
4052          if (this.readsetId == null)
4053            if (Configuration.errorOnAutoCreate())
4054              throw new Error("Attempt to auto-create SequenceRepositoryComponent.readsetId");
4055            else if (Configuration.doAutoCreate())
4056              this.readsetId = new StringType(); // bb
4057          return this.readsetId;
4058        }
4059
4060        public boolean hasReadsetIdElement() { 
4061          return this.readsetId != null && !this.readsetId.isEmpty();
4062        }
4063
4064        public boolean hasReadsetId() { 
4065          return this.readsetId != null && !this.readsetId.isEmpty();
4066        }
4067
4068        /**
4069         * @param value {@link #readsetId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadsetId" gives direct access to the value
4070         */
4071        public SequenceRepositoryComponent setReadsetIdElement(StringType value) { 
4072          this.readsetId = value;
4073          return this;
4074        }
4075
4076        /**
4077         * @return Id of the read in this external repository.
4078         */
4079        public String getReadsetId() { 
4080          return this.readsetId == null ? null : this.readsetId.getValue();
4081        }
4082
4083        /**
4084         * @param value Id of the read in this external repository.
4085         */
4086        public SequenceRepositoryComponent setReadsetId(String value) { 
4087          if (Utilities.noString(value))
4088            this.readsetId = null;
4089          else {
4090            if (this.readsetId == null)
4091              this.readsetId = new StringType();
4092            this.readsetId.setValue(value);
4093          }
4094          return this;
4095        }
4096
4097        protected void listChildren(List<Property> children) {
4098          super.listChildren(children);
4099          children.add(new Property("type", "code", "Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.", 0, 1, type));
4100          children.add(new Property("url", "uri", "URI of an external repository which contains further details about the genetics data.", 0, 1, url));
4101          children.add(new Property("name", "string", "URI of an external repository which contains further details about the genetics data.", 0, 1, name));
4102          children.add(new Property("datasetId", "string", "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.", 0, 1, datasetId));
4103          children.add(new Property("variantsetId", "string", "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.", 0, 1, variantsetId));
4104          children.add(new Property("readsetId", "string", "Id of the read in this external repository.", 0, 1, readsetId));
4105        }
4106
4107        @Override
4108        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4109          switch (_hash) {
4110          case 3575610: /*type*/  return new Property("type", "code", "Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.", 0, 1, type);
4111          case 116079: /*url*/  return new Property("url", "uri", "URI of an external repository which contains further details about the genetics data.", 0, 1, url);
4112          case 3373707: /*name*/  return new Property("name", "string", "URI of an external repository which contains further details about the genetics data.", 0, 1, name);
4113          case -345342029: /*datasetId*/  return new Property("datasetId", "string", "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.", 0, 1, datasetId);
4114          case 1929752504: /*variantsetId*/  return new Property("variantsetId", "string", "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.", 0, 1, variantsetId);
4115          case -1095407289: /*readsetId*/  return new Property("readsetId", "string", "Id of the read in this external repository.", 0, 1, readsetId);
4116          default: return super.getNamedProperty(_hash, _name, _checkValid);
4117          }
4118
4119        }
4120
4121      @Override
4122      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4123        switch (hash) {
4124        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<RepositoryType>
4125        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
4126        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
4127        case -345342029: /*datasetId*/ return this.datasetId == null ? new Base[0] : new Base[] {this.datasetId}; // StringType
4128        case 1929752504: /*variantsetId*/ return this.variantsetId == null ? new Base[0] : new Base[] {this.variantsetId}; // StringType
4129        case -1095407289: /*readsetId*/ return this.readsetId == null ? new Base[0] : new Base[] {this.readsetId}; // StringType
4130        default: return super.getProperty(hash, name, checkValid);
4131        }
4132
4133      }
4134
4135      @Override
4136      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4137        switch (hash) {
4138        case 3575610: // type
4139          value = new RepositoryTypeEnumFactory().fromType(castToCode(value));
4140          this.type = (Enumeration) value; // Enumeration<RepositoryType>
4141          return value;
4142        case 116079: // url
4143          this.url = castToUri(value); // UriType
4144          return value;
4145        case 3373707: // name
4146          this.name = castToString(value); // StringType
4147          return value;
4148        case -345342029: // datasetId
4149          this.datasetId = castToString(value); // StringType
4150          return value;
4151        case 1929752504: // variantsetId
4152          this.variantsetId = castToString(value); // StringType
4153          return value;
4154        case -1095407289: // readsetId
4155          this.readsetId = castToString(value); // StringType
4156          return value;
4157        default: return super.setProperty(hash, name, value);
4158        }
4159
4160      }
4161
4162      @Override
4163      public Base setProperty(String name, Base value) throws FHIRException {
4164        if (name.equals("type")) {
4165          value = new RepositoryTypeEnumFactory().fromType(castToCode(value));
4166          this.type = (Enumeration) value; // Enumeration<RepositoryType>
4167        } else if (name.equals("url")) {
4168          this.url = castToUri(value); // UriType
4169        } else if (name.equals("name")) {
4170          this.name = castToString(value); // StringType
4171        } else if (name.equals("datasetId")) {
4172          this.datasetId = castToString(value); // StringType
4173        } else if (name.equals("variantsetId")) {
4174          this.variantsetId = castToString(value); // StringType
4175        } else if (name.equals("readsetId")) {
4176          this.readsetId = castToString(value); // StringType
4177        } else
4178          return super.setProperty(name, value);
4179        return value;
4180      }
4181
4182      @Override
4183      public Base makeProperty(int hash, String name) throws FHIRException {
4184        switch (hash) {
4185        case 3575610:  return getTypeElement();
4186        case 116079:  return getUrlElement();
4187        case 3373707:  return getNameElement();
4188        case -345342029:  return getDatasetIdElement();
4189        case 1929752504:  return getVariantsetIdElement();
4190        case -1095407289:  return getReadsetIdElement();
4191        default: return super.makeProperty(hash, name);
4192        }
4193
4194      }
4195
4196      @Override
4197      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4198        switch (hash) {
4199        case 3575610: /*type*/ return new String[] {"code"};
4200        case 116079: /*url*/ return new String[] {"uri"};
4201        case 3373707: /*name*/ return new String[] {"string"};
4202        case -345342029: /*datasetId*/ return new String[] {"string"};
4203        case 1929752504: /*variantsetId*/ return new String[] {"string"};
4204        case -1095407289: /*readsetId*/ return new String[] {"string"};
4205        default: return super.getTypesForProperty(hash, name);
4206        }
4207
4208      }
4209
4210      @Override
4211      public Base addChild(String name) throws FHIRException {
4212        if (name.equals("type")) {
4213          throw new FHIRException("Cannot call addChild on a primitive type Sequence.type");
4214        }
4215        else if (name.equals("url")) {
4216          throw new FHIRException("Cannot call addChild on a primitive type Sequence.url");
4217        }
4218        else if (name.equals("name")) {
4219          throw new FHIRException("Cannot call addChild on a primitive type Sequence.name");
4220        }
4221        else if (name.equals("datasetId")) {
4222          throw new FHIRException("Cannot call addChild on a primitive type Sequence.datasetId");
4223        }
4224        else if (name.equals("variantsetId")) {
4225          throw new FHIRException("Cannot call addChild on a primitive type Sequence.variantsetId");
4226        }
4227        else if (name.equals("readsetId")) {
4228          throw new FHIRException("Cannot call addChild on a primitive type Sequence.readsetId");
4229        }
4230        else
4231          return super.addChild(name);
4232      }
4233
4234      public SequenceRepositoryComponent copy() {
4235        SequenceRepositoryComponent dst = new SequenceRepositoryComponent();
4236        copyValues(dst);
4237        dst.type = type == null ? null : type.copy();
4238        dst.url = url == null ? null : url.copy();
4239        dst.name = name == null ? null : name.copy();
4240        dst.datasetId = datasetId == null ? null : datasetId.copy();
4241        dst.variantsetId = variantsetId == null ? null : variantsetId.copy();
4242        dst.readsetId = readsetId == null ? null : readsetId.copy();
4243        return dst;
4244      }
4245
4246      @Override
4247      public boolean equalsDeep(Base other_) {
4248        if (!super.equalsDeep(other_))
4249          return false;
4250        if (!(other_ instanceof SequenceRepositoryComponent))
4251          return false;
4252        SequenceRepositoryComponent o = (SequenceRepositoryComponent) other_;
4253        return compareDeep(type, o.type, true) && compareDeep(url, o.url, true) && compareDeep(name, o.name, true)
4254           && compareDeep(datasetId, o.datasetId, true) && compareDeep(variantsetId, o.variantsetId, true)
4255           && compareDeep(readsetId, o.readsetId, true);
4256      }
4257
4258      @Override
4259      public boolean equalsShallow(Base other_) {
4260        if (!super.equalsShallow(other_))
4261          return false;
4262        if (!(other_ instanceof SequenceRepositoryComponent))
4263          return false;
4264        SequenceRepositoryComponent o = (SequenceRepositoryComponent) other_;
4265        return compareValues(type, o.type, true) && compareValues(url, o.url, true) && compareValues(name, o.name, true)
4266           && compareValues(datasetId, o.datasetId, true) && compareValues(variantsetId, o.variantsetId, true)
4267           && compareValues(readsetId, o.readsetId, true);
4268      }
4269
4270      public boolean isEmpty() {
4271        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, url, name, datasetId
4272          , variantsetId, readsetId);
4273      }
4274
4275  public String fhirType() {
4276    return "Sequence.repository";
4277
4278  }
4279
4280  }
4281
4282    @Block()
4283    public static class SequenceStructureVariantComponent extends BackboneElement implements IBaseBackboneElement {
4284        /**
4285         * Identify the exact boundaries of variant sequences. Each type of structure variant requires the DNA duplex to be broken and rejoined, and this creates a new sequence of bases at the rejoined sites, known as breakpoints or boundaries.
4286         */
4287        @Child(name = "precision", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
4288        @Description(shortDefinition="Precision of boundaries", formalDefinition="Identify the exact boundaries of variant sequences. Each type of structure variant requires the DNA duplex to be broken and rejoined, and this creates a new sequence of bases at the rejoined sites, known as breakpoints or boundaries." )
4289        protected StringType precision;
4290
4291        /**
4292         * Structural Variant reported aCGH ratio.
4293         */
4294        @Child(name = "reportedaCGHRatio", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true)
4295        @Description(shortDefinition="Structural Variant reported aCGH ratio", formalDefinition="Structural Variant reported aCGH ratio." )
4296        protected DecimalType reportedaCGHRatio;
4297
4298        /**
4299         * Length of the variant choromosome.
4300         */
4301        @Child(name = "length", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true)
4302        @Description(shortDefinition="Structural Variant Length", formalDefinition="Length of the variant choromosome." )
4303        protected IntegerType length;
4304
4305        /**
4306         * Structural variant outer.
4307         */
4308        @Child(name = "outer", type = {}, order=4, min=0, max=1, modifier=false, summary=true)
4309        @Description(shortDefinition="Structural variant outer", formalDefinition="Structural variant outer." )
4310        protected SequenceStructureVariantOuterComponent outer;
4311
4312        /**
4313         * Structural variant inner.
4314         */
4315        @Child(name = "inner", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
4316        @Description(shortDefinition="Structural variant inner", formalDefinition="Structural variant inner." )
4317        protected SequenceStructureVariantInnerComponent inner;
4318
4319        private static final long serialVersionUID = 313275793L;
4320
4321    /**
4322     * Constructor
4323     */
4324      public SequenceStructureVariantComponent() {
4325        super();
4326      }
4327
4328        /**
4329         * @return {@link #precision} (Identify the exact boundaries of variant sequences. Each type of structure variant requires the DNA duplex to be broken and rejoined, and this creates a new sequence of bases at the rejoined sites, known as breakpoints or boundaries.). This is the underlying object with id, value and extensions. The accessor "getPrecision" gives direct access to the value
4330         */
4331        public StringType getPrecisionElement() { 
4332          if (this.precision == null)
4333            if (Configuration.errorOnAutoCreate())
4334              throw new Error("Attempt to auto-create SequenceStructureVariantComponent.precision");
4335            else if (Configuration.doAutoCreate())
4336              this.precision = new StringType(); // bb
4337          return this.precision;
4338        }
4339
4340        public boolean hasPrecisionElement() { 
4341          return this.precision != null && !this.precision.isEmpty();
4342        }
4343
4344        public boolean hasPrecision() { 
4345          return this.precision != null && !this.precision.isEmpty();
4346        }
4347
4348        /**
4349         * @param value {@link #precision} (Identify the exact boundaries of variant sequences. Each type of structure variant requires the DNA duplex to be broken and rejoined, and this creates a new sequence of bases at the rejoined sites, known as breakpoints or boundaries.). This is the underlying object with id, value and extensions. The accessor "getPrecision" gives direct access to the value
4350         */
4351        public SequenceStructureVariantComponent setPrecisionElement(StringType value) { 
4352          this.precision = value;
4353          return this;
4354        }
4355
4356        /**
4357         * @return Identify the exact boundaries of variant sequences. Each type of structure variant requires the DNA duplex to be broken and rejoined, and this creates a new sequence of bases at the rejoined sites, known as breakpoints or boundaries.
4358         */
4359        public String getPrecision() { 
4360          return this.precision == null ? null : this.precision.getValue();
4361        }
4362
4363        /**
4364         * @param value Identify the exact boundaries of variant sequences. Each type of structure variant requires the DNA duplex to be broken and rejoined, and this creates a new sequence of bases at the rejoined sites, known as breakpoints or boundaries.
4365         */
4366        public SequenceStructureVariantComponent setPrecision(String value) { 
4367          if (Utilities.noString(value))
4368            this.precision = null;
4369          else {
4370            if (this.precision == null)
4371              this.precision = new StringType();
4372            this.precision.setValue(value);
4373          }
4374          return this;
4375        }
4376
4377        /**
4378         * @return {@link #reportedaCGHRatio} (Structural Variant reported aCGH ratio.). This is the underlying object with id, value and extensions. The accessor "getReportedaCGHRatio" gives direct access to the value
4379         */
4380        public DecimalType getReportedaCGHRatioElement() { 
4381          if (this.reportedaCGHRatio == null)
4382            if (Configuration.errorOnAutoCreate())
4383              throw new Error("Attempt to auto-create SequenceStructureVariantComponent.reportedaCGHRatio");
4384            else if (Configuration.doAutoCreate())
4385              this.reportedaCGHRatio = new DecimalType(); // bb
4386          return this.reportedaCGHRatio;
4387        }
4388
4389        public boolean hasReportedaCGHRatioElement() { 
4390          return this.reportedaCGHRatio != null && !this.reportedaCGHRatio.isEmpty();
4391        }
4392
4393        public boolean hasReportedaCGHRatio() { 
4394          return this.reportedaCGHRatio != null && !this.reportedaCGHRatio.isEmpty();
4395        }
4396
4397        /**
4398         * @param value {@link #reportedaCGHRatio} (Structural Variant reported aCGH ratio.). This is the underlying object with id, value and extensions. The accessor "getReportedaCGHRatio" gives direct access to the value
4399         */
4400        public SequenceStructureVariantComponent setReportedaCGHRatioElement(DecimalType value) { 
4401          this.reportedaCGHRatio = value;
4402          return this;
4403        }
4404
4405        /**
4406         * @return Structural Variant reported aCGH ratio.
4407         */
4408        public BigDecimal getReportedaCGHRatio() { 
4409          return this.reportedaCGHRatio == null ? null : this.reportedaCGHRatio.getValue();
4410        }
4411
4412        /**
4413         * @param value Structural Variant reported aCGH ratio.
4414         */
4415        public SequenceStructureVariantComponent setReportedaCGHRatio(BigDecimal value) { 
4416          if (value == null)
4417            this.reportedaCGHRatio = null;
4418          else {
4419            if (this.reportedaCGHRatio == null)
4420              this.reportedaCGHRatio = new DecimalType();
4421            this.reportedaCGHRatio.setValue(value);
4422          }
4423          return this;
4424        }
4425
4426        /**
4427         * @param value Structural Variant reported aCGH ratio.
4428         */
4429        public SequenceStructureVariantComponent setReportedaCGHRatio(long value) { 
4430              this.reportedaCGHRatio = new DecimalType();
4431            this.reportedaCGHRatio.setValue(value);
4432          return this;
4433        }
4434
4435        /**
4436         * @param value Structural Variant reported aCGH ratio.
4437         */
4438        public SequenceStructureVariantComponent setReportedaCGHRatio(double value) { 
4439              this.reportedaCGHRatio = new DecimalType();
4440            this.reportedaCGHRatio.setValue(value);
4441          return this;
4442        }
4443
4444        /**
4445         * @return {@link #length} (Length of the variant choromosome.). This is the underlying object with id, value and extensions. The accessor "getLength" gives direct access to the value
4446         */
4447        public IntegerType getLengthElement() { 
4448          if (this.length == null)
4449            if (Configuration.errorOnAutoCreate())
4450              throw new Error("Attempt to auto-create SequenceStructureVariantComponent.length");
4451            else if (Configuration.doAutoCreate())
4452              this.length = new IntegerType(); // bb
4453          return this.length;
4454        }
4455
4456        public boolean hasLengthElement() { 
4457          return this.length != null && !this.length.isEmpty();
4458        }
4459
4460        public boolean hasLength() { 
4461          return this.length != null && !this.length.isEmpty();
4462        }
4463
4464        /**
4465         * @param value {@link #length} (Length of the variant choromosome.). This is the underlying object with id, value and extensions. The accessor "getLength" gives direct access to the value
4466         */
4467        public SequenceStructureVariantComponent setLengthElement(IntegerType value) { 
4468          this.length = value;
4469          return this;
4470        }
4471
4472        /**
4473         * @return Length of the variant choromosome.
4474         */
4475        public int getLength() { 
4476          return this.length == null || this.length.isEmpty() ? 0 : this.length.getValue();
4477        }
4478
4479        /**
4480         * @param value Length of the variant choromosome.
4481         */
4482        public SequenceStructureVariantComponent setLength(int value) { 
4483            if (this.length == null)
4484              this.length = new IntegerType();
4485            this.length.setValue(value);
4486          return this;
4487        }
4488
4489        /**
4490         * @return {@link #outer} (Structural variant outer.)
4491         */
4492        public SequenceStructureVariantOuterComponent getOuter() { 
4493          if (this.outer == null)
4494            if (Configuration.errorOnAutoCreate())
4495              throw new Error("Attempt to auto-create SequenceStructureVariantComponent.outer");
4496            else if (Configuration.doAutoCreate())
4497              this.outer = new SequenceStructureVariantOuterComponent(); // cc
4498          return this.outer;
4499        }
4500
4501        public boolean hasOuter() { 
4502          return this.outer != null && !this.outer.isEmpty();
4503        }
4504
4505        /**
4506         * @param value {@link #outer} (Structural variant outer.)
4507         */
4508        public SequenceStructureVariantComponent setOuter(SequenceStructureVariantOuterComponent value) { 
4509          this.outer = value;
4510          return this;
4511        }
4512
4513        /**
4514         * @return {@link #inner} (Structural variant inner.)
4515         */
4516        public SequenceStructureVariantInnerComponent getInner() { 
4517          if (this.inner == null)
4518            if (Configuration.errorOnAutoCreate())
4519              throw new Error("Attempt to auto-create SequenceStructureVariantComponent.inner");
4520            else if (Configuration.doAutoCreate())
4521              this.inner = new SequenceStructureVariantInnerComponent(); // cc
4522          return this.inner;
4523        }
4524
4525        public boolean hasInner() { 
4526          return this.inner != null && !this.inner.isEmpty();
4527        }
4528
4529        /**
4530         * @param value {@link #inner} (Structural variant inner.)
4531         */
4532        public SequenceStructureVariantComponent setInner(SequenceStructureVariantInnerComponent value) { 
4533          this.inner = value;
4534          return this;
4535        }
4536
4537        protected void listChildren(List<Property> children) {
4538          super.listChildren(children);
4539          children.add(new Property("precision", "string", "Identify the exact boundaries of variant sequences. Each type of structure variant requires the DNA duplex to be broken and rejoined, and this creates a new sequence of bases at the rejoined sites, known as breakpoints or boundaries.", 0, 1, precision));
4540          children.add(new Property("reportedaCGHRatio", "decimal", "Structural Variant reported aCGH ratio.", 0, 1, reportedaCGHRatio));
4541          children.add(new Property("length", "integer", "Length of the variant choromosome.", 0, 1, length));
4542          children.add(new Property("outer", "", "Structural variant outer.", 0, 1, outer));
4543          children.add(new Property("inner", "", "Structural variant inner.", 0, 1, inner));
4544        }
4545
4546        @Override
4547        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4548          switch (_hash) {
4549          case -1376177026: /*precision*/  return new Property("precision", "string", "Identify the exact boundaries of variant sequences. Each type of structure variant requires the DNA duplex to be broken and rejoined, and this creates a new sequence of bases at the rejoined sites, known as breakpoints or boundaries.", 0, 1, precision);
4550          case -1872600587: /*reportedaCGHRatio*/  return new Property("reportedaCGHRatio", "decimal", "Structural Variant reported aCGH ratio.", 0, 1, reportedaCGHRatio);
4551          case -1106363674: /*length*/  return new Property("length", "integer", "Length of the variant choromosome.", 0, 1, length);
4552          case 106111099: /*outer*/  return new Property("outer", "", "Structural variant outer.", 0, 1, outer);
4553          case 100355670: /*inner*/  return new Property("inner", "", "Structural variant inner.", 0, 1, inner);
4554          default: return super.getNamedProperty(_hash, _name, _checkValid);
4555          }
4556
4557        }
4558
4559      @Override
4560      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4561        switch (hash) {
4562        case -1376177026: /*precision*/ return this.precision == null ? new Base[0] : new Base[] {this.precision}; // StringType
4563        case -1872600587: /*reportedaCGHRatio*/ return this.reportedaCGHRatio == null ? new Base[0] : new Base[] {this.reportedaCGHRatio}; // DecimalType
4564        case -1106363674: /*length*/ return this.length == null ? new Base[0] : new Base[] {this.length}; // IntegerType
4565        case 106111099: /*outer*/ return this.outer == null ? new Base[0] : new Base[] {this.outer}; // SequenceStructureVariantOuterComponent
4566        case 100355670: /*inner*/ return this.inner == null ? new Base[0] : new Base[] {this.inner}; // SequenceStructureVariantInnerComponent
4567        default: return super.getProperty(hash, name, checkValid);
4568        }
4569
4570      }
4571
4572      @Override
4573      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4574        switch (hash) {
4575        case -1376177026: // precision
4576          this.precision = castToString(value); // StringType
4577          return value;
4578        case -1872600587: // reportedaCGHRatio
4579          this.reportedaCGHRatio = castToDecimal(value); // DecimalType
4580          return value;
4581        case -1106363674: // length
4582          this.length = castToInteger(value); // IntegerType
4583          return value;
4584        case 106111099: // outer
4585          this.outer = (SequenceStructureVariantOuterComponent) value; // SequenceStructureVariantOuterComponent
4586          return value;
4587        case 100355670: // inner
4588          this.inner = (SequenceStructureVariantInnerComponent) value; // SequenceStructureVariantInnerComponent
4589          return value;
4590        default: return super.setProperty(hash, name, value);
4591        }
4592
4593      }
4594
4595      @Override
4596      public Base setProperty(String name, Base value) throws FHIRException {
4597        if (name.equals("precision")) {
4598          this.precision = castToString(value); // StringType
4599        } else if (name.equals("reportedaCGHRatio")) {
4600          this.reportedaCGHRatio = castToDecimal(value); // DecimalType
4601        } else if (name.equals("length")) {
4602          this.length = castToInteger(value); // IntegerType
4603        } else if (name.equals("outer")) {
4604          this.outer = (SequenceStructureVariantOuterComponent) value; // SequenceStructureVariantOuterComponent
4605        } else if (name.equals("inner")) {
4606          this.inner = (SequenceStructureVariantInnerComponent) value; // SequenceStructureVariantInnerComponent
4607        } else
4608          return super.setProperty(name, value);
4609        return value;
4610      }
4611
4612      @Override
4613      public Base makeProperty(int hash, String name) throws FHIRException {
4614        switch (hash) {
4615        case -1376177026:  return getPrecisionElement();
4616        case -1872600587:  return getReportedaCGHRatioElement();
4617        case -1106363674:  return getLengthElement();
4618        case 106111099:  return getOuter(); 
4619        case 100355670:  return getInner(); 
4620        default: return super.makeProperty(hash, name);
4621        }
4622
4623      }
4624
4625      @Override
4626      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4627        switch (hash) {
4628        case -1376177026: /*precision*/ return new String[] {"string"};
4629        case -1872600587: /*reportedaCGHRatio*/ return new String[] {"decimal"};
4630        case -1106363674: /*length*/ return new String[] {"integer"};
4631        case 106111099: /*outer*/ return new String[] {};
4632        case 100355670: /*inner*/ return new String[] {};
4633        default: return super.getTypesForProperty(hash, name);
4634        }
4635
4636      }
4637
4638      @Override
4639      public Base addChild(String name) throws FHIRException {
4640        if (name.equals("precision")) {
4641          throw new FHIRException("Cannot call addChild on a primitive type Sequence.precision");
4642        }
4643        else if (name.equals("reportedaCGHRatio")) {
4644          throw new FHIRException("Cannot call addChild on a primitive type Sequence.reportedaCGHRatio");
4645        }
4646        else if (name.equals("length")) {
4647          throw new FHIRException("Cannot call addChild on a primitive type Sequence.length");
4648        }
4649        else if (name.equals("outer")) {
4650          this.outer = new SequenceStructureVariantOuterComponent();
4651          return this.outer;
4652        }
4653        else if (name.equals("inner")) {
4654          this.inner = new SequenceStructureVariantInnerComponent();
4655          return this.inner;
4656        }
4657        else
4658          return super.addChild(name);
4659      }
4660
4661      public SequenceStructureVariantComponent copy() {
4662        SequenceStructureVariantComponent dst = new SequenceStructureVariantComponent();
4663        copyValues(dst);
4664        dst.precision = precision == null ? null : precision.copy();
4665        dst.reportedaCGHRatio = reportedaCGHRatio == null ? null : reportedaCGHRatio.copy();
4666        dst.length = length == null ? null : length.copy();
4667        dst.outer = outer == null ? null : outer.copy();
4668        dst.inner = inner == null ? null : inner.copy();
4669        return dst;
4670      }
4671
4672      @Override
4673      public boolean equalsDeep(Base other_) {
4674        if (!super.equalsDeep(other_))
4675          return false;
4676        if (!(other_ instanceof SequenceStructureVariantComponent))
4677          return false;
4678        SequenceStructureVariantComponent o = (SequenceStructureVariantComponent) other_;
4679        return compareDeep(precision, o.precision, true) && compareDeep(reportedaCGHRatio, o.reportedaCGHRatio, true)
4680           && compareDeep(length, o.length, true) && compareDeep(outer, o.outer, true) && compareDeep(inner, o.inner, true)
4681          ;
4682      }
4683
4684      @Override
4685      public boolean equalsShallow(Base other_) {
4686        if (!super.equalsShallow(other_))
4687          return false;
4688        if (!(other_ instanceof SequenceStructureVariantComponent))
4689          return false;
4690        SequenceStructureVariantComponent o = (SequenceStructureVariantComponent) other_;
4691        return compareValues(precision, o.precision, true) && compareValues(reportedaCGHRatio, o.reportedaCGHRatio, true)
4692           && compareValues(length, o.length, true);
4693      }
4694
4695      public boolean isEmpty() {
4696        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(precision, reportedaCGHRatio
4697          , length, outer, inner);
4698      }
4699
4700  public String fhirType() {
4701    return "Sequence.structureVariant";
4702
4703  }
4704
4705  }
4706
4707    @Block()
4708    public static class SequenceStructureVariantOuterComponent extends BackboneElement implements IBaseBackboneElement {
4709        /**
4710         * Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.
4711         */
4712        @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true)
4713        @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." )
4714        protected IntegerType start;
4715
4716        /**
4717         * Structural Variant Outer End. If the coordinate system is 0-based then end is 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.
4718         */
4719        @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
4720        @Description(shortDefinition="Structural Variant Outer End", formalDefinition="Structural Variant Outer End. If the coordinate system is 0-based then end is 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." )
4721        protected IntegerType end;
4722
4723        private static final long serialVersionUID = -1798864889L;
4724
4725    /**
4726     * Constructor
4727     */
4728      public SequenceStructureVariantOuterComponent() {
4729        super();
4730      }
4731
4732        /**
4733         * @return {@link #start} (Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
4734         */
4735        public IntegerType getStartElement() { 
4736          if (this.start == null)
4737            if (Configuration.errorOnAutoCreate())
4738              throw new Error("Attempt to auto-create SequenceStructureVariantOuterComponent.start");
4739            else if (Configuration.doAutoCreate())
4740              this.start = new IntegerType(); // bb
4741          return this.start;
4742        }
4743
4744        public boolean hasStartElement() { 
4745          return this.start != null && !this.start.isEmpty();
4746        }
4747
4748        public boolean hasStart() { 
4749          return this.start != null && !this.start.isEmpty();
4750        }
4751
4752        /**
4753         * @param value {@link #start} (Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
4754         */
4755        public SequenceStructureVariantOuterComponent setStartElement(IntegerType value) { 
4756          this.start = value;
4757          return this;
4758        }
4759
4760        /**
4761         * @return Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.
4762         */
4763        public int getStart() { 
4764          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
4765        }
4766
4767        /**
4768         * @param value Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.
4769         */
4770        public SequenceStructureVariantOuterComponent setStart(int value) { 
4771            if (this.start == null)
4772              this.start = new IntegerType();
4773            this.start.setValue(value);
4774          return this;
4775        }
4776
4777        /**
4778         * @return {@link #end} (Structural Variant Outer End. If the coordinate system is 0-based then end is 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.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
4779         */
4780        public IntegerType getEndElement() { 
4781          if (this.end == null)
4782            if (Configuration.errorOnAutoCreate())
4783              throw new Error("Attempt to auto-create SequenceStructureVariantOuterComponent.end");
4784            else if (Configuration.doAutoCreate())
4785              this.end = new IntegerType(); // bb
4786          return this.end;
4787        }
4788
4789        public boolean hasEndElement() { 
4790          return this.end != null && !this.end.isEmpty();
4791        }
4792
4793        public boolean hasEnd() { 
4794          return this.end != null && !this.end.isEmpty();
4795        }
4796
4797        /**
4798         * @param value {@link #end} (Structural Variant Outer End. If the coordinate system is 0-based then end is 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.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
4799         */
4800        public SequenceStructureVariantOuterComponent setEndElement(IntegerType value) { 
4801          this.end = value;
4802          return this;
4803        }
4804
4805        /**
4806         * @return Structural Variant Outer End. If the coordinate system is 0-based then end is 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.
4807         */
4808        public int getEnd() { 
4809          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
4810        }
4811
4812        /**
4813         * @param value Structural Variant Outer End. If the coordinate system is 0-based then end is 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.
4814         */
4815        public SequenceStructureVariantOuterComponent setEnd(int value) { 
4816            if (this.end == null)
4817              this.end = new IntegerType();
4818            this.end.setValue(value);
4819          return this;
4820        }
4821
4822        protected void listChildren(List<Property> children) {
4823          super.listChildren(children);
4824          children.add(new Property("start", "integer", "Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, 1, start));
4825          children.add(new Property("end", "integer", "Structural Variant Outer End. If the coordinate system is 0-based then end is 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.", 0, 1, end));
4826        }
4827
4828        @Override
4829        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4830          switch (_hash) {
4831          case 109757538: /*start*/  return new Property("start", "integer", "Structural Variant Outer Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, 1, start);
4832          case 100571: /*end*/  return new Property("end", "integer", "Structural Variant Outer End. If the coordinate system is 0-based then end is 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.", 0, 1, end);
4833          default: return super.getNamedProperty(_hash, _name, _checkValid);
4834          }
4835
4836        }
4837
4838      @Override
4839      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4840        switch (hash) {
4841        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
4842        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
4843        default: return super.getProperty(hash, name, checkValid);
4844        }
4845
4846      }
4847
4848      @Override
4849      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4850        switch (hash) {
4851        case 109757538: // start
4852          this.start = castToInteger(value); // IntegerType
4853          return value;
4854        case 100571: // end
4855          this.end = castToInteger(value); // IntegerType
4856          return value;
4857        default: return super.setProperty(hash, name, value);
4858        }
4859
4860      }
4861
4862      @Override
4863      public Base setProperty(String name, Base value) throws FHIRException {
4864        if (name.equals("start")) {
4865          this.start = castToInteger(value); // IntegerType
4866        } else if (name.equals("end")) {
4867          this.end = castToInteger(value); // IntegerType
4868        } else
4869          return super.setProperty(name, value);
4870        return value;
4871      }
4872
4873      @Override
4874      public Base makeProperty(int hash, String name) throws FHIRException {
4875        switch (hash) {
4876        case 109757538:  return getStartElement();
4877        case 100571:  return getEndElement();
4878        default: return super.makeProperty(hash, name);
4879        }
4880
4881      }
4882
4883      @Override
4884      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4885        switch (hash) {
4886        case 109757538: /*start*/ return new String[] {"integer"};
4887        case 100571: /*end*/ return new String[] {"integer"};
4888        default: return super.getTypesForProperty(hash, name);
4889        }
4890
4891      }
4892
4893      @Override
4894      public Base addChild(String name) throws FHIRException {
4895        if (name.equals("start")) {
4896          throw new FHIRException("Cannot call addChild on a primitive type Sequence.start");
4897        }
4898        else if (name.equals("end")) {
4899          throw new FHIRException("Cannot call addChild on a primitive type Sequence.end");
4900        }
4901        else
4902          return super.addChild(name);
4903      }
4904
4905      public SequenceStructureVariantOuterComponent copy() {
4906        SequenceStructureVariantOuterComponent dst = new SequenceStructureVariantOuterComponent();
4907        copyValues(dst);
4908        dst.start = start == null ? null : start.copy();
4909        dst.end = end == null ? null : end.copy();
4910        return dst;
4911      }
4912
4913      @Override
4914      public boolean equalsDeep(Base other_) {
4915        if (!super.equalsDeep(other_))
4916          return false;
4917        if (!(other_ instanceof SequenceStructureVariantOuterComponent))
4918          return false;
4919        SequenceStructureVariantOuterComponent o = (SequenceStructureVariantOuterComponent) other_;
4920        return compareDeep(start, o.start, true) && compareDeep(end, o.end, true);
4921      }
4922
4923      @Override
4924      public boolean equalsShallow(Base other_) {
4925        if (!super.equalsShallow(other_))
4926          return false;
4927        if (!(other_ instanceof SequenceStructureVariantOuterComponent))
4928          return false;
4929        SequenceStructureVariantOuterComponent o = (SequenceStructureVariantOuterComponent) other_;
4930        return compareValues(start, o.start, true) && compareValues(end, o.end, true);
4931      }
4932
4933      public boolean isEmpty() {
4934        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(start, end);
4935      }
4936
4937  public String fhirType() {
4938    return "Sequence.structureVariant.outer";
4939
4940  }
4941
4942  }
4943
4944    @Block()
4945    public static class SequenceStructureVariantInnerComponent extends BackboneElement implements IBaseBackboneElement {
4946        /**
4947         * Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.
4948         */
4949        @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true)
4950        @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." )
4951        protected IntegerType start;
4952
4953        /**
4954         * Structural Variant Inner End. If the coordinate system is 0-based then end is 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.
4955         */
4956        @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
4957        @Description(shortDefinition="Structural Variant Inner End", formalDefinition="Structural Variant Inner End. If the coordinate system is 0-based then end is 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." )
4958        protected IntegerType end;
4959
4960        private static final long serialVersionUID = -1798864889L;
4961
4962    /**
4963     * Constructor
4964     */
4965      public SequenceStructureVariantInnerComponent() {
4966        super();
4967      }
4968
4969        /**
4970         * @return {@link #start} (Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
4971         */
4972        public IntegerType getStartElement() { 
4973          if (this.start == null)
4974            if (Configuration.errorOnAutoCreate())
4975              throw new Error("Attempt to auto-create SequenceStructureVariantInnerComponent.start");
4976            else if (Configuration.doAutoCreate())
4977              this.start = new IntegerType(); // bb
4978          return this.start;
4979        }
4980
4981        public boolean hasStartElement() { 
4982          return this.start != null && !this.start.isEmpty();
4983        }
4984
4985        public boolean hasStart() { 
4986          return this.start != null && !this.start.isEmpty();
4987        }
4988
4989        /**
4990         * @param value {@link #start} (Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
4991         */
4992        public SequenceStructureVariantInnerComponent setStartElement(IntegerType value) { 
4993          this.start = value;
4994          return this;
4995        }
4996
4997        /**
4998         * @return Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.
4999         */
5000        public int getStart() { 
5001          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
5002        }
5003
5004        /**
5005         * @param value Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.
5006         */
5007        public SequenceStructureVariantInnerComponent setStart(int value) { 
5008            if (this.start == null)
5009              this.start = new IntegerType();
5010            this.start.setValue(value);
5011          return this;
5012        }
5013
5014        /**
5015         * @return {@link #end} (Structural Variant Inner End. If the coordinate system is 0-based then end is 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.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
5016         */
5017        public IntegerType getEndElement() { 
5018          if (this.end == null)
5019            if (Configuration.errorOnAutoCreate())
5020              throw new Error("Attempt to auto-create SequenceStructureVariantInnerComponent.end");
5021            else if (Configuration.doAutoCreate())
5022              this.end = new IntegerType(); // bb
5023          return this.end;
5024        }
5025
5026        public boolean hasEndElement() { 
5027          return this.end != null && !this.end.isEmpty();
5028        }
5029
5030        public boolean hasEnd() { 
5031          return this.end != null && !this.end.isEmpty();
5032        }
5033
5034        /**
5035         * @param value {@link #end} (Structural Variant Inner End. If the coordinate system is 0-based then end is 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.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
5036         */
5037        public SequenceStructureVariantInnerComponent setEndElement(IntegerType value) { 
5038          this.end = value;
5039          return this;
5040        }
5041
5042        /**
5043         * @return Structural Variant Inner End. If the coordinate system is 0-based then end is 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.
5044         */
5045        public int getEnd() { 
5046          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
5047        }
5048
5049        /**
5050         * @param value Structural Variant Inner End. If the coordinate system is 0-based then end is 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.
5051         */
5052        public SequenceStructureVariantInnerComponent setEnd(int value) { 
5053            if (this.end == null)
5054              this.end = new IntegerType();
5055            this.end.setValue(value);
5056          return this;
5057        }
5058
5059        protected void listChildren(List<Property> children) {
5060          super.listChildren(children);
5061          children.add(new Property("start", "integer", "Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, 1, start));
5062          children.add(new Property("end", "integer", "Structural Variant Inner End. If the coordinate system is 0-based then end is 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.", 0, 1, end));
5063        }
5064
5065        @Override
5066        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5067          switch (_hash) {
5068          case 109757538: /*start*/  return new Property("start", "integer", "Structural Variant Inner Start.If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, 1, start);
5069          case 100571: /*end*/  return new Property("end", "integer", "Structural Variant Inner End. If the coordinate system is 0-based then end is 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.", 0, 1, end);
5070          default: return super.getNamedProperty(_hash, _name, _checkValid);
5071          }
5072
5073        }
5074
5075      @Override
5076      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5077        switch (hash) {
5078        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
5079        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
5080        default: return super.getProperty(hash, name, checkValid);
5081        }
5082
5083      }
5084
5085      @Override
5086      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5087        switch (hash) {
5088        case 109757538: // start
5089          this.start = castToInteger(value); // IntegerType
5090          return value;
5091        case 100571: // end
5092          this.end = castToInteger(value); // IntegerType
5093          return value;
5094        default: return super.setProperty(hash, name, value);
5095        }
5096
5097      }
5098
5099      @Override
5100      public Base setProperty(String name, Base value) throws FHIRException {
5101        if (name.equals("start")) {
5102          this.start = castToInteger(value); // IntegerType
5103        } else if (name.equals("end")) {
5104          this.end = castToInteger(value); // IntegerType
5105        } else
5106          return super.setProperty(name, value);
5107        return value;
5108      }
5109
5110      @Override
5111      public Base makeProperty(int hash, String name) throws FHIRException {
5112        switch (hash) {
5113        case 109757538:  return getStartElement();
5114        case 100571:  return getEndElement();
5115        default: return super.makeProperty(hash, name);
5116        }
5117
5118      }
5119
5120      @Override
5121      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5122        switch (hash) {
5123        case 109757538: /*start*/ return new String[] {"integer"};
5124        case 100571: /*end*/ return new String[] {"integer"};
5125        default: return super.getTypesForProperty(hash, name);
5126        }
5127
5128      }
5129
5130      @Override
5131      public Base addChild(String name) throws FHIRException {
5132        if (name.equals("start")) {
5133          throw new FHIRException("Cannot call addChild on a primitive type Sequence.start");
5134        }
5135        else if (name.equals("end")) {
5136          throw new FHIRException("Cannot call addChild on a primitive type Sequence.end");
5137        }
5138        else
5139          return super.addChild(name);
5140      }
5141
5142      public SequenceStructureVariantInnerComponent copy() {
5143        SequenceStructureVariantInnerComponent dst = new SequenceStructureVariantInnerComponent();
5144        copyValues(dst);
5145        dst.start = start == null ? null : start.copy();
5146        dst.end = end == null ? null : end.copy();
5147        return dst;
5148      }
5149
5150      @Override
5151      public boolean equalsDeep(Base other_) {
5152        if (!super.equalsDeep(other_))
5153          return false;
5154        if (!(other_ instanceof SequenceStructureVariantInnerComponent))
5155          return false;
5156        SequenceStructureVariantInnerComponent o = (SequenceStructureVariantInnerComponent) other_;
5157        return compareDeep(start, o.start, true) && compareDeep(end, o.end, true);
5158      }
5159
5160      @Override
5161      public boolean equalsShallow(Base other_) {
5162        if (!super.equalsShallow(other_))
5163          return false;
5164        if (!(other_ instanceof SequenceStructureVariantInnerComponent))
5165          return false;
5166        SequenceStructureVariantInnerComponent o = (SequenceStructureVariantInnerComponent) other_;
5167        return compareValues(start, o.start, true) && compareValues(end, o.end, true);
5168      }
5169
5170      public boolean isEmpty() {
5171        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(start, end);
5172      }
5173
5174  public String fhirType() {
5175    return "Sequence.structureVariant.inner";
5176
5177  }
5178
5179  }
5180
5181    /**
5182     * A unique identifier for this particular sequence instance. This is a FHIR-defined id.
5183     */
5184    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5185    @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." )
5186    protected List<Identifier> identifier;
5187
5188    /**
5189     * Amino Acid Sequence/ DNA Sequence / RNA Sequence.
5190     */
5191    @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true)
5192    @Description(shortDefinition="aa | dna | rna", formalDefinition="Amino Acid Sequence/ DNA Sequence / RNA Sequence." )
5193    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-type")
5194    protected Enumeration<SequenceType> type;
5195
5196    /**
5197     * 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).
5198     */
5199    @Child(name = "coordinateSystem", type = {IntegerType.class}, order=2, min=1, max=1, modifier=false, summary=true)
5200    @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)." )
5201    protected IntegerType coordinateSystem;
5202
5203    /**
5204     * The patient whose sequencing results are described by this resource.
5205     */
5206    @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1, modifier=false, summary=true)
5207    @Description(shortDefinition="Who and/or what this is about", formalDefinition="The patient whose sequencing results are described by this resource." )
5208    protected Reference patient;
5209
5210    /**
5211     * The actual object that is the target of the reference (The patient whose sequencing results are described by this resource.)
5212     */
5213    protected Patient patientTarget;
5214
5215    /**
5216     * Specimen used for sequencing.
5217     */
5218    @Child(name = "specimen", type = {Specimen.class}, order=4, min=0, max=1, modifier=false, summary=true)
5219    @Description(shortDefinition="Specimen used for sequencing", formalDefinition="Specimen used for sequencing." )
5220    protected Reference specimen;
5221
5222    /**
5223     * The actual object that is the target of the reference (Specimen used for sequencing.)
5224     */
5225    protected Specimen specimenTarget;
5226
5227    /**
5228     * The method for sequencing, for example, chip information.
5229     */
5230    @Child(name = "device", type = {Device.class}, order=5, min=0, max=1, modifier=false, summary=true)
5231    @Description(shortDefinition="The method for sequencing", formalDefinition="The method for sequencing, for example, chip information." )
5232    protected Reference device;
5233
5234    /**
5235     * The actual object that is the target of the reference (The method for sequencing, for example, chip information.)
5236     */
5237    protected Device deviceTarget;
5238
5239    /**
5240     * The organization or lab that should be responsible for this result.
5241     */
5242    @Child(name = "performer", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
5243    @Description(shortDefinition="Who should be responsible for test result", formalDefinition="The organization or lab that should be responsible for this result." )
5244    protected Reference performer;
5245
5246    /**
5247     * The actual object that is the target of the reference (The organization or lab that should be responsible for this result.)
5248     */
5249    protected Organization performerTarget;
5250
5251    /**
5252     * The number of copies of the seqeunce of interest. (RNASeq).
5253     */
5254    @Child(name = "quantity", type = {Quantity.class}, order=7, min=0, max=1, modifier=false, summary=true)
5255    @Description(shortDefinition="The number of copies of the seqeunce of interest.  (RNASeq)", formalDefinition="The number of copies of the seqeunce of interest. (RNASeq)." )
5256    protected Quantity quantity;
5257
5258    /**
5259     * A sequence that is used as a reference to describe variants that are present in a sequence analyzed.
5260     */
5261    @Child(name = "referenceSeq", type = {}, order=8, min=0, max=1, modifier=false, summary=true)
5262    @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." )
5263    protected SequenceReferenceSeqComponent referenceSeq;
5264
5265    /**
5266     * 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.
5267     */
5268    @Child(name = "variant", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5269    @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." )
5270    protected List<SequenceVariantComponent> variant;
5271
5272    /**
5273     * Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.
5274     */
5275    @Child(name = "observedSeq", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true)
5276    @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 starts from referenceSeq.windowStart and end by referenceSeq.windowEnd." )
5277    protected StringType observedSeq;
5278
5279    /**
5280     * 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)).
5281     */
5282    @Child(name = "quality", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5283    @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))." )
5284    protected List<SequenceQualityComponent> quality;
5285
5286    /**
5287     * Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.
5288     */
5289    @Child(name = "readCoverage", type = {IntegerType.class}, order=12, min=0, max=1, modifier=false, summary=true)
5290    @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." )
5291    protected IntegerType readCoverage;
5292
5293    /**
5294     * Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.
5295     */
5296    @Child(name = "repository", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5297    @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." )
5298    protected List<SequenceRepositoryComponent> repository;
5299
5300    /**
5301     * Pointer to next atomic sequence which at most contains one variant.
5302     */
5303    @Child(name = "pointer", type = {Sequence.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5304    @Description(shortDefinition="Pointer to next atomic sequence", formalDefinition="Pointer to next atomic sequence which at most contains one variant." )
5305    protected List<Reference> pointer;
5306    /**
5307     * The actual objects that are the target of the reference (Pointer to next atomic sequence which at most contains one variant.)
5308     */
5309    protected List<Sequence> pointerTarget;
5310
5311
5312    /**
5313     * Information about chromosome structure variation.
5314     */
5315    @Child(name = "structureVariant", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5316    @Description(shortDefinition="Structural variant", formalDefinition="Information about chromosome structure variation." )
5317    protected List<SequenceStructureVariantComponent> structureVariant;
5318
5319    private static final long serialVersionUID = 2091706446L;
5320
5321  /**
5322   * Constructor
5323   */
5324    public Sequence() {
5325      super();
5326    }
5327
5328  /**
5329   * Constructor
5330   */
5331    public Sequence(IntegerType coordinateSystem) {
5332      super();
5333      this.coordinateSystem = coordinateSystem;
5334    }
5335
5336    /**
5337     * @return {@link #identifier} (A unique identifier for this particular sequence instance. This is a FHIR-defined id.)
5338     */
5339    public List<Identifier> getIdentifier() { 
5340      if (this.identifier == null)
5341        this.identifier = new ArrayList<Identifier>();
5342      return this.identifier;
5343    }
5344
5345    /**
5346     * @return Returns a reference to <code>this</code> for easy method chaining
5347     */
5348    public Sequence setIdentifier(List<Identifier> theIdentifier) { 
5349      this.identifier = theIdentifier;
5350      return this;
5351    }
5352
5353    public boolean hasIdentifier() { 
5354      if (this.identifier == null)
5355        return false;
5356      for (Identifier item : this.identifier)
5357        if (!item.isEmpty())
5358          return true;
5359      return false;
5360    }
5361
5362    public Identifier addIdentifier() { //3
5363      Identifier t = new Identifier();
5364      if (this.identifier == null)
5365        this.identifier = new ArrayList<Identifier>();
5366      this.identifier.add(t);
5367      return t;
5368    }
5369
5370    public Sequence addIdentifier(Identifier t) { //3
5371      if (t == null)
5372        return this;
5373      if (this.identifier == null)
5374        this.identifier = new ArrayList<Identifier>();
5375      this.identifier.add(t);
5376      return this;
5377    }
5378
5379    /**
5380     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
5381     */
5382    public Identifier getIdentifierFirstRep() { 
5383      if (getIdentifier().isEmpty()) {
5384        addIdentifier();
5385      }
5386      return getIdentifier().get(0);
5387    }
5388
5389    /**
5390     * @return {@link #type} (Amino Acid Sequence/ DNA Sequence / RNA Sequence.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
5391     */
5392    public Enumeration<SequenceType> getTypeElement() { 
5393      if (this.type == null)
5394        if (Configuration.errorOnAutoCreate())
5395          throw new Error("Attempt to auto-create Sequence.type");
5396        else if (Configuration.doAutoCreate())
5397          this.type = new Enumeration<SequenceType>(new SequenceTypeEnumFactory()); // bb
5398      return this.type;
5399    }
5400
5401    public boolean hasTypeElement() { 
5402      return this.type != null && !this.type.isEmpty();
5403    }
5404
5405    public boolean hasType() { 
5406      return this.type != null && !this.type.isEmpty();
5407    }
5408
5409    /**
5410     * @param value {@link #type} (Amino Acid Sequence/ DNA Sequence / RNA Sequence.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
5411     */
5412    public Sequence setTypeElement(Enumeration<SequenceType> value) { 
5413      this.type = value;
5414      return this;
5415    }
5416
5417    /**
5418     * @return Amino Acid Sequence/ DNA Sequence / RNA Sequence.
5419     */
5420    public SequenceType getType() { 
5421      return this.type == null ? null : this.type.getValue();
5422    }
5423
5424    /**
5425     * @param value Amino Acid Sequence/ DNA Sequence / RNA Sequence.
5426     */
5427    public Sequence setType(SequenceType value) { 
5428      if (value == null)
5429        this.type = null;
5430      else {
5431        if (this.type == null)
5432          this.type = new Enumeration<SequenceType>(new SequenceTypeEnumFactory());
5433        this.type.setValue(value);
5434      }
5435      return this;
5436    }
5437
5438    /**
5439     * @return {@link #coordinateSystem} (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).). This is the underlying object with id, value and extensions. The accessor "getCoordinateSystem" gives direct access to the value
5440     */
5441    public IntegerType getCoordinateSystemElement() { 
5442      if (this.coordinateSystem == null)
5443        if (Configuration.errorOnAutoCreate())
5444          throw new Error("Attempt to auto-create Sequence.coordinateSystem");
5445        else if (Configuration.doAutoCreate())
5446          this.coordinateSystem = new IntegerType(); // bb
5447      return this.coordinateSystem;
5448    }
5449
5450    public boolean hasCoordinateSystemElement() { 
5451      return this.coordinateSystem != null && !this.coordinateSystem.isEmpty();
5452    }
5453
5454    public boolean hasCoordinateSystem() { 
5455      return this.coordinateSystem != null && !this.coordinateSystem.isEmpty();
5456    }
5457
5458    /**
5459     * @param value {@link #coordinateSystem} (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).). This is the underlying object with id, value and extensions. The accessor "getCoordinateSystem" gives direct access to the value
5460     */
5461    public Sequence setCoordinateSystemElement(IntegerType value) { 
5462      this.coordinateSystem = value;
5463      return this;
5464    }
5465
5466    /**
5467     * @return 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).
5468     */
5469    public int getCoordinateSystem() { 
5470      return this.coordinateSystem == null || this.coordinateSystem.isEmpty() ? 0 : this.coordinateSystem.getValue();
5471    }
5472
5473    /**
5474     * @param value 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).
5475     */
5476    public Sequence setCoordinateSystem(int value) { 
5477        if (this.coordinateSystem == null)
5478          this.coordinateSystem = new IntegerType();
5479        this.coordinateSystem.setValue(value);
5480      return this;
5481    }
5482
5483    /**
5484     * @return {@link #patient} (The patient whose sequencing results are described by this resource.)
5485     */
5486    public Reference getPatient() { 
5487      if (this.patient == null)
5488        if (Configuration.errorOnAutoCreate())
5489          throw new Error("Attempt to auto-create Sequence.patient");
5490        else if (Configuration.doAutoCreate())
5491          this.patient = new Reference(); // cc
5492      return this.patient;
5493    }
5494
5495    public boolean hasPatient() { 
5496      return this.patient != null && !this.patient.isEmpty();
5497    }
5498
5499    /**
5500     * @param value {@link #patient} (The patient whose sequencing results are described by this resource.)
5501     */
5502    public Sequence setPatient(Reference value) { 
5503      this.patient = value;
5504      return this;
5505    }
5506
5507    /**
5508     * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient whose sequencing results are described by this resource.)
5509     */
5510    public Patient getPatientTarget() { 
5511      if (this.patientTarget == null)
5512        if (Configuration.errorOnAutoCreate())
5513          throw new Error("Attempt to auto-create Sequence.patient");
5514        else if (Configuration.doAutoCreate())
5515          this.patientTarget = new Patient(); // aa
5516      return this.patientTarget;
5517    }
5518
5519    /**
5520     * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient whose sequencing results are described by this resource.)
5521     */
5522    public Sequence setPatientTarget(Patient value) { 
5523      this.patientTarget = value;
5524      return this;
5525    }
5526
5527    /**
5528     * @return {@link #specimen} (Specimen used for sequencing.)
5529     */
5530    public Reference getSpecimen() { 
5531      if (this.specimen == null)
5532        if (Configuration.errorOnAutoCreate())
5533          throw new Error("Attempt to auto-create Sequence.specimen");
5534        else if (Configuration.doAutoCreate())
5535          this.specimen = new Reference(); // cc
5536      return this.specimen;
5537    }
5538
5539    public boolean hasSpecimen() { 
5540      return this.specimen != null && !this.specimen.isEmpty();
5541    }
5542
5543    /**
5544     * @param value {@link #specimen} (Specimen used for sequencing.)
5545     */
5546    public Sequence setSpecimen(Reference value) { 
5547      this.specimen = value;
5548      return this;
5549    }
5550
5551    /**
5552     * @return {@link #specimen} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Specimen used for sequencing.)
5553     */
5554    public Specimen getSpecimenTarget() { 
5555      if (this.specimenTarget == null)
5556        if (Configuration.errorOnAutoCreate())
5557          throw new Error("Attempt to auto-create Sequence.specimen");
5558        else if (Configuration.doAutoCreate())
5559          this.specimenTarget = new Specimen(); // aa
5560      return this.specimenTarget;
5561    }
5562
5563    /**
5564     * @param value {@link #specimen} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Specimen used for sequencing.)
5565     */
5566    public Sequence setSpecimenTarget(Specimen value) { 
5567      this.specimenTarget = value;
5568      return this;
5569    }
5570
5571    /**
5572     * @return {@link #device} (The method for sequencing, for example, chip information.)
5573     */
5574    public Reference getDevice() { 
5575      if (this.device == null)
5576        if (Configuration.errorOnAutoCreate())
5577          throw new Error("Attempt to auto-create Sequence.device");
5578        else if (Configuration.doAutoCreate())
5579          this.device = new Reference(); // cc
5580      return this.device;
5581    }
5582
5583    public boolean hasDevice() { 
5584      return this.device != null && !this.device.isEmpty();
5585    }
5586
5587    /**
5588     * @param value {@link #device} (The method for sequencing, for example, chip information.)
5589     */
5590    public Sequence setDevice(Reference value) { 
5591      this.device = value;
5592      return this;
5593    }
5594
5595    /**
5596     * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The method for sequencing, for example, chip information.)
5597     */
5598    public Device getDeviceTarget() { 
5599      if (this.deviceTarget == null)
5600        if (Configuration.errorOnAutoCreate())
5601          throw new Error("Attempt to auto-create Sequence.device");
5602        else if (Configuration.doAutoCreate())
5603          this.deviceTarget = new Device(); // aa
5604      return this.deviceTarget;
5605    }
5606
5607    /**
5608     * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The method for sequencing, for example, chip information.)
5609     */
5610    public Sequence setDeviceTarget(Device value) { 
5611      this.deviceTarget = value;
5612      return this;
5613    }
5614
5615    /**
5616     * @return {@link #performer} (The organization or lab that should be responsible for this result.)
5617     */
5618    public Reference getPerformer() { 
5619      if (this.performer == null)
5620        if (Configuration.errorOnAutoCreate())
5621          throw new Error("Attempt to auto-create Sequence.performer");
5622        else if (Configuration.doAutoCreate())
5623          this.performer = new Reference(); // cc
5624      return this.performer;
5625    }
5626
5627    public boolean hasPerformer() { 
5628      return this.performer != null && !this.performer.isEmpty();
5629    }
5630
5631    /**
5632     * @param value {@link #performer} (The organization or lab that should be responsible for this result.)
5633     */
5634    public Sequence setPerformer(Reference value) { 
5635      this.performer = value;
5636      return this;
5637    }
5638
5639    /**
5640     * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization or lab that should be responsible for this result.)
5641     */
5642    public Organization getPerformerTarget() { 
5643      if (this.performerTarget == null)
5644        if (Configuration.errorOnAutoCreate())
5645          throw new Error("Attempt to auto-create Sequence.performer");
5646        else if (Configuration.doAutoCreate())
5647          this.performerTarget = new Organization(); // aa
5648      return this.performerTarget;
5649    }
5650
5651    /**
5652     * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization or lab that should be responsible for this result.)
5653     */
5654    public Sequence setPerformerTarget(Organization value) { 
5655      this.performerTarget = value;
5656      return this;
5657    }
5658
5659    /**
5660     * @return {@link #quantity} (The number of copies of the seqeunce of interest. (RNASeq).)
5661     */
5662    public Quantity getQuantity() { 
5663      if (this.quantity == null)
5664        if (Configuration.errorOnAutoCreate())
5665          throw new Error("Attempt to auto-create Sequence.quantity");
5666        else if (Configuration.doAutoCreate())
5667          this.quantity = new Quantity(); // cc
5668      return this.quantity;
5669    }
5670
5671    public boolean hasQuantity() { 
5672      return this.quantity != null && !this.quantity.isEmpty();
5673    }
5674
5675    /**
5676     * @param value {@link #quantity} (The number of copies of the seqeunce of interest. (RNASeq).)
5677     */
5678    public Sequence setQuantity(Quantity value) { 
5679      this.quantity = value;
5680      return this;
5681    }
5682
5683    /**
5684     * @return {@link #referenceSeq} (A sequence that is used as a reference to describe variants that are present in a sequence analyzed.)
5685     */
5686    public SequenceReferenceSeqComponent getReferenceSeq() { 
5687      if (this.referenceSeq == null)
5688        if (Configuration.errorOnAutoCreate())
5689          throw new Error("Attempt to auto-create Sequence.referenceSeq");
5690        else if (Configuration.doAutoCreate())
5691          this.referenceSeq = new SequenceReferenceSeqComponent(); // cc
5692      return this.referenceSeq;
5693    }
5694
5695    public boolean hasReferenceSeq() { 
5696      return this.referenceSeq != null && !this.referenceSeq.isEmpty();
5697    }
5698
5699    /**
5700     * @param value {@link #referenceSeq} (A sequence that is used as a reference to describe variants that are present in a sequence analyzed.)
5701     */
5702    public Sequence setReferenceSeq(SequenceReferenceSeqComponent value) { 
5703      this.referenceSeq = value;
5704      return this;
5705    }
5706
5707    /**
5708     * @return {@link #variant} (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.)
5709     */
5710    public List<SequenceVariantComponent> getVariant() { 
5711      if (this.variant == null)
5712        this.variant = new ArrayList<SequenceVariantComponent>();
5713      return this.variant;
5714    }
5715
5716    /**
5717     * @return Returns a reference to <code>this</code> for easy method chaining
5718     */
5719    public Sequence setVariant(List<SequenceVariantComponent> theVariant) { 
5720      this.variant = theVariant;
5721      return this;
5722    }
5723
5724    public boolean hasVariant() { 
5725      if (this.variant == null)
5726        return false;
5727      for (SequenceVariantComponent item : this.variant)
5728        if (!item.isEmpty())
5729          return true;
5730      return false;
5731    }
5732
5733    public SequenceVariantComponent addVariant() { //3
5734      SequenceVariantComponent t = new SequenceVariantComponent();
5735      if (this.variant == null)
5736        this.variant = new ArrayList<SequenceVariantComponent>();
5737      this.variant.add(t);
5738      return t;
5739    }
5740
5741    public Sequence addVariant(SequenceVariantComponent t) { //3
5742      if (t == null)
5743        return this;
5744      if (this.variant == null)
5745        this.variant = new ArrayList<SequenceVariantComponent>();
5746      this.variant.add(t);
5747      return this;
5748    }
5749
5750    /**
5751     * @return The first repetition of repeating field {@link #variant}, creating it if it does not already exist
5752     */
5753    public SequenceVariantComponent getVariantFirstRep() { 
5754      if (getVariant().isEmpty()) {
5755        addVariant();
5756      }
5757      return getVariant().get(0);
5758    }
5759
5760    /**
5761     * @return {@link #observedSeq} (Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value
5762     */
5763    public StringType getObservedSeqElement() { 
5764      if (this.observedSeq == null)
5765        if (Configuration.errorOnAutoCreate())
5766          throw new Error("Attempt to auto-create Sequence.observedSeq");
5767        else if (Configuration.doAutoCreate())
5768          this.observedSeq = new StringType(); // bb
5769      return this.observedSeq;
5770    }
5771
5772    public boolean hasObservedSeqElement() { 
5773      return this.observedSeq != null && !this.observedSeq.isEmpty();
5774    }
5775
5776    public boolean hasObservedSeq() { 
5777      return this.observedSeq != null && !this.observedSeq.isEmpty();
5778    }
5779
5780    /**
5781     * @param value {@link #observedSeq} (Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value
5782     */
5783    public Sequence setObservedSeqElement(StringType value) { 
5784      this.observedSeq = value;
5785      return this;
5786    }
5787
5788    /**
5789     * @return Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.
5790     */
5791    public String getObservedSeq() { 
5792      return this.observedSeq == null ? null : this.observedSeq.getValue();
5793    }
5794
5795    /**
5796     * @param value Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.
5797     */
5798    public Sequence setObservedSeq(String value) { 
5799      if (Utilities.noString(value))
5800        this.observedSeq = null;
5801      else {
5802        if (this.observedSeq == null)
5803          this.observedSeq = new StringType();
5804        this.observedSeq.setValue(value);
5805      }
5806      return this;
5807    }
5808
5809    /**
5810     * @return {@link #quality} (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)).)
5811     */
5812    public List<SequenceQualityComponent> getQuality() { 
5813      if (this.quality == null)
5814        this.quality = new ArrayList<SequenceQualityComponent>();
5815      return this.quality;
5816    }
5817
5818    /**
5819     * @return Returns a reference to <code>this</code> for easy method chaining
5820     */
5821    public Sequence setQuality(List<SequenceQualityComponent> theQuality) { 
5822      this.quality = theQuality;
5823      return this;
5824    }
5825
5826    public boolean hasQuality() { 
5827      if (this.quality == null)
5828        return false;
5829      for (SequenceQualityComponent item : this.quality)
5830        if (!item.isEmpty())
5831          return true;
5832      return false;
5833    }
5834
5835    public SequenceQualityComponent addQuality() { //3
5836      SequenceQualityComponent t = new SequenceQualityComponent();
5837      if (this.quality == null)
5838        this.quality = new ArrayList<SequenceQualityComponent>();
5839      this.quality.add(t);
5840      return t;
5841    }
5842
5843    public Sequence addQuality(SequenceQualityComponent t) { //3
5844      if (t == null)
5845        return this;
5846      if (this.quality == null)
5847        this.quality = new ArrayList<SequenceQualityComponent>();
5848      this.quality.add(t);
5849      return this;
5850    }
5851
5852    /**
5853     * @return The first repetition of repeating field {@link #quality}, creating it if it does not already exist
5854     */
5855    public SequenceQualityComponent getQualityFirstRep() { 
5856      if (getQuality().isEmpty()) {
5857        addQuality();
5858      }
5859      return getQuality().get(0);
5860    }
5861
5862    /**
5863     * @return {@link #readCoverage} (Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.). This is the underlying object with id, value and extensions. The accessor "getReadCoverage" gives direct access to the value
5864     */
5865    public IntegerType getReadCoverageElement() { 
5866      if (this.readCoverage == null)
5867        if (Configuration.errorOnAutoCreate())
5868          throw new Error("Attempt to auto-create Sequence.readCoverage");
5869        else if (Configuration.doAutoCreate())
5870          this.readCoverage = new IntegerType(); // bb
5871      return this.readCoverage;
5872    }
5873
5874    public boolean hasReadCoverageElement() { 
5875      return this.readCoverage != null && !this.readCoverage.isEmpty();
5876    }
5877
5878    public boolean hasReadCoverage() { 
5879      return this.readCoverage != null && !this.readCoverage.isEmpty();
5880    }
5881
5882    /**
5883     * @param value {@link #readCoverage} (Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.). This is the underlying object with id, value and extensions. The accessor "getReadCoverage" gives direct access to the value
5884     */
5885    public Sequence setReadCoverageElement(IntegerType value) { 
5886      this.readCoverage = value;
5887      return this;
5888    }
5889
5890    /**
5891     * @return Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.
5892     */
5893    public int getReadCoverage() { 
5894      return this.readCoverage == null || this.readCoverage.isEmpty() ? 0 : this.readCoverage.getValue();
5895    }
5896
5897    /**
5898     * @param value Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.
5899     */
5900    public Sequence setReadCoverage(int value) { 
5901        if (this.readCoverage == null)
5902          this.readCoverage = new IntegerType();
5903        this.readCoverage.setValue(value);
5904      return this;
5905    }
5906
5907    /**
5908     * @return {@link #repository} (Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.)
5909     */
5910    public List<SequenceRepositoryComponent> getRepository() { 
5911      if (this.repository == null)
5912        this.repository = new ArrayList<SequenceRepositoryComponent>();
5913      return this.repository;
5914    }
5915
5916    /**
5917     * @return Returns a reference to <code>this</code> for easy method chaining
5918     */
5919    public Sequence setRepository(List<SequenceRepositoryComponent> theRepository) { 
5920      this.repository = theRepository;
5921      return this;
5922    }
5923
5924    public boolean hasRepository() { 
5925      if (this.repository == null)
5926        return false;
5927      for (SequenceRepositoryComponent item : this.repository)
5928        if (!item.isEmpty())
5929          return true;
5930      return false;
5931    }
5932
5933    public SequenceRepositoryComponent addRepository() { //3
5934      SequenceRepositoryComponent t = new SequenceRepositoryComponent();
5935      if (this.repository == null)
5936        this.repository = new ArrayList<SequenceRepositoryComponent>();
5937      this.repository.add(t);
5938      return t;
5939    }
5940
5941    public Sequence addRepository(SequenceRepositoryComponent t) { //3
5942      if (t == null)
5943        return this;
5944      if (this.repository == null)
5945        this.repository = new ArrayList<SequenceRepositoryComponent>();
5946      this.repository.add(t);
5947      return this;
5948    }
5949
5950    /**
5951     * @return The first repetition of repeating field {@link #repository}, creating it if it does not already exist
5952     */
5953    public SequenceRepositoryComponent getRepositoryFirstRep() { 
5954      if (getRepository().isEmpty()) {
5955        addRepository();
5956      }
5957      return getRepository().get(0);
5958    }
5959
5960    /**
5961     * @return {@link #pointer} (Pointer to next atomic sequence which at most contains one variant.)
5962     */
5963    public List<Reference> getPointer() { 
5964      if (this.pointer == null)
5965        this.pointer = new ArrayList<Reference>();
5966      return this.pointer;
5967    }
5968
5969    /**
5970     * @return Returns a reference to <code>this</code> for easy method chaining
5971     */
5972    public Sequence setPointer(List<Reference> thePointer) { 
5973      this.pointer = thePointer;
5974      return this;
5975    }
5976
5977    public boolean hasPointer() { 
5978      if (this.pointer == null)
5979        return false;
5980      for (Reference item : this.pointer)
5981        if (!item.isEmpty())
5982          return true;
5983      return false;
5984    }
5985
5986    public Reference addPointer() { //3
5987      Reference t = new Reference();
5988      if (this.pointer == null)
5989        this.pointer = new ArrayList<Reference>();
5990      this.pointer.add(t);
5991      return t;
5992    }
5993
5994    public Sequence addPointer(Reference t) { //3
5995      if (t == null)
5996        return this;
5997      if (this.pointer == null)
5998        this.pointer = new ArrayList<Reference>();
5999      this.pointer.add(t);
6000      return this;
6001    }
6002
6003    /**
6004     * @return The first repetition of repeating field {@link #pointer}, creating it if it does not already exist
6005     */
6006    public Reference getPointerFirstRep() { 
6007      if (getPointer().isEmpty()) {
6008        addPointer();
6009      }
6010      return getPointer().get(0);
6011    }
6012
6013    /**
6014     * @deprecated Use Reference#setResource(IBaseResource) instead
6015     */
6016    @Deprecated
6017    public List<Sequence> getPointerTarget() { 
6018      if (this.pointerTarget == null)
6019        this.pointerTarget = new ArrayList<Sequence>();
6020      return this.pointerTarget;
6021    }
6022
6023    /**
6024     * @deprecated Use Reference#setResource(IBaseResource) instead
6025     */
6026    @Deprecated
6027    public Sequence addPointerTarget() { 
6028      Sequence r = new Sequence();
6029      if (this.pointerTarget == null)
6030        this.pointerTarget = new ArrayList<Sequence>();
6031      this.pointerTarget.add(r);
6032      return r;
6033    }
6034
6035    /**
6036     * @return {@link #structureVariant} (Information about chromosome structure variation.)
6037     */
6038    public List<SequenceStructureVariantComponent> getStructureVariant() { 
6039      if (this.structureVariant == null)
6040        this.structureVariant = new ArrayList<SequenceStructureVariantComponent>();
6041      return this.structureVariant;
6042    }
6043
6044    /**
6045     * @return Returns a reference to <code>this</code> for easy method chaining
6046     */
6047    public Sequence setStructureVariant(List<SequenceStructureVariantComponent> theStructureVariant) { 
6048      this.structureVariant = theStructureVariant;
6049      return this;
6050    }
6051
6052    public boolean hasStructureVariant() { 
6053      if (this.structureVariant == null)
6054        return false;
6055      for (SequenceStructureVariantComponent item : this.structureVariant)
6056        if (!item.isEmpty())
6057          return true;
6058      return false;
6059    }
6060
6061    public SequenceStructureVariantComponent addStructureVariant() { //3
6062      SequenceStructureVariantComponent t = new SequenceStructureVariantComponent();
6063      if (this.structureVariant == null)
6064        this.structureVariant = new ArrayList<SequenceStructureVariantComponent>();
6065      this.structureVariant.add(t);
6066      return t;
6067    }
6068
6069    public Sequence addStructureVariant(SequenceStructureVariantComponent t) { //3
6070      if (t == null)
6071        return this;
6072      if (this.structureVariant == null)
6073        this.structureVariant = new ArrayList<SequenceStructureVariantComponent>();
6074      this.structureVariant.add(t);
6075      return this;
6076    }
6077
6078    /**
6079     * @return The first repetition of repeating field {@link #structureVariant}, creating it if it does not already exist
6080     */
6081    public SequenceStructureVariantComponent getStructureVariantFirstRep() { 
6082      if (getStructureVariant().isEmpty()) {
6083        addStructureVariant();
6084      }
6085      return getStructureVariant().get(0);
6086    }
6087
6088      protected void listChildren(List<Property> children) {
6089        super.listChildren(children);
6090        children.add(new Property("identifier", "Identifier", "A unique identifier for this particular sequence instance. This is a FHIR-defined id.", 0, java.lang.Integer.MAX_VALUE, identifier));
6091        children.add(new Property("type", "code", "Amino Acid Sequence/ DNA Sequence / RNA Sequence.", 0, 1, type));
6092        children.add(new Property("coordinateSystem", "integer", "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).", 0, 1, coordinateSystem));
6093        children.add(new Property("patient", "Reference(Patient)", "The patient whose sequencing results are described by this resource.", 0, 1, patient));
6094        children.add(new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, 1, specimen));
6095        children.add(new Property("device", "Reference(Device)", "The method for sequencing, for example, chip information.", 0, 1, device));
6096        children.add(new Property("performer", "Reference(Organization)", "The organization or lab that should be responsible for this result.", 0, 1, performer));
6097        children.add(new Property("quantity", "Quantity", "The number of copies of the seqeunce of interest. (RNASeq).", 0, 1, quantity));
6098        children.add(new Property("referenceSeq", "", "A sequence that is used as a reference to describe variants that are present in a sequence analyzed.", 0, 1, referenceSeq));
6099        children.add(new Property("variant", "", "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.", 0, java.lang.Integer.MAX_VALUE, variant));
6100        children.add(new Property("observedSeq", "string", "Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.", 0, 1, observedSeq));
6101        children.add(new Property("quality", "", "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)).", 0, java.lang.Integer.MAX_VALUE, quality));
6102        children.add(new Property("readCoverage", "integer", "Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.", 0, 1, readCoverage));
6103        children.add(new Property("repository", "", "Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.", 0, java.lang.Integer.MAX_VALUE, repository));
6104        children.add(new Property("pointer", "Reference(Sequence)", "Pointer to next atomic sequence which at most contains one variant.", 0, java.lang.Integer.MAX_VALUE, pointer));
6105        children.add(new Property("structureVariant", "", "Information about chromosome structure variation.", 0, java.lang.Integer.MAX_VALUE, structureVariant));
6106      }
6107
6108      @Override
6109      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6110        switch (_hash) {
6111        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier for this particular sequence instance. This is a FHIR-defined id.", 0, java.lang.Integer.MAX_VALUE, identifier);
6112        case 3575610: /*type*/  return new Property("type", "code", "Amino Acid Sequence/ DNA Sequence / RNA Sequence.", 0, 1, type);
6113        case 354212295: /*coordinateSystem*/  return new Property("coordinateSystem", "integer", "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).", 0, 1, coordinateSystem);
6114        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The patient whose sequencing results are described by this resource.", 0, 1, patient);
6115        case -2132868344: /*specimen*/  return new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, 1, specimen);
6116        case -1335157162: /*device*/  return new Property("device", "Reference(Device)", "The method for sequencing, for example, chip information.", 0, 1, device);
6117        case 481140686: /*performer*/  return new Property("performer", "Reference(Organization)", "The organization or lab that should be responsible for this result.", 0, 1, performer);
6118        case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "The number of copies of the seqeunce of interest. (RNASeq).", 0, 1, quantity);
6119        case -502547180: /*referenceSeq*/  return new Property("referenceSeq", "", "A sequence that is used as a reference to describe variants that are present in a sequence analyzed.", 0, 1, referenceSeq);
6120        case 236785797: /*variant*/  return new Property("variant", "", "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.", 0, java.lang.Integer.MAX_VALUE, variant);
6121        case 125541495: /*observedSeq*/  return new Property("observedSeq", "string", "Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall starts from referenceSeq.windowStart and end by referenceSeq.windowEnd.", 0, 1, observedSeq);
6122        case 651215103: /*quality*/  return new Property("quality", "", "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)).", 0, java.lang.Integer.MAX_VALUE, quality);
6123        case -1798816354: /*readCoverage*/  return new Property("readCoverage", "integer", "Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.", 0, 1, readCoverage);
6124        case 1950800714: /*repository*/  return new Property("repository", "", "Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.", 0, java.lang.Integer.MAX_VALUE, repository);
6125        case -400605635: /*pointer*/  return new Property("pointer", "Reference(Sequence)", "Pointer to next atomic sequence which at most contains one variant.", 0, java.lang.Integer.MAX_VALUE, pointer);
6126        case 757269394: /*structureVariant*/  return new Property("structureVariant", "", "Information about chromosome structure variation.", 0, java.lang.Integer.MAX_VALUE, structureVariant);
6127        default: return super.getNamedProperty(_hash, _name, _checkValid);
6128        }
6129
6130      }
6131
6132      @Override
6133      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6134        switch (hash) {
6135        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
6136        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<SequenceType>
6137        case 354212295: /*coordinateSystem*/ return this.coordinateSystem == null ? new Base[0] : new Base[] {this.coordinateSystem}; // IntegerType
6138        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
6139        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : new Base[] {this.specimen}; // Reference
6140        case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference
6141        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference
6142        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
6143        case -502547180: /*referenceSeq*/ return this.referenceSeq == null ? new Base[0] : new Base[] {this.referenceSeq}; // SequenceReferenceSeqComponent
6144        case 236785797: /*variant*/ return this.variant == null ? new Base[0] : this.variant.toArray(new Base[this.variant.size()]); // SequenceVariantComponent
6145        case 125541495: /*observedSeq*/ return this.observedSeq == null ? new Base[0] : new Base[] {this.observedSeq}; // StringType
6146        case 651215103: /*quality*/ return this.quality == null ? new Base[0] : this.quality.toArray(new Base[this.quality.size()]); // SequenceQualityComponent
6147        case -1798816354: /*readCoverage*/ return this.readCoverage == null ? new Base[0] : new Base[] {this.readCoverage}; // IntegerType
6148        case 1950800714: /*repository*/ return this.repository == null ? new Base[0] : this.repository.toArray(new Base[this.repository.size()]); // SequenceRepositoryComponent
6149        case -400605635: /*pointer*/ return this.pointer == null ? new Base[0] : this.pointer.toArray(new Base[this.pointer.size()]); // Reference
6150        case 757269394: /*structureVariant*/ return this.structureVariant == null ? new Base[0] : this.structureVariant.toArray(new Base[this.structureVariant.size()]); // SequenceStructureVariantComponent
6151        default: return super.getProperty(hash, name, checkValid);
6152        }
6153
6154      }
6155
6156      @Override
6157      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6158        switch (hash) {
6159        case -1618432855: // identifier
6160          this.getIdentifier().add(castToIdentifier(value)); // Identifier
6161          return value;
6162        case 3575610: // type
6163          value = new SequenceTypeEnumFactory().fromType(castToCode(value));
6164          this.type = (Enumeration) value; // Enumeration<SequenceType>
6165          return value;
6166        case 354212295: // coordinateSystem
6167          this.coordinateSystem = castToInteger(value); // IntegerType
6168          return value;
6169        case -791418107: // patient
6170          this.patient = castToReference(value); // Reference
6171          return value;
6172        case -2132868344: // specimen
6173          this.specimen = castToReference(value); // Reference
6174          return value;
6175        case -1335157162: // device
6176          this.device = castToReference(value); // Reference
6177          return value;
6178        case 481140686: // performer
6179          this.performer = castToReference(value); // Reference
6180          return value;
6181        case -1285004149: // quantity
6182          this.quantity = castToQuantity(value); // Quantity
6183          return value;
6184        case -502547180: // referenceSeq
6185          this.referenceSeq = (SequenceReferenceSeqComponent) value; // SequenceReferenceSeqComponent
6186          return value;
6187        case 236785797: // variant
6188          this.getVariant().add((SequenceVariantComponent) value); // SequenceVariantComponent
6189          return value;
6190        case 125541495: // observedSeq
6191          this.observedSeq = castToString(value); // StringType
6192          return value;
6193        case 651215103: // quality
6194          this.getQuality().add((SequenceQualityComponent) value); // SequenceQualityComponent
6195          return value;
6196        case -1798816354: // readCoverage
6197          this.readCoverage = castToInteger(value); // IntegerType
6198          return value;
6199        case 1950800714: // repository
6200          this.getRepository().add((SequenceRepositoryComponent) value); // SequenceRepositoryComponent
6201          return value;
6202        case -400605635: // pointer
6203          this.getPointer().add(castToReference(value)); // Reference
6204          return value;
6205        case 757269394: // structureVariant
6206          this.getStructureVariant().add((SequenceStructureVariantComponent) value); // SequenceStructureVariantComponent
6207          return value;
6208        default: return super.setProperty(hash, name, value);
6209        }
6210
6211      }
6212
6213      @Override
6214      public Base setProperty(String name, Base value) throws FHIRException {
6215        if (name.equals("identifier")) {
6216          this.getIdentifier().add(castToIdentifier(value));
6217        } else if (name.equals("type")) {
6218          value = new SequenceTypeEnumFactory().fromType(castToCode(value));
6219          this.type = (Enumeration) value; // Enumeration<SequenceType>
6220        } else if (name.equals("coordinateSystem")) {
6221          this.coordinateSystem = castToInteger(value); // IntegerType
6222        } else if (name.equals("patient")) {
6223          this.patient = castToReference(value); // Reference
6224        } else if (name.equals("specimen")) {
6225          this.specimen = castToReference(value); // Reference
6226        } else if (name.equals("device")) {
6227          this.device = castToReference(value); // Reference
6228        } else if (name.equals("performer")) {
6229          this.performer = castToReference(value); // Reference
6230        } else if (name.equals("quantity")) {
6231          this.quantity = castToQuantity(value); // Quantity
6232        } else if (name.equals("referenceSeq")) {
6233          this.referenceSeq = (SequenceReferenceSeqComponent) value; // SequenceReferenceSeqComponent
6234        } else if (name.equals("variant")) {
6235          this.getVariant().add((SequenceVariantComponent) value);
6236        } else if (name.equals("observedSeq")) {
6237          this.observedSeq = castToString(value); // StringType
6238        } else if (name.equals("quality")) {
6239          this.getQuality().add((SequenceQualityComponent) value);
6240        } else if (name.equals("readCoverage")) {
6241          this.readCoverage = castToInteger(value); // IntegerType
6242        } else if (name.equals("repository")) {
6243          this.getRepository().add((SequenceRepositoryComponent) value);
6244        } else if (name.equals("pointer")) {
6245          this.getPointer().add(castToReference(value));
6246        } else if (name.equals("structureVariant")) {
6247          this.getStructureVariant().add((SequenceStructureVariantComponent) value);
6248        } else
6249          return super.setProperty(name, value);
6250        return value;
6251      }
6252
6253      @Override
6254      public Base makeProperty(int hash, String name) throws FHIRException {
6255        switch (hash) {
6256        case -1618432855:  return addIdentifier(); 
6257        case 3575610:  return getTypeElement();
6258        case 354212295:  return getCoordinateSystemElement();
6259        case -791418107:  return getPatient(); 
6260        case -2132868344:  return getSpecimen(); 
6261        case -1335157162:  return getDevice(); 
6262        case 481140686:  return getPerformer(); 
6263        case -1285004149:  return getQuantity(); 
6264        case -502547180:  return getReferenceSeq(); 
6265        case 236785797:  return addVariant(); 
6266        case 125541495:  return getObservedSeqElement();
6267        case 651215103:  return addQuality(); 
6268        case -1798816354:  return getReadCoverageElement();
6269        case 1950800714:  return addRepository(); 
6270        case -400605635:  return addPointer(); 
6271        case 757269394:  return addStructureVariant(); 
6272        default: return super.makeProperty(hash, name);
6273        }
6274
6275      }
6276
6277      @Override
6278      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6279        switch (hash) {
6280        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
6281        case 3575610: /*type*/ return new String[] {"code"};
6282        case 354212295: /*coordinateSystem*/ return new String[] {"integer"};
6283        case -791418107: /*patient*/ return new String[] {"Reference"};
6284        case -2132868344: /*specimen*/ return new String[] {"Reference"};
6285        case -1335157162: /*device*/ return new String[] {"Reference"};
6286        case 481140686: /*performer*/ return new String[] {"Reference"};
6287        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
6288        case -502547180: /*referenceSeq*/ return new String[] {};
6289        case 236785797: /*variant*/ return new String[] {};
6290        case 125541495: /*observedSeq*/ return new String[] {"string"};
6291        case 651215103: /*quality*/ return new String[] {};
6292        case -1798816354: /*readCoverage*/ return new String[] {"integer"};
6293        case 1950800714: /*repository*/ return new String[] {};
6294        case -400605635: /*pointer*/ return new String[] {"Reference"};
6295        case 757269394: /*structureVariant*/ return new String[] {};
6296        default: return super.getTypesForProperty(hash, name);
6297        }
6298
6299      }
6300
6301      @Override
6302      public Base addChild(String name) throws FHIRException {
6303        if (name.equals("identifier")) {
6304          return addIdentifier();
6305        }
6306        else if (name.equals("type")) {
6307          throw new FHIRException("Cannot call addChild on a primitive type Sequence.type");
6308        }
6309        else if (name.equals("coordinateSystem")) {
6310          throw new FHIRException("Cannot call addChild on a primitive type Sequence.coordinateSystem");
6311        }
6312        else if (name.equals("patient")) {
6313          this.patient = new Reference();
6314          return this.patient;
6315        }
6316        else if (name.equals("specimen")) {
6317          this.specimen = new Reference();
6318          return this.specimen;
6319        }
6320        else if (name.equals("device")) {
6321          this.device = new Reference();
6322          return this.device;
6323        }
6324        else if (name.equals("performer")) {
6325          this.performer = new Reference();
6326          return this.performer;
6327        }
6328        else if (name.equals("quantity")) {
6329          this.quantity = new Quantity();
6330          return this.quantity;
6331        }
6332        else if (name.equals("referenceSeq")) {
6333          this.referenceSeq = new SequenceReferenceSeqComponent();
6334          return this.referenceSeq;
6335        }
6336        else if (name.equals("variant")) {
6337          return addVariant();
6338        }
6339        else if (name.equals("observedSeq")) {
6340          throw new FHIRException("Cannot call addChild on a primitive type Sequence.observedSeq");
6341        }
6342        else if (name.equals("quality")) {
6343          return addQuality();
6344        }
6345        else if (name.equals("readCoverage")) {
6346          throw new FHIRException("Cannot call addChild on a primitive type Sequence.readCoverage");
6347        }
6348        else if (name.equals("repository")) {
6349          return addRepository();
6350        }
6351        else if (name.equals("pointer")) {
6352          return addPointer();
6353        }
6354        else if (name.equals("structureVariant")) {
6355          return addStructureVariant();
6356        }
6357        else
6358          return super.addChild(name);
6359      }
6360
6361  public String fhirType() {
6362    return "Sequence";
6363
6364  }
6365
6366      public Sequence copy() {
6367        Sequence dst = new Sequence();
6368        copyValues(dst);
6369        if (identifier != null) {
6370          dst.identifier = new ArrayList<Identifier>();
6371          for (Identifier i : identifier)
6372            dst.identifier.add(i.copy());
6373        };
6374        dst.type = type == null ? null : type.copy();
6375        dst.coordinateSystem = coordinateSystem == null ? null : coordinateSystem.copy();
6376        dst.patient = patient == null ? null : patient.copy();
6377        dst.specimen = specimen == null ? null : specimen.copy();
6378        dst.device = device == null ? null : device.copy();
6379        dst.performer = performer == null ? null : performer.copy();
6380        dst.quantity = quantity == null ? null : quantity.copy();
6381        dst.referenceSeq = referenceSeq == null ? null : referenceSeq.copy();
6382        if (variant != null) {
6383          dst.variant = new ArrayList<SequenceVariantComponent>();
6384          for (SequenceVariantComponent i : variant)
6385            dst.variant.add(i.copy());
6386        };
6387        dst.observedSeq = observedSeq == null ? null : observedSeq.copy();
6388        if (quality != null) {
6389          dst.quality = new ArrayList<SequenceQualityComponent>();
6390          for (SequenceQualityComponent i : quality)
6391            dst.quality.add(i.copy());
6392        };
6393        dst.readCoverage = readCoverage == null ? null : readCoverage.copy();
6394        if (repository != null) {
6395          dst.repository = new ArrayList<SequenceRepositoryComponent>();
6396          for (SequenceRepositoryComponent i : repository)
6397            dst.repository.add(i.copy());
6398        };
6399        if (pointer != null) {
6400          dst.pointer = new ArrayList<Reference>();
6401          for (Reference i : pointer)
6402            dst.pointer.add(i.copy());
6403        };
6404        if (structureVariant != null) {
6405          dst.structureVariant = new ArrayList<SequenceStructureVariantComponent>();
6406          for (SequenceStructureVariantComponent i : structureVariant)
6407            dst.structureVariant.add(i.copy());
6408        };
6409        return dst;
6410      }
6411
6412      protected Sequence typedCopy() {
6413        return copy();
6414      }
6415
6416      @Override
6417      public boolean equalsDeep(Base other_) {
6418        if (!super.equalsDeep(other_))
6419          return false;
6420        if (!(other_ instanceof Sequence))
6421          return false;
6422        Sequence o = (Sequence) other_;
6423        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(coordinateSystem, o.coordinateSystem, true)
6424           && compareDeep(patient, o.patient, true) && compareDeep(specimen, o.specimen, true) && compareDeep(device, o.device, true)
6425           && compareDeep(performer, o.performer, true) && compareDeep(quantity, o.quantity, true) && compareDeep(referenceSeq, o.referenceSeq, true)
6426           && compareDeep(variant, o.variant, true) && compareDeep(observedSeq, o.observedSeq, true) && compareDeep(quality, o.quality, true)
6427           && compareDeep(readCoverage, o.readCoverage, true) && compareDeep(repository, o.repository, true)
6428           && compareDeep(pointer, o.pointer, true) && compareDeep(structureVariant, o.structureVariant, true)
6429          ;
6430      }
6431
6432      @Override
6433      public boolean equalsShallow(Base other_) {
6434        if (!super.equalsShallow(other_))
6435          return false;
6436        if (!(other_ instanceof Sequence))
6437          return false;
6438        Sequence o = (Sequence) other_;
6439        return compareValues(type, o.type, true) && compareValues(coordinateSystem, o.coordinateSystem, true)
6440           && compareValues(observedSeq, o.observedSeq, true) && compareValues(readCoverage, o.readCoverage, true)
6441          ;
6442      }
6443
6444      public boolean isEmpty() {
6445        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, coordinateSystem
6446          , patient, specimen, device, performer, quantity, referenceSeq, variant, observedSeq
6447          , quality, readCoverage, repository, pointer, structureVariant);
6448      }
6449
6450  @Override
6451  public ResourceType getResourceType() {
6452    return ResourceType.Sequence;
6453   }
6454
6455 /**
6456   * Search parameter: <b>identifier</b>
6457   * <p>
6458   * Description: <b>The unique identity for a particular sequence</b><br>
6459   * Type: <b>token</b><br>
6460   * Path: <b>Sequence.identifier</b><br>
6461   * </p>
6462   */
6463  @SearchParamDefinition(name="identifier", path="Sequence.identifier", description="The unique identity for a particular sequence", type="token" )
6464  public static final String SP_IDENTIFIER = "identifier";
6465 /**
6466   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
6467   * <p>
6468   * Description: <b>The unique identity for a particular sequence</b><br>
6469   * Type: <b>token</b><br>
6470   * Path: <b>Sequence.identifier</b><br>
6471   * </p>
6472   */
6473  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
6474
6475 /**
6476   * Search parameter: <b>coordinate</b>
6477   * <p>
6478   * Description: <b>Search parameter for region of the reference DNA sequence string. 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 `coordinate=1$lt345$gt123`, this means it will search for the Sequence resource 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.</b><br>
6479   * Type: <b>composite</b><br>
6480   * Path: <b></b><br>
6481   * </p>
6482   */
6483  @SearchParamDefinition(name="coordinate", path="Sequence.variant", description="Search parameter for region of the reference DNA sequence string. 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 `coordinate=1$lt345$gt123`, this means it will search for the Sequence resource 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={"chromosome", "start"} )
6484  public static final String SP_COORDINATE = "coordinate";
6485 /**
6486   * <b>Fluent Client</b> search parameter constant for <b>coordinate</b>
6487   * <p>
6488   * Description: <b>Search parameter for region of the reference DNA sequence string. 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 `coordinate=1$lt345$gt123`, this means it will search for the Sequence resource 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.</b><br>
6489   * Type: <b>composite</b><br>
6490   * Path: <b></b><br>
6491   * </p>
6492   */
6493  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.NumberClientParam> COORDINATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.NumberClientParam>(SP_COORDINATE);
6494
6495 /**
6496   * Search parameter: <b>patient</b>
6497   * <p>
6498   * Description: <b>The subject that the observation is about</b><br>
6499   * Type: <b>reference</b><br>
6500   * Path: <b>Sequence.patient</b><br>
6501   * </p>
6502   */
6503  @SearchParamDefinition(name="patient", path="Sequence.patient", description="The subject that the observation is about", type="reference", target={Patient.class } )
6504  public static final String SP_PATIENT = "patient";
6505 /**
6506   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
6507   * <p>
6508   * Description: <b>The subject that the observation is about</b><br>
6509   * Type: <b>reference</b><br>
6510   * Path: <b>Sequence.patient</b><br>
6511   * </p>
6512   */
6513  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
6514
6515/**
6516   * Constant for fluent queries to be used to add include statements. Specifies
6517   * the path value of "<b>Sequence:patient</b>".
6518   */
6519  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Sequence:patient").toLocked();
6520
6521 /**
6522   * Search parameter: <b>chromosome</b>
6523   * <p>
6524   * Description: <b>Chromosome number of the reference sequence</b><br>
6525   * Type: <b>token</b><br>
6526   * Path: <b>Sequence.referenceSeq.chromosome</b><br>
6527   * </p>
6528   */
6529  @SearchParamDefinition(name="chromosome", path="Sequence.referenceSeq.chromosome", description="Chromosome number of the reference sequence", type="token" )
6530  public static final String SP_CHROMOSOME = "chromosome";
6531 /**
6532   * <b>Fluent Client</b> search parameter constant for <b>chromosome</b>
6533   * <p>
6534   * Description: <b>Chromosome number of the reference sequence</b><br>
6535   * Type: <b>token</b><br>
6536   * Path: <b>Sequence.referenceSeq.chromosome</b><br>
6537   * </p>
6538   */
6539  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHROMOSOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHROMOSOME);
6540
6541 /**
6542   * Search parameter: <b>start</b>
6543   * <p>
6544   * Description: <b>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.</b><br>
6545   * Type: <b>number</b><br>
6546   * Path: <b>Sequence.referenceSeq.windowStart</b><br>
6547   * </p>
6548   */
6549  @SearchParamDefinition(name="start", path="Sequence.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" )
6550  public static final String SP_START = "start";
6551 /**
6552   * <b>Fluent Client</b> search parameter constant for <b>start</b>
6553   * <p>
6554   * Description: <b>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.</b><br>
6555   * Type: <b>number</b><br>
6556   * Path: <b>Sequence.referenceSeq.windowStart</b><br>
6557   * </p>
6558   */
6559  public static final ca.uhn.fhir.rest.gclient.NumberClientParam START = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_START);
6560
6561 /**
6562   * Search parameter: <b>end</b>
6563   * <p>
6564   * Description: <b>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.</b><br>
6565   * Type: <b>number</b><br>
6566   * Path: <b>Sequence.referenceSeq.windowEnd</b><br>
6567   * </p>
6568   */
6569  @SearchParamDefinition(name="end", path="Sequence.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" )
6570  public static final String SP_END = "end";
6571 /**
6572   * <b>Fluent Client</b> search parameter constant for <b>end</b>
6573   * <p>
6574   * Description: <b>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.</b><br>
6575   * Type: <b>number</b><br>
6576   * Path: <b>Sequence.referenceSeq.windowEnd</b><br>
6577   * </p>
6578   */
6579  public static final ca.uhn.fhir.rest.gclient.NumberClientParam END = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_END);
6580
6581 /**
6582   * Search parameter: <b>type</b>
6583   * <p>
6584   * Description: <b>Amino Acid Sequence/ DNA Sequence / RNA Sequence</b><br>
6585   * Type: <b>token</b><br>
6586   * Path: <b>Sequence.type</b><br>
6587   * </p>
6588   */
6589  @SearchParamDefinition(name="type", path="Sequence.type", description="Amino Acid Sequence/ DNA Sequence / RNA Sequence", type="token" )
6590  public static final String SP_TYPE = "type";
6591 /**
6592   * <b>Fluent Client</b> search parameter constant for <b>type</b>
6593   * <p>
6594   * Description: <b>Amino Acid Sequence/ DNA Sequence / RNA Sequence</b><br>
6595   * Type: <b>token</b><br>
6596   * Path: <b>Sequence.type</b><br>
6597   * </p>
6598   */
6599  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
6600
6601
6602}
6603