001package org.hl7.fhir.dstu3.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 Mon, Apr 17, 2017 17:38-0400 for FHIR v3.0.1
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/Profile/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 QualityType {
161        /**
162         * INDEL Comparison
163         */
164        INDEL, 
165        /**
166         * SNP Comparison
167         */
168        SNP, 
169        /**
170         * UNKNOWN Comparison
171         */
172        UNKNOWN, 
173        /**
174         * added to help the parsers with the generic types
175         */
176        NULL;
177        public static QualityType fromCode(String codeString) throws FHIRException {
178            if (codeString == null || "".equals(codeString))
179                return null;
180        if ("indel".equals(codeString))
181          return INDEL;
182        if ("snp".equals(codeString))
183          return SNP;
184        if ("unknown".equals(codeString))
185          return UNKNOWN;
186        if (Configuration.isAcceptInvalidEnums())
187          return null;
188        else
189          throw new FHIRException("Unknown QualityType code '"+codeString+"'");
190        }
191        public String toCode() {
192          switch (this) {
193            case INDEL: return "indel";
194            case SNP: return "snp";
195            case UNKNOWN: return "unknown";
196            default: return "?";
197          }
198        }
199        public String getSystem() {
200          switch (this) {
201            case INDEL: return "http://hl7.org/fhir/quality-type";
202            case SNP: return "http://hl7.org/fhir/quality-type";
203            case UNKNOWN: return "http://hl7.org/fhir/quality-type";
204            default: return "?";
205          }
206        }
207        public String getDefinition() {
208          switch (this) {
209            case INDEL: return "INDEL Comparison";
210            case SNP: return "SNP Comparison";
211            case UNKNOWN: return "UNKNOWN Comparison";
212            default: return "?";
213          }
214        }
215        public String getDisplay() {
216          switch (this) {
217            case INDEL: return "INDEL Comparison";
218            case SNP: return "SNP Comparison";
219            case UNKNOWN: return "UNKNOWN Comparison";
220            default: return "?";
221          }
222        }
223    }
224
225  public static class QualityTypeEnumFactory implements EnumFactory<QualityType> {
226    public QualityType fromCode(String codeString) throws IllegalArgumentException {
227      if (codeString == null || "".equals(codeString))
228            if (codeString == null || "".equals(codeString))
229                return null;
230        if ("indel".equals(codeString))
231          return QualityType.INDEL;
232        if ("snp".equals(codeString))
233          return QualityType.SNP;
234        if ("unknown".equals(codeString))
235          return QualityType.UNKNOWN;
236        throw new IllegalArgumentException("Unknown QualityType code '"+codeString+"'");
237        }
238        public Enumeration<QualityType> fromType(Base code) throws FHIRException {
239          if (code == null)
240            return null;
241          if (code.isEmpty())
242            return new Enumeration<QualityType>(this);
243          String codeString = ((PrimitiveType) code).asStringValue();
244          if (codeString == null || "".equals(codeString))
245            return null;
246        if ("indel".equals(codeString))
247          return new Enumeration<QualityType>(this, QualityType.INDEL);
248        if ("snp".equals(codeString))
249          return new Enumeration<QualityType>(this, QualityType.SNP);
250        if ("unknown".equals(codeString))
251          return new Enumeration<QualityType>(this, QualityType.UNKNOWN);
252        throw new FHIRException("Unknown QualityType code '"+codeString+"'");
253        }
254    public String toCode(QualityType code) {
255      if (code == QualityType.INDEL)
256        return "indel";
257      if (code == QualityType.SNP)
258        return "snp";
259      if (code == QualityType.UNKNOWN)
260        return "unknown";
261      return "?";
262      }
263    public String toSystem(QualityType code) {
264      return code.getSystem();
265      }
266    }
267
268    public enum RepositoryType {
269        /**
270         * When URL is clicked, the resource can be seen directly (by webpage or by download link format)
271         */
272        DIRECTLINK, 
273        /**
274         * 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)
275         */
276        OPENAPI, 
277        /**
278         * When logged into the website, the resource can be seen.
279         */
280        LOGIN, 
281        /**
282         * When logged in and  follow the API in the website related with URL, the resource can be seen.
283         */
284        OAUTH, 
285        /**
286         * Some other complicated or particular way to get resource from URL.
287         */
288        OTHER, 
289        /**
290         * added to help the parsers with the generic types
291         */
292        NULL;
293        public static RepositoryType fromCode(String codeString) throws FHIRException {
294            if (codeString == null || "".equals(codeString))
295                return null;
296        if ("directlink".equals(codeString))
297          return DIRECTLINK;
298        if ("openapi".equals(codeString))
299          return OPENAPI;
300        if ("login".equals(codeString))
301          return LOGIN;
302        if ("oauth".equals(codeString))
303          return OAUTH;
304        if ("other".equals(codeString))
305          return OTHER;
306        if (Configuration.isAcceptInvalidEnums())
307          return null;
308        else
309          throw new FHIRException("Unknown RepositoryType code '"+codeString+"'");
310        }
311        public String toCode() {
312          switch (this) {
313            case DIRECTLINK: return "directlink";
314            case OPENAPI: return "openapi";
315            case LOGIN: return "login";
316            case OAUTH: return "oauth";
317            case OTHER: return "other";
318            default: return "?";
319          }
320        }
321        public String getSystem() {
322          switch (this) {
323            case DIRECTLINK: return "http://hl7.org/fhir/repository-type";
324            case OPENAPI: return "http://hl7.org/fhir/repository-type";
325            case LOGIN: return "http://hl7.org/fhir/repository-type";
326            case OAUTH: return "http://hl7.org/fhir/repository-type";
327            case OTHER: return "http://hl7.org/fhir/repository-type";
328            default: return "?";
329          }
330        }
331        public String getDefinition() {
332          switch (this) {
333            case DIRECTLINK: return "When URL is clicked, the resource can be seen directly (by webpage or by download link format)";
334            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)";
335            case LOGIN: return "When logged into the website, the resource can be seen.";
336            case OAUTH: return "When logged in and  follow the API in the website related with URL, the resource can be seen.";
337            case OTHER: return "Some other complicated or particular way to get resource from URL.";
338            default: return "?";
339          }
340        }
341        public String getDisplay() {
342          switch (this) {
343            case DIRECTLINK: return "Click and see";
344            case OPENAPI: return "The URL is the RESTful or other kind of API that can access to the result.";
345            case LOGIN: return "Result cannot be access unless an account is logged in";
346            case OAUTH: return "Result need to be fetched with API and need LOGIN( or cookies are required when visiting the link of resource)";
347            case OTHER: return "Some other complicated or particular way to get resource from URL.";
348            default: return "?";
349          }
350        }
351    }
352
353  public static class RepositoryTypeEnumFactory implements EnumFactory<RepositoryType> {
354    public RepositoryType fromCode(String codeString) throws IllegalArgumentException {
355      if (codeString == null || "".equals(codeString))
356            if (codeString == null || "".equals(codeString))
357                return null;
358        if ("directlink".equals(codeString))
359          return RepositoryType.DIRECTLINK;
360        if ("openapi".equals(codeString))
361          return RepositoryType.OPENAPI;
362        if ("login".equals(codeString))
363          return RepositoryType.LOGIN;
364        if ("oauth".equals(codeString))
365          return RepositoryType.OAUTH;
366        if ("other".equals(codeString))
367          return RepositoryType.OTHER;
368        throw new IllegalArgumentException("Unknown RepositoryType code '"+codeString+"'");
369        }
370        public Enumeration<RepositoryType> fromType(Base code) throws FHIRException {
371          if (code == null)
372            return null;
373          if (code.isEmpty())
374            return new Enumeration<RepositoryType>(this);
375          String codeString = ((PrimitiveType) code).asStringValue();
376          if (codeString == null || "".equals(codeString))
377            return null;
378        if ("directlink".equals(codeString))
379          return new Enumeration<RepositoryType>(this, RepositoryType.DIRECTLINK);
380        if ("openapi".equals(codeString))
381          return new Enumeration<RepositoryType>(this, RepositoryType.OPENAPI);
382        if ("login".equals(codeString))
383          return new Enumeration<RepositoryType>(this, RepositoryType.LOGIN);
384        if ("oauth".equals(codeString))
385          return new Enumeration<RepositoryType>(this, RepositoryType.OAUTH);
386        if ("other".equals(codeString))
387          return new Enumeration<RepositoryType>(this, RepositoryType.OTHER);
388        throw new FHIRException("Unknown RepositoryType code '"+codeString+"'");
389        }
390    public String toCode(RepositoryType code) {
391      if (code == RepositoryType.DIRECTLINK)
392        return "directlink";
393      if (code == RepositoryType.OPENAPI)
394        return "openapi";
395      if (code == RepositoryType.LOGIN)
396        return "login";
397      if (code == RepositoryType.OAUTH)
398        return "oauth";
399      if (code == RepositoryType.OTHER)
400        return "other";
401      return "?";
402      }
403    public String toSystem(RepositoryType code) {
404      return code.getSystem();
405      }
406    }
407
408    @Block()
409    public static class SequenceReferenceSeqComponent extends BackboneElement implements IBaseBackboneElement {
410        /**
411         * 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)).
412         */
413        @Child(name = "chromosome", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
414        @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))." )
415        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/chromosome-human")
416        protected CodeableConcept chromosome;
417
418        /**
419         * 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.
420         */
421        @Child(name = "genomeBuild", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
422        @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." )
423        protected StringType genomeBuild;
424
425        /**
426         * 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.
427         */
428        @Child(name = "referenceSeqId", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
429        @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." )
430        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-referenceSeq")
431        protected CodeableConcept referenceSeqId;
432
433        /**
434         * A Pointer to another Sequence entity as reference sequence.
435         */
436        @Child(name = "referenceSeqPointer", type = {Sequence.class}, order=4, min=0, max=1, modifier=false, summary=true)
437        @Description(shortDefinition="A Pointer to another Sequence entity as reference sequence", formalDefinition="A Pointer to another Sequence entity as reference sequence." )
438        protected Reference referenceSeqPointer;
439
440        /**
441         * The actual object that is the target of the reference (A Pointer to another Sequence entity as reference sequence.)
442         */
443        protected Sequence referenceSeqPointerTarget;
444
445        /**
446         * A string like "ACGT".
447         */
448        @Child(name = "referenceSeqString", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
449        @Description(shortDefinition="A string to represent reference sequence", formalDefinition="A string like \"ACGT\"." )
450        protected StringType referenceSeqString;
451
452        /**
453         * Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive  and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative.
454         */
455        @Child(name = "strand", type = {IntegerType.class}, order=6, min=0, max=1, modifier=false, summary=true)
456        @Description(shortDefinition="Directionality of DNA ( +1/-1)", formalDefinition="Directionality of DNA sequence. Available values are \"1\" for the plus strand (5' to 3')/Watson/Sense/positive  and \"-1\" for the minus strand(3' to 5')/Crick/Antisense/negative." )
457        protected IntegerType strand;
458
459        /**
460         * 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.
461         */
462        @Child(name = "windowStart", type = {IntegerType.class}, order=7, min=1, max=1, modifier=false, summary=true)
463        @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." )
464        protected IntegerType windowStart;
465
466        /**
467         * 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.
468         */
469        @Child(name = "windowEnd", type = {IntegerType.class}, order=8, min=1, max=1, modifier=false, summary=true)
470        @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." )
471        protected IntegerType windowEnd;
472
473        private static final long serialVersionUID = -1675617731L;
474
475    /**
476     * Constructor
477     */
478      public SequenceReferenceSeqComponent() {
479        super();
480      }
481
482    /**
483     * Constructor
484     */
485      public SequenceReferenceSeqComponent(IntegerType windowStart, IntegerType windowEnd) {
486        super();
487        this.windowStart = windowStart;
488        this.windowEnd = windowEnd;
489      }
490
491        /**
492         * @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)).)
493         */
494        public CodeableConcept getChromosome() { 
495          if (this.chromosome == null)
496            if (Configuration.errorOnAutoCreate())
497              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.chromosome");
498            else if (Configuration.doAutoCreate())
499              this.chromosome = new CodeableConcept(); // cc
500          return this.chromosome;
501        }
502
503        public boolean hasChromosome() { 
504          return this.chromosome != null && !this.chromosome.isEmpty();
505        }
506
507        /**
508         * @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)).)
509         */
510        public SequenceReferenceSeqComponent setChromosome(CodeableConcept value) { 
511          this.chromosome = value;
512          return this;
513        }
514
515        /**
516         * @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
517         */
518        public StringType getGenomeBuildElement() { 
519          if (this.genomeBuild == null)
520            if (Configuration.errorOnAutoCreate())
521              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.genomeBuild");
522            else if (Configuration.doAutoCreate())
523              this.genomeBuild = new StringType(); // bb
524          return this.genomeBuild;
525        }
526
527        public boolean hasGenomeBuildElement() { 
528          return this.genomeBuild != null && !this.genomeBuild.isEmpty();
529        }
530
531        public boolean hasGenomeBuild() { 
532          return this.genomeBuild != null && !this.genomeBuild.isEmpty();
533        }
534
535        /**
536         * @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
537         */
538        public SequenceReferenceSeqComponent setGenomeBuildElement(StringType value) { 
539          this.genomeBuild = value;
540          return this;
541        }
542
543        /**
544         * @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.
545         */
546        public String getGenomeBuild() { 
547          return this.genomeBuild == null ? null : this.genomeBuild.getValue();
548        }
549
550        /**
551         * @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.
552         */
553        public SequenceReferenceSeqComponent setGenomeBuild(String value) { 
554          if (Utilities.noString(value))
555            this.genomeBuild = null;
556          else {
557            if (this.genomeBuild == null)
558              this.genomeBuild = new StringType();
559            this.genomeBuild.setValue(value);
560          }
561          return this;
562        }
563
564        /**
565         * @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.)
566         */
567        public CodeableConcept getReferenceSeqId() { 
568          if (this.referenceSeqId == null)
569            if (Configuration.errorOnAutoCreate())
570              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqId");
571            else if (Configuration.doAutoCreate())
572              this.referenceSeqId = new CodeableConcept(); // cc
573          return this.referenceSeqId;
574        }
575
576        public boolean hasReferenceSeqId() { 
577          return this.referenceSeqId != null && !this.referenceSeqId.isEmpty();
578        }
579
580        /**
581         * @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.)
582         */
583        public SequenceReferenceSeqComponent setReferenceSeqId(CodeableConcept value) { 
584          this.referenceSeqId = value;
585          return this;
586        }
587
588        /**
589         * @return {@link #referenceSeqPointer} (A Pointer to another Sequence entity as reference sequence.)
590         */
591        public Reference getReferenceSeqPointer() { 
592          if (this.referenceSeqPointer == null)
593            if (Configuration.errorOnAutoCreate())
594              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqPointer");
595            else if (Configuration.doAutoCreate())
596              this.referenceSeqPointer = new Reference(); // cc
597          return this.referenceSeqPointer;
598        }
599
600        public boolean hasReferenceSeqPointer() { 
601          return this.referenceSeqPointer != null && !this.referenceSeqPointer.isEmpty();
602        }
603
604        /**
605         * @param value {@link #referenceSeqPointer} (A Pointer to another Sequence entity as reference sequence.)
606         */
607        public SequenceReferenceSeqComponent setReferenceSeqPointer(Reference value) { 
608          this.referenceSeqPointer = value;
609          return this;
610        }
611
612        /**
613         * @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.)
614         */
615        public Sequence getReferenceSeqPointerTarget() { 
616          if (this.referenceSeqPointerTarget == null)
617            if (Configuration.errorOnAutoCreate())
618              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqPointer");
619            else if (Configuration.doAutoCreate())
620              this.referenceSeqPointerTarget = new Sequence(); // aa
621          return this.referenceSeqPointerTarget;
622        }
623
624        /**
625         * @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.)
626         */
627        public SequenceReferenceSeqComponent setReferenceSeqPointerTarget(Sequence value) { 
628          this.referenceSeqPointerTarget = value;
629          return this;
630        }
631
632        /**
633         * @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
634         */
635        public StringType getReferenceSeqStringElement() { 
636          if (this.referenceSeqString == null)
637            if (Configuration.errorOnAutoCreate())
638              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqString");
639            else if (Configuration.doAutoCreate())
640              this.referenceSeqString = new StringType(); // bb
641          return this.referenceSeqString;
642        }
643
644        public boolean hasReferenceSeqStringElement() { 
645          return this.referenceSeqString != null && !this.referenceSeqString.isEmpty();
646        }
647
648        public boolean hasReferenceSeqString() { 
649          return this.referenceSeqString != null && !this.referenceSeqString.isEmpty();
650        }
651
652        /**
653         * @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
654         */
655        public SequenceReferenceSeqComponent setReferenceSeqStringElement(StringType value) { 
656          this.referenceSeqString = value;
657          return this;
658        }
659
660        /**
661         * @return A string like "ACGT".
662         */
663        public String getReferenceSeqString() { 
664          return this.referenceSeqString == null ? null : this.referenceSeqString.getValue();
665        }
666
667        /**
668         * @param value A string like "ACGT".
669         */
670        public SequenceReferenceSeqComponent setReferenceSeqString(String value) { 
671          if (Utilities.noString(value))
672            this.referenceSeqString = null;
673          else {
674            if (this.referenceSeqString == null)
675              this.referenceSeqString = new StringType();
676            this.referenceSeqString.setValue(value);
677          }
678          return this;
679        }
680
681        /**
682         * @return {@link #strand} (Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive  and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative.). This is the underlying object with id, value and extensions. The accessor "getStrand" gives direct access to the value
683         */
684        public IntegerType getStrandElement() { 
685          if (this.strand == null)
686            if (Configuration.errorOnAutoCreate())
687              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.strand");
688            else if (Configuration.doAutoCreate())
689              this.strand = new IntegerType(); // bb
690          return this.strand;
691        }
692
693        public boolean hasStrandElement() { 
694          return this.strand != null && !this.strand.isEmpty();
695        }
696
697        public boolean hasStrand() { 
698          return this.strand != null && !this.strand.isEmpty();
699        }
700
701        /**
702         * @param value {@link #strand} (Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive  and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative.). This is the underlying object with id, value and extensions. The accessor "getStrand" gives direct access to the value
703         */
704        public SequenceReferenceSeqComponent setStrandElement(IntegerType value) { 
705          this.strand = value;
706          return this;
707        }
708
709        /**
710         * @return Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive  and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative.
711         */
712        public int getStrand() { 
713          return this.strand == null || this.strand.isEmpty() ? 0 : this.strand.getValue();
714        }
715
716        /**
717         * @param value Directionality of DNA sequence. Available values are "1" for the plus strand (5' to 3')/Watson/Sense/positive  and "-1" for the minus strand(3' to 5')/Crick/Antisense/negative.
718         */
719        public SequenceReferenceSeqComponent setStrand(int value) { 
720            if (this.strand == null)
721              this.strand = new IntegerType();
722            this.strand.setValue(value);
723          return this;
724        }
725
726        /**
727         * @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
728         */
729        public IntegerType getWindowStartElement() { 
730          if (this.windowStart == null)
731            if (Configuration.errorOnAutoCreate())
732              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.windowStart");
733            else if (Configuration.doAutoCreate())
734              this.windowStart = new IntegerType(); // bb
735          return this.windowStart;
736        }
737
738        public boolean hasWindowStartElement() { 
739          return this.windowStart != null && !this.windowStart.isEmpty();
740        }
741
742        public boolean hasWindowStart() { 
743          return this.windowStart != null && !this.windowStart.isEmpty();
744        }
745
746        /**
747         * @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
748         */
749        public SequenceReferenceSeqComponent setWindowStartElement(IntegerType value) { 
750          this.windowStart = value;
751          return this;
752        }
753
754        /**
755         * @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.
756         */
757        public int getWindowStart() { 
758          return this.windowStart == null || this.windowStart.isEmpty() ? 0 : this.windowStart.getValue();
759        }
760
761        /**
762         * @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.
763         */
764        public SequenceReferenceSeqComponent setWindowStart(int value) { 
765            if (this.windowStart == null)
766              this.windowStart = new IntegerType();
767            this.windowStart.setValue(value);
768          return this;
769        }
770
771        /**
772         * @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
773         */
774        public IntegerType getWindowEndElement() { 
775          if (this.windowEnd == null)
776            if (Configuration.errorOnAutoCreate())
777              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.windowEnd");
778            else if (Configuration.doAutoCreate())
779              this.windowEnd = new IntegerType(); // bb
780          return this.windowEnd;
781        }
782
783        public boolean hasWindowEndElement() { 
784          return this.windowEnd != null && !this.windowEnd.isEmpty();
785        }
786
787        public boolean hasWindowEnd() { 
788          return this.windowEnd != null && !this.windowEnd.isEmpty();
789        }
790
791        /**
792         * @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
793         */
794        public SequenceReferenceSeqComponent setWindowEndElement(IntegerType value) { 
795          this.windowEnd = value;
796          return this;
797        }
798
799        /**
800         * @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.
801         */
802        public int getWindowEnd() { 
803          return this.windowEnd == null || this.windowEnd.isEmpty() ? 0 : this.windowEnd.getValue();
804        }
805
806        /**
807         * @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.
808         */
809        public SequenceReferenceSeqComponent setWindowEnd(int value) { 
810            if (this.windowEnd == null)
811              this.windowEnd = new IntegerType();
812            this.windowEnd.setValue(value);
813          return this;
814        }
815
816        protected void listChildren(List<Property> childrenList) {
817          super.listChildren(childrenList);
818          childrenList.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, java.lang.Integer.MAX_VALUE, chromosome));
819          childrenList.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, java.lang.Integer.MAX_VALUE, genomeBuild));
820          childrenList.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, java.lang.Integer.MAX_VALUE, referenceSeqId));
821          childrenList.add(new Property("referenceSeqPointer", "Reference(Sequence)", "A Pointer to another Sequence entity as reference sequence.", 0, java.lang.Integer.MAX_VALUE, referenceSeqPointer));
822          childrenList.add(new Property("referenceSeqString", "string", "A string like \"ACGT\".", 0, java.lang.Integer.MAX_VALUE, referenceSeqString));
823          childrenList.add(new Property("strand", "integer", "Directionality of DNA sequence. Available values are \"1\" for the plus strand (5' to 3')/Watson/Sense/positive  and \"-1\" for the minus strand(3' to 5')/Crick/Antisense/negative.", 0, java.lang.Integer.MAX_VALUE, strand));
824          childrenList.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, java.lang.Integer.MAX_VALUE, windowStart));
825          childrenList.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, java.lang.Integer.MAX_VALUE, windowEnd));
826        }
827
828      @Override
829      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
830        switch (hash) {
831        case -1499470472: /*chromosome*/ return this.chromosome == null ? new Base[0] : new Base[] {this.chromosome}; // CodeableConcept
832        case 1061239735: /*genomeBuild*/ return this.genomeBuild == null ? new Base[0] : new Base[] {this.genomeBuild}; // StringType
833        case -1911500465: /*referenceSeqId*/ return this.referenceSeqId == null ? new Base[0] : new Base[] {this.referenceSeqId}; // CodeableConcept
834        case 1923414665: /*referenceSeqPointer*/ return this.referenceSeqPointer == null ? new Base[0] : new Base[] {this.referenceSeqPointer}; // Reference
835        case -1648301499: /*referenceSeqString*/ return this.referenceSeqString == null ? new Base[0] : new Base[] {this.referenceSeqString}; // StringType
836        case -891993594: /*strand*/ return this.strand == null ? new Base[0] : new Base[] {this.strand}; // IntegerType
837        case 1903685202: /*windowStart*/ return this.windowStart == null ? new Base[0] : new Base[] {this.windowStart}; // IntegerType
838        case -217026869: /*windowEnd*/ return this.windowEnd == null ? new Base[0] : new Base[] {this.windowEnd}; // IntegerType
839        default: return super.getProperty(hash, name, checkValid);
840        }
841
842      }
843
844      @Override
845      public Base setProperty(int hash, String name, Base value) throws FHIRException {
846        switch (hash) {
847        case -1499470472: // chromosome
848          this.chromosome = castToCodeableConcept(value); // CodeableConcept
849          return value;
850        case 1061239735: // genomeBuild
851          this.genomeBuild = castToString(value); // StringType
852          return value;
853        case -1911500465: // referenceSeqId
854          this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept
855          return value;
856        case 1923414665: // referenceSeqPointer
857          this.referenceSeqPointer = castToReference(value); // Reference
858          return value;
859        case -1648301499: // referenceSeqString
860          this.referenceSeqString = castToString(value); // StringType
861          return value;
862        case -891993594: // strand
863          this.strand = castToInteger(value); // IntegerType
864          return value;
865        case 1903685202: // windowStart
866          this.windowStart = castToInteger(value); // IntegerType
867          return value;
868        case -217026869: // windowEnd
869          this.windowEnd = castToInteger(value); // IntegerType
870          return value;
871        default: return super.setProperty(hash, name, value);
872        }
873
874      }
875
876      @Override
877      public Base setProperty(String name, Base value) throws FHIRException {
878        if (name.equals("chromosome")) {
879          this.chromosome = castToCodeableConcept(value); // CodeableConcept
880        } else if (name.equals("genomeBuild")) {
881          this.genomeBuild = castToString(value); // StringType
882        } else if (name.equals("referenceSeqId")) {
883          this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept
884        } else if (name.equals("referenceSeqPointer")) {
885          this.referenceSeqPointer = castToReference(value); // Reference
886        } else if (name.equals("referenceSeqString")) {
887          this.referenceSeqString = castToString(value); // StringType
888        } else if (name.equals("strand")) {
889          this.strand = castToInteger(value); // IntegerType
890        } else if (name.equals("windowStart")) {
891          this.windowStart = castToInteger(value); // IntegerType
892        } else if (name.equals("windowEnd")) {
893          this.windowEnd = castToInteger(value); // IntegerType
894        } else
895          return super.setProperty(name, value);
896        return value;
897      }
898
899      @Override
900      public Base makeProperty(int hash, String name) throws FHIRException {
901        switch (hash) {
902        case -1499470472:  return getChromosome(); 
903        case 1061239735:  return getGenomeBuildElement();
904        case -1911500465:  return getReferenceSeqId(); 
905        case 1923414665:  return getReferenceSeqPointer(); 
906        case -1648301499:  return getReferenceSeqStringElement();
907        case -891993594:  return getStrandElement();
908        case 1903685202:  return getWindowStartElement();
909        case -217026869:  return getWindowEndElement();
910        default: return super.makeProperty(hash, name);
911        }
912
913      }
914
915      @Override
916      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
917        switch (hash) {
918        case -1499470472: /*chromosome*/ return new String[] {"CodeableConcept"};
919        case 1061239735: /*genomeBuild*/ return new String[] {"string"};
920        case -1911500465: /*referenceSeqId*/ return new String[] {"CodeableConcept"};
921        case 1923414665: /*referenceSeqPointer*/ return new String[] {"Reference"};
922        case -1648301499: /*referenceSeqString*/ return new String[] {"string"};
923        case -891993594: /*strand*/ return new String[] {"integer"};
924        case 1903685202: /*windowStart*/ return new String[] {"integer"};
925        case -217026869: /*windowEnd*/ return new String[] {"integer"};
926        default: return super.getTypesForProperty(hash, name);
927        }
928
929      }
930
931      @Override
932      public Base addChild(String name) throws FHIRException {
933        if (name.equals("chromosome")) {
934          this.chromosome = new CodeableConcept();
935          return this.chromosome;
936        }
937        else if (name.equals("genomeBuild")) {
938          throw new FHIRException("Cannot call addChild on a primitive type Sequence.genomeBuild");
939        }
940        else if (name.equals("referenceSeqId")) {
941          this.referenceSeqId = new CodeableConcept();
942          return this.referenceSeqId;
943        }
944        else if (name.equals("referenceSeqPointer")) {
945          this.referenceSeqPointer = new Reference();
946          return this.referenceSeqPointer;
947        }
948        else if (name.equals("referenceSeqString")) {
949          throw new FHIRException("Cannot call addChild on a primitive type Sequence.referenceSeqString");
950        }
951        else if (name.equals("strand")) {
952          throw new FHIRException("Cannot call addChild on a primitive type Sequence.strand");
953        }
954        else if (name.equals("windowStart")) {
955          throw new FHIRException("Cannot call addChild on a primitive type Sequence.windowStart");
956        }
957        else if (name.equals("windowEnd")) {
958          throw new FHIRException("Cannot call addChild on a primitive type Sequence.windowEnd");
959        }
960        else
961          return super.addChild(name);
962      }
963
964      public SequenceReferenceSeqComponent copy() {
965        SequenceReferenceSeqComponent dst = new SequenceReferenceSeqComponent();
966        copyValues(dst);
967        dst.chromosome = chromosome == null ? null : chromosome.copy();
968        dst.genomeBuild = genomeBuild == null ? null : genomeBuild.copy();
969        dst.referenceSeqId = referenceSeqId == null ? null : referenceSeqId.copy();
970        dst.referenceSeqPointer = referenceSeqPointer == null ? null : referenceSeqPointer.copy();
971        dst.referenceSeqString = referenceSeqString == null ? null : referenceSeqString.copy();
972        dst.strand = strand == null ? null : strand.copy();
973        dst.windowStart = windowStart == null ? null : windowStart.copy();
974        dst.windowEnd = windowEnd == null ? null : windowEnd.copy();
975        return dst;
976      }
977
978      @Override
979      public boolean equalsDeep(Base other) {
980        if (!super.equalsDeep(other))
981          return false;
982        if (!(other instanceof SequenceReferenceSeqComponent))
983          return false;
984        SequenceReferenceSeqComponent o = (SequenceReferenceSeqComponent) other;
985        return compareDeep(chromosome, o.chromosome, true) && compareDeep(genomeBuild, o.genomeBuild, true)
986           && compareDeep(referenceSeqId, o.referenceSeqId, true) && compareDeep(referenceSeqPointer, o.referenceSeqPointer, true)
987           && compareDeep(referenceSeqString, o.referenceSeqString, true) && compareDeep(strand, o.strand, true)
988           && compareDeep(windowStart, o.windowStart, true) && compareDeep(windowEnd, o.windowEnd, true);
989      }
990
991      @Override
992      public boolean equalsShallow(Base other) {
993        if (!super.equalsShallow(other))
994          return false;
995        if (!(other instanceof SequenceReferenceSeqComponent))
996          return false;
997        SequenceReferenceSeqComponent o = (SequenceReferenceSeqComponent) other;
998        return compareValues(genomeBuild, o.genomeBuild, true) && compareValues(referenceSeqString, o.referenceSeqString, true)
999           && compareValues(strand, o.strand, true) && compareValues(windowStart, o.windowStart, true) && compareValues(windowEnd, o.windowEnd, true)
1000          ;
1001      }
1002
1003      public boolean isEmpty() {
1004        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(chromosome, genomeBuild, referenceSeqId
1005          , referenceSeqPointer, referenceSeqString, strand, windowStart, windowEnd);
1006      }
1007
1008  public String fhirType() {
1009    return "Sequence.referenceSeq";
1010
1011  }
1012
1013  }
1014
1015    @Block()
1016    public static class SequenceVariantComponent extends BackboneElement implements IBaseBackboneElement {
1017        /**
1018         * 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.
1019         */
1020        @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1021        @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." )
1022        protected IntegerType start;
1023
1024        /**
1025         * 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.
1026         */
1027        @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1028        @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." )
1029        protected IntegerType end;
1030
1031        /**
1032         * 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.
1033         */
1034        @Child(name = "observedAllele", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1035        @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." )
1036        protected StringType observedAllele;
1037
1038        /**
1039         * 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.
1040         */
1041        @Child(name = "referenceAllele", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1042        @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." )
1043        protected StringType referenceAllele;
1044
1045        /**
1046         * 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).
1047         */
1048        @Child(name = "cigar", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
1049        @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)." )
1050        protected StringType cigar;
1051
1052        /**
1053         * A pointer to an Observation containing variant information.
1054         */
1055        @Child(name = "variantPointer", type = {Observation.class}, order=6, min=0, max=1, modifier=false, summary=true)
1056        @Description(shortDefinition="Pointer to observed variant information", formalDefinition="A pointer to an Observation containing variant information." )
1057        protected Reference variantPointer;
1058
1059        /**
1060         * The actual object that is the target of the reference (A pointer to an Observation containing variant information.)
1061         */
1062        protected Observation variantPointerTarget;
1063
1064        private static final long serialVersionUID = 105611837L;
1065
1066    /**
1067     * Constructor
1068     */
1069      public SequenceVariantComponent() {
1070        super();
1071      }
1072
1073        /**
1074         * @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
1075         */
1076        public IntegerType getStartElement() { 
1077          if (this.start == null)
1078            if (Configuration.errorOnAutoCreate())
1079              throw new Error("Attempt to auto-create SequenceVariantComponent.start");
1080            else if (Configuration.doAutoCreate())
1081              this.start = new IntegerType(); // bb
1082          return this.start;
1083        }
1084
1085        public boolean hasStartElement() { 
1086          return this.start != null && !this.start.isEmpty();
1087        }
1088
1089        public boolean hasStart() { 
1090          return this.start != null && !this.start.isEmpty();
1091        }
1092
1093        /**
1094         * @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
1095         */
1096        public SequenceVariantComponent setStartElement(IntegerType value) { 
1097          this.start = value;
1098          return this;
1099        }
1100
1101        /**
1102         * @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.
1103         */
1104        public int getStart() { 
1105          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
1106        }
1107
1108        /**
1109         * @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.
1110         */
1111        public SequenceVariantComponent setStart(int value) { 
1112            if (this.start == null)
1113              this.start = new IntegerType();
1114            this.start.setValue(value);
1115          return this;
1116        }
1117
1118        /**
1119         * @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
1120         */
1121        public IntegerType getEndElement() { 
1122          if (this.end == null)
1123            if (Configuration.errorOnAutoCreate())
1124              throw new Error("Attempt to auto-create SequenceVariantComponent.end");
1125            else if (Configuration.doAutoCreate())
1126              this.end = new IntegerType(); // bb
1127          return this.end;
1128        }
1129
1130        public boolean hasEndElement() { 
1131          return this.end != null && !this.end.isEmpty();
1132        }
1133
1134        public boolean hasEnd() { 
1135          return this.end != null && !this.end.isEmpty();
1136        }
1137
1138        /**
1139         * @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
1140         */
1141        public SequenceVariantComponent setEndElement(IntegerType value) { 
1142          this.end = value;
1143          return this;
1144        }
1145
1146        /**
1147         * @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.
1148         */
1149        public int getEnd() { 
1150          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
1151        }
1152
1153        /**
1154         * @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.
1155         */
1156        public SequenceVariantComponent setEnd(int value) { 
1157            if (this.end == null)
1158              this.end = new IntegerType();
1159            this.end.setValue(value);
1160          return this;
1161        }
1162
1163        /**
1164         * @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
1165         */
1166        public StringType getObservedAlleleElement() { 
1167          if (this.observedAllele == null)
1168            if (Configuration.errorOnAutoCreate())
1169              throw new Error("Attempt to auto-create SequenceVariantComponent.observedAllele");
1170            else if (Configuration.doAutoCreate())
1171              this.observedAllele = new StringType(); // bb
1172          return this.observedAllele;
1173        }
1174
1175        public boolean hasObservedAlleleElement() { 
1176          return this.observedAllele != null && !this.observedAllele.isEmpty();
1177        }
1178
1179        public boolean hasObservedAllele() { 
1180          return this.observedAllele != null && !this.observedAllele.isEmpty();
1181        }
1182
1183        /**
1184         * @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
1185         */
1186        public SequenceVariantComponent setObservedAlleleElement(StringType value) { 
1187          this.observedAllele = value;
1188          return this;
1189        }
1190
1191        /**
1192         * @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.
1193         */
1194        public String getObservedAllele() { 
1195          return this.observedAllele == null ? null : this.observedAllele.getValue();
1196        }
1197
1198        /**
1199         * @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.
1200         */
1201        public SequenceVariantComponent setObservedAllele(String value) { 
1202          if (Utilities.noString(value))
1203            this.observedAllele = null;
1204          else {
1205            if (this.observedAllele == null)
1206              this.observedAllele = new StringType();
1207            this.observedAllele.setValue(value);
1208          }
1209          return this;
1210        }
1211
1212        /**
1213         * @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
1214         */
1215        public StringType getReferenceAlleleElement() { 
1216          if (this.referenceAllele == null)
1217            if (Configuration.errorOnAutoCreate())
1218              throw new Error("Attempt to auto-create SequenceVariantComponent.referenceAllele");
1219            else if (Configuration.doAutoCreate())
1220              this.referenceAllele = new StringType(); // bb
1221          return this.referenceAllele;
1222        }
1223
1224        public boolean hasReferenceAlleleElement() { 
1225          return this.referenceAllele != null && !this.referenceAllele.isEmpty();
1226        }
1227
1228        public boolean hasReferenceAllele() { 
1229          return this.referenceAllele != null && !this.referenceAllele.isEmpty();
1230        }
1231
1232        /**
1233         * @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
1234         */
1235        public SequenceVariantComponent setReferenceAlleleElement(StringType value) { 
1236          this.referenceAllele = value;
1237          return this;
1238        }
1239
1240        /**
1241         * @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.
1242         */
1243        public String getReferenceAllele() { 
1244          return this.referenceAllele == null ? null : this.referenceAllele.getValue();
1245        }
1246
1247        /**
1248         * @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.
1249         */
1250        public SequenceVariantComponent setReferenceAllele(String value) { 
1251          if (Utilities.noString(value))
1252            this.referenceAllele = null;
1253          else {
1254            if (this.referenceAllele == null)
1255              this.referenceAllele = new StringType();
1256            this.referenceAllele.setValue(value);
1257          }
1258          return this;
1259        }
1260
1261        /**
1262         * @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
1263         */
1264        public StringType getCigarElement() { 
1265          if (this.cigar == null)
1266            if (Configuration.errorOnAutoCreate())
1267              throw new Error("Attempt to auto-create SequenceVariantComponent.cigar");
1268            else if (Configuration.doAutoCreate())
1269              this.cigar = new StringType(); // bb
1270          return this.cigar;
1271        }
1272
1273        public boolean hasCigarElement() { 
1274          return this.cigar != null && !this.cigar.isEmpty();
1275        }
1276
1277        public boolean hasCigar() { 
1278          return this.cigar != null && !this.cigar.isEmpty();
1279        }
1280
1281        /**
1282         * @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
1283         */
1284        public SequenceVariantComponent setCigarElement(StringType value) { 
1285          this.cigar = value;
1286          return this;
1287        }
1288
1289        /**
1290         * @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).
1291         */
1292        public String getCigar() { 
1293          return this.cigar == null ? null : this.cigar.getValue();
1294        }
1295
1296        /**
1297         * @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).
1298         */
1299        public SequenceVariantComponent setCigar(String value) { 
1300          if (Utilities.noString(value))
1301            this.cigar = null;
1302          else {
1303            if (this.cigar == null)
1304              this.cigar = new StringType();
1305            this.cigar.setValue(value);
1306          }
1307          return this;
1308        }
1309
1310        /**
1311         * @return {@link #variantPointer} (A pointer to an Observation containing variant information.)
1312         */
1313        public Reference getVariantPointer() { 
1314          if (this.variantPointer == null)
1315            if (Configuration.errorOnAutoCreate())
1316              throw new Error("Attempt to auto-create SequenceVariantComponent.variantPointer");
1317            else if (Configuration.doAutoCreate())
1318              this.variantPointer = new Reference(); // cc
1319          return this.variantPointer;
1320        }
1321
1322        public boolean hasVariantPointer() { 
1323          return this.variantPointer != null && !this.variantPointer.isEmpty();
1324        }
1325
1326        /**
1327         * @param value {@link #variantPointer} (A pointer to an Observation containing variant information.)
1328         */
1329        public SequenceVariantComponent setVariantPointer(Reference value) { 
1330          this.variantPointer = value;
1331          return this;
1332        }
1333
1334        /**
1335         * @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.)
1336         */
1337        public Observation getVariantPointerTarget() { 
1338          if (this.variantPointerTarget == null)
1339            if (Configuration.errorOnAutoCreate())
1340              throw new Error("Attempt to auto-create SequenceVariantComponent.variantPointer");
1341            else if (Configuration.doAutoCreate())
1342              this.variantPointerTarget = new Observation(); // aa
1343          return this.variantPointerTarget;
1344        }
1345
1346        /**
1347         * @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.)
1348         */
1349        public SequenceVariantComponent setVariantPointerTarget(Observation value) { 
1350          this.variantPointerTarget = value;
1351          return this;
1352        }
1353
1354        protected void listChildren(List<Property> childrenList) {
1355          super.listChildren(childrenList);
1356          childrenList.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, java.lang.Integer.MAX_VALUE, start));
1357          childrenList.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, java.lang.Integer.MAX_VALUE, end));
1358          childrenList.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, java.lang.Integer.MAX_VALUE, observedAllele));
1359          childrenList.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, java.lang.Integer.MAX_VALUE, referenceAllele));
1360          childrenList.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, java.lang.Integer.MAX_VALUE, cigar));
1361          childrenList.add(new Property("variantPointer", "Reference(Observation)", "A pointer to an Observation containing variant information.", 0, java.lang.Integer.MAX_VALUE, variantPointer));
1362        }
1363
1364      @Override
1365      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1366        switch (hash) {
1367        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
1368        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
1369        case -1418745787: /*observedAllele*/ return this.observedAllele == null ? new Base[0] : new Base[] {this.observedAllele}; // StringType
1370        case 364045960: /*referenceAllele*/ return this.referenceAllele == null ? new Base[0] : new Base[] {this.referenceAllele}; // StringType
1371        case 94658738: /*cigar*/ return this.cigar == null ? new Base[0] : new Base[] {this.cigar}; // StringType
1372        case -1654319624: /*variantPointer*/ return this.variantPointer == null ? new Base[0] : new Base[] {this.variantPointer}; // Reference
1373        default: return super.getProperty(hash, name, checkValid);
1374        }
1375
1376      }
1377
1378      @Override
1379      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1380        switch (hash) {
1381        case 109757538: // start
1382          this.start = castToInteger(value); // IntegerType
1383          return value;
1384        case 100571: // end
1385          this.end = castToInteger(value); // IntegerType
1386          return value;
1387        case -1418745787: // observedAllele
1388          this.observedAllele = castToString(value); // StringType
1389          return value;
1390        case 364045960: // referenceAllele
1391          this.referenceAllele = castToString(value); // StringType
1392          return value;
1393        case 94658738: // cigar
1394          this.cigar = castToString(value); // StringType
1395          return value;
1396        case -1654319624: // variantPointer
1397          this.variantPointer = castToReference(value); // Reference
1398          return value;
1399        default: return super.setProperty(hash, name, value);
1400        }
1401
1402      }
1403
1404      @Override
1405      public Base setProperty(String name, Base value) throws FHIRException {
1406        if (name.equals("start")) {
1407          this.start = castToInteger(value); // IntegerType
1408        } else if (name.equals("end")) {
1409          this.end = castToInteger(value); // IntegerType
1410        } else if (name.equals("observedAllele")) {
1411          this.observedAllele = castToString(value); // StringType
1412        } else if (name.equals("referenceAllele")) {
1413          this.referenceAllele = castToString(value); // StringType
1414        } else if (name.equals("cigar")) {
1415          this.cigar = castToString(value); // StringType
1416        } else if (name.equals("variantPointer")) {
1417          this.variantPointer = castToReference(value); // Reference
1418        } else
1419          return super.setProperty(name, value);
1420        return value;
1421      }
1422
1423      @Override
1424      public Base makeProperty(int hash, String name) throws FHIRException {
1425        switch (hash) {
1426        case 109757538:  return getStartElement();
1427        case 100571:  return getEndElement();
1428        case -1418745787:  return getObservedAlleleElement();
1429        case 364045960:  return getReferenceAlleleElement();
1430        case 94658738:  return getCigarElement();
1431        case -1654319624:  return getVariantPointer(); 
1432        default: return super.makeProperty(hash, name);
1433        }
1434
1435      }
1436
1437      @Override
1438      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1439        switch (hash) {
1440        case 109757538: /*start*/ return new String[] {"integer"};
1441        case 100571: /*end*/ return new String[] {"integer"};
1442        case -1418745787: /*observedAllele*/ return new String[] {"string"};
1443        case 364045960: /*referenceAllele*/ return new String[] {"string"};
1444        case 94658738: /*cigar*/ return new String[] {"string"};
1445        case -1654319624: /*variantPointer*/ return new String[] {"Reference"};
1446        default: return super.getTypesForProperty(hash, name);
1447        }
1448
1449      }
1450
1451      @Override
1452      public Base addChild(String name) throws FHIRException {
1453        if (name.equals("start")) {
1454          throw new FHIRException("Cannot call addChild on a primitive type Sequence.start");
1455        }
1456        else if (name.equals("end")) {
1457          throw new FHIRException("Cannot call addChild on a primitive type Sequence.end");
1458        }
1459        else if (name.equals("observedAllele")) {
1460          throw new FHIRException("Cannot call addChild on a primitive type Sequence.observedAllele");
1461        }
1462        else if (name.equals("referenceAllele")) {
1463          throw new FHIRException("Cannot call addChild on a primitive type Sequence.referenceAllele");
1464        }
1465        else if (name.equals("cigar")) {
1466          throw new FHIRException("Cannot call addChild on a primitive type Sequence.cigar");
1467        }
1468        else if (name.equals("variantPointer")) {
1469          this.variantPointer = new Reference();
1470          return this.variantPointer;
1471        }
1472        else
1473          return super.addChild(name);
1474      }
1475
1476      public SequenceVariantComponent copy() {
1477        SequenceVariantComponent dst = new SequenceVariantComponent();
1478        copyValues(dst);
1479        dst.start = start == null ? null : start.copy();
1480        dst.end = end == null ? null : end.copy();
1481        dst.observedAllele = observedAllele == null ? null : observedAllele.copy();
1482        dst.referenceAllele = referenceAllele == null ? null : referenceAllele.copy();
1483        dst.cigar = cigar == null ? null : cigar.copy();
1484        dst.variantPointer = variantPointer == null ? null : variantPointer.copy();
1485        return dst;
1486      }
1487
1488      @Override
1489      public boolean equalsDeep(Base other) {
1490        if (!super.equalsDeep(other))
1491          return false;
1492        if (!(other instanceof SequenceVariantComponent))
1493          return false;
1494        SequenceVariantComponent o = (SequenceVariantComponent) other;
1495        return compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(observedAllele, o.observedAllele, true)
1496           && compareDeep(referenceAllele, o.referenceAllele, true) && compareDeep(cigar, o.cigar, true) && compareDeep(variantPointer, o.variantPointer, true)
1497          ;
1498      }
1499
1500      @Override
1501      public boolean equalsShallow(Base other) {
1502        if (!super.equalsShallow(other))
1503          return false;
1504        if (!(other instanceof SequenceVariantComponent))
1505          return false;
1506        SequenceVariantComponent o = (SequenceVariantComponent) other;
1507        return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(observedAllele, o.observedAllele, true)
1508           && compareValues(referenceAllele, o.referenceAllele, true) && compareValues(cigar, o.cigar, true);
1509      }
1510
1511      public boolean isEmpty() {
1512        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(start, end, observedAllele
1513          , referenceAllele, cigar, variantPointer);
1514      }
1515
1516  public String fhirType() {
1517    return "Sequence.variant";
1518
1519  }
1520
1521  }
1522
1523    @Block()
1524    public static class SequenceQualityComponent extends BackboneElement implements IBaseBackboneElement {
1525        /**
1526         * INDEL / SNP / Undefined variant.
1527         */
1528        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1529        @Description(shortDefinition="indel | snp | unknown", formalDefinition="INDEL / SNP / Undefined variant." )
1530        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/quality-type")
1531        protected Enumeration<QualityType> type;
1532
1533        /**
1534         * Gold standard sequence used for comparing against.
1535         */
1536        @Child(name = "standardSequence", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1537        @Description(shortDefinition="Standard sequence for comparison", formalDefinition="Gold standard sequence used for comparing against." )
1538        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-quality-standardSequence")
1539        protected CodeableConcept standardSequence;
1540
1541        /**
1542         * Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.
1543         */
1544        @Child(name = "start", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1545        @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." )
1546        protected IntegerType start;
1547
1548        /**
1549         * 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.
1550         */
1551        @Child(name = "end", type = {IntegerType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1552        @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." )
1553        protected IntegerType end;
1554
1555        /**
1556         * The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).
1557         */
1558        @Child(name = "score", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=true)
1559        @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))." )
1560        protected Quantity score;
1561
1562        /**
1563         * Which method is used to get sequence quality.
1564         */
1565        @Child(name = "method", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
1566        @Description(shortDefinition="Method to get quality", formalDefinition="Which method is used to get sequence quality." )
1567        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-quality-method")
1568        protected CodeableConcept method;
1569
1570        /**
1571         * 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.
1572         */
1573        @Child(name = "truthTP", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1574        @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." )
1575        protected DecimalType truthTP;
1576
1577        /**
1578         * 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.
1579         */
1580        @Child(name = "queryTP", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true)
1581        @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." )
1582        protected DecimalType queryTP;
1583
1584        /**
1585         * 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.
1586         */
1587        @Child(name = "truthFN", type = {DecimalType.class}, order=9, min=0, max=1, modifier=false, summary=true)
1588        @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." )
1589        protected DecimalType truthFN;
1590
1591        /**
1592         * 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.
1593         */
1594        @Child(name = "queryFP", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true)
1595        @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." )
1596        protected DecimalType queryFP;
1597
1598        /**
1599         * 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).
1600         */
1601        @Child(name = "gtFP", type = {DecimalType.class}, order=11, min=0, max=1, modifier=false, summary=true)
1602        @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)." )
1603        protected DecimalType gtFP;
1604
1605        /**
1606         * QUERY.TP / (QUERY.TP + QUERY.FP).
1607         */
1608        @Child(name = "precision", type = {DecimalType.class}, order=12, min=0, max=1, modifier=false, summary=true)
1609        @Description(shortDefinition="Precision of comparison", formalDefinition="QUERY.TP / (QUERY.TP + QUERY.FP)." )
1610        protected DecimalType precision;
1611
1612        /**
1613         * TRUTH.TP / (TRUTH.TP + TRUTH.FN).
1614         */
1615        @Child(name = "recall", type = {DecimalType.class}, order=13, min=0, max=1, modifier=false, summary=true)
1616        @Description(shortDefinition="Recall of comparison", formalDefinition="TRUTH.TP / (TRUTH.TP + TRUTH.FN)." )
1617        protected DecimalType recall;
1618
1619        /**
1620         * Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).
1621         */
1622        @Child(name = "fScore", type = {DecimalType.class}, order=14, min=0, max=1, modifier=false, summary=true)
1623        @Description(shortDefinition="F-score", formalDefinition="Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall)." )
1624        protected DecimalType fScore;
1625
1626        private static final long serialVersionUID = -383644463L;
1627
1628    /**
1629     * Constructor
1630     */
1631      public SequenceQualityComponent() {
1632        super();
1633      }
1634
1635    /**
1636     * Constructor
1637     */
1638      public SequenceQualityComponent(Enumeration<QualityType> type) {
1639        super();
1640        this.type = type;
1641      }
1642
1643        /**
1644         * @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
1645         */
1646        public Enumeration<QualityType> getTypeElement() { 
1647          if (this.type == null)
1648            if (Configuration.errorOnAutoCreate())
1649              throw new Error("Attempt to auto-create SequenceQualityComponent.type");
1650            else if (Configuration.doAutoCreate())
1651              this.type = new Enumeration<QualityType>(new QualityTypeEnumFactory()); // bb
1652          return this.type;
1653        }
1654
1655        public boolean hasTypeElement() { 
1656          return this.type != null && !this.type.isEmpty();
1657        }
1658
1659        public boolean hasType() { 
1660          return this.type != null && !this.type.isEmpty();
1661        }
1662
1663        /**
1664         * @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
1665         */
1666        public SequenceQualityComponent setTypeElement(Enumeration<QualityType> value) { 
1667          this.type = value;
1668          return this;
1669        }
1670
1671        /**
1672         * @return INDEL / SNP / Undefined variant.
1673         */
1674        public QualityType getType() { 
1675          return this.type == null ? null : this.type.getValue();
1676        }
1677
1678        /**
1679         * @param value INDEL / SNP / Undefined variant.
1680         */
1681        public SequenceQualityComponent setType(QualityType value) { 
1682            if (this.type == null)
1683              this.type = new Enumeration<QualityType>(new QualityTypeEnumFactory());
1684            this.type.setValue(value);
1685          return this;
1686        }
1687
1688        /**
1689         * @return {@link #standardSequence} (Gold standard sequence used for comparing against.)
1690         */
1691        public CodeableConcept getStandardSequence() { 
1692          if (this.standardSequence == null)
1693            if (Configuration.errorOnAutoCreate())
1694              throw new Error("Attempt to auto-create SequenceQualityComponent.standardSequence");
1695            else if (Configuration.doAutoCreate())
1696              this.standardSequence = new CodeableConcept(); // cc
1697          return this.standardSequence;
1698        }
1699
1700        public boolean hasStandardSequence() { 
1701          return this.standardSequence != null && !this.standardSequence.isEmpty();
1702        }
1703
1704        /**
1705         * @param value {@link #standardSequence} (Gold standard sequence used for comparing against.)
1706         */
1707        public SequenceQualityComponent setStandardSequence(CodeableConcept value) { 
1708          this.standardSequence = value;
1709          return this;
1710        }
1711
1712        /**
1713         * @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
1714         */
1715        public IntegerType getStartElement() { 
1716          if (this.start == null)
1717            if (Configuration.errorOnAutoCreate())
1718              throw new Error("Attempt to auto-create SequenceQualityComponent.start");
1719            else if (Configuration.doAutoCreate())
1720              this.start = new IntegerType(); // bb
1721          return this.start;
1722        }
1723
1724        public boolean hasStartElement() { 
1725          return this.start != null && !this.start.isEmpty();
1726        }
1727
1728        public boolean hasStart() { 
1729          return this.start != null && !this.start.isEmpty();
1730        }
1731
1732        /**
1733         * @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
1734         */
1735        public SequenceQualityComponent setStartElement(IntegerType value) { 
1736          this.start = value;
1737          return this;
1738        }
1739
1740        /**
1741         * @return Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.
1742         */
1743        public int getStart() { 
1744          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
1745        }
1746
1747        /**
1748         * @param value Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.
1749         */
1750        public SequenceQualityComponent setStart(int value) { 
1751            if (this.start == null)
1752              this.start = new IntegerType();
1753            this.start.setValue(value);
1754          return this;
1755        }
1756
1757        /**
1758         * @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
1759         */
1760        public IntegerType getEndElement() { 
1761          if (this.end == null)
1762            if (Configuration.errorOnAutoCreate())
1763              throw new Error("Attempt to auto-create SequenceQualityComponent.end");
1764            else if (Configuration.doAutoCreate())
1765              this.end = new IntegerType(); // bb
1766          return this.end;
1767        }
1768
1769        public boolean hasEndElement() { 
1770          return this.end != null && !this.end.isEmpty();
1771        }
1772
1773        public boolean hasEnd() { 
1774          return this.end != null && !this.end.isEmpty();
1775        }
1776
1777        /**
1778         * @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
1779         */
1780        public SequenceQualityComponent setEndElement(IntegerType value) { 
1781          this.end = value;
1782          return this;
1783        }
1784
1785        /**
1786         * @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.
1787         */
1788        public int getEnd() { 
1789          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
1790        }
1791
1792        /**
1793         * @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.
1794         */
1795        public SequenceQualityComponent setEnd(int value) { 
1796            if (this.end == null)
1797              this.end = new IntegerType();
1798            this.end.setValue(value);
1799          return this;
1800        }
1801
1802        /**
1803         * @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)).)
1804         */
1805        public Quantity getScore() { 
1806          if (this.score == null)
1807            if (Configuration.errorOnAutoCreate())
1808              throw new Error("Attempt to auto-create SequenceQualityComponent.score");
1809            else if (Configuration.doAutoCreate())
1810              this.score = new Quantity(); // cc
1811          return this.score;
1812        }
1813
1814        public boolean hasScore() { 
1815          return this.score != null && !this.score.isEmpty();
1816        }
1817
1818        /**
1819         * @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)).)
1820         */
1821        public SequenceQualityComponent setScore(Quantity value) { 
1822          this.score = value;
1823          return this;
1824        }
1825
1826        /**
1827         * @return {@link #method} (Which method is used to get sequence quality.)
1828         */
1829        public CodeableConcept getMethod() { 
1830          if (this.method == null)
1831            if (Configuration.errorOnAutoCreate())
1832              throw new Error("Attempt to auto-create SequenceQualityComponent.method");
1833            else if (Configuration.doAutoCreate())
1834              this.method = new CodeableConcept(); // cc
1835          return this.method;
1836        }
1837
1838        public boolean hasMethod() { 
1839          return this.method != null && !this.method.isEmpty();
1840        }
1841
1842        /**
1843         * @param value {@link #method} (Which method is used to get sequence quality.)
1844         */
1845        public SequenceQualityComponent setMethod(CodeableConcept value) { 
1846          this.method = value;
1847          return this;
1848        }
1849
1850        /**
1851         * @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
1852         */
1853        public DecimalType getTruthTPElement() { 
1854          if (this.truthTP == null)
1855            if (Configuration.errorOnAutoCreate())
1856              throw new Error("Attempt to auto-create SequenceQualityComponent.truthTP");
1857            else if (Configuration.doAutoCreate())
1858              this.truthTP = new DecimalType(); // bb
1859          return this.truthTP;
1860        }
1861
1862        public boolean hasTruthTPElement() { 
1863          return this.truthTP != null && !this.truthTP.isEmpty();
1864        }
1865
1866        public boolean hasTruthTP() { 
1867          return this.truthTP != null && !this.truthTP.isEmpty();
1868        }
1869
1870        /**
1871         * @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
1872         */
1873        public SequenceQualityComponent setTruthTPElement(DecimalType value) { 
1874          this.truthTP = value;
1875          return this;
1876        }
1877
1878        /**
1879         * @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.
1880         */
1881        public BigDecimal getTruthTP() { 
1882          return this.truthTP == null ? null : this.truthTP.getValue();
1883        }
1884
1885        /**
1886         * @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.
1887         */
1888        public SequenceQualityComponent setTruthTP(BigDecimal value) { 
1889          if (value == null)
1890            this.truthTP = null;
1891          else {
1892            if (this.truthTP == null)
1893              this.truthTP = new DecimalType();
1894            this.truthTP.setValue(value);
1895          }
1896          return this;
1897        }
1898
1899        /**
1900         * @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.
1901         */
1902        public SequenceQualityComponent setTruthTP(long value) { 
1903              this.truthTP = new DecimalType();
1904            this.truthTP.setValue(value);
1905          return this;
1906        }
1907
1908        /**
1909         * @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.
1910         */
1911        public SequenceQualityComponent setTruthTP(double value) { 
1912              this.truthTP = new DecimalType();
1913            this.truthTP.setValue(value);
1914          return this;
1915        }
1916
1917        /**
1918         * @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
1919         */
1920        public DecimalType getQueryTPElement() { 
1921          if (this.queryTP == null)
1922            if (Configuration.errorOnAutoCreate())
1923              throw new Error("Attempt to auto-create SequenceQualityComponent.queryTP");
1924            else if (Configuration.doAutoCreate())
1925              this.queryTP = new DecimalType(); // bb
1926          return this.queryTP;
1927        }
1928
1929        public boolean hasQueryTPElement() { 
1930          return this.queryTP != null && !this.queryTP.isEmpty();
1931        }
1932
1933        public boolean hasQueryTP() { 
1934          return this.queryTP != null && !this.queryTP.isEmpty();
1935        }
1936
1937        /**
1938         * @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
1939         */
1940        public SequenceQualityComponent setQueryTPElement(DecimalType value) { 
1941          this.queryTP = value;
1942          return this;
1943        }
1944
1945        /**
1946         * @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.
1947         */
1948        public BigDecimal getQueryTP() { 
1949          return this.queryTP == null ? null : this.queryTP.getValue();
1950        }
1951
1952        /**
1953         * @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.
1954         */
1955        public SequenceQualityComponent setQueryTP(BigDecimal value) { 
1956          if (value == null)
1957            this.queryTP = null;
1958          else {
1959            if (this.queryTP == null)
1960              this.queryTP = new DecimalType();
1961            this.queryTP.setValue(value);
1962          }
1963          return this;
1964        }
1965
1966        /**
1967         * @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.
1968         */
1969        public SequenceQualityComponent setQueryTP(long value) { 
1970              this.queryTP = new DecimalType();
1971            this.queryTP.setValue(value);
1972          return this;
1973        }
1974
1975        /**
1976         * @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.
1977         */
1978        public SequenceQualityComponent setQueryTP(double value) { 
1979              this.queryTP = new DecimalType();
1980            this.queryTP.setValue(value);
1981          return this;
1982        }
1983
1984        /**
1985         * @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
1986         */
1987        public DecimalType getTruthFNElement() { 
1988          if (this.truthFN == null)
1989            if (Configuration.errorOnAutoCreate())
1990              throw new Error("Attempt to auto-create SequenceQualityComponent.truthFN");
1991            else if (Configuration.doAutoCreate())
1992              this.truthFN = new DecimalType(); // bb
1993          return this.truthFN;
1994        }
1995
1996        public boolean hasTruthFNElement() { 
1997          return this.truthFN != null && !this.truthFN.isEmpty();
1998        }
1999
2000        public boolean hasTruthFN() { 
2001          return this.truthFN != null && !this.truthFN.isEmpty();
2002        }
2003
2004        /**
2005         * @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
2006         */
2007        public SequenceQualityComponent setTruthFNElement(DecimalType value) { 
2008          this.truthFN = value;
2009          return this;
2010        }
2011
2012        /**
2013         * @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.
2014         */
2015        public BigDecimal getTruthFN() { 
2016          return this.truthFN == null ? null : this.truthFN.getValue();
2017        }
2018
2019        /**
2020         * @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.
2021         */
2022        public SequenceQualityComponent setTruthFN(BigDecimal value) { 
2023          if (value == null)
2024            this.truthFN = null;
2025          else {
2026            if (this.truthFN == null)
2027              this.truthFN = new DecimalType();
2028            this.truthFN.setValue(value);
2029          }
2030          return this;
2031        }
2032
2033        /**
2034         * @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.
2035         */
2036        public SequenceQualityComponent setTruthFN(long value) { 
2037              this.truthFN = new DecimalType();
2038            this.truthFN.setValue(value);
2039          return this;
2040        }
2041
2042        /**
2043         * @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.
2044         */
2045        public SequenceQualityComponent setTruthFN(double value) { 
2046              this.truthFN = new DecimalType();
2047            this.truthFN.setValue(value);
2048          return this;
2049        }
2050
2051        /**
2052         * @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
2053         */
2054        public DecimalType getQueryFPElement() { 
2055          if (this.queryFP == null)
2056            if (Configuration.errorOnAutoCreate())
2057              throw new Error("Attempt to auto-create SequenceQualityComponent.queryFP");
2058            else if (Configuration.doAutoCreate())
2059              this.queryFP = new DecimalType(); // bb
2060          return this.queryFP;
2061        }
2062
2063        public boolean hasQueryFPElement() { 
2064          return this.queryFP != null && !this.queryFP.isEmpty();
2065        }
2066
2067        public boolean hasQueryFP() { 
2068          return this.queryFP != null && !this.queryFP.isEmpty();
2069        }
2070
2071        /**
2072         * @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
2073         */
2074        public SequenceQualityComponent setQueryFPElement(DecimalType value) { 
2075          this.queryFP = value;
2076          return this;
2077        }
2078
2079        /**
2080         * @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.
2081         */
2082        public BigDecimal getQueryFP() { 
2083          return this.queryFP == null ? null : this.queryFP.getValue();
2084        }
2085
2086        /**
2087         * @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.
2088         */
2089        public SequenceQualityComponent setQueryFP(BigDecimal value) { 
2090          if (value == null)
2091            this.queryFP = null;
2092          else {
2093            if (this.queryFP == null)
2094              this.queryFP = new DecimalType();
2095            this.queryFP.setValue(value);
2096          }
2097          return this;
2098        }
2099
2100        /**
2101         * @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.
2102         */
2103        public SequenceQualityComponent setQueryFP(long value) { 
2104              this.queryFP = new DecimalType();
2105            this.queryFP.setValue(value);
2106          return this;
2107        }
2108
2109        /**
2110         * @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.
2111         */
2112        public SequenceQualityComponent setQueryFP(double value) { 
2113              this.queryFP = new DecimalType();
2114            this.queryFP.setValue(value);
2115          return this;
2116        }
2117
2118        /**
2119         * @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
2120         */
2121        public DecimalType getGtFPElement() { 
2122          if (this.gtFP == null)
2123            if (Configuration.errorOnAutoCreate())
2124              throw new Error("Attempt to auto-create SequenceQualityComponent.gtFP");
2125            else if (Configuration.doAutoCreate())
2126              this.gtFP = new DecimalType(); // bb
2127          return this.gtFP;
2128        }
2129
2130        public boolean hasGtFPElement() { 
2131          return this.gtFP != null && !this.gtFP.isEmpty();
2132        }
2133
2134        public boolean hasGtFP() { 
2135          return this.gtFP != null && !this.gtFP.isEmpty();
2136        }
2137
2138        /**
2139         * @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
2140         */
2141        public SequenceQualityComponent setGtFPElement(DecimalType value) { 
2142          this.gtFP = value;
2143          return this;
2144        }
2145
2146        /**
2147         * @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).
2148         */
2149        public BigDecimal getGtFP() { 
2150          return this.gtFP == null ? null : this.gtFP.getValue();
2151        }
2152
2153        /**
2154         * @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).
2155         */
2156        public SequenceQualityComponent setGtFP(BigDecimal value) { 
2157          if (value == null)
2158            this.gtFP = null;
2159          else {
2160            if (this.gtFP == null)
2161              this.gtFP = new DecimalType();
2162            this.gtFP.setValue(value);
2163          }
2164          return this;
2165        }
2166
2167        /**
2168         * @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).
2169         */
2170        public SequenceQualityComponent setGtFP(long value) { 
2171              this.gtFP = new DecimalType();
2172            this.gtFP.setValue(value);
2173          return this;
2174        }
2175
2176        /**
2177         * @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).
2178         */
2179        public SequenceQualityComponent setGtFP(double value) { 
2180              this.gtFP = new DecimalType();
2181            this.gtFP.setValue(value);
2182          return this;
2183        }
2184
2185        /**
2186         * @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
2187         */
2188        public DecimalType getPrecisionElement() { 
2189          if (this.precision == null)
2190            if (Configuration.errorOnAutoCreate())
2191              throw new Error("Attempt to auto-create SequenceQualityComponent.precision");
2192            else if (Configuration.doAutoCreate())
2193              this.precision = new DecimalType(); // bb
2194          return this.precision;
2195        }
2196
2197        public boolean hasPrecisionElement() { 
2198          return this.precision != null && !this.precision.isEmpty();
2199        }
2200
2201        public boolean hasPrecision() { 
2202          return this.precision != null && !this.precision.isEmpty();
2203        }
2204
2205        /**
2206         * @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
2207         */
2208        public SequenceQualityComponent setPrecisionElement(DecimalType value) { 
2209          this.precision = value;
2210          return this;
2211        }
2212
2213        /**
2214         * @return QUERY.TP / (QUERY.TP + QUERY.FP).
2215         */
2216        public BigDecimal getPrecision() { 
2217          return this.precision == null ? null : this.precision.getValue();
2218        }
2219
2220        /**
2221         * @param value QUERY.TP / (QUERY.TP + QUERY.FP).
2222         */
2223        public SequenceQualityComponent setPrecision(BigDecimal value) { 
2224          if (value == null)
2225            this.precision = null;
2226          else {
2227            if (this.precision == null)
2228              this.precision = new DecimalType();
2229            this.precision.setValue(value);
2230          }
2231          return this;
2232        }
2233
2234        /**
2235         * @param value QUERY.TP / (QUERY.TP + QUERY.FP).
2236         */
2237        public SequenceQualityComponent setPrecision(long value) { 
2238              this.precision = new DecimalType();
2239            this.precision.setValue(value);
2240          return this;
2241        }
2242
2243        /**
2244         * @param value QUERY.TP / (QUERY.TP + QUERY.FP).
2245         */
2246        public SequenceQualityComponent setPrecision(double value) { 
2247              this.precision = new DecimalType();
2248            this.precision.setValue(value);
2249          return this;
2250        }
2251
2252        /**
2253         * @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
2254         */
2255        public DecimalType getRecallElement() { 
2256          if (this.recall == null)
2257            if (Configuration.errorOnAutoCreate())
2258              throw new Error("Attempt to auto-create SequenceQualityComponent.recall");
2259            else if (Configuration.doAutoCreate())
2260              this.recall = new DecimalType(); // bb
2261          return this.recall;
2262        }
2263
2264        public boolean hasRecallElement() { 
2265          return this.recall != null && !this.recall.isEmpty();
2266        }
2267
2268        public boolean hasRecall() { 
2269          return this.recall != null && !this.recall.isEmpty();
2270        }
2271
2272        /**
2273         * @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
2274         */
2275        public SequenceQualityComponent setRecallElement(DecimalType value) { 
2276          this.recall = value;
2277          return this;
2278        }
2279
2280        /**
2281         * @return TRUTH.TP / (TRUTH.TP + TRUTH.FN).
2282         */
2283        public BigDecimal getRecall() { 
2284          return this.recall == null ? null : this.recall.getValue();
2285        }
2286
2287        /**
2288         * @param value TRUTH.TP / (TRUTH.TP + TRUTH.FN).
2289         */
2290        public SequenceQualityComponent setRecall(BigDecimal value) { 
2291          if (value == null)
2292            this.recall = null;
2293          else {
2294            if (this.recall == null)
2295              this.recall = new DecimalType();
2296            this.recall.setValue(value);
2297          }
2298          return this;
2299        }
2300
2301        /**
2302         * @param value TRUTH.TP / (TRUTH.TP + TRUTH.FN).
2303         */
2304        public SequenceQualityComponent setRecall(long value) { 
2305              this.recall = new DecimalType();
2306            this.recall.setValue(value);
2307          return this;
2308        }
2309
2310        /**
2311         * @param value TRUTH.TP / (TRUTH.TP + TRUTH.FN).
2312         */
2313        public SequenceQualityComponent setRecall(double value) { 
2314              this.recall = new DecimalType();
2315            this.recall.setValue(value);
2316          return this;
2317        }
2318
2319        /**
2320         * @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
2321         */
2322        public DecimalType getFScoreElement() { 
2323          if (this.fScore == null)
2324            if (Configuration.errorOnAutoCreate())
2325              throw new Error("Attempt to auto-create SequenceQualityComponent.fScore");
2326            else if (Configuration.doAutoCreate())
2327              this.fScore = new DecimalType(); // bb
2328          return this.fScore;
2329        }
2330
2331        public boolean hasFScoreElement() { 
2332          return this.fScore != null && !this.fScore.isEmpty();
2333        }
2334
2335        public boolean hasFScore() { 
2336          return this.fScore != null && !this.fScore.isEmpty();
2337        }
2338
2339        /**
2340         * @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
2341         */
2342        public SequenceQualityComponent setFScoreElement(DecimalType value) { 
2343          this.fScore = value;
2344          return this;
2345        }
2346
2347        /**
2348         * @return Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).
2349         */
2350        public BigDecimal getFScore() { 
2351          return this.fScore == null ? null : this.fScore.getValue();
2352        }
2353
2354        /**
2355         * @param value Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).
2356         */
2357        public SequenceQualityComponent setFScore(BigDecimal value) { 
2358          if (value == null)
2359            this.fScore = null;
2360          else {
2361            if (this.fScore == null)
2362              this.fScore = new DecimalType();
2363            this.fScore.setValue(value);
2364          }
2365          return this;
2366        }
2367
2368        /**
2369         * @param value Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).
2370         */
2371        public SequenceQualityComponent setFScore(long value) { 
2372              this.fScore = new DecimalType();
2373            this.fScore.setValue(value);
2374          return this;
2375        }
2376
2377        /**
2378         * @param value Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).
2379         */
2380        public SequenceQualityComponent setFScore(double value) { 
2381              this.fScore = new DecimalType();
2382            this.fScore.setValue(value);
2383          return this;
2384        }
2385
2386        protected void listChildren(List<Property> childrenList) {
2387          super.listChildren(childrenList);
2388          childrenList.add(new Property("type", "code", "INDEL / SNP / Undefined variant.", 0, java.lang.Integer.MAX_VALUE, type));
2389          childrenList.add(new Property("standardSequence", "CodeableConcept", "Gold standard sequence used for comparing against.", 0, java.lang.Integer.MAX_VALUE, standardSequence));
2390          childrenList.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, java.lang.Integer.MAX_VALUE, start));
2391          childrenList.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, java.lang.Integer.MAX_VALUE, end));
2392          childrenList.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, java.lang.Integer.MAX_VALUE, score));
2393          childrenList.add(new Property("method", "CodeableConcept", "Which method is used to get sequence quality.", 0, java.lang.Integer.MAX_VALUE, method));
2394          childrenList.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, java.lang.Integer.MAX_VALUE, truthTP));
2395          childrenList.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, java.lang.Integer.MAX_VALUE, queryTP));
2396          childrenList.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, java.lang.Integer.MAX_VALUE, truthFN));
2397          childrenList.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, java.lang.Integer.MAX_VALUE, queryFP));
2398          childrenList.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, java.lang.Integer.MAX_VALUE, gtFP));
2399          childrenList.add(new Property("precision", "decimal", "QUERY.TP / (QUERY.TP + QUERY.FP).", 0, java.lang.Integer.MAX_VALUE, precision));
2400          childrenList.add(new Property("recall", "decimal", "TRUTH.TP / (TRUTH.TP + TRUTH.FN).", 0, java.lang.Integer.MAX_VALUE, recall));
2401          childrenList.add(new Property("fScore", "decimal", "Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).", 0, java.lang.Integer.MAX_VALUE, fScore));
2402        }
2403
2404      @Override
2405      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2406        switch (hash) {
2407        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<QualityType>
2408        case -1861227106: /*standardSequence*/ return this.standardSequence == null ? new Base[0] : new Base[] {this.standardSequence}; // CodeableConcept
2409        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
2410        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
2411        case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // Quantity
2412        case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept
2413        case -1048421849: /*truthTP*/ return this.truthTP == null ? new Base[0] : new Base[] {this.truthTP}; // DecimalType
2414        case 655102276: /*queryTP*/ return this.queryTP == null ? new Base[0] : new Base[] {this.queryTP}; // DecimalType
2415        case -1048422285: /*truthFN*/ return this.truthFN == null ? new Base[0] : new Base[] {this.truthFN}; // DecimalType
2416        case 655101842: /*queryFP*/ return this.queryFP == null ? new Base[0] : new Base[] {this.queryFP}; // DecimalType
2417        case 3182199: /*gtFP*/ return this.gtFP == null ? new Base[0] : new Base[] {this.gtFP}; // DecimalType
2418        case -1376177026: /*precision*/ return this.precision == null ? new Base[0] : new Base[] {this.precision}; // DecimalType
2419        case -934922479: /*recall*/ return this.recall == null ? new Base[0] : new Base[] {this.recall}; // DecimalType
2420        case -1295082036: /*fScore*/ return this.fScore == null ? new Base[0] : new Base[] {this.fScore}; // DecimalType
2421        default: return super.getProperty(hash, name, checkValid);
2422        }
2423
2424      }
2425
2426      @Override
2427      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2428        switch (hash) {
2429        case 3575610: // type
2430          value = new QualityTypeEnumFactory().fromType(castToCode(value));
2431          this.type = (Enumeration) value; // Enumeration<QualityType>
2432          return value;
2433        case -1861227106: // standardSequence
2434          this.standardSequence = castToCodeableConcept(value); // CodeableConcept
2435          return value;
2436        case 109757538: // start
2437          this.start = castToInteger(value); // IntegerType
2438          return value;
2439        case 100571: // end
2440          this.end = castToInteger(value); // IntegerType
2441          return value;
2442        case 109264530: // score
2443          this.score = castToQuantity(value); // Quantity
2444          return value;
2445        case -1077554975: // method
2446          this.method = castToCodeableConcept(value); // CodeableConcept
2447          return value;
2448        case -1048421849: // truthTP
2449          this.truthTP = castToDecimal(value); // DecimalType
2450          return value;
2451        case 655102276: // queryTP
2452          this.queryTP = castToDecimal(value); // DecimalType
2453          return value;
2454        case -1048422285: // truthFN
2455          this.truthFN = castToDecimal(value); // DecimalType
2456          return value;
2457        case 655101842: // queryFP
2458          this.queryFP = castToDecimal(value); // DecimalType
2459          return value;
2460        case 3182199: // gtFP
2461          this.gtFP = castToDecimal(value); // DecimalType
2462          return value;
2463        case -1376177026: // precision
2464          this.precision = castToDecimal(value); // DecimalType
2465          return value;
2466        case -934922479: // recall
2467          this.recall = castToDecimal(value); // DecimalType
2468          return value;
2469        case -1295082036: // fScore
2470          this.fScore = castToDecimal(value); // DecimalType
2471          return value;
2472        default: return super.setProperty(hash, name, value);
2473        }
2474
2475      }
2476
2477      @Override
2478      public Base setProperty(String name, Base value) throws FHIRException {
2479        if (name.equals("type")) {
2480          value = new QualityTypeEnumFactory().fromType(castToCode(value));
2481          this.type = (Enumeration) value; // Enumeration<QualityType>
2482        } else if (name.equals("standardSequence")) {
2483          this.standardSequence = castToCodeableConcept(value); // CodeableConcept
2484        } else if (name.equals("start")) {
2485          this.start = castToInteger(value); // IntegerType
2486        } else if (name.equals("end")) {
2487          this.end = castToInteger(value); // IntegerType
2488        } else if (name.equals("score")) {
2489          this.score = castToQuantity(value); // Quantity
2490        } else if (name.equals("method")) {
2491          this.method = castToCodeableConcept(value); // CodeableConcept
2492        } else if (name.equals("truthTP")) {
2493          this.truthTP = castToDecimal(value); // DecimalType
2494        } else if (name.equals("queryTP")) {
2495          this.queryTP = castToDecimal(value); // DecimalType
2496        } else if (name.equals("truthFN")) {
2497          this.truthFN = castToDecimal(value); // DecimalType
2498        } else if (name.equals("queryFP")) {
2499          this.queryFP = castToDecimal(value); // DecimalType
2500        } else if (name.equals("gtFP")) {
2501          this.gtFP = castToDecimal(value); // DecimalType
2502        } else if (name.equals("precision")) {
2503          this.precision = castToDecimal(value); // DecimalType
2504        } else if (name.equals("recall")) {
2505          this.recall = castToDecimal(value); // DecimalType
2506        } else if (name.equals("fScore")) {
2507          this.fScore = castToDecimal(value); // DecimalType
2508        } else
2509          return super.setProperty(name, value);
2510        return value;
2511      }
2512
2513      @Override
2514      public Base makeProperty(int hash, String name) throws FHIRException {
2515        switch (hash) {
2516        case 3575610:  return getTypeElement();
2517        case -1861227106:  return getStandardSequence(); 
2518        case 109757538:  return getStartElement();
2519        case 100571:  return getEndElement();
2520        case 109264530:  return getScore(); 
2521        case -1077554975:  return getMethod(); 
2522        case -1048421849:  return getTruthTPElement();
2523        case 655102276:  return getQueryTPElement();
2524        case -1048422285:  return getTruthFNElement();
2525        case 655101842:  return getQueryFPElement();
2526        case 3182199:  return getGtFPElement();
2527        case -1376177026:  return getPrecisionElement();
2528        case -934922479:  return getRecallElement();
2529        case -1295082036:  return getFScoreElement();
2530        default: return super.makeProperty(hash, name);
2531        }
2532
2533      }
2534
2535      @Override
2536      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2537        switch (hash) {
2538        case 3575610: /*type*/ return new String[] {"code"};
2539        case -1861227106: /*standardSequence*/ return new String[] {"CodeableConcept"};
2540        case 109757538: /*start*/ return new String[] {"integer"};
2541        case 100571: /*end*/ return new String[] {"integer"};
2542        case 109264530: /*score*/ return new String[] {"Quantity"};
2543        case -1077554975: /*method*/ return new String[] {"CodeableConcept"};
2544        case -1048421849: /*truthTP*/ return new String[] {"decimal"};
2545        case 655102276: /*queryTP*/ return new String[] {"decimal"};
2546        case -1048422285: /*truthFN*/ return new String[] {"decimal"};
2547        case 655101842: /*queryFP*/ return new String[] {"decimal"};
2548        case 3182199: /*gtFP*/ return new String[] {"decimal"};
2549        case -1376177026: /*precision*/ return new String[] {"decimal"};
2550        case -934922479: /*recall*/ return new String[] {"decimal"};
2551        case -1295082036: /*fScore*/ return new String[] {"decimal"};
2552        default: return super.getTypesForProperty(hash, name);
2553        }
2554
2555      }
2556
2557      @Override
2558      public Base addChild(String name) throws FHIRException {
2559        if (name.equals("type")) {
2560          throw new FHIRException("Cannot call addChild on a primitive type Sequence.type");
2561        }
2562        else if (name.equals("standardSequence")) {
2563          this.standardSequence = new CodeableConcept();
2564          return this.standardSequence;
2565        }
2566        else if (name.equals("start")) {
2567          throw new FHIRException("Cannot call addChild on a primitive type Sequence.start");
2568        }
2569        else if (name.equals("end")) {
2570          throw new FHIRException("Cannot call addChild on a primitive type Sequence.end");
2571        }
2572        else if (name.equals("score")) {
2573          this.score = new Quantity();
2574          return this.score;
2575        }
2576        else if (name.equals("method")) {
2577          this.method = new CodeableConcept();
2578          return this.method;
2579        }
2580        else if (name.equals("truthTP")) {
2581          throw new FHIRException("Cannot call addChild on a primitive type Sequence.truthTP");
2582        }
2583        else if (name.equals("queryTP")) {
2584          throw new FHIRException("Cannot call addChild on a primitive type Sequence.queryTP");
2585        }
2586        else if (name.equals("truthFN")) {
2587          throw new FHIRException("Cannot call addChild on a primitive type Sequence.truthFN");
2588        }
2589        else if (name.equals("queryFP")) {
2590          throw new FHIRException("Cannot call addChild on a primitive type Sequence.queryFP");
2591        }
2592        else if (name.equals("gtFP")) {
2593          throw new FHIRException("Cannot call addChild on a primitive type Sequence.gtFP");
2594        }
2595        else if (name.equals("precision")) {
2596          throw new FHIRException("Cannot call addChild on a primitive type Sequence.precision");
2597        }
2598        else if (name.equals("recall")) {
2599          throw new FHIRException("Cannot call addChild on a primitive type Sequence.recall");
2600        }
2601        else if (name.equals("fScore")) {
2602          throw new FHIRException("Cannot call addChild on a primitive type Sequence.fScore");
2603        }
2604        else
2605          return super.addChild(name);
2606      }
2607
2608      public SequenceQualityComponent copy() {
2609        SequenceQualityComponent dst = new SequenceQualityComponent();
2610        copyValues(dst);
2611        dst.type = type == null ? null : type.copy();
2612        dst.standardSequence = standardSequence == null ? null : standardSequence.copy();
2613        dst.start = start == null ? null : start.copy();
2614        dst.end = end == null ? null : end.copy();
2615        dst.score = score == null ? null : score.copy();
2616        dst.method = method == null ? null : method.copy();
2617        dst.truthTP = truthTP == null ? null : truthTP.copy();
2618        dst.queryTP = queryTP == null ? null : queryTP.copy();
2619        dst.truthFN = truthFN == null ? null : truthFN.copy();
2620        dst.queryFP = queryFP == null ? null : queryFP.copy();
2621        dst.gtFP = gtFP == null ? null : gtFP.copy();
2622        dst.precision = precision == null ? null : precision.copy();
2623        dst.recall = recall == null ? null : recall.copy();
2624        dst.fScore = fScore == null ? null : fScore.copy();
2625        return dst;
2626      }
2627
2628      @Override
2629      public boolean equalsDeep(Base other) {
2630        if (!super.equalsDeep(other))
2631          return false;
2632        if (!(other instanceof SequenceQualityComponent))
2633          return false;
2634        SequenceQualityComponent o = (SequenceQualityComponent) other;
2635        return compareDeep(type, o.type, true) && compareDeep(standardSequence, o.standardSequence, true)
2636           && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(score, o.score, true)
2637           && compareDeep(method, o.method, true) && compareDeep(truthTP, o.truthTP, true) && compareDeep(queryTP, o.queryTP, true)
2638           && compareDeep(truthFN, o.truthFN, true) && compareDeep(queryFP, o.queryFP, true) && compareDeep(gtFP, o.gtFP, true)
2639           && compareDeep(precision, o.precision, true) && compareDeep(recall, o.recall, true) && compareDeep(fScore, o.fScore, true)
2640          ;
2641      }
2642
2643      @Override
2644      public boolean equalsShallow(Base other) {
2645        if (!super.equalsShallow(other))
2646          return false;
2647        if (!(other instanceof SequenceQualityComponent))
2648          return false;
2649        SequenceQualityComponent o = (SequenceQualityComponent) other;
2650        return compareValues(type, o.type, true) && compareValues(start, o.start, true) && compareValues(end, o.end, true)
2651           && compareValues(truthTP, o.truthTP, true) && compareValues(queryTP, o.queryTP, true) && compareValues(truthFN, o.truthFN, true)
2652           && compareValues(queryFP, o.queryFP, true) && compareValues(gtFP, o.gtFP, true) && compareValues(precision, o.precision, true)
2653           && compareValues(recall, o.recall, true) && compareValues(fScore, o.fScore, true);
2654      }
2655
2656      public boolean isEmpty() {
2657        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, standardSequence, start
2658          , end, score, method, truthTP, queryTP, truthFN, queryFP, gtFP, precision
2659          , recall, fScore);
2660      }
2661
2662  public String fhirType() {
2663    return "Sequence.quality";
2664
2665  }
2666
2667  }
2668
2669    @Block()
2670    public static class SequenceRepositoryComponent extends BackboneElement implements IBaseBackboneElement {
2671        /**
2672         * Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.
2673         */
2674        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2675        @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." )
2676        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/repository-type")
2677        protected Enumeration<RepositoryType> type;
2678
2679        /**
2680         * URI of an external repository which contains further details about the genetics data.
2681         */
2682        @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2683        @Description(shortDefinition="URI of the repository", formalDefinition="URI of an external repository which contains further details about the genetics data." )
2684        protected UriType url;
2685
2686        /**
2687         * URI of an external repository which contains further details about the genetics data.
2688         */
2689        @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
2690        @Description(shortDefinition="Repository's name", formalDefinition="URI of an external repository which contains further details about the genetics data." )
2691        protected StringType name;
2692
2693        /**
2694         * 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.
2695         */
2696        @Child(name = "datasetId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2697        @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." )
2698        protected StringType datasetId;
2699
2700        /**
2701         * 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.
2702         */
2703        @Child(name = "variantsetId", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
2704        @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." )
2705        protected StringType variantsetId;
2706
2707        /**
2708         * Id of the read in this external repository.
2709         */
2710        @Child(name = "readsetId", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
2711        @Description(shortDefinition="Id of the read", formalDefinition="Id of the read in this external repository." )
2712        protected StringType readsetId;
2713
2714        private static final long serialVersionUID = -899243265L;
2715
2716    /**
2717     * Constructor
2718     */
2719      public SequenceRepositoryComponent() {
2720        super();
2721      }
2722
2723    /**
2724     * Constructor
2725     */
2726      public SequenceRepositoryComponent(Enumeration<RepositoryType> type) {
2727        super();
2728        this.type = type;
2729      }
2730
2731        /**
2732         * @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
2733         */
2734        public Enumeration<RepositoryType> getTypeElement() { 
2735          if (this.type == null)
2736            if (Configuration.errorOnAutoCreate())
2737              throw new Error("Attempt to auto-create SequenceRepositoryComponent.type");
2738            else if (Configuration.doAutoCreate())
2739              this.type = new Enumeration<RepositoryType>(new RepositoryTypeEnumFactory()); // bb
2740          return this.type;
2741        }
2742
2743        public boolean hasTypeElement() { 
2744          return this.type != null && !this.type.isEmpty();
2745        }
2746
2747        public boolean hasType() { 
2748          return this.type != null && !this.type.isEmpty();
2749        }
2750
2751        /**
2752         * @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
2753         */
2754        public SequenceRepositoryComponent setTypeElement(Enumeration<RepositoryType> value) { 
2755          this.type = value;
2756          return this;
2757        }
2758
2759        /**
2760         * @return Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.
2761         */
2762        public RepositoryType getType() { 
2763          return this.type == null ? null : this.type.getValue();
2764        }
2765
2766        /**
2767         * @param value Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.
2768         */
2769        public SequenceRepositoryComponent setType(RepositoryType value) { 
2770            if (this.type == null)
2771              this.type = new Enumeration<RepositoryType>(new RepositoryTypeEnumFactory());
2772            this.type.setValue(value);
2773          return this;
2774        }
2775
2776        /**
2777         * @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
2778         */
2779        public UriType getUrlElement() { 
2780          if (this.url == null)
2781            if (Configuration.errorOnAutoCreate())
2782              throw new Error("Attempt to auto-create SequenceRepositoryComponent.url");
2783            else if (Configuration.doAutoCreate())
2784              this.url = new UriType(); // bb
2785          return this.url;
2786        }
2787
2788        public boolean hasUrlElement() { 
2789          return this.url != null && !this.url.isEmpty();
2790        }
2791
2792        public boolean hasUrl() { 
2793          return this.url != null && !this.url.isEmpty();
2794        }
2795
2796        /**
2797         * @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
2798         */
2799        public SequenceRepositoryComponent setUrlElement(UriType value) { 
2800          this.url = value;
2801          return this;
2802        }
2803
2804        /**
2805         * @return URI of an external repository which contains further details about the genetics data.
2806         */
2807        public String getUrl() { 
2808          return this.url == null ? null : this.url.getValue();
2809        }
2810
2811        /**
2812         * @param value URI of an external repository which contains further details about the genetics data.
2813         */
2814        public SequenceRepositoryComponent setUrl(String value) { 
2815          if (Utilities.noString(value))
2816            this.url = null;
2817          else {
2818            if (this.url == null)
2819              this.url = new UriType();
2820            this.url.setValue(value);
2821          }
2822          return this;
2823        }
2824
2825        /**
2826         * @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
2827         */
2828        public StringType getNameElement() { 
2829          if (this.name == null)
2830            if (Configuration.errorOnAutoCreate())
2831              throw new Error("Attempt to auto-create SequenceRepositoryComponent.name");
2832            else if (Configuration.doAutoCreate())
2833              this.name = new StringType(); // bb
2834          return this.name;
2835        }
2836
2837        public boolean hasNameElement() { 
2838          return this.name != null && !this.name.isEmpty();
2839        }
2840
2841        public boolean hasName() { 
2842          return this.name != null && !this.name.isEmpty();
2843        }
2844
2845        /**
2846         * @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
2847         */
2848        public SequenceRepositoryComponent setNameElement(StringType value) { 
2849          this.name = value;
2850          return this;
2851        }
2852
2853        /**
2854         * @return URI of an external repository which contains further details about the genetics data.
2855         */
2856        public String getName() { 
2857          return this.name == null ? null : this.name.getValue();
2858        }
2859
2860        /**
2861         * @param value URI of an external repository which contains further details about the genetics data.
2862         */
2863        public SequenceRepositoryComponent setName(String value) { 
2864          if (Utilities.noString(value))
2865            this.name = null;
2866          else {
2867            if (this.name == null)
2868              this.name = new StringType();
2869            this.name.setValue(value);
2870          }
2871          return this;
2872        }
2873
2874        /**
2875         * @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
2876         */
2877        public StringType getDatasetIdElement() { 
2878          if (this.datasetId == null)
2879            if (Configuration.errorOnAutoCreate())
2880              throw new Error("Attempt to auto-create SequenceRepositoryComponent.datasetId");
2881            else if (Configuration.doAutoCreate())
2882              this.datasetId = new StringType(); // bb
2883          return this.datasetId;
2884        }
2885
2886        public boolean hasDatasetIdElement() { 
2887          return this.datasetId != null && !this.datasetId.isEmpty();
2888        }
2889
2890        public boolean hasDatasetId() { 
2891          return this.datasetId != null && !this.datasetId.isEmpty();
2892        }
2893
2894        /**
2895         * @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
2896         */
2897        public SequenceRepositoryComponent setDatasetIdElement(StringType value) { 
2898          this.datasetId = value;
2899          return this;
2900        }
2901
2902        /**
2903         * @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.
2904         */
2905        public String getDatasetId() { 
2906          return this.datasetId == null ? null : this.datasetId.getValue();
2907        }
2908
2909        /**
2910         * @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.
2911         */
2912        public SequenceRepositoryComponent setDatasetId(String value) { 
2913          if (Utilities.noString(value))
2914            this.datasetId = null;
2915          else {
2916            if (this.datasetId == null)
2917              this.datasetId = new StringType();
2918            this.datasetId.setValue(value);
2919          }
2920          return this;
2921        }
2922
2923        /**
2924         * @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
2925         */
2926        public StringType getVariantsetIdElement() { 
2927          if (this.variantsetId == null)
2928            if (Configuration.errorOnAutoCreate())
2929              throw new Error("Attempt to auto-create SequenceRepositoryComponent.variantsetId");
2930            else if (Configuration.doAutoCreate())
2931              this.variantsetId = new StringType(); // bb
2932          return this.variantsetId;
2933        }
2934
2935        public boolean hasVariantsetIdElement() { 
2936          return this.variantsetId != null && !this.variantsetId.isEmpty();
2937        }
2938
2939        public boolean hasVariantsetId() { 
2940          return this.variantsetId != null && !this.variantsetId.isEmpty();
2941        }
2942
2943        /**
2944         * @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
2945         */
2946        public SequenceRepositoryComponent setVariantsetIdElement(StringType value) { 
2947          this.variantsetId = value;
2948          return this;
2949        }
2950
2951        /**
2952         * @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.
2953         */
2954        public String getVariantsetId() { 
2955          return this.variantsetId == null ? null : this.variantsetId.getValue();
2956        }
2957
2958        /**
2959         * @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.
2960         */
2961        public SequenceRepositoryComponent setVariantsetId(String value) { 
2962          if (Utilities.noString(value))
2963            this.variantsetId = null;
2964          else {
2965            if (this.variantsetId == null)
2966              this.variantsetId = new StringType();
2967            this.variantsetId.setValue(value);
2968          }
2969          return this;
2970        }
2971
2972        /**
2973         * @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
2974         */
2975        public StringType getReadsetIdElement() { 
2976          if (this.readsetId == null)
2977            if (Configuration.errorOnAutoCreate())
2978              throw new Error("Attempt to auto-create SequenceRepositoryComponent.readsetId");
2979            else if (Configuration.doAutoCreate())
2980              this.readsetId = new StringType(); // bb
2981          return this.readsetId;
2982        }
2983
2984        public boolean hasReadsetIdElement() { 
2985          return this.readsetId != null && !this.readsetId.isEmpty();
2986        }
2987
2988        public boolean hasReadsetId() { 
2989          return this.readsetId != null && !this.readsetId.isEmpty();
2990        }
2991
2992        /**
2993         * @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
2994         */
2995        public SequenceRepositoryComponent setReadsetIdElement(StringType value) { 
2996          this.readsetId = value;
2997          return this;
2998        }
2999
3000        /**
3001         * @return Id of the read in this external repository.
3002         */
3003        public String getReadsetId() { 
3004          return this.readsetId == null ? null : this.readsetId.getValue();
3005        }
3006
3007        /**
3008         * @param value Id of the read in this external repository.
3009         */
3010        public SequenceRepositoryComponent setReadsetId(String value) { 
3011          if (Utilities.noString(value))
3012            this.readsetId = null;
3013          else {
3014            if (this.readsetId == null)
3015              this.readsetId = new StringType();
3016            this.readsetId.setValue(value);
3017          }
3018          return this;
3019        }
3020
3021        protected void listChildren(List<Property> childrenList) {
3022          super.listChildren(childrenList);
3023          childrenList.add(new Property("type", "code", "Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.", 0, java.lang.Integer.MAX_VALUE, type));
3024          childrenList.add(new Property("url", "uri", "URI of an external repository which contains further details about the genetics data.", 0, java.lang.Integer.MAX_VALUE, url));
3025          childrenList.add(new Property("name", "string", "URI of an external repository which contains further details about the genetics data.", 0, java.lang.Integer.MAX_VALUE, name));
3026          childrenList.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, java.lang.Integer.MAX_VALUE, datasetId));
3027          childrenList.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, java.lang.Integer.MAX_VALUE, variantsetId));
3028          childrenList.add(new Property("readsetId", "string", "Id of the read in this external repository.", 0, java.lang.Integer.MAX_VALUE, readsetId));
3029        }
3030
3031      @Override
3032      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3033        switch (hash) {
3034        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<RepositoryType>
3035        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3036        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3037        case -345342029: /*datasetId*/ return this.datasetId == null ? new Base[0] : new Base[] {this.datasetId}; // StringType
3038        case 1929752504: /*variantsetId*/ return this.variantsetId == null ? new Base[0] : new Base[] {this.variantsetId}; // StringType
3039        case -1095407289: /*readsetId*/ return this.readsetId == null ? new Base[0] : new Base[] {this.readsetId}; // StringType
3040        default: return super.getProperty(hash, name, checkValid);
3041        }
3042
3043      }
3044
3045      @Override
3046      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3047        switch (hash) {
3048        case 3575610: // type
3049          value = new RepositoryTypeEnumFactory().fromType(castToCode(value));
3050          this.type = (Enumeration) value; // Enumeration<RepositoryType>
3051          return value;
3052        case 116079: // url
3053          this.url = castToUri(value); // UriType
3054          return value;
3055        case 3373707: // name
3056          this.name = castToString(value); // StringType
3057          return value;
3058        case -345342029: // datasetId
3059          this.datasetId = castToString(value); // StringType
3060          return value;
3061        case 1929752504: // variantsetId
3062          this.variantsetId = castToString(value); // StringType
3063          return value;
3064        case -1095407289: // readsetId
3065          this.readsetId = castToString(value); // StringType
3066          return value;
3067        default: return super.setProperty(hash, name, value);
3068        }
3069
3070      }
3071
3072      @Override
3073      public Base setProperty(String name, Base value) throws FHIRException {
3074        if (name.equals("type")) {
3075          value = new RepositoryTypeEnumFactory().fromType(castToCode(value));
3076          this.type = (Enumeration) value; // Enumeration<RepositoryType>
3077        } else if (name.equals("url")) {
3078          this.url = castToUri(value); // UriType
3079        } else if (name.equals("name")) {
3080          this.name = castToString(value); // StringType
3081        } else if (name.equals("datasetId")) {
3082          this.datasetId = castToString(value); // StringType
3083        } else if (name.equals("variantsetId")) {
3084          this.variantsetId = castToString(value); // StringType
3085        } else if (name.equals("readsetId")) {
3086          this.readsetId = castToString(value); // StringType
3087        } else
3088          return super.setProperty(name, value);
3089        return value;
3090      }
3091
3092      @Override
3093      public Base makeProperty(int hash, String name) throws FHIRException {
3094        switch (hash) {
3095        case 3575610:  return getTypeElement();
3096        case 116079:  return getUrlElement();
3097        case 3373707:  return getNameElement();
3098        case -345342029:  return getDatasetIdElement();
3099        case 1929752504:  return getVariantsetIdElement();
3100        case -1095407289:  return getReadsetIdElement();
3101        default: return super.makeProperty(hash, name);
3102        }
3103
3104      }
3105
3106      @Override
3107      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3108        switch (hash) {
3109        case 3575610: /*type*/ return new String[] {"code"};
3110        case 116079: /*url*/ return new String[] {"uri"};
3111        case 3373707: /*name*/ return new String[] {"string"};
3112        case -345342029: /*datasetId*/ return new String[] {"string"};
3113        case 1929752504: /*variantsetId*/ return new String[] {"string"};
3114        case -1095407289: /*readsetId*/ return new String[] {"string"};
3115        default: return super.getTypesForProperty(hash, name);
3116        }
3117
3118      }
3119
3120      @Override
3121      public Base addChild(String name) throws FHIRException {
3122        if (name.equals("type")) {
3123          throw new FHIRException("Cannot call addChild on a primitive type Sequence.type");
3124        }
3125        else if (name.equals("url")) {
3126          throw new FHIRException("Cannot call addChild on a primitive type Sequence.url");
3127        }
3128        else if (name.equals("name")) {
3129          throw new FHIRException("Cannot call addChild on a primitive type Sequence.name");
3130        }
3131        else if (name.equals("datasetId")) {
3132          throw new FHIRException("Cannot call addChild on a primitive type Sequence.datasetId");
3133        }
3134        else if (name.equals("variantsetId")) {
3135          throw new FHIRException("Cannot call addChild on a primitive type Sequence.variantsetId");
3136        }
3137        else if (name.equals("readsetId")) {
3138          throw new FHIRException("Cannot call addChild on a primitive type Sequence.readsetId");
3139        }
3140        else
3141          return super.addChild(name);
3142      }
3143
3144      public SequenceRepositoryComponent copy() {
3145        SequenceRepositoryComponent dst = new SequenceRepositoryComponent();
3146        copyValues(dst);
3147        dst.type = type == null ? null : type.copy();
3148        dst.url = url == null ? null : url.copy();
3149        dst.name = name == null ? null : name.copy();
3150        dst.datasetId = datasetId == null ? null : datasetId.copy();
3151        dst.variantsetId = variantsetId == null ? null : variantsetId.copy();
3152        dst.readsetId = readsetId == null ? null : readsetId.copy();
3153        return dst;
3154      }
3155
3156      @Override
3157      public boolean equalsDeep(Base other) {
3158        if (!super.equalsDeep(other))
3159          return false;
3160        if (!(other instanceof SequenceRepositoryComponent))
3161          return false;
3162        SequenceRepositoryComponent o = (SequenceRepositoryComponent) other;
3163        return compareDeep(type, o.type, true) && compareDeep(url, o.url, true) && compareDeep(name, o.name, true)
3164           && compareDeep(datasetId, o.datasetId, true) && compareDeep(variantsetId, o.variantsetId, true)
3165           && compareDeep(readsetId, o.readsetId, true);
3166      }
3167
3168      @Override
3169      public boolean equalsShallow(Base other) {
3170        if (!super.equalsShallow(other))
3171          return false;
3172        if (!(other instanceof SequenceRepositoryComponent))
3173          return false;
3174        SequenceRepositoryComponent o = (SequenceRepositoryComponent) other;
3175        return compareValues(type, o.type, true) && compareValues(url, o.url, true) && compareValues(name, o.name, true)
3176           && compareValues(datasetId, o.datasetId, true) && compareValues(variantsetId, o.variantsetId, true)
3177           && compareValues(readsetId, o.readsetId, true);
3178      }
3179
3180      public boolean isEmpty() {
3181        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, url, name, datasetId
3182          , variantsetId, readsetId);
3183      }
3184
3185  public String fhirType() {
3186    return "Sequence.repository";
3187
3188  }
3189
3190  }
3191
3192    /**
3193     * A unique identifier for this particular sequence instance. This is a FHIR-defined id.
3194     */
3195    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3196    @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." )
3197    protected List<Identifier> identifier;
3198
3199    /**
3200     * Amino Acid Sequence/ DNA Sequence / RNA Sequence.
3201     */
3202    @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true)
3203    @Description(shortDefinition="aa | dna | rna", formalDefinition="Amino Acid Sequence/ DNA Sequence / RNA Sequence." )
3204    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-type")
3205    protected Enumeration<SequenceType> type;
3206
3207    /**
3208     * 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).
3209     */
3210    @Child(name = "coordinateSystem", type = {IntegerType.class}, order=2, min=1, max=1, modifier=false, summary=true)
3211    @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)." )
3212    protected IntegerType coordinateSystem;
3213
3214    /**
3215     * The patient whose sequencing results are described by this resource.
3216     */
3217    @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1, modifier=false, summary=true)
3218    @Description(shortDefinition="Who and/or what this is about", formalDefinition="The patient whose sequencing results are described by this resource." )
3219    protected Reference patient;
3220
3221    /**
3222     * The actual object that is the target of the reference (The patient whose sequencing results are described by this resource.)
3223     */
3224    protected Patient patientTarget;
3225
3226    /**
3227     * Specimen used for sequencing.
3228     */
3229    @Child(name = "specimen", type = {Specimen.class}, order=4, min=0, max=1, modifier=false, summary=true)
3230    @Description(shortDefinition="Specimen used for sequencing", formalDefinition="Specimen used for sequencing." )
3231    protected Reference specimen;
3232
3233    /**
3234     * The actual object that is the target of the reference (Specimen used for sequencing.)
3235     */
3236    protected Specimen specimenTarget;
3237
3238    /**
3239     * The method for sequencing, for example, chip information.
3240     */
3241    @Child(name = "device", type = {Device.class}, order=5, min=0, max=1, modifier=false, summary=true)
3242    @Description(shortDefinition="The method for sequencing", formalDefinition="The method for sequencing, for example, chip information." )
3243    protected Reference device;
3244
3245    /**
3246     * The actual object that is the target of the reference (The method for sequencing, for example, chip information.)
3247     */
3248    protected Device deviceTarget;
3249
3250    /**
3251     * The organization or lab that should be responsible for this result.
3252     */
3253    @Child(name = "performer", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
3254    @Description(shortDefinition="Who should be responsible for test result", formalDefinition="The organization or lab that should be responsible for this result." )
3255    protected Reference performer;
3256
3257    /**
3258     * The actual object that is the target of the reference (The organization or lab that should be responsible for this result.)
3259     */
3260    protected Organization performerTarget;
3261
3262    /**
3263     * The number of copies of the seqeunce of interest. (RNASeq).
3264     */
3265    @Child(name = "quantity", type = {Quantity.class}, order=7, min=0, max=1, modifier=false, summary=true)
3266    @Description(shortDefinition="The number of copies of the seqeunce of interest.  (RNASeq)", formalDefinition="The number of copies of the seqeunce of interest. (RNASeq)." )
3267    protected Quantity quantity;
3268
3269    /**
3270     * A sequence that is used as a reference to describe variants that are present in a sequence analyzed.
3271     */
3272    @Child(name = "referenceSeq", type = {}, order=8, min=0, max=1, modifier=false, summary=true)
3273    @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." )
3274    protected SequenceReferenceSeqComponent referenceSeq;
3275
3276    /**
3277     * 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.
3278     */
3279    @Child(name = "variant", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3280    @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." )
3281    protected List<SequenceVariantComponent> variant;
3282
3283    /**
3284     * 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.
3285     */
3286    @Child(name = "observedSeq", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true)
3287    @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." )
3288    protected StringType observedSeq;
3289
3290    /**
3291     * 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)).
3292     */
3293    @Child(name = "quality", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3294    @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))." )
3295    protected List<SequenceQualityComponent> quality;
3296
3297    /**
3298     * Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.
3299     */
3300    @Child(name = "readCoverage", type = {IntegerType.class}, order=12, min=0, max=1, modifier=false, summary=true)
3301    @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." )
3302    protected IntegerType readCoverage;
3303
3304    /**
3305     * Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.
3306     */
3307    @Child(name = "repository", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3308    @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." )
3309    protected List<SequenceRepositoryComponent> repository;
3310
3311    /**
3312     * Pointer to next atomic sequence which at most contains one variant.
3313     */
3314    @Child(name = "pointer", type = {Sequence.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3315    @Description(shortDefinition="Pointer to next atomic sequence", formalDefinition="Pointer to next atomic sequence which at most contains one variant." )
3316    protected List<Reference> pointer;
3317    /**
3318     * The actual objects that are the target of the reference (Pointer to next atomic sequence which at most contains one variant.)
3319     */
3320    protected List<Sequence> pointerTarget;
3321
3322
3323    private static final long serialVersionUID = -2101352712L;
3324
3325  /**
3326   * Constructor
3327   */
3328    public Sequence() {
3329      super();
3330    }
3331
3332  /**
3333   * Constructor
3334   */
3335    public Sequence(IntegerType coordinateSystem) {
3336      super();
3337      this.coordinateSystem = coordinateSystem;
3338    }
3339
3340    /**
3341     * @return {@link #identifier} (A unique identifier for this particular sequence instance. This is a FHIR-defined id.)
3342     */
3343    public List<Identifier> getIdentifier() { 
3344      if (this.identifier == null)
3345        this.identifier = new ArrayList<Identifier>();
3346      return this.identifier;
3347    }
3348
3349    /**
3350     * @return Returns a reference to <code>this</code> for easy method chaining
3351     */
3352    public Sequence setIdentifier(List<Identifier> theIdentifier) { 
3353      this.identifier = theIdentifier;
3354      return this;
3355    }
3356
3357    public boolean hasIdentifier() { 
3358      if (this.identifier == null)
3359        return false;
3360      for (Identifier item : this.identifier)
3361        if (!item.isEmpty())
3362          return true;
3363      return false;
3364    }
3365
3366    public Identifier addIdentifier() { //3
3367      Identifier t = new Identifier();
3368      if (this.identifier == null)
3369        this.identifier = new ArrayList<Identifier>();
3370      this.identifier.add(t);
3371      return t;
3372    }
3373
3374    public Sequence addIdentifier(Identifier t) { //3
3375      if (t == null)
3376        return this;
3377      if (this.identifier == null)
3378        this.identifier = new ArrayList<Identifier>();
3379      this.identifier.add(t);
3380      return this;
3381    }
3382
3383    /**
3384     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
3385     */
3386    public Identifier getIdentifierFirstRep() { 
3387      if (getIdentifier().isEmpty()) {
3388        addIdentifier();
3389      }
3390      return getIdentifier().get(0);
3391    }
3392
3393    /**
3394     * @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
3395     */
3396    public Enumeration<SequenceType> getTypeElement() { 
3397      if (this.type == null)
3398        if (Configuration.errorOnAutoCreate())
3399          throw new Error("Attempt to auto-create Sequence.type");
3400        else if (Configuration.doAutoCreate())
3401          this.type = new Enumeration<SequenceType>(new SequenceTypeEnumFactory()); // bb
3402      return this.type;
3403    }
3404
3405    public boolean hasTypeElement() { 
3406      return this.type != null && !this.type.isEmpty();
3407    }
3408
3409    public boolean hasType() { 
3410      return this.type != null && !this.type.isEmpty();
3411    }
3412
3413    /**
3414     * @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
3415     */
3416    public Sequence setTypeElement(Enumeration<SequenceType> value) { 
3417      this.type = value;
3418      return this;
3419    }
3420
3421    /**
3422     * @return Amino Acid Sequence/ DNA Sequence / RNA Sequence.
3423     */
3424    public SequenceType getType() { 
3425      return this.type == null ? null : this.type.getValue();
3426    }
3427
3428    /**
3429     * @param value Amino Acid Sequence/ DNA Sequence / RNA Sequence.
3430     */
3431    public Sequence setType(SequenceType value) { 
3432      if (value == null)
3433        this.type = null;
3434      else {
3435        if (this.type == null)
3436          this.type = new Enumeration<SequenceType>(new SequenceTypeEnumFactory());
3437        this.type.setValue(value);
3438      }
3439      return this;
3440    }
3441
3442    /**
3443     * @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
3444     */
3445    public IntegerType getCoordinateSystemElement() { 
3446      if (this.coordinateSystem == null)
3447        if (Configuration.errorOnAutoCreate())
3448          throw new Error("Attempt to auto-create Sequence.coordinateSystem");
3449        else if (Configuration.doAutoCreate())
3450          this.coordinateSystem = new IntegerType(); // bb
3451      return this.coordinateSystem;
3452    }
3453
3454    public boolean hasCoordinateSystemElement() { 
3455      return this.coordinateSystem != null && !this.coordinateSystem.isEmpty();
3456    }
3457
3458    public boolean hasCoordinateSystem() { 
3459      return this.coordinateSystem != null && !this.coordinateSystem.isEmpty();
3460    }
3461
3462    /**
3463     * @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
3464     */
3465    public Sequence setCoordinateSystemElement(IntegerType value) { 
3466      this.coordinateSystem = value;
3467      return this;
3468    }
3469
3470    /**
3471     * @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).
3472     */
3473    public int getCoordinateSystem() { 
3474      return this.coordinateSystem == null || this.coordinateSystem.isEmpty() ? 0 : this.coordinateSystem.getValue();
3475    }
3476
3477    /**
3478     * @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).
3479     */
3480    public Sequence setCoordinateSystem(int value) { 
3481        if (this.coordinateSystem == null)
3482          this.coordinateSystem = new IntegerType();
3483        this.coordinateSystem.setValue(value);
3484      return this;
3485    }
3486
3487    /**
3488     * @return {@link #patient} (The patient whose sequencing results are described by this resource.)
3489     */
3490    public Reference getPatient() { 
3491      if (this.patient == null)
3492        if (Configuration.errorOnAutoCreate())
3493          throw new Error("Attempt to auto-create Sequence.patient");
3494        else if (Configuration.doAutoCreate())
3495          this.patient = new Reference(); // cc
3496      return this.patient;
3497    }
3498
3499    public boolean hasPatient() { 
3500      return this.patient != null && !this.patient.isEmpty();
3501    }
3502
3503    /**
3504     * @param value {@link #patient} (The patient whose sequencing results are described by this resource.)
3505     */
3506    public Sequence setPatient(Reference value) { 
3507      this.patient = value;
3508      return this;
3509    }
3510
3511    /**
3512     * @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.)
3513     */
3514    public Patient getPatientTarget() { 
3515      if (this.patientTarget == null)
3516        if (Configuration.errorOnAutoCreate())
3517          throw new Error("Attempt to auto-create Sequence.patient");
3518        else if (Configuration.doAutoCreate())
3519          this.patientTarget = new Patient(); // aa
3520      return this.patientTarget;
3521    }
3522
3523    /**
3524     * @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.)
3525     */
3526    public Sequence setPatientTarget(Patient value) { 
3527      this.patientTarget = value;
3528      return this;
3529    }
3530
3531    /**
3532     * @return {@link #specimen} (Specimen used for sequencing.)
3533     */
3534    public Reference getSpecimen() { 
3535      if (this.specimen == null)
3536        if (Configuration.errorOnAutoCreate())
3537          throw new Error("Attempt to auto-create Sequence.specimen");
3538        else if (Configuration.doAutoCreate())
3539          this.specimen = new Reference(); // cc
3540      return this.specimen;
3541    }
3542
3543    public boolean hasSpecimen() { 
3544      return this.specimen != null && !this.specimen.isEmpty();
3545    }
3546
3547    /**
3548     * @param value {@link #specimen} (Specimen used for sequencing.)
3549     */
3550    public Sequence setSpecimen(Reference value) { 
3551      this.specimen = value;
3552      return this;
3553    }
3554
3555    /**
3556     * @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.)
3557     */
3558    public Specimen getSpecimenTarget() { 
3559      if (this.specimenTarget == null)
3560        if (Configuration.errorOnAutoCreate())
3561          throw new Error("Attempt to auto-create Sequence.specimen");
3562        else if (Configuration.doAutoCreate())
3563          this.specimenTarget = new Specimen(); // aa
3564      return this.specimenTarget;
3565    }
3566
3567    /**
3568     * @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.)
3569     */
3570    public Sequence setSpecimenTarget(Specimen value) { 
3571      this.specimenTarget = value;
3572      return this;
3573    }
3574
3575    /**
3576     * @return {@link #device} (The method for sequencing, for example, chip information.)
3577     */
3578    public Reference getDevice() { 
3579      if (this.device == null)
3580        if (Configuration.errorOnAutoCreate())
3581          throw new Error("Attempt to auto-create Sequence.device");
3582        else if (Configuration.doAutoCreate())
3583          this.device = new Reference(); // cc
3584      return this.device;
3585    }
3586
3587    public boolean hasDevice() { 
3588      return this.device != null && !this.device.isEmpty();
3589    }
3590
3591    /**
3592     * @param value {@link #device} (The method for sequencing, for example, chip information.)
3593     */
3594    public Sequence setDevice(Reference value) { 
3595      this.device = value;
3596      return this;
3597    }
3598
3599    /**
3600     * @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.)
3601     */
3602    public Device getDeviceTarget() { 
3603      if (this.deviceTarget == null)
3604        if (Configuration.errorOnAutoCreate())
3605          throw new Error("Attempt to auto-create Sequence.device");
3606        else if (Configuration.doAutoCreate())
3607          this.deviceTarget = new Device(); // aa
3608      return this.deviceTarget;
3609    }
3610
3611    /**
3612     * @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.)
3613     */
3614    public Sequence setDeviceTarget(Device value) { 
3615      this.deviceTarget = value;
3616      return this;
3617    }
3618
3619    /**
3620     * @return {@link #performer} (The organization or lab that should be responsible for this result.)
3621     */
3622    public Reference getPerformer() { 
3623      if (this.performer == null)
3624        if (Configuration.errorOnAutoCreate())
3625          throw new Error("Attempt to auto-create Sequence.performer");
3626        else if (Configuration.doAutoCreate())
3627          this.performer = new Reference(); // cc
3628      return this.performer;
3629    }
3630
3631    public boolean hasPerformer() { 
3632      return this.performer != null && !this.performer.isEmpty();
3633    }
3634
3635    /**
3636     * @param value {@link #performer} (The organization or lab that should be responsible for this result.)
3637     */
3638    public Sequence setPerformer(Reference value) { 
3639      this.performer = value;
3640      return this;
3641    }
3642
3643    /**
3644     * @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.)
3645     */
3646    public Organization getPerformerTarget() { 
3647      if (this.performerTarget == null)
3648        if (Configuration.errorOnAutoCreate())
3649          throw new Error("Attempt to auto-create Sequence.performer");
3650        else if (Configuration.doAutoCreate())
3651          this.performerTarget = new Organization(); // aa
3652      return this.performerTarget;
3653    }
3654
3655    /**
3656     * @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.)
3657     */
3658    public Sequence setPerformerTarget(Organization value) { 
3659      this.performerTarget = value;
3660      return this;
3661    }
3662
3663    /**
3664     * @return {@link #quantity} (The number of copies of the seqeunce of interest. (RNASeq).)
3665     */
3666    public Quantity getQuantity() { 
3667      if (this.quantity == null)
3668        if (Configuration.errorOnAutoCreate())
3669          throw new Error("Attempt to auto-create Sequence.quantity");
3670        else if (Configuration.doAutoCreate())
3671          this.quantity = new Quantity(); // cc
3672      return this.quantity;
3673    }
3674
3675    public boolean hasQuantity() { 
3676      return this.quantity != null && !this.quantity.isEmpty();
3677    }
3678
3679    /**
3680     * @param value {@link #quantity} (The number of copies of the seqeunce of interest. (RNASeq).)
3681     */
3682    public Sequence setQuantity(Quantity value) { 
3683      this.quantity = value;
3684      return this;
3685    }
3686
3687    /**
3688     * @return {@link #referenceSeq} (A sequence that is used as a reference to describe variants that are present in a sequence analyzed.)
3689     */
3690    public SequenceReferenceSeqComponent getReferenceSeq() { 
3691      if (this.referenceSeq == null)
3692        if (Configuration.errorOnAutoCreate())
3693          throw new Error("Attempt to auto-create Sequence.referenceSeq");
3694        else if (Configuration.doAutoCreate())
3695          this.referenceSeq = new SequenceReferenceSeqComponent(); // cc
3696      return this.referenceSeq;
3697    }
3698
3699    public boolean hasReferenceSeq() { 
3700      return this.referenceSeq != null && !this.referenceSeq.isEmpty();
3701    }
3702
3703    /**
3704     * @param value {@link #referenceSeq} (A sequence that is used as a reference to describe variants that are present in a sequence analyzed.)
3705     */
3706    public Sequence setReferenceSeq(SequenceReferenceSeqComponent value) { 
3707      this.referenceSeq = value;
3708      return this;
3709    }
3710
3711    /**
3712     * @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.)
3713     */
3714    public List<SequenceVariantComponent> getVariant() { 
3715      if (this.variant == null)
3716        this.variant = new ArrayList<SequenceVariantComponent>();
3717      return this.variant;
3718    }
3719
3720    /**
3721     * @return Returns a reference to <code>this</code> for easy method chaining
3722     */
3723    public Sequence setVariant(List<SequenceVariantComponent> theVariant) { 
3724      this.variant = theVariant;
3725      return this;
3726    }
3727
3728    public boolean hasVariant() { 
3729      if (this.variant == null)
3730        return false;
3731      for (SequenceVariantComponent item : this.variant)
3732        if (!item.isEmpty())
3733          return true;
3734      return false;
3735    }
3736
3737    public SequenceVariantComponent addVariant() { //3
3738      SequenceVariantComponent t = new SequenceVariantComponent();
3739      if (this.variant == null)
3740        this.variant = new ArrayList<SequenceVariantComponent>();
3741      this.variant.add(t);
3742      return t;
3743    }
3744
3745    public Sequence addVariant(SequenceVariantComponent t) { //3
3746      if (t == null)
3747        return this;
3748      if (this.variant == null)
3749        this.variant = new ArrayList<SequenceVariantComponent>();
3750      this.variant.add(t);
3751      return this;
3752    }
3753
3754    /**
3755     * @return The first repetition of repeating field {@link #variant}, creating it if it does not already exist
3756     */
3757    public SequenceVariantComponent getVariantFirstRep() { 
3758      if (getVariant().isEmpty()) {
3759        addVariant();
3760      }
3761      return getVariant().get(0);
3762    }
3763
3764    /**
3765     * @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
3766     */
3767    public StringType getObservedSeqElement() { 
3768      if (this.observedSeq == null)
3769        if (Configuration.errorOnAutoCreate())
3770          throw new Error("Attempt to auto-create Sequence.observedSeq");
3771        else if (Configuration.doAutoCreate())
3772          this.observedSeq = new StringType(); // bb
3773      return this.observedSeq;
3774    }
3775
3776    public boolean hasObservedSeqElement() { 
3777      return this.observedSeq != null && !this.observedSeq.isEmpty();
3778    }
3779
3780    public boolean hasObservedSeq() { 
3781      return this.observedSeq != null && !this.observedSeq.isEmpty();
3782    }
3783
3784    /**
3785     * @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
3786     */
3787    public Sequence setObservedSeqElement(StringType value) { 
3788      this.observedSeq = value;
3789      return this;
3790    }
3791
3792    /**
3793     * @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.
3794     */
3795    public String getObservedSeq() { 
3796      return this.observedSeq == null ? null : this.observedSeq.getValue();
3797    }
3798
3799    /**
3800     * @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.
3801     */
3802    public Sequence setObservedSeq(String value) { 
3803      if (Utilities.noString(value))
3804        this.observedSeq = null;
3805      else {
3806        if (this.observedSeq == null)
3807          this.observedSeq = new StringType();
3808        this.observedSeq.setValue(value);
3809      }
3810      return this;
3811    }
3812
3813    /**
3814     * @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)).)
3815     */
3816    public List<SequenceQualityComponent> getQuality() { 
3817      if (this.quality == null)
3818        this.quality = new ArrayList<SequenceQualityComponent>();
3819      return this.quality;
3820    }
3821
3822    /**
3823     * @return Returns a reference to <code>this</code> for easy method chaining
3824     */
3825    public Sequence setQuality(List<SequenceQualityComponent> theQuality) { 
3826      this.quality = theQuality;
3827      return this;
3828    }
3829
3830    public boolean hasQuality() { 
3831      if (this.quality == null)
3832        return false;
3833      for (SequenceQualityComponent item : this.quality)
3834        if (!item.isEmpty())
3835          return true;
3836      return false;
3837    }
3838
3839    public SequenceQualityComponent addQuality() { //3
3840      SequenceQualityComponent t = new SequenceQualityComponent();
3841      if (this.quality == null)
3842        this.quality = new ArrayList<SequenceQualityComponent>();
3843      this.quality.add(t);
3844      return t;
3845    }
3846
3847    public Sequence addQuality(SequenceQualityComponent t) { //3
3848      if (t == null)
3849        return this;
3850      if (this.quality == null)
3851        this.quality = new ArrayList<SequenceQualityComponent>();
3852      this.quality.add(t);
3853      return this;
3854    }
3855
3856    /**
3857     * @return The first repetition of repeating field {@link #quality}, creating it if it does not already exist
3858     */
3859    public SequenceQualityComponent getQualityFirstRep() { 
3860      if (getQuality().isEmpty()) {
3861        addQuality();
3862      }
3863      return getQuality().get(0);
3864    }
3865
3866    /**
3867     * @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
3868     */
3869    public IntegerType getReadCoverageElement() { 
3870      if (this.readCoverage == null)
3871        if (Configuration.errorOnAutoCreate())
3872          throw new Error("Attempt to auto-create Sequence.readCoverage");
3873        else if (Configuration.doAutoCreate())
3874          this.readCoverage = new IntegerType(); // bb
3875      return this.readCoverage;
3876    }
3877
3878    public boolean hasReadCoverageElement() { 
3879      return this.readCoverage != null && !this.readCoverage.isEmpty();
3880    }
3881
3882    public boolean hasReadCoverage() { 
3883      return this.readCoverage != null && !this.readCoverage.isEmpty();
3884    }
3885
3886    /**
3887     * @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
3888     */
3889    public Sequence setReadCoverageElement(IntegerType value) { 
3890      this.readCoverage = value;
3891      return this;
3892    }
3893
3894    /**
3895     * @return Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.
3896     */
3897    public int getReadCoverage() { 
3898      return this.readCoverage == null || this.readCoverage.isEmpty() ? 0 : this.readCoverage.getValue();
3899    }
3900
3901    /**
3902     * @param value Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.
3903     */
3904    public Sequence setReadCoverage(int value) { 
3905        if (this.readCoverage == null)
3906          this.readCoverage = new IntegerType();
3907        this.readCoverage.setValue(value);
3908      return this;
3909    }
3910
3911    /**
3912     * @return {@link #repository} (Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.)
3913     */
3914    public List<SequenceRepositoryComponent> getRepository() { 
3915      if (this.repository == null)
3916        this.repository = new ArrayList<SequenceRepositoryComponent>();
3917      return this.repository;
3918    }
3919
3920    /**
3921     * @return Returns a reference to <code>this</code> for easy method chaining
3922     */
3923    public Sequence setRepository(List<SequenceRepositoryComponent> theRepository) { 
3924      this.repository = theRepository;
3925      return this;
3926    }
3927
3928    public boolean hasRepository() { 
3929      if (this.repository == null)
3930        return false;
3931      for (SequenceRepositoryComponent item : this.repository)
3932        if (!item.isEmpty())
3933          return true;
3934      return false;
3935    }
3936
3937    public SequenceRepositoryComponent addRepository() { //3
3938      SequenceRepositoryComponent t = new SequenceRepositoryComponent();
3939      if (this.repository == null)
3940        this.repository = new ArrayList<SequenceRepositoryComponent>();
3941      this.repository.add(t);
3942      return t;
3943    }
3944
3945    public Sequence addRepository(SequenceRepositoryComponent t) { //3
3946      if (t == null)
3947        return this;
3948      if (this.repository == null)
3949        this.repository = new ArrayList<SequenceRepositoryComponent>();
3950      this.repository.add(t);
3951      return this;
3952    }
3953
3954    /**
3955     * @return The first repetition of repeating field {@link #repository}, creating it if it does not already exist
3956     */
3957    public SequenceRepositoryComponent getRepositoryFirstRep() { 
3958      if (getRepository().isEmpty()) {
3959        addRepository();
3960      }
3961      return getRepository().get(0);
3962    }
3963
3964    /**
3965     * @return {@link #pointer} (Pointer to next atomic sequence which at most contains one variant.)
3966     */
3967    public List<Reference> getPointer() { 
3968      if (this.pointer == null)
3969        this.pointer = new ArrayList<Reference>();
3970      return this.pointer;
3971    }
3972
3973    /**
3974     * @return Returns a reference to <code>this</code> for easy method chaining
3975     */
3976    public Sequence setPointer(List<Reference> thePointer) { 
3977      this.pointer = thePointer;
3978      return this;
3979    }
3980
3981    public boolean hasPointer() { 
3982      if (this.pointer == null)
3983        return false;
3984      for (Reference item : this.pointer)
3985        if (!item.isEmpty())
3986          return true;
3987      return false;
3988    }
3989
3990    public Reference addPointer() { //3
3991      Reference t = new Reference();
3992      if (this.pointer == null)
3993        this.pointer = new ArrayList<Reference>();
3994      this.pointer.add(t);
3995      return t;
3996    }
3997
3998    public Sequence addPointer(Reference t) { //3
3999      if (t == null)
4000        return this;
4001      if (this.pointer == null)
4002        this.pointer = new ArrayList<Reference>();
4003      this.pointer.add(t);
4004      return this;
4005    }
4006
4007    /**
4008     * @return The first repetition of repeating field {@link #pointer}, creating it if it does not already exist
4009     */
4010    public Reference getPointerFirstRep() { 
4011      if (getPointer().isEmpty()) {
4012        addPointer();
4013      }
4014      return getPointer().get(0);
4015    }
4016
4017    /**
4018     * @deprecated Use Reference#setResource(IBaseResource) instead
4019     */
4020    @Deprecated
4021    public List<Sequence> getPointerTarget() { 
4022      if (this.pointerTarget == null)
4023        this.pointerTarget = new ArrayList<Sequence>();
4024      return this.pointerTarget;
4025    }
4026
4027    /**
4028     * @deprecated Use Reference#setResource(IBaseResource) instead
4029     */
4030    @Deprecated
4031    public Sequence addPointerTarget() { 
4032      Sequence r = new Sequence();
4033      if (this.pointerTarget == null)
4034        this.pointerTarget = new ArrayList<Sequence>();
4035      this.pointerTarget.add(r);
4036      return r;
4037    }
4038
4039      protected void listChildren(List<Property> childrenList) {
4040        super.listChildren(childrenList);
4041        childrenList.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));
4042        childrenList.add(new Property("type", "code", "Amino Acid Sequence/ DNA Sequence / RNA Sequence.", 0, java.lang.Integer.MAX_VALUE, type));
4043        childrenList.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, java.lang.Integer.MAX_VALUE, coordinateSystem));
4044        childrenList.add(new Property("patient", "Reference(Patient)", "The patient whose sequencing results are described by this resource.", 0, java.lang.Integer.MAX_VALUE, patient));
4045        childrenList.add(new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, java.lang.Integer.MAX_VALUE, specimen));
4046        childrenList.add(new Property("device", "Reference(Device)", "The method for sequencing, for example, chip information.", 0, java.lang.Integer.MAX_VALUE, device));
4047        childrenList.add(new Property("performer", "Reference(Organization)", "The organization or lab that should be responsible for this result.", 0, java.lang.Integer.MAX_VALUE, performer));
4048        childrenList.add(new Property("quantity", "Quantity", "The number of copies of the seqeunce of interest. (RNASeq).", 0, java.lang.Integer.MAX_VALUE, quantity));
4049        childrenList.add(new Property("referenceSeq", "", "A sequence that is used as a reference to describe variants that are present in a sequence analyzed.", 0, java.lang.Integer.MAX_VALUE, referenceSeq));
4050        childrenList.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));
4051        childrenList.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, java.lang.Integer.MAX_VALUE, observedSeq));
4052        childrenList.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));
4053        childrenList.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, java.lang.Integer.MAX_VALUE, readCoverage));
4054        childrenList.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));
4055        childrenList.add(new Property("pointer", "Reference(Sequence)", "Pointer to next atomic sequence which at most contains one variant.", 0, java.lang.Integer.MAX_VALUE, pointer));
4056      }
4057
4058      @Override
4059      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4060        switch (hash) {
4061        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
4062        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<SequenceType>
4063        case 354212295: /*coordinateSystem*/ return this.coordinateSystem == null ? new Base[0] : new Base[] {this.coordinateSystem}; // IntegerType
4064        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
4065        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : new Base[] {this.specimen}; // Reference
4066        case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference
4067        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference
4068        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
4069        case -502547180: /*referenceSeq*/ return this.referenceSeq == null ? new Base[0] : new Base[] {this.referenceSeq}; // SequenceReferenceSeqComponent
4070        case 236785797: /*variant*/ return this.variant == null ? new Base[0] : this.variant.toArray(new Base[this.variant.size()]); // SequenceVariantComponent
4071        case 125541495: /*observedSeq*/ return this.observedSeq == null ? new Base[0] : new Base[] {this.observedSeq}; // StringType
4072        case 651215103: /*quality*/ return this.quality == null ? new Base[0] : this.quality.toArray(new Base[this.quality.size()]); // SequenceQualityComponent
4073        case -1798816354: /*readCoverage*/ return this.readCoverage == null ? new Base[0] : new Base[] {this.readCoverage}; // IntegerType
4074        case 1950800714: /*repository*/ return this.repository == null ? new Base[0] : this.repository.toArray(new Base[this.repository.size()]); // SequenceRepositoryComponent
4075        case -400605635: /*pointer*/ return this.pointer == null ? new Base[0] : this.pointer.toArray(new Base[this.pointer.size()]); // Reference
4076        default: return super.getProperty(hash, name, checkValid);
4077        }
4078
4079      }
4080
4081      @Override
4082      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4083        switch (hash) {
4084        case -1618432855: // identifier
4085          this.getIdentifier().add(castToIdentifier(value)); // Identifier
4086          return value;
4087        case 3575610: // type
4088          value = new SequenceTypeEnumFactory().fromType(castToCode(value));
4089          this.type = (Enumeration) value; // Enumeration<SequenceType>
4090          return value;
4091        case 354212295: // coordinateSystem
4092          this.coordinateSystem = castToInteger(value); // IntegerType
4093          return value;
4094        case -791418107: // patient
4095          this.patient = castToReference(value); // Reference
4096          return value;
4097        case -2132868344: // specimen
4098          this.specimen = castToReference(value); // Reference
4099          return value;
4100        case -1335157162: // device
4101          this.device = castToReference(value); // Reference
4102          return value;
4103        case 481140686: // performer
4104          this.performer = castToReference(value); // Reference
4105          return value;
4106        case -1285004149: // quantity
4107          this.quantity = castToQuantity(value); // Quantity
4108          return value;
4109        case -502547180: // referenceSeq
4110          this.referenceSeq = (SequenceReferenceSeqComponent) value; // SequenceReferenceSeqComponent
4111          return value;
4112        case 236785797: // variant
4113          this.getVariant().add((SequenceVariantComponent) value); // SequenceVariantComponent
4114          return value;
4115        case 125541495: // observedSeq
4116          this.observedSeq = castToString(value); // StringType
4117          return value;
4118        case 651215103: // quality
4119          this.getQuality().add((SequenceQualityComponent) value); // SequenceQualityComponent
4120          return value;
4121        case -1798816354: // readCoverage
4122          this.readCoverage = castToInteger(value); // IntegerType
4123          return value;
4124        case 1950800714: // repository
4125          this.getRepository().add((SequenceRepositoryComponent) value); // SequenceRepositoryComponent
4126          return value;
4127        case -400605635: // pointer
4128          this.getPointer().add(castToReference(value)); // Reference
4129          return value;
4130        default: return super.setProperty(hash, name, value);
4131        }
4132
4133      }
4134
4135      @Override
4136      public Base setProperty(String name, Base value) throws FHIRException {
4137        if (name.equals("identifier")) {
4138          this.getIdentifier().add(castToIdentifier(value));
4139        } else if (name.equals("type")) {
4140          value = new SequenceTypeEnumFactory().fromType(castToCode(value));
4141          this.type = (Enumeration) value; // Enumeration<SequenceType>
4142        } else if (name.equals("coordinateSystem")) {
4143          this.coordinateSystem = castToInteger(value); // IntegerType
4144        } else if (name.equals("patient")) {
4145          this.patient = castToReference(value); // Reference
4146        } else if (name.equals("specimen")) {
4147          this.specimen = castToReference(value); // Reference
4148        } else if (name.equals("device")) {
4149          this.device = castToReference(value); // Reference
4150        } else if (name.equals("performer")) {
4151          this.performer = castToReference(value); // Reference
4152        } else if (name.equals("quantity")) {
4153          this.quantity = castToQuantity(value); // Quantity
4154        } else if (name.equals("referenceSeq")) {
4155          this.referenceSeq = (SequenceReferenceSeqComponent) value; // SequenceReferenceSeqComponent
4156        } else if (name.equals("variant")) {
4157          this.getVariant().add((SequenceVariantComponent) value);
4158        } else if (name.equals("observedSeq")) {
4159          this.observedSeq = castToString(value); // StringType
4160        } else if (name.equals("quality")) {
4161          this.getQuality().add((SequenceQualityComponent) value);
4162        } else if (name.equals("readCoverage")) {
4163          this.readCoverage = castToInteger(value); // IntegerType
4164        } else if (name.equals("repository")) {
4165          this.getRepository().add((SequenceRepositoryComponent) value);
4166        } else if (name.equals("pointer")) {
4167          this.getPointer().add(castToReference(value));
4168        } else
4169          return super.setProperty(name, value);
4170        return value;
4171      }
4172
4173      @Override
4174      public Base makeProperty(int hash, String name) throws FHIRException {
4175        switch (hash) {
4176        case -1618432855:  return addIdentifier(); 
4177        case 3575610:  return getTypeElement();
4178        case 354212295:  return getCoordinateSystemElement();
4179        case -791418107:  return getPatient(); 
4180        case -2132868344:  return getSpecimen(); 
4181        case -1335157162:  return getDevice(); 
4182        case 481140686:  return getPerformer(); 
4183        case -1285004149:  return getQuantity(); 
4184        case -502547180:  return getReferenceSeq(); 
4185        case 236785797:  return addVariant(); 
4186        case 125541495:  return getObservedSeqElement();
4187        case 651215103:  return addQuality(); 
4188        case -1798816354:  return getReadCoverageElement();
4189        case 1950800714:  return addRepository(); 
4190        case -400605635:  return addPointer(); 
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 -1618432855: /*identifier*/ return new String[] {"Identifier"};
4200        case 3575610: /*type*/ return new String[] {"code"};
4201        case 354212295: /*coordinateSystem*/ return new String[] {"integer"};
4202        case -791418107: /*patient*/ return new String[] {"Reference"};
4203        case -2132868344: /*specimen*/ return new String[] {"Reference"};
4204        case -1335157162: /*device*/ return new String[] {"Reference"};
4205        case 481140686: /*performer*/ return new String[] {"Reference"};
4206        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
4207        case -502547180: /*referenceSeq*/ return new String[] {};
4208        case 236785797: /*variant*/ return new String[] {};
4209        case 125541495: /*observedSeq*/ return new String[] {"string"};
4210        case 651215103: /*quality*/ return new String[] {};
4211        case -1798816354: /*readCoverage*/ return new String[] {"integer"};
4212        case 1950800714: /*repository*/ return new String[] {};
4213        case -400605635: /*pointer*/ return new String[] {"Reference"};
4214        default: return super.getTypesForProperty(hash, name);
4215        }
4216
4217      }
4218
4219      @Override
4220      public Base addChild(String name) throws FHIRException {
4221        if (name.equals("identifier")) {
4222          return addIdentifier();
4223        }
4224        else if (name.equals("type")) {
4225          throw new FHIRException("Cannot call addChild on a primitive type Sequence.type");
4226        }
4227        else if (name.equals("coordinateSystem")) {
4228          throw new FHIRException("Cannot call addChild on a primitive type Sequence.coordinateSystem");
4229        }
4230        else if (name.equals("patient")) {
4231          this.patient = new Reference();
4232          return this.patient;
4233        }
4234        else if (name.equals("specimen")) {
4235          this.specimen = new Reference();
4236          return this.specimen;
4237        }
4238        else if (name.equals("device")) {
4239          this.device = new Reference();
4240          return this.device;
4241        }
4242        else if (name.equals("performer")) {
4243          this.performer = new Reference();
4244          return this.performer;
4245        }
4246        else if (name.equals("quantity")) {
4247          this.quantity = new Quantity();
4248          return this.quantity;
4249        }
4250        else if (name.equals("referenceSeq")) {
4251          this.referenceSeq = new SequenceReferenceSeqComponent();
4252          return this.referenceSeq;
4253        }
4254        else if (name.equals("variant")) {
4255          return addVariant();
4256        }
4257        else if (name.equals("observedSeq")) {
4258          throw new FHIRException("Cannot call addChild on a primitive type Sequence.observedSeq");
4259        }
4260        else if (name.equals("quality")) {
4261          return addQuality();
4262        }
4263        else if (name.equals("readCoverage")) {
4264          throw new FHIRException("Cannot call addChild on a primitive type Sequence.readCoverage");
4265        }
4266        else if (name.equals("repository")) {
4267          return addRepository();
4268        }
4269        else if (name.equals("pointer")) {
4270          return addPointer();
4271        }
4272        else
4273          return super.addChild(name);
4274      }
4275
4276  public String fhirType() {
4277    return "Sequence";
4278
4279  }
4280
4281      public Sequence copy() {
4282        Sequence dst = new Sequence();
4283        copyValues(dst);
4284        if (identifier != null) {
4285          dst.identifier = new ArrayList<Identifier>();
4286          for (Identifier i : identifier)
4287            dst.identifier.add(i.copy());
4288        };
4289        dst.type = type == null ? null : type.copy();
4290        dst.coordinateSystem = coordinateSystem == null ? null : coordinateSystem.copy();
4291        dst.patient = patient == null ? null : patient.copy();
4292        dst.specimen = specimen == null ? null : specimen.copy();
4293        dst.device = device == null ? null : device.copy();
4294        dst.performer = performer == null ? null : performer.copy();
4295        dst.quantity = quantity == null ? null : quantity.copy();
4296        dst.referenceSeq = referenceSeq == null ? null : referenceSeq.copy();
4297        if (variant != null) {
4298          dst.variant = new ArrayList<SequenceVariantComponent>();
4299          for (SequenceVariantComponent i : variant)
4300            dst.variant.add(i.copy());
4301        };
4302        dst.observedSeq = observedSeq == null ? null : observedSeq.copy();
4303        if (quality != null) {
4304          dst.quality = new ArrayList<SequenceQualityComponent>();
4305          for (SequenceQualityComponent i : quality)
4306            dst.quality.add(i.copy());
4307        };
4308        dst.readCoverage = readCoverage == null ? null : readCoverage.copy();
4309        if (repository != null) {
4310          dst.repository = new ArrayList<SequenceRepositoryComponent>();
4311          for (SequenceRepositoryComponent i : repository)
4312            dst.repository.add(i.copy());
4313        };
4314        if (pointer != null) {
4315          dst.pointer = new ArrayList<Reference>();
4316          for (Reference i : pointer)
4317            dst.pointer.add(i.copy());
4318        };
4319        return dst;
4320      }
4321
4322      protected Sequence typedCopy() {
4323        return copy();
4324      }
4325
4326      @Override
4327      public boolean equalsDeep(Base other) {
4328        if (!super.equalsDeep(other))
4329          return false;
4330        if (!(other instanceof Sequence))
4331          return false;
4332        Sequence o = (Sequence) other;
4333        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(coordinateSystem, o.coordinateSystem, true)
4334           && compareDeep(patient, o.patient, true) && compareDeep(specimen, o.specimen, true) && compareDeep(device, o.device, true)
4335           && compareDeep(performer, o.performer, true) && compareDeep(quantity, o.quantity, true) && compareDeep(referenceSeq, o.referenceSeq, true)
4336           && compareDeep(variant, o.variant, true) && compareDeep(observedSeq, o.observedSeq, true) && compareDeep(quality, o.quality, true)
4337           && compareDeep(readCoverage, o.readCoverage, true) && compareDeep(repository, o.repository, true)
4338           && compareDeep(pointer, o.pointer, true);
4339      }
4340
4341      @Override
4342      public boolean equalsShallow(Base other) {
4343        if (!super.equalsShallow(other))
4344          return false;
4345        if (!(other instanceof Sequence))
4346          return false;
4347        Sequence o = (Sequence) other;
4348        return compareValues(type, o.type, true) && compareValues(coordinateSystem, o.coordinateSystem, true)
4349           && compareValues(observedSeq, o.observedSeq, true) && compareValues(readCoverage, o.readCoverage, true)
4350          ;
4351      }
4352
4353      public boolean isEmpty() {
4354        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, coordinateSystem
4355          , patient, specimen, device, performer, quantity, referenceSeq, variant, observedSeq
4356          , quality, readCoverage, repository, pointer);
4357      }
4358
4359  @Override
4360  public ResourceType getResourceType() {
4361    return ResourceType.Sequence;
4362   }
4363
4364 /**
4365   * Search parameter: <b>identifier</b>
4366   * <p>
4367   * Description: <b>The unique identity for a particular sequence</b><br>
4368   * Type: <b>token</b><br>
4369   * Path: <b>Sequence.identifier</b><br>
4370   * </p>
4371   */
4372  @SearchParamDefinition(name="identifier", path="Sequence.identifier", description="The unique identity for a particular sequence", type="token" )
4373  public static final String SP_IDENTIFIER = "identifier";
4374 /**
4375   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4376   * <p>
4377   * Description: <b>The unique identity for a particular sequence</b><br>
4378   * Type: <b>token</b><br>
4379   * Path: <b>Sequence.identifier</b><br>
4380   * </p>
4381   */
4382  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4383
4384 /**
4385   * Search parameter: <b>coordinate</b>
4386   * <p>
4387   * 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>
4388   * Type: <b>composite</b><br>
4389   * Path: <b></b><br>
4390   * </p>
4391   */
4392  @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"} )
4393  public static final String SP_COORDINATE = "coordinate";
4394 /**
4395   * <b>Fluent Client</b> search parameter constant for <b>coordinate</b>
4396   * <p>
4397   * 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>
4398   * Type: <b>composite</b><br>
4399   * Path: <b></b><br>
4400   * </p>
4401   */
4402  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);
4403
4404 /**
4405   * Search parameter: <b>patient</b>
4406   * <p>
4407   * Description: <b>The subject that the observation is about</b><br>
4408   * Type: <b>reference</b><br>
4409   * Path: <b>Sequence.patient</b><br>
4410   * </p>
4411   */
4412  @SearchParamDefinition(name="patient", path="Sequence.patient", description="The subject that the observation is about", type="reference", target={Patient.class } )
4413  public static final String SP_PATIENT = "patient";
4414 /**
4415   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
4416   * <p>
4417   * Description: <b>The subject that the observation is about</b><br>
4418   * Type: <b>reference</b><br>
4419   * Path: <b>Sequence.patient</b><br>
4420   * </p>
4421   */
4422  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
4423
4424/**
4425   * Constant for fluent queries to be used to add include statements. Specifies
4426   * the path value of "<b>Sequence:patient</b>".
4427   */
4428  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Sequence:patient").toLocked();
4429
4430 /**
4431   * Search parameter: <b>chromosome</b>
4432   * <p>
4433   * Description: <b>Chromosome number of the reference sequence</b><br>
4434   * Type: <b>token</b><br>
4435   * Path: <b>Sequence.referenceSeq.chromosome</b><br>
4436   * </p>
4437   */
4438  @SearchParamDefinition(name="chromosome", path="Sequence.referenceSeq.chromosome", description="Chromosome number of the reference sequence", type="token" )
4439  public static final String SP_CHROMOSOME = "chromosome";
4440 /**
4441   * <b>Fluent Client</b> search parameter constant for <b>chromosome</b>
4442   * <p>
4443   * Description: <b>Chromosome number of the reference sequence</b><br>
4444   * Type: <b>token</b><br>
4445   * Path: <b>Sequence.referenceSeq.chromosome</b><br>
4446   * </p>
4447   */
4448  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHROMOSOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHROMOSOME);
4449
4450 /**
4451   * Search parameter: <b>start</b>
4452   * <p>
4453   * 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>
4454   * Type: <b>number</b><br>
4455   * Path: <b>Sequence.referenceSeq.windowStart</b><br>
4456   * </p>
4457   */
4458  @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" )
4459  public static final String SP_START = "start";
4460 /**
4461   * <b>Fluent Client</b> search parameter constant for <b>start</b>
4462   * <p>
4463   * 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>
4464   * Type: <b>number</b><br>
4465   * Path: <b>Sequence.referenceSeq.windowStart</b><br>
4466   * </p>
4467   */
4468  public static final ca.uhn.fhir.rest.gclient.NumberClientParam START = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_START);
4469
4470 /**
4471   * Search parameter: <b>end</b>
4472   * <p>
4473   * 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>
4474   * Type: <b>number</b><br>
4475   * Path: <b>Sequence.referenceSeq.windowEnd</b><br>
4476   * </p>
4477   */
4478  @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" )
4479  public static final String SP_END = "end";
4480 /**
4481   * <b>Fluent Client</b> search parameter constant for <b>end</b>
4482   * <p>
4483   * 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>
4484   * Type: <b>number</b><br>
4485   * Path: <b>Sequence.referenceSeq.windowEnd</b><br>
4486   * </p>
4487   */
4488  public static final ca.uhn.fhir.rest.gclient.NumberClientParam END = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_END);
4489
4490 /**
4491   * Search parameter: <b>type</b>
4492   * <p>
4493   * Description: <b>Amino Acid Sequence/ DNA Sequence / RNA Sequence</b><br>
4494   * Type: <b>token</b><br>
4495   * Path: <b>Sequence.type</b><br>
4496   * </p>
4497   */
4498  @SearchParamDefinition(name="type", path="Sequence.type", description="Amino Acid Sequence/ DNA Sequence / RNA Sequence", type="token" )
4499  public static final String SP_TYPE = "type";
4500 /**
4501   * <b>Fluent Client</b> search parameter constant for <b>type</b>
4502   * <p>
4503   * Description: <b>Amino Acid Sequence/ DNA Sequence / RNA Sequence</b><br>
4504   * Type: <b>token</b><br>
4505   * Path: <b>Sequence.type</b><br>
4506   * </p>
4507   */
4508  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
4509
4510
4511}
4512