001package org.hl7.fhir.dstu2016may.model;
002
003
004
005
006import java.math.BigDecimal;
007
008/*
009  Copyright (c) 2011+, HL7, Inc.
010  All rights reserved.
011  
012  Redistribution and use in source and binary forms, with or without modification, 
013  are permitted provided that the following conditions are met:
014  
015   * Redistributions of source code must retain the above copyright notice, this 
016     list of conditions and the following disclaimer.
017   * Redistributions in binary form must reproduce the above copyright notice, 
018     this list of conditions and the following disclaimer in the documentation 
019     and/or other materials provided with the distribution.
020   * Neither the name of HL7 nor the names of its contributors may be used to 
021     endorse or promote products derived from this software without specific 
022     prior written permission.
023  
024  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
025  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
026  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
027  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
028  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
029  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
030  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
031  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
032  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
033  POSSIBILITY OF SUCH DAMAGE.
034  
035*/
036
037// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
038import java.util.ArrayList;
039import java.util.List;
040
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
043import org.hl7.fhir.utilities.Utilities;
044
045import ca.uhn.fhir.model.api.annotation.Block;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.ResourceDef;
049import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
050/**
051 * Variation and Sequence data.
052 */
053@ResourceDef(name="Sequence", profile="http://hl7.org/fhir/Profile/Sequence")
054public class Sequence extends DomainResource {
055
056    public enum SequenceType {
057        /**
058         * Amino acid sequence
059         */
060        AA, 
061        /**
062         * DNA Sequence
063         */
064        DNA, 
065        /**
066         * RNA Sequence
067         */
068        RNA, 
069        /**
070         * added to help the parsers
071         */
072        NULL;
073        public static SequenceType fromCode(String codeString) throws FHIRException {
074            if (codeString == null || "".equals(codeString))
075                return null;
076        if ("AA".equals(codeString))
077          return AA;
078        if ("DNA".equals(codeString))
079          return DNA;
080        if ("RNA".equals(codeString))
081          return RNA;
082        throw new FHIRException("Unknown SequenceType code '"+codeString+"'");
083        }
084        public String toCode() {
085          switch (this) {
086            case AA: return "AA";
087            case DNA: return "DNA";
088            case RNA: return "RNA";
089            case NULL: return null;
090            default: return "?";
091          }
092        }
093        public String getSystem() {
094          switch (this) {
095            case AA: return "http://hl7.org/fhir/sequence-type";
096            case DNA: return "http://hl7.org/fhir/sequence-type";
097            case RNA: return "http://hl7.org/fhir/sequence-type";
098            case NULL: return null;
099            default: return "?";
100          }
101        }
102        public String getDefinition() {
103          switch (this) {
104            case AA: return "Amino acid sequence";
105            case DNA: return "DNA Sequence";
106            case RNA: return "RNA Sequence";
107            case NULL: return null;
108            default: return "?";
109          }
110        }
111        public String getDisplay() {
112          switch (this) {
113            case AA: return "AA Sequence";
114            case DNA: return "DNA Sequence";
115            case RNA: return "RNA Sequence";
116            case NULL: return null;
117            default: return "?";
118          }
119        }
120    }
121
122  public static class SequenceTypeEnumFactory implements EnumFactory<SequenceType> {
123    public SequenceType fromCode(String codeString) throws IllegalArgumentException {
124      if (codeString == null || "".equals(codeString))
125            if (codeString == null || "".equals(codeString))
126                return null;
127        if ("AA".equals(codeString))
128          return SequenceType.AA;
129        if ("DNA".equals(codeString))
130          return SequenceType.DNA;
131        if ("RNA".equals(codeString))
132          return SequenceType.RNA;
133        throw new IllegalArgumentException("Unknown SequenceType code '"+codeString+"'");
134        }
135        public Enumeration<SequenceType> fromType(Base code) throws FHIRException {
136          if (code == null || code.isEmpty())
137            return null;
138          String codeString = ((PrimitiveType) code).asStringValue();
139          if (codeString == null || "".equals(codeString))
140            return null;
141        if ("AA".equals(codeString))
142          return new Enumeration<SequenceType>(this, SequenceType.AA);
143        if ("DNA".equals(codeString))
144          return new Enumeration<SequenceType>(this, SequenceType.DNA);
145        if ("RNA".equals(codeString))
146          return new Enumeration<SequenceType>(this, SequenceType.RNA);
147        throw new FHIRException("Unknown SequenceType code '"+codeString+"'");
148        }
149    public String toCode(SequenceType code) {
150      if (code == SequenceType.AA)
151        return "AA";
152      if (code == SequenceType.DNA)
153        return "DNA";
154      if (code == SequenceType.RNA)
155        return "RNA";
156      return "?";
157      }
158    public String toSystem(SequenceType code) {
159      return code.getSystem();
160      }
161    }
162
163    @Block()
164    public static class SequenceReferenceSeqComponent extends BackboneElement implements IBaseBackboneElement {
165        /**
166         * The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise,  NCBI-Gene code system should be used.
167         */
168        @Child(name = "chromosome", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
169        @Description(shortDefinition="The chromosome containing the genetic finding", formalDefinition="The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise,  NCBI-Gene code system should be used." )
170        protected CodeableConcept chromosome;
171
172        /**
173         * 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.
174         */
175        @Child(name = "genomeBuild", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
176        @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." )
177        protected StringType genomeBuild;
178
179        /**
180         * 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.
181         */
182        @Child(name = "referenceSeqId", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true)
183        @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." )
184        protected CodeableConcept referenceSeqId;
185
186        /**
187         * A Pointer to another Sequence entity as refence sequence.
188         */
189        @Child(name = "referenceSeqPointer", type = {Sequence.class}, order=4, min=0, max=1, modifier=false, summary=true)
190        @Description(shortDefinition="A Pointer to another Sequence entity as refence sequence", formalDefinition="A Pointer to another Sequence entity as refence sequence." )
191        protected Reference referenceSeqPointer;
192
193        /**
194         * The actual object that is the target of the reference (A Pointer to another Sequence entity as refence sequence.)
195         */
196        protected Sequence referenceSeqPointerTarget;
197
198        /**
199         * A Reference Sequence string.
200         */
201        @Child(name = "referenceSeqString", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
202        @Description(shortDefinition="A Reference Sequence string", formalDefinition="A Reference Sequence string." )
203        protected StringType referenceSeqString;
204
205        /**
206         * 0-based start position (inclusive) of the window on the reference sequence.
207         */
208        @Child(name = "windowStart", type = {IntegerType.class}, order=6, min=1, max=1, modifier=false, summary=true)
209        @Description(shortDefinition="0-based start position (inclusive) of the window on the  reference sequence", formalDefinition="0-based start position (inclusive) of the window on the reference sequence." )
210        protected IntegerType windowStart;
211
212        /**
213         * 0-based end position (exclusive) of the window on the reference sequence.
214         */
215        @Child(name = "windowEnd", type = {IntegerType.class}, order=7, min=1, max=1, modifier=false, summary=true)
216        @Description(shortDefinition="0-based end position (exclusive) of the window on the reference sequence", formalDefinition="0-based end position (exclusive) of the window on the reference sequence." )
217        protected IntegerType windowEnd;
218
219        private static final long serialVersionUID = -165922935L;
220
221    /**
222     * Constructor
223     */
224      public SequenceReferenceSeqComponent() {
225        super();
226      }
227
228    /**
229     * Constructor
230     */
231      public SequenceReferenceSeqComponent(CodeableConcept referenceSeqId, IntegerType windowStart, IntegerType windowEnd) {
232        super();
233        this.referenceSeqId = referenceSeqId;
234        this.windowStart = windowStart;
235        this.windowEnd = windowEnd;
236      }
237
238        /**
239         * @return {@link #chromosome} (The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise,  NCBI-Gene code system should be used.)
240         */
241        public CodeableConcept getChromosome() { 
242          if (this.chromosome == null)
243            if (Configuration.errorOnAutoCreate())
244              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.chromosome");
245            else if (Configuration.doAutoCreate())
246              this.chromosome = new CodeableConcept(); // cc
247          return this.chromosome;
248        }
249
250        public boolean hasChromosome() { 
251          return this.chromosome != null && !this.chromosome.isEmpty();
252        }
253
254        /**
255         * @param value {@link #chromosome} (The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise,  NCBI-Gene code system should be used.)
256         */
257        public SequenceReferenceSeqComponent setChromosome(CodeableConcept value) { 
258          this.chromosome = value;
259          return this;
260        }
261
262        /**
263         * @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
264         */
265        public StringType getGenomeBuildElement() { 
266          if (this.genomeBuild == null)
267            if (Configuration.errorOnAutoCreate())
268              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.genomeBuild");
269            else if (Configuration.doAutoCreate())
270              this.genomeBuild = new StringType(); // bb
271          return this.genomeBuild;
272        }
273
274        public boolean hasGenomeBuildElement() { 
275          return this.genomeBuild != null && !this.genomeBuild.isEmpty();
276        }
277
278        public boolean hasGenomeBuild() { 
279          return this.genomeBuild != null && !this.genomeBuild.isEmpty();
280        }
281
282        /**
283         * @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
284         */
285        public SequenceReferenceSeqComponent setGenomeBuildElement(StringType value) { 
286          this.genomeBuild = value;
287          return this;
288        }
289
290        /**
291         * @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.
292         */
293        public String getGenomeBuild() { 
294          return this.genomeBuild == null ? null : this.genomeBuild.getValue();
295        }
296
297        /**
298         * @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.
299         */
300        public SequenceReferenceSeqComponent setGenomeBuild(String value) { 
301          if (Utilities.noString(value))
302            this.genomeBuild = null;
303          else {
304            if (this.genomeBuild == null)
305              this.genomeBuild = new StringType();
306            this.genomeBuild.setValue(value);
307          }
308          return this;
309        }
310
311        /**
312         * @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.)
313         */
314        public CodeableConcept getReferenceSeqId() { 
315          if (this.referenceSeqId == null)
316            if (Configuration.errorOnAutoCreate())
317              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqId");
318            else if (Configuration.doAutoCreate())
319              this.referenceSeqId = new CodeableConcept(); // cc
320          return this.referenceSeqId;
321        }
322
323        public boolean hasReferenceSeqId() { 
324          return this.referenceSeqId != null && !this.referenceSeqId.isEmpty();
325        }
326
327        /**
328         * @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.)
329         */
330        public SequenceReferenceSeqComponent setReferenceSeqId(CodeableConcept value) { 
331          this.referenceSeqId = value;
332          return this;
333        }
334
335        /**
336         * @return {@link #referenceSeqPointer} (A Pointer to another Sequence entity as refence sequence.)
337         */
338        public Reference getReferenceSeqPointer() { 
339          if (this.referenceSeqPointer == null)
340            if (Configuration.errorOnAutoCreate())
341              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqPointer");
342            else if (Configuration.doAutoCreate())
343              this.referenceSeqPointer = new Reference(); // cc
344          return this.referenceSeqPointer;
345        }
346
347        public boolean hasReferenceSeqPointer() { 
348          return this.referenceSeqPointer != null && !this.referenceSeqPointer.isEmpty();
349        }
350
351        /**
352         * @param value {@link #referenceSeqPointer} (A Pointer to another Sequence entity as refence sequence.)
353         */
354        public SequenceReferenceSeqComponent setReferenceSeqPointer(Reference value) { 
355          this.referenceSeqPointer = value;
356          return this;
357        }
358
359        /**
360         * @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 refence sequence.)
361         */
362        public Sequence getReferenceSeqPointerTarget() { 
363          if (this.referenceSeqPointerTarget == null)
364            if (Configuration.errorOnAutoCreate())
365              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqPointer");
366            else if (Configuration.doAutoCreate())
367              this.referenceSeqPointerTarget = new Sequence(); // aa
368          return this.referenceSeqPointerTarget;
369        }
370
371        /**
372         * @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 refence sequence.)
373         */
374        public SequenceReferenceSeqComponent setReferenceSeqPointerTarget(Sequence value) { 
375          this.referenceSeqPointerTarget = value;
376          return this;
377        }
378
379        /**
380         * @return {@link #referenceSeqString} (A Reference Sequence string.). This is the underlying object with id, value and extensions. The accessor "getReferenceSeqString" gives direct access to the value
381         */
382        public StringType getReferenceSeqStringElement() { 
383          if (this.referenceSeqString == null)
384            if (Configuration.errorOnAutoCreate())
385              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqString");
386            else if (Configuration.doAutoCreate())
387              this.referenceSeqString = new StringType(); // bb
388          return this.referenceSeqString;
389        }
390
391        public boolean hasReferenceSeqStringElement() { 
392          return this.referenceSeqString != null && !this.referenceSeqString.isEmpty();
393        }
394
395        public boolean hasReferenceSeqString() { 
396          return this.referenceSeqString != null && !this.referenceSeqString.isEmpty();
397        }
398
399        /**
400         * @param value {@link #referenceSeqString} (A Reference Sequence string.). This is the underlying object with id, value and extensions. The accessor "getReferenceSeqString" gives direct access to the value
401         */
402        public SequenceReferenceSeqComponent setReferenceSeqStringElement(StringType value) { 
403          this.referenceSeqString = value;
404          return this;
405        }
406
407        /**
408         * @return A Reference Sequence string.
409         */
410        public String getReferenceSeqString() { 
411          return this.referenceSeqString == null ? null : this.referenceSeqString.getValue();
412        }
413
414        /**
415         * @param value A Reference Sequence string.
416         */
417        public SequenceReferenceSeqComponent setReferenceSeqString(String value) { 
418          if (Utilities.noString(value))
419            this.referenceSeqString = null;
420          else {
421            if (this.referenceSeqString == null)
422              this.referenceSeqString = new StringType();
423            this.referenceSeqString.setValue(value);
424          }
425          return this;
426        }
427
428        /**
429         * @return {@link #windowStart} (0-based start position (inclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value
430         */
431        public IntegerType getWindowStartElement() { 
432          if (this.windowStart == null)
433            if (Configuration.errorOnAutoCreate())
434              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.windowStart");
435            else if (Configuration.doAutoCreate())
436              this.windowStart = new IntegerType(); // bb
437          return this.windowStart;
438        }
439
440        public boolean hasWindowStartElement() { 
441          return this.windowStart != null && !this.windowStart.isEmpty();
442        }
443
444        public boolean hasWindowStart() { 
445          return this.windowStart != null && !this.windowStart.isEmpty();
446        }
447
448        /**
449         * @param value {@link #windowStart} (0-based start position (inclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value
450         */
451        public SequenceReferenceSeqComponent setWindowStartElement(IntegerType value) { 
452          this.windowStart = value;
453          return this;
454        }
455
456        /**
457         * @return 0-based start position (inclusive) of the window on the reference sequence.
458         */
459        public int getWindowStart() { 
460          return this.windowStart == null || this.windowStart.isEmpty() ? 0 : this.windowStart.getValue();
461        }
462
463        /**
464         * @param value 0-based start position (inclusive) of the window on the reference sequence.
465         */
466        public SequenceReferenceSeqComponent setWindowStart(int value) { 
467            if (this.windowStart == null)
468              this.windowStart = new IntegerType();
469            this.windowStart.setValue(value);
470          return this;
471        }
472
473        /**
474         * @return {@link #windowEnd} (0-based end position (exclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value
475         */
476        public IntegerType getWindowEndElement() { 
477          if (this.windowEnd == null)
478            if (Configuration.errorOnAutoCreate())
479              throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.windowEnd");
480            else if (Configuration.doAutoCreate())
481              this.windowEnd = new IntegerType(); // bb
482          return this.windowEnd;
483        }
484
485        public boolean hasWindowEndElement() { 
486          return this.windowEnd != null && !this.windowEnd.isEmpty();
487        }
488
489        public boolean hasWindowEnd() { 
490          return this.windowEnd != null && !this.windowEnd.isEmpty();
491        }
492
493        /**
494         * @param value {@link #windowEnd} (0-based end position (exclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value
495         */
496        public SequenceReferenceSeqComponent setWindowEndElement(IntegerType value) { 
497          this.windowEnd = value;
498          return this;
499        }
500
501        /**
502         * @return 0-based end position (exclusive) of the window on the reference sequence.
503         */
504        public int getWindowEnd() { 
505          return this.windowEnd == null || this.windowEnd.isEmpty() ? 0 : this.windowEnd.getValue();
506        }
507
508        /**
509         * @param value 0-based end position (exclusive) of the window on the reference sequence.
510         */
511        public SequenceReferenceSeqComponent setWindowEnd(int value) { 
512            if (this.windowEnd == null)
513              this.windowEnd = new IntegerType();
514            this.windowEnd.setValue(value);
515          return this;
516        }
517
518        protected void listChildren(List<Property> childrenList) {
519          super.listChildren(childrenList);
520          childrenList.add(new Property("chromosome", "CodeableConcept", "The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise,  NCBI-Gene code system should be used.", 0, java.lang.Integer.MAX_VALUE, chromosome));
521          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));
522          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));
523          childrenList.add(new Property("referenceSeqPointer", "Reference(Sequence)", "A Pointer to another Sequence entity as refence sequence.", 0, java.lang.Integer.MAX_VALUE, referenceSeqPointer));
524          childrenList.add(new Property("referenceSeqString", "string", "A Reference Sequence string.", 0, java.lang.Integer.MAX_VALUE, referenceSeqString));
525          childrenList.add(new Property("windowStart", "integer", "0-based start position (inclusive) of the window on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, windowStart));
526          childrenList.add(new Property("windowEnd", "integer", "0-based end position (exclusive) of the window on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, windowEnd));
527        }
528
529      @Override
530      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
531        switch (hash) {
532        case -1499470472: /*chromosome*/ return this.chromosome == null ? new Base[0] : new Base[] {this.chromosome}; // CodeableConcept
533        case 1061239735: /*genomeBuild*/ return this.genomeBuild == null ? new Base[0] : new Base[] {this.genomeBuild}; // StringType
534        case -1911500465: /*referenceSeqId*/ return this.referenceSeqId == null ? new Base[0] : new Base[] {this.referenceSeqId}; // CodeableConcept
535        case 1923414665: /*referenceSeqPointer*/ return this.referenceSeqPointer == null ? new Base[0] : new Base[] {this.referenceSeqPointer}; // Reference
536        case -1648301499: /*referenceSeqString*/ return this.referenceSeqString == null ? new Base[0] : new Base[] {this.referenceSeqString}; // StringType
537        case 1903685202: /*windowStart*/ return this.windowStart == null ? new Base[0] : new Base[] {this.windowStart}; // IntegerType
538        case -217026869: /*windowEnd*/ return this.windowEnd == null ? new Base[0] : new Base[] {this.windowEnd}; // IntegerType
539        default: return super.getProperty(hash, name, checkValid);
540        }
541
542      }
543
544      @Override
545      public void setProperty(int hash, String name, Base value) throws FHIRException {
546        switch (hash) {
547        case -1499470472: // chromosome
548          this.chromosome = castToCodeableConcept(value); // CodeableConcept
549          break;
550        case 1061239735: // genomeBuild
551          this.genomeBuild = castToString(value); // StringType
552          break;
553        case -1911500465: // referenceSeqId
554          this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept
555          break;
556        case 1923414665: // referenceSeqPointer
557          this.referenceSeqPointer = castToReference(value); // Reference
558          break;
559        case -1648301499: // referenceSeqString
560          this.referenceSeqString = castToString(value); // StringType
561          break;
562        case 1903685202: // windowStart
563          this.windowStart = castToInteger(value); // IntegerType
564          break;
565        case -217026869: // windowEnd
566          this.windowEnd = castToInteger(value); // IntegerType
567          break;
568        default: super.setProperty(hash, name, value);
569        }
570
571      }
572
573      @Override
574      public void setProperty(String name, Base value) throws FHIRException {
575        if (name.equals("chromosome"))
576          this.chromosome = castToCodeableConcept(value); // CodeableConcept
577        else if (name.equals("genomeBuild"))
578          this.genomeBuild = castToString(value); // StringType
579        else if (name.equals("referenceSeqId"))
580          this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept
581        else if (name.equals("referenceSeqPointer"))
582          this.referenceSeqPointer = castToReference(value); // Reference
583        else if (name.equals("referenceSeqString"))
584          this.referenceSeqString = castToString(value); // StringType
585        else if (name.equals("windowStart"))
586          this.windowStart = castToInteger(value); // IntegerType
587        else if (name.equals("windowEnd"))
588          this.windowEnd = castToInteger(value); // IntegerType
589        else
590          super.setProperty(name, value);
591      }
592
593      @Override
594      public Base makeProperty(int hash, String name) throws FHIRException {
595        switch (hash) {
596        case -1499470472:  return getChromosome(); // CodeableConcept
597        case 1061239735: throw new FHIRException("Cannot make property genomeBuild as it is not a complex type"); // StringType
598        case -1911500465:  return getReferenceSeqId(); // CodeableConcept
599        case 1923414665:  return getReferenceSeqPointer(); // Reference
600        case -1648301499: throw new FHIRException("Cannot make property referenceSeqString as it is not a complex type"); // StringType
601        case 1903685202: throw new FHIRException("Cannot make property windowStart as it is not a complex type"); // IntegerType
602        case -217026869: throw new FHIRException("Cannot make property windowEnd as it is not a complex type"); // IntegerType
603        default: return super.makeProperty(hash, name);
604        }
605
606      }
607
608      @Override
609      public Base addChild(String name) throws FHIRException {
610        if (name.equals("chromosome")) {
611          this.chromosome = new CodeableConcept();
612          return this.chromosome;
613        }
614        else if (name.equals("genomeBuild")) {
615          throw new FHIRException("Cannot call addChild on a primitive type Sequence.genomeBuild");
616        }
617        else if (name.equals("referenceSeqId")) {
618          this.referenceSeqId = new CodeableConcept();
619          return this.referenceSeqId;
620        }
621        else if (name.equals("referenceSeqPointer")) {
622          this.referenceSeqPointer = new Reference();
623          return this.referenceSeqPointer;
624        }
625        else if (name.equals("referenceSeqString")) {
626          throw new FHIRException("Cannot call addChild on a primitive type Sequence.referenceSeqString");
627        }
628        else if (name.equals("windowStart")) {
629          throw new FHIRException("Cannot call addChild on a primitive type Sequence.windowStart");
630        }
631        else if (name.equals("windowEnd")) {
632          throw new FHIRException("Cannot call addChild on a primitive type Sequence.windowEnd");
633        }
634        else
635          return super.addChild(name);
636      }
637
638      public SequenceReferenceSeqComponent copy() {
639        SequenceReferenceSeqComponent dst = new SequenceReferenceSeqComponent();
640        copyValues(dst);
641        dst.chromosome = chromosome == null ? null : chromosome.copy();
642        dst.genomeBuild = genomeBuild == null ? null : genomeBuild.copy();
643        dst.referenceSeqId = referenceSeqId == null ? null : referenceSeqId.copy();
644        dst.referenceSeqPointer = referenceSeqPointer == null ? null : referenceSeqPointer.copy();
645        dst.referenceSeqString = referenceSeqString == null ? null : referenceSeqString.copy();
646        dst.windowStart = windowStart == null ? null : windowStart.copy();
647        dst.windowEnd = windowEnd == null ? null : windowEnd.copy();
648        return dst;
649      }
650
651      @Override
652      public boolean equalsDeep(Base other) {
653        if (!super.equalsDeep(other))
654          return false;
655        if (!(other instanceof SequenceReferenceSeqComponent))
656          return false;
657        SequenceReferenceSeqComponent o = (SequenceReferenceSeqComponent) other;
658        return compareDeep(chromosome, o.chromosome, true) && compareDeep(genomeBuild, o.genomeBuild, true)
659           && compareDeep(referenceSeqId, o.referenceSeqId, true) && compareDeep(referenceSeqPointer, o.referenceSeqPointer, true)
660           && compareDeep(referenceSeqString, o.referenceSeqString, true) && compareDeep(windowStart, o.windowStart, true)
661           && compareDeep(windowEnd, o.windowEnd, true);
662      }
663
664      @Override
665      public boolean equalsShallow(Base other) {
666        if (!super.equalsShallow(other))
667          return false;
668        if (!(other instanceof SequenceReferenceSeqComponent))
669          return false;
670        SequenceReferenceSeqComponent o = (SequenceReferenceSeqComponent) other;
671        return compareValues(genomeBuild, o.genomeBuild, true) && compareValues(referenceSeqString, o.referenceSeqString, true)
672           && compareValues(windowStart, o.windowStart, true) && compareValues(windowEnd, o.windowEnd, true);
673      }
674
675      public boolean isEmpty() {
676        return super.isEmpty() && (chromosome == null || chromosome.isEmpty()) && (genomeBuild == null || genomeBuild.isEmpty())
677           && (referenceSeqId == null || referenceSeqId.isEmpty()) && (referenceSeqPointer == null || referenceSeqPointer.isEmpty())
678           && (referenceSeqString == null || referenceSeqString.isEmpty()) && (windowStart == null || windowStart.isEmpty())
679           && (windowEnd == null || windowEnd.isEmpty());
680      }
681
682  public String fhirType() {
683    return "Sequence.referenceSeq";
684
685  }
686
687  }
688
689    @Block()
690    public static class SequenceVariationComponent extends BackboneElement implements IBaseBackboneElement {
691        /**
692         * 0-based start position (inclusive) of the variation on the  reference sequence.
693         */
694        @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true)
695        @Description(shortDefinition="0-based start position (inclusive) of the variation on the  reference sequence", formalDefinition="0-based start position (inclusive) of the variation on the  reference sequence." )
696        protected IntegerType start;
697
698        /**
699         * 0-based end position (exclusive) of the variation on the reference sequence.
700         */
701        @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
702        @Description(shortDefinition="0-based end position (exclusive) of the variation on the reference sequence", formalDefinition="0-based end position (exclusive) of the variation on the reference sequence." )
703        protected IntegerType end;
704
705        /**
706         * 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.
707         */
708        @Child(name = "observedAllele", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
709        @Description(shortDefinition="Nucleotide(s)/amino acids from start position to stop position of observed variation", formalDefinition="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." )
710        protected StringType observedAllele;
711
712        /**
713         * 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.
714         */
715        @Child(name = "referenceAllele", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
716        @Description(shortDefinition="Nucleotide(s)/amino acids from start position to stop position of reference variation", formalDefinition="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." )
717        protected StringType referenceAllele;
718
719        /**
720         * 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).
721         */
722        @Child(name = "cigar", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
723        @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)." )
724        protected StringType cigar;
725
726        private static final long serialVersionUID = 913298829L;
727
728    /**
729     * Constructor
730     */
731      public SequenceVariationComponent() {
732        super();
733      }
734
735        /**
736         * @return {@link #start} (0-based start position (inclusive) of the variation on the  reference sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
737         */
738        public IntegerType getStartElement() { 
739          if (this.start == null)
740            if (Configuration.errorOnAutoCreate())
741              throw new Error("Attempt to auto-create SequenceVariationComponent.start");
742            else if (Configuration.doAutoCreate())
743              this.start = new IntegerType(); // bb
744          return this.start;
745        }
746
747        public boolean hasStartElement() { 
748          return this.start != null && !this.start.isEmpty();
749        }
750
751        public boolean hasStart() { 
752          return this.start != null && !this.start.isEmpty();
753        }
754
755        /**
756         * @param value {@link #start} (0-based start position (inclusive) of the variation on the  reference sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
757         */
758        public SequenceVariationComponent setStartElement(IntegerType value) { 
759          this.start = value;
760          return this;
761        }
762
763        /**
764         * @return 0-based start position (inclusive) of the variation on the  reference sequence.
765         */
766        public int getStart() { 
767          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
768        }
769
770        /**
771         * @param value 0-based start position (inclusive) of the variation on the  reference sequence.
772         */
773        public SequenceVariationComponent setStart(int value) { 
774            if (this.start == null)
775              this.start = new IntegerType();
776            this.start.setValue(value);
777          return this;
778        }
779
780        /**
781         * @return {@link #end} (0-based end position (exclusive) of the variation on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
782         */
783        public IntegerType getEndElement() { 
784          if (this.end == null)
785            if (Configuration.errorOnAutoCreate())
786              throw new Error("Attempt to auto-create SequenceVariationComponent.end");
787            else if (Configuration.doAutoCreate())
788              this.end = new IntegerType(); // bb
789          return this.end;
790        }
791
792        public boolean hasEndElement() { 
793          return this.end != null && !this.end.isEmpty();
794        }
795
796        public boolean hasEnd() { 
797          return this.end != null && !this.end.isEmpty();
798        }
799
800        /**
801         * @param value {@link #end} (0-based end position (exclusive) of the variation on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
802         */
803        public SequenceVariationComponent setEndElement(IntegerType value) { 
804          this.end = value;
805          return this;
806        }
807
808        /**
809         * @return 0-based end position (exclusive) of the variation on the reference sequence.
810         */
811        public int getEnd() { 
812          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
813        }
814
815        /**
816         * @param value 0-based end position (exclusive) of the variation on the reference sequence.
817         */
818        public SequenceVariationComponent setEnd(int value) { 
819            if (this.end == null)
820              this.end = new IntegerType();
821            this.end.setValue(value);
822          return this;
823        }
824
825        /**
826         * @return {@link #observedAllele} (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 is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value
827         */
828        public StringType getObservedAlleleElement() { 
829          if (this.observedAllele == null)
830            if (Configuration.errorOnAutoCreate())
831              throw new Error("Attempt to auto-create SequenceVariationComponent.observedAllele");
832            else if (Configuration.doAutoCreate())
833              this.observedAllele = new StringType(); // bb
834          return this.observedAllele;
835        }
836
837        public boolean hasObservedAlleleElement() { 
838          return this.observedAllele != null && !this.observedAllele.isEmpty();
839        }
840
841        public boolean hasObservedAllele() { 
842          return this.observedAllele != null && !this.observedAllele.isEmpty();
843        }
844
845        /**
846         * @param value {@link #observedAllele} (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 is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value
847         */
848        public SequenceVariationComponent setObservedAlleleElement(StringType value) { 
849          this.observedAllele = value;
850          return this;
851        }
852
853        /**
854         * @return 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.
855         */
856        public String getObservedAllele() { 
857          return this.observedAllele == null ? null : this.observedAllele.getValue();
858        }
859
860        /**
861         * @param value 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.
862         */
863        public SequenceVariationComponent setObservedAllele(String value) { 
864          if (Utilities.noString(value))
865            this.observedAllele = null;
866          else {
867            if (this.observedAllele == null)
868              this.observedAllele = new StringType();
869            this.observedAllele.setValue(value);
870          }
871          return this;
872        }
873
874        /**
875         * @return {@link #referenceAllele} (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 is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value
876         */
877        public StringType getReferenceAlleleElement() { 
878          if (this.referenceAllele == null)
879            if (Configuration.errorOnAutoCreate())
880              throw new Error("Attempt to auto-create SequenceVariationComponent.referenceAllele");
881            else if (Configuration.doAutoCreate())
882              this.referenceAllele = new StringType(); // bb
883          return this.referenceAllele;
884        }
885
886        public boolean hasReferenceAlleleElement() { 
887          return this.referenceAllele != null && !this.referenceAllele.isEmpty();
888        }
889
890        public boolean hasReferenceAllele() { 
891          return this.referenceAllele != null && !this.referenceAllele.isEmpty();
892        }
893
894        /**
895         * @param value {@link #referenceAllele} (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 is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value
896         */
897        public SequenceVariationComponent setReferenceAlleleElement(StringType value) { 
898          this.referenceAllele = value;
899          return this;
900        }
901
902        /**
903         * @return 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.
904         */
905        public String getReferenceAllele() { 
906          return this.referenceAllele == null ? null : this.referenceAllele.getValue();
907        }
908
909        /**
910         * @param value 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.
911         */
912        public SequenceVariationComponent setReferenceAllele(String value) { 
913          if (Utilities.noString(value))
914            this.referenceAllele = null;
915          else {
916            if (this.referenceAllele == null)
917              this.referenceAllele = new StringType();
918            this.referenceAllele.setValue(value);
919          }
920          return this;
921        }
922
923        /**
924         * @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
925         */
926        public StringType getCigarElement() { 
927          if (this.cigar == null)
928            if (Configuration.errorOnAutoCreate())
929              throw new Error("Attempt to auto-create SequenceVariationComponent.cigar");
930            else if (Configuration.doAutoCreate())
931              this.cigar = new StringType(); // bb
932          return this.cigar;
933        }
934
935        public boolean hasCigarElement() { 
936          return this.cigar != null && !this.cigar.isEmpty();
937        }
938
939        public boolean hasCigar() { 
940          return this.cigar != null && !this.cigar.isEmpty();
941        }
942
943        /**
944         * @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
945         */
946        public SequenceVariationComponent setCigarElement(StringType value) { 
947          this.cigar = value;
948          return this;
949        }
950
951        /**
952         * @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).
953         */
954        public String getCigar() { 
955          return this.cigar == null ? null : this.cigar.getValue();
956        }
957
958        /**
959         * @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).
960         */
961        public SequenceVariationComponent setCigar(String value) { 
962          if (Utilities.noString(value))
963            this.cigar = null;
964          else {
965            if (this.cigar == null)
966              this.cigar = new StringType();
967            this.cigar.setValue(value);
968          }
969          return this;
970        }
971
972        protected void listChildren(List<Property> childrenList) {
973          super.listChildren(childrenList);
974          childrenList.add(new Property("start", "integer", "0-based start position (inclusive) of the variation on the  reference sequence.", 0, java.lang.Integer.MAX_VALUE, start));
975          childrenList.add(new Property("end", "integer", "0-based end position (exclusive) of the variation on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, end));
976          childrenList.add(new Property("observedAllele", "string", "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.", 0, java.lang.Integer.MAX_VALUE, observedAllele));
977          childrenList.add(new Property("referenceAllele", "string", "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.", 0, java.lang.Integer.MAX_VALUE, referenceAllele));
978          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));
979        }
980
981      @Override
982      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
983        switch (hash) {
984        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
985        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
986        case -1418745787: /*observedAllele*/ return this.observedAllele == null ? new Base[0] : new Base[] {this.observedAllele}; // StringType
987        case 364045960: /*referenceAllele*/ return this.referenceAllele == null ? new Base[0] : new Base[] {this.referenceAllele}; // StringType
988        case 94658738: /*cigar*/ return this.cigar == null ? new Base[0] : new Base[] {this.cigar}; // StringType
989        default: return super.getProperty(hash, name, checkValid);
990        }
991
992      }
993
994      @Override
995      public void setProperty(int hash, String name, Base value) throws FHIRException {
996        switch (hash) {
997        case 109757538: // start
998          this.start = castToInteger(value); // IntegerType
999          break;
1000        case 100571: // end
1001          this.end = castToInteger(value); // IntegerType
1002          break;
1003        case -1418745787: // observedAllele
1004          this.observedAllele = castToString(value); // StringType
1005          break;
1006        case 364045960: // referenceAllele
1007          this.referenceAllele = castToString(value); // StringType
1008          break;
1009        case 94658738: // cigar
1010          this.cigar = castToString(value); // StringType
1011          break;
1012        default: super.setProperty(hash, name, value);
1013        }
1014
1015      }
1016
1017      @Override
1018      public void setProperty(String name, Base value) throws FHIRException {
1019        if (name.equals("start"))
1020          this.start = castToInteger(value); // IntegerType
1021        else if (name.equals("end"))
1022          this.end = castToInteger(value); // IntegerType
1023        else if (name.equals("observedAllele"))
1024          this.observedAllele = castToString(value); // StringType
1025        else if (name.equals("referenceAllele"))
1026          this.referenceAllele = castToString(value); // StringType
1027        else if (name.equals("cigar"))
1028          this.cigar = castToString(value); // StringType
1029        else
1030          super.setProperty(name, value);
1031      }
1032
1033      @Override
1034      public Base makeProperty(int hash, String name) throws FHIRException {
1035        switch (hash) {
1036        case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType
1037        case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType
1038        case -1418745787: throw new FHIRException("Cannot make property observedAllele as it is not a complex type"); // StringType
1039        case 364045960: throw new FHIRException("Cannot make property referenceAllele as it is not a complex type"); // StringType
1040        case 94658738: throw new FHIRException("Cannot make property cigar as it is not a complex type"); // StringType
1041        default: return super.makeProperty(hash, name);
1042        }
1043
1044      }
1045
1046      @Override
1047      public Base addChild(String name) throws FHIRException {
1048        if (name.equals("start")) {
1049          throw new FHIRException("Cannot call addChild on a primitive type Sequence.start");
1050        }
1051        else if (name.equals("end")) {
1052          throw new FHIRException("Cannot call addChild on a primitive type Sequence.end");
1053        }
1054        else if (name.equals("observedAllele")) {
1055          throw new FHIRException("Cannot call addChild on a primitive type Sequence.observedAllele");
1056        }
1057        else if (name.equals("referenceAllele")) {
1058          throw new FHIRException("Cannot call addChild on a primitive type Sequence.referenceAllele");
1059        }
1060        else if (name.equals("cigar")) {
1061          throw new FHIRException("Cannot call addChild on a primitive type Sequence.cigar");
1062        }
1063        else
1064          return super.addChild(name);
1065      }
1066
1067      public SequenceVariationComponent copy() {
1068        SequenceVariationComponent dst = new SequenceVariationComponent();
1069        copyValues(dst);
1070        dst.start = start == null ? null : start.copy();
1071        dst.end = end == null ? null : end.copy();
1072        dst.observedAllele = observedAllele == null ? null : observedAllele.copy();
1073        dst.referenceAllele = referenceAllele == null ? null : referenceAllele.copy();
1074        dst.cigar = cigar == null ? null : cigar.copy();
1075        return dst;
1076      }
1077
1078      @Override
1079      public boolean equalsDeep(Base other) {
1080        if (!super.equalsDeep(other))
1081          return false;
1082        if (!(other instanceof SequenceVariationComponent))
1083          return false;
1084        SequenceVariationComponent o = (SequenceVariationComponent) other;
1085        return compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(observedAllele, o.observedAllele, true)
1086           && compareDeep(referenceAllele, o.referenceAllele, true) && compareDeep(cigar, o.cigar, true);
1087      }
1088
1089      @Override
1090      public boolean equalsShallow(Base other) {
1091        if (!super.equalsShallow(other))
1092          return false;
1093        if (!(other instanceof SequenceVariationComponent))
1094          return false;
1095        SequenceVariationComponent o = (SequenceVariationComponent) other;
1096        return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(observedAllele, o.observedAllele, true)
1097           && compareValues(referenceAllele, o.referenceAllele, true) && compareValues(cigar, o.cigar, true);
1098      }
1099
1100      public boolean isEmpty() {
1101        return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty())
1102           && (observedAllele == null || observedAllele.isEmpty()) && (referenceAllele == null || referenceAllele.isEmpty())
1103           && (cigar == null || cigar.isEmpty());
1104      }
1105
1106  public String fhirType() {
1107    return "Sequence.variation";
1108
1109  }
1110
1111  }
1112
1113    @Block()
1114    public static class SequenceQualityComponent extends BackboneElement implements IBaseBackboneElement {
1115        /**
1116         * 0-based start position (inclusive) of the sequence.
1117         */
1118        @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1119        @Description(shortDefinition="0-based start position (inclusive) of the sequence", formalDefinition="0-based start position (inclusive) of the sequence." )
1120        protected IntegerType start;
1121
1122        /**
1123         * 0-based end position (exclusive) of the sequence.
1124         */
1125        @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1126        @Description(shortDefinition="0-based end position (exclusive) of the sequence", formalDefinition="0-based end position (exclusive) of the sequence." )
1127        protected IntegerType end;
1128
1129        /**
1130         * Quality score.
1131         */
1132        @Child(name = "score", type = {Quantity.class}, order=3, min=0, max=1, modifier=false, summary=true)
1133        @Description(shortDefinition="Quality score", formalDefinition="Quality score." )
1134        protected Quantity score;
1135
1136        /**
1137         * Method for quality.
1138         */
1139        @Child(name = "method", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1140        @Description(shortDefinition="Method for quality", formalDefinition="Method for quality." )
1141        protected StringType method;
1142
1143        private static final long serialVersionUID = -1046665930L;
1144
1145    /**
1146     * Constructor
1147     */
1148      public SequenceQualityComponent() {
1149        super();
1150      }
1151
1152        /**
1153         * @return {@link #start} (0-based start position (inclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
1154         */
1155        public IntegerType getStartElement() { 
1156          if (this.start == null)
1157            if (Configuration.errorOnAutoCreate())
1158              throw new Error("Attempt to auto-create SequenceQualityComponent.start");
1159            else if (Configuration.doAutoCreate())
1160              this.start = new IntegerType(); // bb
1161          return this.start;
1162        }
1163
1164        public boolean hasStartElement() { 
1165          return this.start != null && !this.start.isEmpty();
1166        }
1167
1168        public boolean hasStart() { 
1169          return this.start != null && !this.start.isEmpty();
1170        }
1171
1172        /**
1173         * @param value {@link #start} (0-based start position (inclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
1174         */
1175        public SequenceQualityComponent setStartElement(IntegerType value) { 
1176          this.start = value;
1177          return this;
1178        }
1179
1180        /**
1181         * @return 0-based start position (inclusive) of the sequence.
1182         */
1183        public int getStart() { 
1184          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
1185        }
1186
1187        /**
1188         * @param value 0-based start position (inclusive) of the sequence.
1189         */
1190        public SequenceQualityComponent setStart(int value) { 
1191            if (this.start == null)
1192              this.start = new IntegerType();
1193            this.start.setValue(value);
1194          return this;
1195        }
1196
1197        /**
1198         * @return {@link #end} (0-based end position (exclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
1199         */
1200        public IntegerType getEndElement() { 
1201          if (this.end == null)
1202            if (Configuration.errorOnAutoCreate())
1203              throw new Error("Attempt to auto-create SequenceQualityComponent.end");
1204            else if (Configuration.doAutoCreate())
1205              this.end = new IntegerType(); // bb
1206          return this.end;
1207        }
1208
1209        public boolean hasEndElement() { 
1210          return this.end != null && !this.end.isEmpty();
1211        }
1212
1213        public boolean hasEnd() { 
1214          return this.end != null && !this.end.isEmpty();
1215        }
1216
1217        /**
1218         * @param value {@link #end} (0-based end position (exclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
1219         */
1220        public SequenceQualityComponent setEndElement(IntegerType value) { 
1221          this.end = value;
1222          return this;
1223        }
1224
1225        /**
1226         * @return 0-based end position (exclusive) of the sequence.
1227         */
1228        public int getEnd() { 
1229          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
1230        }
1231
1232        /**
1233         * @param value 0-based end position (exclusive) of the sequence.
1234         */
1235        public SequenceQualityComponent setEnd(int value) { 
1236            if (this.end == null)
1237              this.end = new IntegerType();
1238            this.end.setValue(value);
1239          return this;
1240        }
1241
1242        /**
1243         * @return {@link #score} (Quality score.)
1244         */
1245        public Quantity getScore() { 
1246          if (this.score == null)
1247            if (Configuration.errorOnAutoCreate())
1248              throw new Error("Attempt to auto-create SequenceQualityComponent.score");
1249            else if (Configuration.doAutoCreate())
1250              this.score = new Quantity(); // cc
1251          return this.score;
1252        }
1253
1254        public boolean hasScore() { 
1255          return this.score != null && !this.score.isEmpty();
1256        }
1257
1258        /**
1259         * @param value {@link #score} (Quality score.)
1260         */
1261        public SequenceQualityComponent setScore(Quantity value) { 
1262          this.score = value;
1263          return this;
1264        }
1265
1266        /**
1267         * @return {@link #method} (Method for quality.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value
1268         */
1269        public StringType getMethodElement() { 
1270          if (this.method == null)
1271            if (Configuration.errorOnAutoCreate())
1272              throw new Error("Attempt to auto-create SequenceQualityComponent.method");
1273            else if (Configuration.doAutoCreate())
1274              this.method = new StringType(); // bb
1275          return this.method;
1276        }
1277
1278        public boolean hasMethodElement() { 
1279          return this.method != null && !this.method.isEmpty();
1280        }
1281
1282        public boolean hasMethod() { 
1283          return this.method != null && !this.method.isEmpty();
1284        }
1285
1286        /**
1287         * @param value {@link #method} (Method for quality.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value
1288         */
1289        public SequenceQualityComponent setMethodElement(StringType value) { 
1290          this.method = value;
1291          return this;
1292        }
1293
1294        /**
1295         * @return Method for quality.
1296         */
1297        public String getMethod() { 
1298          return this.method == null ? null : this.method.getValue();
1299        }
1300
1301        /**
1302         * @param value Method for quality.
1303         */
1304        public SequenceQualityComponent setMethod(String value) { 
1305          if (Utilities.noString(value))
1306            this.method = null;
1307          else {
1308            if (this.method == null)
1309              this.method = new StringType();
1310            this.method.setValue(value);
1311          }
1312          return this;
1313        }
1314
1315        protected void listChildren(List<Property> childrenList) {
1316          super.listChildren(childrenList);
1317          childrenList.add(new Property("start", "integer", "0-based start position (inclusive) of the sequence.", 0, java.lang.Integer.MAX_VALUE, start));
1318          childrenList.add(new Property("end", "integer", "0-based end position (exclusive) of the sequence.", 0, java.lang.Integer.MAX_VALUE, end));
1319          childrenList.add(new Property("score", "Quantity", "Quality score.", 0, java.lang.Integer.MAX_VALUE, score));
1320          childrenList.add(new Property("method", "string", "Method for quality.", 0, java.lang.Integer.MAX_VALUE, method));
1321        }
1322
1323      @Override
1324      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1325        switch (hash) {
1326        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
1327        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
1328        case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // Quantity
1329        case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // StringType
1330        default: return super.getProperty(hash, name, checkValid);
1331        }
1332
1333      }
1334
1335      @Override
1336      public void setProperty(int hash, String name, Base value) throws FHIRException {
1337        switch (hash) {
1338        case 109757538: // start
1339          this.start = castToInteger(value); // IntegerType
1340          break;
1341        case 100571: // end
1342          this.end = castToInteger(value); // IntegerType
1343          break;
1344        case 109264530: // score
1345          this.score = castToQuantity(value); // Quantity
1346          break;
1347        case -1077554975: // method
1348          this.method = castToString(value); // StringType
1349          break;
1350        default: super.setProperty(hash, name, value);
1351        }
1352
1353      }
1354
1355      @Override
1356      public void setProperty(String name, Base value) throws FHIRException {
1357        if (name.equals("start"))
1358          this.start = castToInteger(value); // IntegerType
1359        else if (name.equals("end"))
1360          this.end = castToInteger(value); // IntegerType
1361        else if (name.equals("score"))
1362          this.score = castToQuantity(value); // Quantity
1363        else if (name.equals("method"))
1364          this.method = castToString(value); // StringType
1365        else
1366          super.setProperty(name, value);
1367      }
1368
1369      @Override
1370      public Base makeProperty(int hash, String name) throws FHIRException {
1371        switch (hash) {
1372        case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType
1373        case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType
1374        case 109264530:  return getScore(); // Quantity
1375        case -1077554975: throw new FHIRException("Cannot make property method as it is not a complex type"); // StringType
1376        default: return super.makeProperty(hash, name);
1377        }
1378
1379      }
1380
1381      @Override
1382      public Base addChild(String name) throws FHIRException {
1383        if (name.equals("start")) {
1384          throw new FHIRException("Cannot call addChild on a primitive type Sequence.start");
1385        }
1386        else if (name.equals("end")) {
1387          throw new FHIRException("Cannot call addChild on a primitive type Sequence.end");
1388        }
1389        else if (name.equals("score")) {
1390          this.score = new Quantity();
1391          return this.score;
1392        }
1393        else if (name.equals("method")) {
1394          throw new FHIRException("Cannot call addChild on a primitive type Sequence.method");
1395        }
1396        else
1397          return super.addChild(name);
1398      }
1399
1400      public SequenceQualityComponent copy() {
1401        SequenceQualityComponent dst = new SequenceQualityComponent();
1402        copyValues(dst);
1403        dst.start = start == null ? null : start.copy();
1404        dst.end = end == null ? null : end.copy();
1405        dst.score = score == null ? null : score.copy();
1406        dst.method = method == null ? null : method.copy();
1407        return dst;
1408      }
1409
1410      @Override
1411      public boolean equalsDeep(Base other) {
1412        if (!super.equalsDeep(other))
1413          return false;
1414        if (!(other instanceof SequenceQualityComponent))
1415          return false;
1416        SequenceQualityComponent o = (SequenceQualityComponent) other;
1417        return compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(score, o.score, true)
1418           && compareDeep(method, o.method, true);
1419      }
1420
1421      @Override
1422      public boolean equalsShallow(Base other) {
1423        if (!super.equalsShallow(other))
1424          return false;
1425        if (!(other instanceof SequenceQualityComponent))
1426          return false;
1427        SequenceQualityComponent o = (SequenceQualityComponent) other;
1428        return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(method, o.method, true)
1429          ;
1430      }
1431
1432      public boolean isEmpty() {
1433        return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty())
1434           && (score == null || score.isEmpty()) && (method == null || method.isEmpty());
1435      }
1436
1437  public String fhirType() {
1438    return "Sequence.quality";
1439
1440  }
1441
1442  }
1443
1444    @Block()
1445    public static class SequenceRepositoryComponent extends BackboneElement implements IBaseBackboneElement {
1446        /**
1447         * URI of an external repository which contains further details about the genetics data.
1448         */
1449        @Child(name = "url", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1450        @Description(shortDefinition="URI of the repository", formalDefinition="URI of an external repository which contains further details about the genetics data." )
1451        protected UriType url;
1452
1453        /**
1454         * URI of an external repository which contains further details about the genetics data.
1455         */
1456        @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1457        @Description(shortDefinition="Name of the repository", formalDefinition="URI of an external repository which contains further details about the genetics data." )
1458        protected StringType name;
1459
1460        /**
1461         * Id of the variation in this external repository.
1462         */
1463        @Child(name = "variantId", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1464        @Description(shortDefinition="Id of the variant", formalDefinition="Id of the variation in this external repository." )
1465        protected StringType variantId;
1466
1467        /**
1468         * Id of the read in this external repository.
1469         */
1470        @Child(name = "readId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1471        @Description(shortDefinition="Id of the read", formalDefinition="Id of the read in this external repository." )
1472        protected StringType readId;
1473
1474        private static final long serialVersionUID = 1218159360L;
1475
1476    /**
1477     * Constructor
1478     */
1479      public SequenceRepositoryComponent() {
1480        super();
1481      }
1482
1483        /**
1484         * @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
1485         */
1486        public UriType getUrlElement() { 
1487          if (this.url == null)
1488            if (Configuration.errorOnAutoCreate())
1489              throw new Error("Attempt to auto-create SequenceRepositoryComponent.url");
1490            else if (Configuration.doAutoCreate())
1491              this.url = new UriType(); // bb
1492          return this.url;
1493        }
1494
1495        public boolean hasUrlElement() { 
1496          return this.url != null && !this.url.isEmpty();
1497        }
1498
1499        public boolean hasUrl() { 
1500          return this.url != null && !this.url.isEmpty();
1501        }
1502
1503        /**
1504         * @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
1505         */
1506        public SequenceRepositoryComponent setUrlElement(UriType value) { 
1507          this.url = value;
1508          return this;
1509        }
1510
1511        /**
1512         * @return URI of an external repository which contains further details about the genetics data.
1513         */
1514        public String getUrl() { 
1515          return this.url == null ? null : this.url.getValue();
1516        }
1517
1518        /**
1519         * @param value URI of an external repository which contains further details about the genetics data.
1520         */
1521        public SequenceRepositoryComponent setUrl(String value) { 
1522          if (Utilities.noString(value))
1523            this.url = null;
1524          else {
1525            if (this.url == null)
1526              this.url = new UriType();
1527            this.url.setValue(value);
1528          }
1529          return this;
1530        }
1531
1532        /**
1533         * @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
1534         */
1535        public StringType getNameElement() { 
1536          if (this.name == null)
1537            if (Configuration.errorOnAutoCreate())
1538              throw new Error("Attempt to auto-create SequenceRepositoryComponent.name");
1539            else if (Configuration.doAutoCreate())
1540              this.name = new StringType(); // bb
1541          return this.name;
1542        }
1543
1544        public boolean hasNameElement() { 
1545          return this.name != null && !this.name.isEmpty();
1546        }
1547
1548        public boolean hasName() { 
1549          return this.name != null && !this.name.isEmpty();
1550        }
1551
1552        /**
1553         * @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
1554         */
1555        public SequenceRepositoryComponent setNameElement(StringType value) { 
1556          this.name = value;
1557          return this;
1558        }
1559
1560        /**
1561         * @return URI of an external repository which contains further details about the genetics data.
1562         */
1563        public String getName() { 
1564          return this.name == null ? null : this.name.getValue();
1565        }
1566
1567        /**
1568         * @param value URI of an external repository which contains further details about the genetics data.
1569         */
1570        public SequenceRepositoryComponent setName(String value) { 
1571          if (Utilities.noString(value))
1572            this.name = null;
1573          else {
1574            if (this.name == null)
1575              this.name = new StringType();
1576            this.name.setValue(value);
1577          }
1578          return this;
1579        }
1580
1581        /**
1582         * @return {@link #variantId} (Id of the variation in this external repository.). This is the underlying object with id, value and extensions. The accessor "getVariantId" gives direct access to the value
1583         */
1584        public StringType getVariantIdElement() { 
1585          if (this.variantId == null)
1586            if (Configuration.errorOnAutoCreate())
1587              throw new Error("Attempt to auto-create SequenceRepositoryComponent.variantId");
1588            else if (Configuration.doAutoCreate())
1589              this.variantId = new StringType(); // bb
1590          return this.variantId;
1591        }
1592
1593        public boolean hasVariantIdElement() { 
1594          return this.variantId != null && !this.variantId.isEmpty();
1595        }
1596
1597        public boolean hasVariantId() { 
1598          return this.variantId != null && !this.variantId.isEmpty();
1599        }
1600
1601        /**
1602         * @param value {@link #variantId} (Id of the variation in this external repository.). This is the underlying object with id, value and extensions. The accessor "getVariantId" gives direct access to the value
1603         */
1604        public SequenceRepositoryComponent setVariantIdElement(StringType value) { 
1605          this.variantId = value;
1606          return this;
1607        }
1608
1609        /**
1610         * @return Id of the variation in this external repository.
1611         */
1612        public String getVariantId() { 
1613          return this.variantId == null ? null : this.variantId.getValue();
1614        }
1615
1616        /**
1617         * @param value Id of the variation in this external repository.
1618         */
1619        public SequenceRepositoryComponent setVariantId(String value) { 
1620          if (Utilities.noString(value))
1621            this.variantId = null;
1622          else {
1623            if (this.variantId == null)
1624              this.variantId = new StringType();
1625            this.variantId.setValue(value);
1626          }
1627          return this;
1628        }
1629
1630        /**
1631         * @return {@link #readId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadId" gives direct access to the value
1632         */
1633        public StringType getReadIdElement() { 
1634          if (this.readId == null)
1635            if (Configuration.errorOnAutoCreate())
1636              throw new Error("Attempt to auto-create SequenceRepositoryComponent.readId");
1637            else if (Configuration.doAutoCreate())
1638              this.readId = new StringType(); // bb
1639          return this.readId;
1640        }
1641
1642        public boolean hasReadIdElement() { 
1643          return this.readId != null && !this.readId.isEmpty();
1644        }
1645
1646        public boolean hasReadId() { 
1647          return this.readId != null && !this.readId.isEmpty();
1648        }
1649
1650        /**
1651         * @param value {@link #readId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadId" gives direct access to the value
1652         */
1653        public SequenceRepositoryComponent setReadIdElement(StringType value) { 
1654          this.readId = value;
1655          return this;
1656        }
1657
1658        /**
1659         * @return Id of the read in this external repository.
1660         */
1661        public String getReadId() { 
1662          return this.readId == null ? null : this.readId.getValue();
1663        }
1664
1665        /**
1666         * @param value Id of the read in this external repository.
1667         */
1668        public SequenceRepositoryComponent setReadId(String value) { 
1669          if (Utilities.noString(value))
1670            this.readId = null;
1671          else {
1672            if (this.readId == null)
1673              this.readId = new StringType();
1674            this.readId.setValue(value);
1675          }
1676          return this;
1677        }
1678
1679        protected void listChildren(List<Property> childrenList) {
1680          super.listChildren(childrenList);
1681          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));
1682          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));
1683          childrenList.add(new Property("variantId", "string", "Id of the variation in this external repository.", 0, java.lang.Integer.MAX_VALUE, variantId));
1684          childrenList.add(new Property("readId", "string", "Id of the read in this external repository.", 0, java.lang.Integer.MAX_VALUE, readId));
1685        }
1686
1687      @Override
1688      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1689        switch (hash) {
1690        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
1691        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1692        case -82113408: /*variantId*/ return this.variantId == null ? new Base[0] : new Base[] {this.variantId}; // StringType
1693        case -934980271: /*readId*/ return this.readId == null ? new Base[0] : new Base[] {this.readId}; // StringType
1694        default: return super.getProperty(hash, name, checkValid);
1695        }
1696
1697      }
1698
1699      @Override
1700      public void setProperty(int hash, String name, Base value) throws FHIRException {
1701        switch (hash) {
1702        case 116079: // url
1703          this.url = castToUri(value); // UriType
1704          break;
1705        case 3373707: // name
1706          this.name = castToString(value); // StringType
1707          break;
1708        case -82113408: // variantId
1709          this.variantId = castToString(value); // StringType
1710          break;
1711        case -934980271: // readId
1712          this.readId = castToString(value); // StringType
1713          break;
1714        default: super.setProperty(hash, name, value);
1715        }
1716
1717      }
1718
1719      @Override
1720      public void setProperty(String name, Base value) throws FHIRException {
1721        if (name.equals("url"))
1722          this.url = castToUri(value); // UriType
1723        else if (name.equals("name"))
1724          this.name = castToString(value); // StringType
1725        else if (name.equals("variantId"))
1726          this.variantId = castToString(value); // StringType
1727        else if (name.equals("readId"))
1728          this.readId = castToString(value); // StringType
1729        else
1730          super.setProperty(name, value);
1731      }
1732
1733      @Override
1734      public Base makeProperty(int hash, String name) throws FHIRException {
1735        switch (hash) {
1736        case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType
1737        case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType
1738        case -82113408: throw new FHIRException("Cannot make property variantId as it is not a complex type"); // StringType
1739        case -934980271: throw new FHIRException("Cannot make property readId as it is not a complex type"); // StringType
1740        default: return super.makeProperty(hash, name);
1741        }
1742
1743      }
1744
1745      @Override
1746      public Base addChild(String name) throws FHIRException {
1747        if (name.equals("url")) {
1748          throw new FHIRException("Cannot call addChild on a primitive type Sequence.url");
1749        }
1750        else if (name.equals("name")) {
1751          throw new FHIRException("Cannot call addChild on a primitive type Sequence.name");
1752        }
1753        else if (name.equals("variantId")) {
1754          throw new FHIRException("Cannot call addChild on a primitive type Sequence.variantId");
1755        }
1756        else if (name.equals("readId")) {
1757          throw new FHIRException("Cannot call addChild on a primitive type Sequence.readId");
1758        }
1759        else
1760          return super.addChild(name);
1761      }
1762
1763      public SequenceRepositoryComponent copy() {
1764        SequenceRepositoryComponent dst = new SequenceRepositoryComponent();
1765        copyValues(dst);
1766        dst.url = url == null ? null : url.copy();
1767        dst.name = name == null ? null : name.copy();
1768        dst.variantId = variantId == null ? null : variantId.copy();
1769        dst.readId = readId == null ? null : readId.copy();
1770        return dst;
1771      }
1772
1773      @Override
1774      public boolean equalsDeep(Base other) {
1775        if (!super.equalsDeep(other))
1776          return false;
1777        if (!(other instanceof SequenceRepositoryComponent))
1778          return false;
1779        SequenceRepositoryComponent o = (SequenceRepositoryComponent) other;
1780        return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(variantId, o.variantId, true)
1781           && compareDeep(readId, o.readId, true);
1782      }
1783
1784      @Override
1785      public boolean equalsShallow(Base other) {
1786        if (!super.equalsShallow(other))
1787          return false;
1788        if (!(other instanceof SequenceRepositoryComponent))
1789          return false;
1790        SequenceRepositoryComponent o = (SequenceRepositoryComponent) other;
1791        return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(variantId, o.variantId, true)
1792           && compareValues(readId, o.readId, true);
1793      }
1794
1795      public boolean isEmpty() {
1796        return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty())
1797           && (variantId == null || variantId.isEmpty()) && (readId == null || readId.isEmpty());
1798      }
1799
1800  public String fhirType() {
1801    return "Sequence.repository";
1802
1803  }
1804
1805  }
1806
1807    @Block()
1808    public static class SequenceStructureVariationComponent extends BackboneElement implements IBaseBackboneElement {
1809        /**
1810         * Precision of boundaries.
1811         */
1812        @Child(name = "precisionOfBoundaries", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1813        @Description(shortDefinition="Precision of boundaries", formalDefinition="Precision of boundaries." )
1814        protected StringType precisionOfBoundaries;
1815
1816        /**
1817         * Structural Variant reported aCGH ratio.
1818         */
1819        @Child(name = "reportedaCGHRatio", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1820        @Description(shortDefinition="Structural Variant reported aCGH ratio", formalDefinition="Structural Variant reported aCGH ratio." )
1821        protected DecimalType reportedaCGHRatio;
1822
1823        /**
1824         * Structural Variant Length.
1825         */
1826        @Child(name = "length", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1827        @Description(shortDefinition="Structural Variant Length", formalDefinition="Structural Variant Length." )
1828        protected IntegerType length;
1829
1830        /**
1831         * Structural variant outer.
1832         */
1833        @Child(name = "outer", type = {}, order=4, min=0, max=1, modifier=false, summary=true)
1834        @Description(shortDefinition="", formalDefinition="Structural variant outer." )
1835        protected SequenceStructureVariationOuterComponent outer;
1836
1837        /**
1838         * Structural variant inner.
1839         */
1840        @Child(name = "inner", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
1841        @Description(shortDefinition="", formalDefinition="Structural variant inner." )
1842        protected SequenceStructureVariationInnerComponent inner;
1843
1844        private static final long serialVersionUID = -1615654736L;
1845
1846    /**
1847     * Constructor
1848     */
1849      public SequenceStructureVariationComponent() {
1850        super();
1851      }
1852
1853        /**
1854         * @return {@link #precisionOfBoundaries} (Precision of boundaries.). This is the underlying object with id, value and extensions. The accessor "getPrecisionOfBoundaries" gives direct access to the value
1855         */
1856        public StringType getPrecisionOfBoundariesElement() { 
1857          if (this.precisionOfBoundaries == null)
1858            if (Configuration.errorOnAutoCreate())
1859              throw new Error("Attempt to auto-create SequenceStructureVariationComponent.precisionOfBoundaries");
1860            else if (Configuration.doAutoCreate())
1861              this.precisionOfBoundaries = new StringType(); // bb
1862          return this.precisionOfBoundaries;
1863        }
1864
1865        public boolean hasPrecisionOfBoundariesElement() { 
1866          return this.precisionOfBoundaries != null && !this.precisionOfBoundaries.isEmpty();
1867        }
1868
1869        public boolean hasPrecisionOfBoundaries() { 
1870          return this.precisionOfBoundaries != null && !this.precisionOfBoundaries.isEmpty();
1871        }
1872
1873        /**
1874         * @param value {@link #precisionOfBoundaries} (Precision of boundaries.). This is the underlying object with id, value and extensions. The accessor "getPrecisionOfBoundaries" gives direct access to the value
1875         */
1876        public SequenceStructureVariationComponent setPrecisionOfBoundariesElement(StringType value) { 
1877          this.precisionOfBoundaries = value;
1878          return this;
1879        }
1880
1881        /**
1882         * @return Precision of boundaries.
1883         */
1884        public String getPrecisionOfBoundaries() { 
1885          return this.precisionOfBoundaries == null ? null : this.precisionOfBoundaries.getValue();
1886        }
1887
1888        /**
1889         * @param value Precision of boundaries.
1890         */
1891        public SequenceStructureVariationComponent setPrecisionOfBoundaries(String value) { 
1892          if (Utilities.noString(value))
1893            this.precisionOfBoundaries = null;
1894          else {
1895            if (this.precisionOfBoundaries == null)
1896              this.precisionOfBoundaries = new StringType();
1897            this.precisionOfBoundaries.setValue(value);
1898          }
1899          return this;
1900        }
1901
1902        /**
1903         * @return {@link #reportedaCGHRatio} (Structural Variant reported aCGH ratio.). This is the underlying object with id, value and extensions. The accessor "getReportedaCGHRatio" gives direct access to the value
1904         */
1905        public DecimalType getReportedaCGHRatioElement() { 
1906          if (this.reportedaCGHRatio == null)
1907            if (Configuration.errorOnAutoCreate())
1908              throw new Error("Attempt to auto-create SequenceStructureVariationComponent.reportedaCGHRatio");
1909            else if (Configuration.doAutoCreate())
1910              this.reportedaCGHRatio = new DecimalType(); // bb
1911          return this.reportedaCGHRatio;
1912        }
1913
1914        public boolean hasReportedaCGHRatioElement() { 
1915          return this.reportedaCGHRatio != null && !this.reportedaCGHRatio.isEmpty();
1916        }
1917
1918        public boolean hasReportedaCGHRatio() { 
1919          return this.reportedaCGHRatio != null && !this.reportedaCGHRatio.isEmpty();
1920        }
1921
1922        /**
1923         * @param value {@link #reportedaCGHRatio} (Structural Variant reported aCGH ratio.). This is the underlying object with id, value and extensions. The accessor "getReportedaCGHRatio" gives direct access to the value
1924         */
1925        public SequenceStructureVariationComponent setReportedaCGHRatioElement(DecimalType value) { 
1926          this.reportedaCGHRatio = value;
1927          return this;
1928        }
1929
1930        /**
1931         * @return Structural Variant reported aCGH ratio.
1932         */
1933        public BigDecimal getReportedaCGHRatio() { 
1934          return this.reportedaCGHRatio == null ? null : this.reportedaCGHRatio.getValue();
1935        }
1936
1937        /**
1938         * @param value Structural Variant reported aCGH ratio.
1939         */
1940        public SequenceStructureVariationComponent setReportedaCGHRatio(BigDecimal value) { 
1941          if (value == null)
1942            this.reportedaCGHRatio = null;
1943          else {
1944            if (this.reportedaCGHRatio == null)
1945              this.reportedaCGHRatio = new DecimalType();
1946            this.reportedaCGHRatio.setValue(value);
1947          }
1948          return this;
1949        }
1950
1951        /**
1952         * @param value Structural Variant reported aCGH ratio.
1953         */
1954        public SequenceStructureVariationComponent setReportedaCGHRatio(long value) { 
1955              this.reportedaCGHRatio = new DecimalType();
1956            this.reportedaCGHRatio.setValue(value);
1957          return this;
1958        }
1959
1960        /**
1961         * @param value Structural Variant reported aCGH ratio.
1962         */
1963        public SequenceStructureVariationComponent setReportedaCGHRatio(double value) { 
1964              this.reportedaCGHRatio = new DecimalType();
1965            this.reportedaCGHRatio.setValue(value);
1966          return this;
1967        }
1968
1969        /**
1970         * @return {@link #length} (Structural Variant Length.). This is the underlying object with id, value and extensions. The accessor "getLength" gives direct access to the value
1971         */
1972        public IntegerType getLengthElement() { 
1973          if (this.length == null)
1974            if (Configuration.errorOnAutoCreate())
1975              throw new Error("Attempt to auto-create SequenceStructureVariationComponent.length");
1976            else if (Configuration.doAutoCreate())
1977              this.length = new IntegerType(); // bb
1978          return this.length;
1979        }
1980
1981        public boolean hasLengthElement() { 
1982          return this.length != null && !this.length.isEmpty();
1983        }
1984
1985        public boolean hasLength() { 
1986          return this.length != null && !this.length.isEmpty();
1987        }
1988
1989        /**
1990         * @param value {@link #length} (Structural Variant Length.). This is the underlying object with id, value and extensions. The accessor "getLength" gives direct access to the value
1991         */
1992        public SequenceStructureVariationComponent setLengthElement(IntegerType value) { 
1993          this.length = value;
1994          return this;
1995        }
1996
1997        /**
1998         * @return Structural Variant Length.
1999         */
2000        public int getLength() { 
2001          return this.length == null || this.length.isEmpty() ? 0 : this.length.getValue();
2002        }
2003
2004        /**
2005         * @param value Structural Variant Length.
2006         */
2007        public SequenceStructureVariationComponent setLength(int value) { 
2008            if (this.length == null)
2009              this.length = new IntegerType();
2010            this.length.setValue(value);
2011          return this;
2012        }
2013
2014        /**
2015         * @return {@link #outer} (Structural variant outer.)
2016         */
2017        public SequenceStructureVariationOuterComponent getOuter() { 
2018          if (this.outer == null)
2019            if (Configuration.errorOnAutoCreate())
2020              throw new Error("Attempt to auto-create SequenceStructureVariationComponent.outer");
2021            else if (Configuration.doAutoCreate())
2022              this.outer = new SequenceStructureVariationOuterComponent(); // cc
2023          return this.outer;
2024        }
2025
2026        public boolean hasOuter() { 
2027          return this.outer != null && !this.outer.isEmpty();
2028        }
2029
2030        /**
2031         * @param value {@link #outer} (Structural variant outer.)
2032         */
2033        public SequenceStructureVariationComponent setOuter(SequenceStructureVariationOuterComponent value) { 
2034          this.outer = value;
2035          return this;
2036        }
2037
2038        /**
2039         * @return {@link #inner} (Structural variant inner.)
2040         */
2041        public SequenceStructureVariationInnerComponent getInner() { 
2042          if (this.inner == null)
2043            if (Configuration.errorOnAutoCreate())
2044              throw new Error("Attempt to auto-create SequenceStructureVariationComponent.inner");
2045            else if (Configuration.doAutoCreate())
2046              this.inner = new SequenceStructureVariationInnerComponent(); // cc
2047          return this.inner;
2048        }
2049
2050        public boolean hasInner() { 
2051          return this.inner != null && !this.inner.isEmpty();
2052        }
2053
2054        /**
2055         * @param value {@link #inner} (Structural variant inner.)
2056         */
2057        public SequenceStructureVariationComponent setInner(SequenceStructureVariationInnerComponent value) { 
2058          this.inner = value;
2059          return this;
2060        }
2061
2062        protected void listChildren(List<Property> childrenList) {
2063          super.listChildren(childrenList);
2064          childrenList.add(new Property("precisionOfBoundaries", "string", "Precision of boundaries.", 0, java.lang.Integer.MAX_VALUE, precisionOfBoundaries));
2065          childrenList.add(new Property("reportedaCGHRatio", "decimal", "Structural Variant reported aCGH ratio.", 0, java.lang.Integer.MAX_VALUE, reportedaCGHRatio));
2066          childrenList.add(new Property("length", "integer", "Structural Variant Length.", 0, java.lang.Integer.MAX_VALUE, length));
2067          childrenList.add(new Property("outer", "", "Structural variant outer.", 0, java.lang.Integer.MAX_VALUE, outer));
2068          childrenList.add(new Property("inner", "", "Structural variant inner.", 0, java.lang.Integer.MAX_VALUE, inner));
2069        }
2070
2071      @Override
2072      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2073        switch (hash) {
2074        case 1591532317: /*precisionOfBoundaries*/ return this.precisionOfBoundaries == null ? new Base[0] : new Base[] {this.precisionOfBoundaries}; // StringType
2075        case -1872600587: /*reportedaCGHRatio*/ return this.reportedaCGHRatio == null ? new Base[0] : new Base[] {this.reportedaCGHRatio}; // DecimalType
2076        case -1106363674: /*length*/ return this.length == null ? new Base[0] : new Base[] {this.length}; // IntegerType
2077        case 106111099: /*outer*/ return this.outer == null ? new Base[0] : new Base[] {this.outer}; // SequenceStructureVariationOuterComponent
2078        case 100355670: /*inner*/ return this.inner == null ? new Base[0] : new Base[] {this.inner}; // SequenceStructureVariationInnerComponent
2079        default: return super.getProperty(hash, name, checkValid);
2080        }
2081
2082      }
2083
2084      @Override
2085      public void setProperty(int hash, String name, Base value) throws FHIRException {
2086        switch (hash) {
2087        case 1591532317: // precisionOfBoundaries
2088          this.precisionOfBoundaries = castToString(value); // StringType
2089          break;
2090        case -1872600587: // reportedaCGHRatio
2091          this.reportedaCGHRatio = castToDecimal(value); // DecimalType
2092          break;
2093        case -1106363674: // length
2094          this.length = castToInteger(value); // IntegerType
2095          break;
2096        case 106111099: // outer
2097          this.outer = (SequenceStructureVariationOuterComponent) value; // SequenceStructureVariationOuterComponent
2098          break;
2099        case 100355670: // inner
2100          this.inner = (SequenceStructureVariationInnerComponent) value; // SequenceStructureVariationInnerComponent
2101          break;
2102        default: super.setProperty(hash, name, value);
2103        }
2104
2105      }
2106
2107      @Override
2108      public void setProperty(String name, Base value) throws FHIRException {
2109        if (name.equals("precisionOfBoundaries"))
2110          this.precisionOfBoundaries = castToString(value); // StringType
2111        else if (name.equals("reportedaCGHRatio"))
2112          this.reportedaCGHRatio = castToDecimal(value); // DecimalType
2113        else if (name.equals("length"))
2114          this.length = castToInteger(value); // IntegerType
2115        else if (name.equals("outer"))
2116          this.outer = (SequenceStructureVariationOuterComponent) value; // SequenceStructureVariationOuterComponent
2117        else if (name.equals("inner"))
2118          this.inner = (SequenceStructureVariationInnerComponent) value; // SequenceStructureVariationInnerComponent
2119        else
2120          super.setProperty(name, value);
2121      }
2122
2123      @Override
2124      public Base makeProperty(int hash, String name) throws FHIRException {
2125        switch (hash) {
2126        case 1591532317: throw new FHIRException("Cannot make property precisionOfBoundaries as it is not a complex type"); // StringType
2127        case -1872600587: throw new FHIRException("Cannot make property reportedaCGHRatio as it is not a complex type"); // DecimalType
2128        case -1106363674: throw new FHIRException("Cannot make property length as it is not a complex type"); // IntegerType
2129        case 106111099:  return getOuter(); // SequenceStructureVariationOuterComponent
2130        case 100355670:  return getInner(); // SequenceStructureVariationInnerComponent
2131        default: return super.makeProperty(hash, name);
2132        }
2133
2134      }
2135
2136      @Override
2137      public Base addChild(String name) throws FHIRException {
2138        if (name.equals("precisionOfBoundaries")) {
2139          throw new FHIRException("Cannot call addChild on a primitive type Sequence.precisionOfBoundaries");
2140        }
2141        else if (name.equals("reportedaCGHRatio")) {
2142          throw new FHIRException("Cannot call addChild on a primitive type Sequence.reportedaCGHRatio");
2143        }
2144        else if (name.equals("length")) {
2145          throw new FHIRException("Cannot call addChild on a primitive type Sequence.length");
2146        }
2147        else if (name.equals("outer")) {
2148          this.outer = new SequenceStructureVariationOuterComponent();
2149          return this.outer;
2150        }
2151        else if (name.equals("inner")) {
2152          this.inner = new SequenceStructureVariationInnerComponent();
2153          return this.inner;
2154        }
2155        else
2156          return super.addChild(name);
2157      }
2158
2159      public SequenceStructureVariationComponent copy() {
2160        SequenceStructureVariationComponent dst = new SequenceStructureVariationComponent();
2161        copyValues(dst);
2162        dst.precisionOfBoundaries = precisionOfBoundaries == null ? null : precisionOfBoundaries.copy();
2163        dst.reportedaCGHRatio = reportedaCGHRatio == null ? null : reportedaCGHRatio.copy();
2164        dst.length = length == null ? null : length.copy();
2165        dst.outer = outer == null ? null : outer.copy();
2166        dst.inner = inner == null ? null : inner.copy();
2167        return dst;
2168      }
2169
2170      @Override
2171      public boolean equalsDeep(Base other) {
2172        if (!super.equalsDeep(other))
2173          return false;
2174        if (!(other instanceof SequenceStructureVariationComponent))
2175          return false;
2176        SequenceStructureVariationComponent o = (SequenceStructureVariationComponent) other;
2177        return compareDeep(precisionOfBoundaries, o.precisionOfBoundaries, true) && compareDeep(reportedaCGHRatio, o.reportedaCGHRatio, true)
2178           && compareDeep(length, o.length, true) && compareDeep(outer, o.outer, true) && compareDeep(inner, o.inner, true)
2179          ;
2180      }
2181
2182      @Override
2183      public boolean equalsShallow(Base other) {
2184        if (!super.equalsShallow(other))
2185          return false;
2186        if (!(other instanceof SequenceStructureVariationComponent))
2187          return false;
2188        SequenceStructureVariationComponent o = (SequenceStructureVariationComponent) other;
2189        return compareValues(precisionOfBoundaries, o.precisionOfBoundaries, true) && compareValues(reportedaCGHRatio, o.reportedaCGHRatio, true)
2190           && compareValues(length, o.length, true);
2191      }
2192
2193      public boolean isEmpty() {
2194        return super.isEmpty() && (precisionOfBoundaries == null || precisionOfBoundaries.isEmpty())
2195           && (reportedaCGHRatio == null || reportedaCGHRatio.isEmpty()) && (length == null || length.isEmpty())
2196           && (outer == null || outer.isEmpty()) && (inner == null || inner.isEmpty());
2197      }
2198
2199  public String fhirType() {
2200    return "Sequence.structureVariation";
2201
2202  }
2203
2204  }
2205
2206    @Block()
2207    public static class SequenceStructureVariationOuterComponent extends BackboneElement implements IBaseBackboneElement {
2208        /**
2209         * Structural Variant Outer Start-End.
2210         */
2211        @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true)
2212        @Description(shortDefinition="Structural Variant Outer Start-End", formalDefinition="Structural Variant Outer Start-End." )
2213        protected IntegerType start;
2214
2215        /**
2216         * Structural Variant Outer Start-End.
2217         */
2218        @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2219        @Description(shortDefinition="Structural Variant Outer Start-End", formalDefinition="Structural Variant Outer Start-End." )
2220        protected IntegerType end;
2221
2222        private static final long serialVersionUID = -1798864889L;
2223
2224    /**
2225     * Constructor
2226     */
2227      public SequenceStructureVariationOuterComponent() {
2228        super();
2229      }
2230
2231        /**
2232         * @return {@link #start} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
2233         */
2234        public IntegerType getStartElement() { 
2235          if (this.start == null)
2236            if (Configuration.errorOnAutoCreate())
2237              throw new Error("Attempt to auto-create SequenceStructureVariationOuterComponent.start");
2238            else if (Configuration.doAutoCreate())
2239              this.start = new IntegerType(); // bb
2240          return this.start;
2241        }
2242
2243        public boolean hasStartElement() { 
2244          return this.start != null && !this.start.isEmpty();
2245        }
2246
2247        public boolean hasStart() { 
2248          return this.start != null && !this.start.isEmpty();
2249        }
2250
2251        /**
2252         * @param value {@link #start} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
2253         */
2254        public SequenceStructureVariationOuterComponent setStartElement(IntegerType value) { 
2255          this.start = value;
2256          return this;
2257        }
2258
2259        /**
2260         * @return Structural Variant Outer Start-End.
2261         */
2262        public int getStart() { 
2263          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
2264        }
2265
2266        /**
2267         * @param value Structural Variant Outer Start-End.
2268         */
2269        public SequenceStructureVariationOuterComponent setStart(int value) { 
2270            if (this.start == null)
2271              this.start = new IntegerType();
2272            this.start.setValue(value);
2273          return this;
2274        }
2275
2276        /**
2277         * @return {@link #end} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
2278         */
2279        public IntegerType getEndElement() { 
2280          if (this.end == null)
2281            if (Configuration.errorOnAutoCreate())
2282              throw new Error("Attempt to auto-create SequenceStructureVariationOuterComponent.end");
2283            else if (Configuration.doAutoCreate())
2284              this.end = new IntegerType(); // bb
2285          return this.end;
2286        }
2287
2288        public boolean hasEndElement() { 
2289          return this.end != null && !this.end.isEmpty();
2290        }
2291
2292        public boolean hasEnd() { 
2293          return this.end != null && !this.end.isEmpty();
2294        }
2295
2296        /**
2297         * @param value {@link #end} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
2298         */
2299        public SequenceStructureVariationOuterComponent setEndElement(IntegerType value) { 
2300          this.end = value;
2301          return this;
2302        }
2303
2304        /**
2305         * @return Structural Variant Outer Start-End.
2306         */
2307        public int getEnd() { 
2308          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
2309        }
2310
2311        /**
2312         * @param value Structural Variant Outer Start-End.
2313         */
2314        public SequenceStructureVariationOuterComponent setEnd(int value) { 
2315            if (this.end == null)
2316              this.end = new IntegerType();
2317            this.end.setValue(value);
2318          return this;
2319        }
2320
2321        protected void listChildren(List<Property> childrenList) {
2322          super.listChildren(childrenList);
2323          childrenList.add(new Property("start", "integer", "Structural Variant Outer Start-End.", 0, java.lang.Integer.MAX_VALUE, start));
2324          childrenList.add(new Property("end", "integer", "Structural Variant Outer Start-End.", 0, java.lang.Integer.MAX_VALUE, end));
2325        }
2326
2327      @Override
2328      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2329        switch (hash) {
2330        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
2331        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
2332        default: return super.getProperty(hash, name, checkValid);
2333        }
2334
2335      }
2336
2337      @Override
2338      public void setProperty(int hash, String name, Base value) throws FHIRException {
2339        switch (hash) {
2340        case 109757538: // start
2341          this.start = castToInteger(value); // IntegerType
2342          break;
2343        case 100571: // end
2344          this.end = castToInteger(value); // IntegerType
2345          break;
2346        default: super.setProperty(hash, name, value);
2347        }
2348
2349      }
2350
2351      @Override
2352      public void setProperty(String name, Base value) throws FHIRException {
2353        if (name.equals("start"))
2354          this.start = castToInteger(value); // IntegerType
2355        else if (name.equals("end"))
2356          this.end = castToInteger(value); // IntegerType
2357        else
2358          super.setProperty(name, value);
2359      }
2360
2361      @Override
2362      public Base makeProperty(int hash, String name) throws FHIRException {
2363        switch (hash) {
2364        case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType
2365        case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType
2366        default: return super.makeProperty(hash, name);
2367        }
2368
2369      }
2370
2371      @Override
2372      public Base addChild(String name) throws FHIRException {
2373        if (name.equals("start")) {
2374          throw new FHIRException("Cannot call addChild on a primitive type Sequence.start");
2375        }
2376        else if (name.equals("end")) {
2377          throw new FHIRException("Cannot call addChild on a primitive type Sequence.end");
2378        }
2379        else
2380          return super.addChild(name);
2381      }
2382
2383      public SequenceStructureVariationOuterComponent copy() {
2384        SequenceStructureVariationOuterComponent dst = new SequenceStructureVariationOuterComponent();
2385        copyValues(dst);
2386        dst.start = start == null ? null : start.copy();
2387        dst.end = end == null ? null : end.copy();
2388        return dst;
2389      }
2390
2391      @Override
2392      public boolean equalsDeep(Base other) {
2393        if (!super.equalsDeep(other))
2394          return false;
2395        if (!(other instanceof SequenceStructureVariationOuterComponent))
2396          return false;
2397        SequenceStructureVariationOuterComponent o = (SequenceStructureVariationOuterComponent) other;
2398        return compareDeep(start, o.start, true) && compareDeep(end, o.end, true);
2399      }
2400
2401      @Override
2402      public boolean equalsShallow(Base other) {
2403        if (!super.equalsShallow(other))
2404          return false;
2405        if (!(other instanceof SequenceStructureVariationOuterComponent))
2406          return false;
2407        SequenceStructureVariationOuterComponent o = (SequenceStructureVariationOuterComponent) other;
2408        return compareValues(start, o.start, true) && compareValues(end, o.end, true);
2409      }
2410
2411      public boolean isEmpty() {
2412        return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty())
2413          ;
2414      }
2415
2416  public String fhirType() {
2417    return "Sequence.structureVariation.outer";
2418
2419  }
2420
2421  }
2422
2423    @Block()
2424    public static class SequenceStructureVariationInnerComponent extends BackboneElement implements IBaseBackboneElement {
2425        /**
2426         * Structural Variant Inner Start-End.
2427         */
2428        @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true)
2429        @Description(shortDefinition="Structural Variant Inner Start-End", formalDefinition="Structural Variant Inner Start-End." )
2430        protected IntegerType start;
2431
2432        /**
2433         * Structural Variant Inner Start-End.
2434         */
2435        @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2436        @Description(shortDefinition="Structural Variant Inner Start-End", formalDefinition="Structural Variant Inner Start-End." )
2437        protected IntegerType end;
2438
2439        private static final long serialVersionUID = -1798864889L;
2440
2441    /**
2442     * Constructor
2443     */
2444      public SequenceStructureVariationInnerComponent() {
2445        super();
2446      }
2447
2448        /**
2449         * @return {@link #start} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
2450         */
2451        public IntegerType getStartElement() { 
2452          if (this.start == null)
2453            if (Configuration.errorOnAutoCreate())
2454              throw new Error("Attempt to auto-create SequenceStructureVariationInnerComponent.start");
2455            else if (Configuration.doAutoCreate())
2456              this.start = new IntegerType(); // bb
2457          return this.start;
2458        }
2459
2460        public boolean hasStartElement() { 
2461          return this.start != null && !this.start.isEmpty();
2462        }
2463
2464        public boolean hasStart() { 
2465          return this.start != null && !this.start.isEmpty();
2466        }
2467
2468        /**
2469         * @param value {@link #start} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
2470         */
2471        public SequenceStructureVariationInnerComponent setStartElement(IntegerType value) { 
2472          this.start = value;
2473          return this;
2474        }
2475
2476        /**
2477         * @return Structural Variant Inner Start-End.
2478         */
2479        public int getStart() { 
2480          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
2481        }
2482
2483        /**
2484         * @param value Structural Variant Inner Start-End.
2485         */
2486        public SequenceStructureVariationInnerComponent setStart(int value) { 
2487            if (this.start == null)
2488              this.start = new IntegerType();
2489            this.start.setValue(value);
2490          return this;
2491        }
2492
2493        /**
2494         * @return {@link #end} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
2495         */
2496        public IntegerType getEndElement() { 
2497          if (this.end == null)
2498            if (Configuration.errorOnAutoCreate())
2499              throw new Error("Attempt to auto-create SequenceStructureVariationInnerComponent.end");
2500            else if (Configuration.doAutoCreate())
2501              this.end = new IntegerType(); // bb
2502          return this.end;
2503        }
2504
2505        public boolean hasEndElement() { 
2506          return this.end != null && !this.end.isEmpty();
2507        }
2508
2509        public boolean hasEnd() { 
2510          return this.end != null && !this.end.isEmpty();
2511        }
2512
2513        /**
2514         * @param value {@link #end} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
2515         */
2516        public SequenceStructureVariationInnerComponent setEndElement(IntegerType value) { 
2517          this.end = value;
2518          return this;
2519        }
2520
2521        /**
2522         * @return Structural Variant Inner Start-End.
2523         */
2524        public int getEnd() { 
2525          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
2526        }
2527
2528        /**
2529         * @param value Structural Variant Inner Start-End.
2530         */
2531        public SequenceStructureVariationInnerComponent setEnd(int value) { 
2532            if (this.end == null)
2533              this.end = new IntegerType();
2534            this.end.setValue(value);
2535          return this;
2536        }
2537
2538        protected void listChildren(List<Property> childrenList) {
2539          super.listChildren(childrenList);
2540          childrenList.add(new Property("start", "integer", "Structural Variant Inner Start-End.", 0, java.lang.Integer.MAX_VALUE, start));
2541          childrenList.add(new Property("end", "integer", "Structural Variant Inner Start-End.", 0, java.lang.Integer.MAX_VALUE, end));
2542        }
2543
2544      @Override
2545      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2546        switch (hash) {
2547        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
2548        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
2549        default: return super.getProperty(hash, name, checkValid);
2550        }
2551
2552      }
2553
2554      @Override
2555      public void setProperty(int hash, String name, Base value) throws FHIRException {
2556        switch (hash) {
2557        case 109757538: // start
2558          this.start = castToInteger(value); // IntegerType
2559          break;
2560        case 100571: // end
2561          this.end = castToInteger(value); // IntegerType
2562          break;
2563        default: super.setProperty(hash, name, value);
2564        }
2565
2566      }
2567
2568      @Override
2569      public void setProperty(String name, Base value) throws FHIRException {
2570        if (name.equals("start"))
2571          this.start = castToInteger(value); // IntegerType
2572        else if (name.equals("end"))
2573          this.end = castToInteger(value); // IntegerType
2574        else
2575          super.setProperty(name, value);
2576      }
2577
2578      @Override
2579      public Base makeProperty(int hash, String name) throws FHIRException {
2580        switch (hash) {
2581        case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType
2582        case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType
2583        default: return super.makeProperty(hash, name);
2584        }
2585
2586      }
2587
2588      @Override
2589      public Base addChild(String name) throws FHIRException {
2590        if (name.equals("start")) {
2591          throw new FHIRException("Cannot call addChild on a primitive type Sequence.start");
2592        }
2593        else if (name.equals("end")) {
2594          throw new FHIRException("Cannot call addChild on a primitive type Sequence.end");
2595        }
2596        else
2597          return super.addChild(name);
2598      }
2599
2600      public SequenceStructureVariationInnerComponent copy() {
2601        SequenceStructureVariationInnerComponent dst = new SequenceStructureVariationInnerComponent();
2602        copyValues(dst);
2603        dst.start = start == null ? null : start.copy();
2604        dst.end = end == null ? null : end.copy();
2605        return dst;
2606      }
2607
2608      @Override
2609      public boolean equalsDeep(Base other) {
2610        if (!super.equalsDeep(other))
2611          return false;
2612        if (!(other instanceof SequenceStructureVariationInnerComponent))
2613          return false;
2614        SequenceStructureVariationInnerComponent o = (SequenceStructureVariationInnerComponent) other;
2615        return compareDeep(start, o.start, true) && compareDeep(end, o.end, true);
2616      }
2617
2618      @Override
2619      public boolean equalsShallow(Base other) {
2620        if (!super.equalsShallow(other))
2621          return false;
2622        if (!(other instanceof SequenceStructureVariationInnerComponent))
2623          return false;
2624        SequenceStructureVariationInnerComponent o = (SequenceStructureVariationInnerComponent) other;
2625        return compareValues(start, o.start, true) && compareValues(end, o.end, true);
2626      }
2627
2628      public boolean isEmpty() {
2629        return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty())
2630          ;
2631      }
2632
2633  public String fhirType() {
2634    return "Sequence.structureVariation.inner";
2635
2636  }
2637
2638  }
2639
2640    /**
2641     * Amino acid / cDNA transcript / RNA variation.
2642     */
2643    @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true)
2644    @Description(shortDefinition="AA | DNA | RNA", formalDefinition="Amino acid / cDNA transcript / RNA variation." )
2645    protected Enumeration<SequenceType> type;
2646
2647    /**
2648     * The patient, or group of patients whose sequencing results are described by this resource.
2649     */
2650    @Child(name = "patient", type = {Patient.class}, order=1, min=0, max=1, modifier=false, summary=true)
2651    @Description(shortDefinition="Who and/or what this is about", formalDefinition="The patient, or group of patients whose sequencing results are described by this resource." )
2652    protected Reference patient;
2653
2654    /**
2655     * The actual object that is the target of the reference (The patient, or group of patients whose sequencing results are described by this resource.)
2656     */
2657    protected Patient patientTarget;
2658
2659    /**
2660     * Specimen used for sequencing.
2661     */
2662    @Child(name = "specimen", type = {Specimen.class}, order=2, min=0, max=1, modifier=false, summary=true)
2663    @Description(shortDefinition="Specimen used for sequencing", formalDefinition="Specimen used for sequencing." )
2664    protected Reference specimen;
2665
2666    /**
2667     * The actual object that is the target of the reference (Specimen used for sequencing.)
2668     */
2669    protected Specimen specimenTarget;
2670
2671    /**
2672     * The method for sequencing, for example, chip information.
2673     */
2674    @Child(name = "device", type = {Device.class}, order=3, min=0, max=1, modifier=false, summary=true)
2675    @Description(shortDefinition="The method for sequencing", formalDefinition="The method for sequencing, for example, chip information." )
2676    protected Reference device;
2677
2678    /**
2679     * The actual object that is the target of the reference (The method for sequencing, for example, chip information.)
2680     */
2681    protected Device deviceTarget;
2682
2683    /**
2684     * Quantity of the sequence.
2685     */
2686    @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=true)
2687    @Description(shortDefinition="Quantity of the sequence", formalDefinition="Quantity of the sequence." )
2688    protected Quantity quantity;
2689
2690    /**
2691     * The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria.
2692     */
2693    @Child(name = "species", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true)
2694    @Description(shortDefinition="Supporting tests of human, viruses, and bacteria", formalDefinition="The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria." )
2695    protected CodeableConcept species;
2696
2697    /**
2698     * Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined.  The other way is using  genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) .
2699     */
2700    @Child(name = "referenceSeq", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2701    @Description(shortDefinition="Reference sequence", formalDefinition="Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined.  The other way is using  genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) ." )
2702    protected List<SequenceReferenceSeqComponent> referenceSeq;
2703
2704    /**
2705     * Variation info in this sequence.
2706     */
2707    @Child(name = "variation", type = {}, order=7, min=0, max=1, modifier=false, summary=true)
2708    @Description(shortDefinition="Variation info in this sequence", formalDefinition="Variation info in this sequence." )
2709    protected SequenceVariationComponent variation;
2710
2711    /**
2712     * Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing.
2713     */
2714    @Child(name = "quality", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2715    @Description(shortDefinition="Sequence Quality", formalDefinition="Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing." )
2716    protected List<SequenceQualityComponent> quality;
2717
2718    /**
2719     * The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA.
2720     */
2721    @Child(name = "allelicState", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true)
2722    @Description(shortDefinition="The level of occurrence of a single DNA Sequence Variation within a set of chromosomes: Heteroplasmic / Homoplasmic / Homozygous / Heterozygous / Hemizygous", formalDefinition="The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA." )
2723    protected CodeableConcept allelicState;
2724
2725    /**
2726     * Allele frequencies.
2727     */
2728    @Child(name = "allelicFrequency", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true)
2729    @Description(shortDefinition="Allele frequencies", formalDefinition="Allele frequencies." )
2730    protected DecimalType allelicFrequency;
2731
2732    /**
2733     * Values: amplificaiton / deletion / LOH.
2734     */
2735    @Child(name = "copyNumberEvent", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=true)
2736    @Description(shortDefinition="Copy Number Event: Values: amplificaiton / deletion / LOH", formalDefinition="Values: amplificaiton / deletion / LOH." )
2737    protected CodeableConcept copyNumberEvent;
2738
2739    /**
2740     * Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.
2741     */
2742    @Child(name = "readCoverage", type = {IntegerType.class}, order=12, min=0, max=1, modifier=false, summary=true)
2743    @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." )
2744    protected IntegerType readCoverage;
2745
2746    /**
2747     * Configurations of the external repository.
2748     */
2749    @Child(name = "repository", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2750    @Description(shortDefinition="External repository", formalDefinition="Configurations of the external repository." )
2751    protected List<SequenceRepositoryComponent> repository;
2752
2753    /**
2754     * Pointer to next atomic sequence which at most contains one variation.
2755     */
2756    @Child(name = "pointer", type = {Sequence.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2757    @Description(shortDefinition="Pointer to next atomic sequence", formalDefinition="Pointer to next atomic sequence which at most contains one variation." )
2758    protected List<Reference> pointer;
2759    /**
2760     * The actual objects that are the target of the reference (Pointer to next atomic sequence which at most contains one variation.)
2761     */
2762    protected List<Sequence> pointerTarget;
2763
2764
2765    /**
2766     * Observed Sequence.
2767     */
2768    @Child(name = "observedSeq", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true)
2769    @Description(shortDefinition="Observed Sequence", formalDefinition="Observed Sequence." )
2770    protected StringType observedSeq;
2771
2772    /**
2773     * Analysis of the sequence.
2774     */
2775    @Child(name = "observation", type = {Observation.class}, order=16, min=0, max=1, modifier=false, summary=true)
2776    @Description(shortDefinition="Observation-genetics", formalDefinition="Analysis of the sequence." )
2777    protected Reference observation;
2778
2779    /**
2780     * The actual object that is the target of the reference (Analysis of the sequence.)
2781     */
2782    protected Observation observationTarget;
2783
2784    /**
2785     * Structural variant.
2786     */
2787    @Child(name = "structureVariation", type = {}, order=17, min=0, max=1, modifier=false, summary=true)
2788    @Description(shortDefinition="", formalDefinition="Structural variant." )
2789    protected SequenceStructureVariationComponent structureVariation;
2790
2791    private static final long serialVersionUID = -1153660995L;
2792
2793  /**
2794   * Constructor
2795   */
2796    public Sequence() {
2797      super();
2798    }
2799
2800  /**
2801   * Constructor
2802   */
2803    public Sequence(Enumeration<SequenceType> type) {
2804      super();
2805      this.type = type;
2806    }
2807
2808    /**
2809     * @return {@link #type} (Amino acid / cDNA transcript / RNA variation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2810     */
2811    public Enumeration<SequenceType> getTypeElement() { 
2812      if (this.type == null)
2813        if (Configuration.errorOnAutoCreate())
2814          throw new Error("Attempt to auto-create Sequence.type");
2815        else if (Configuration.doAutoCreate())
2816          this.type = new Enumeration<SequenceType>(new SequenceTypeEnumFactory()); // bb
2817      return this.type;
2818    }
2819
2820    public boolean hasTypeElement() { 
2821      return this.type != null && !this.type.isEmpty();
2822    }
2823
2824    public boolean hasType() { 
2825      return this.type != null && !this.type.isEmpty();
2826    }
2827
2828    /**
2829     * @param value {@link #type} (Amino acid / cDNA transcript / RNA variation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2830     */
2831    public Sequence setTypeElement(Enumeration<SequenceType> value) { 
2832      this.type = value;
2833      return this;
2834    }
2835
2836    /**
2837     * @return Amino acid / cDNA transcript / RNA variation.
2838     */
2839    public SequenceType getType() { 
2840      return this.type == null ? null : this.type.getValue();
2841    }
2842
2843    /**
2844     * @param value Amino acid / cDNA transcript / RNA variation.
2845     */
2846    public Sequence setType(SequenceType value) { 
2847        if (this.type == null)
2848          this.type = new Enumeration<SequenceType>(new SequenceTypeEnumFactory());
2849        this.type.setValue(value);
2850      return this;
2851    }
2852
2853    /**
2854     * @return {@link #patient} (The patient, or group of patients whose sequencing results are described by this resource.)
2855     */
2856    public Reference getPatient() { 
2857      if (this.patient == null)
2858        if (Configuration.errorOnAutoCreate())
2859          throw new Error("Attempt to auto-create Sequence.patient");
2860        else if (Configuration.doAutoCreate())
2861          this.patient = new Reference(); // cc
2862      return this.patient;
2863    }
2864
2865    public boolean hasPatient() { 
2866      return this.patient != null && !this.patient.isEmpty();
2867    }
2868
2869    /**
2870     * @param value {@link #patient} (The patient, or group of patients whose sequencing results are described by this resource.)
2871     */
2872    public Sequence setPatient(Reference value) { 
2873      this.patient = value;
2874      return this;
2875    }
2876
2877    /**
2878     * @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, or group of patients whose sequencing results are described by this resource.)
2879     */
2880    public Patient getPatientTarget() { 
2881      if (this.patientTarget == null)
2882        if (Configuration.errorOnAutoCreate())
2883          throw new Error("Attempt to auto-create Sequence.patient");
2884        else if (Configuration.doAutoCreate())
2885          this.patientTarget = new Patient(); // aa
2886      return this.patientTarget;
2887    }
2888
2889    /**
2890     * @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, or group of patients whose sequencing results are described by this resource.)
2891     */
2892    public Sequence setPatientTarget(Patient value) { 
2893      this.patientTarget = value;
2894      return this;
2895    }
2896
2897    /**
2898     * @return {@link #specimen} (Specimen used for sequencing.)
2899     */
2900    public Reference getSpecimen() { 
2901      if (this.specimen == null)
2902        if (Configuration.errorOnAutoCreate())
2903          throw new Error("Attempt to auto-create Sequence.specimen");
2904        else if (Configuration.doAutoCreate())
2905          this.specimen = new Reference(); // cc
2906      return this.specimen;
2907    }
2908
2909    public boolean hasSpecimen() { 
2910      return this.specimen != null && !this.specimen.isEmpty();
2911    }
2912
2913    /**
2914     * @param value {@link #specimen} (Specimen used for sequencing.)
2915     */
2916    public Sequence setSpecimen(Reference value) { 
2917      this.specimen = value;
2918      return this;
2919    }
2920
2921    /**
2922     * @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.)
2923     */
2924    public Specimen getSpecimenTarget() { 
2925      if (this.specimenTarget == null)
2926        if (Configuration.errorOnAutoCreate())
2927          throw new Error("Attempt to auto-create Sequence.specimen");
2928        else if (Configuration.doAutoCreate())
2929          this.specimenTarget = new Specimen(); // aa
2930      return this.specimenTarget;
2931    }
2932
2933    /**
2934     * @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.)
2935     */
2936    public Sequence setSpecimenTarget(Specimen value) { 
2937      this.specimenTarget = value;
2938      return this;
2939    }
2940
2941    /**
2942     * @return {@link #device} (The method for sequencing, for example, chip information.)
2943     */
2944    public Reference getDevice() { 
2945      if (this.device == null)
2946        if (Configuration.errorOnAutoCreate())
2947          throw new Error("Attempt to auto-create Sequence.device");
2948        else if (Configuration.doAutoCreate())
2949          this.device = new Reference(); // cc
2950      return this.device;
2951    }
2952
2953    public boolean hasDevice() { 
2954      return this.device != null && !this.device.isEmpty();
2955    }
2956
2957    /**
2958     * @param value {@link #device} (The method for sequencing, for example, chip information.)
2959     */
2960    public Sequence setDevice(Reference value) { 
2961      this.device = value;
2962      return this;
2963    }
2964
2965    /**
2966     * @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.)
2967     */
2968    public Device getDeviceTarget() { 
2969      if (this.deviceTarget == null)
2970        if (Configuration.errorOnAutoCreate())
2971          throw new Error("Attempt to auto-create Sequence.device");
2972        else if (Configuration.doAutoCreate())
2973          this.deviceTarget = new Device(); // aa
2974      return this.deviceTarget;
2975    }
2976
2977    /**
2978     * @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.)
2979     */
2980    public Sequence setDeviceTarget(Device value) { 
2981      this.deviceTarget = value;
2982      return this;
2983    }
2984
2985    /**
2986     * @return {@link #quantity} (Quantity of the sequence.)
2987     */
2988    public Quantity getQuantity() { 
2989      if (this.quantity == null)
2990        if (Configuration.errorOnAutoCreate())
2991          throw new Error("Attempt to auto-create Sequence.quantity");
2992        else if (Configuration.doAutoCreate())
2993          this.quantity = new Quantity(); // cc
2994      return this.quantity;
2995    }
2996
2997    public boolean hasQuantity() { 
2998      return this.quantity != null && !this.quantity.isEmpty();
2999    }
3000
3001    /**
3002     * @param value {@link #quantity} (Quantity of the sequence.)
3003     */
3004    public Sequence setQuantity(Quantity value) { 
3005      this.quantity = value;
3006      return this;
3007    }
3008
3009    /**
3010     * @return {@link #species} (The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria.)
3011     */
3012    public CodeableConcept getSpecies() { 
3013      if (this.species == null)
3014        if (Configuration.errorOnAutoCreate())
3015          throw new Error("Attempt to auto-create Sequence.species");
3016        else if (Configuration.doAutoCreate())
3017          this.species = new CodeableConcept(); // cc
3018      return this.species;
3019    }
3020
3021    public boolean hasSpecies() { 
3022      return this.species != null && !this.species.isEmpty();
3023    }
3024
3025    /**
3026     * @param value {@link #species} (The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria.)
3027     */
3028    public Sequence setSpecies(CodeableConcept value) { 
3029      this.species = value;
3030      return this;
3031    }
3032
3033    /**
3034     * @return {@link #referenceSeq} (Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined.  The other way is using  genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) .)
3035     */
3036    public List<SequenceReferenceSeqComponent> getReferenceSeq() { 
3037      if (this.referenceSeq == null)
3038        this.referenceSeq = new ArrayList<SequenceReferenceSeqComponent>();
3039      return this.referenceSeq;
3040    }
3041
3042    public boolean hasReferenceSeq() { 
3043      if (this.referenceSeq == null)
3044        return false;
3045      for (SequenceReferenceSeqComponent item : this.referenceSeq)
3046        if (!item.isEmpty())
3047          return true;
3048      return false;
3049    }
3050
3051    /**
3052     * @return {@link #referenceSeq} (Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined.  The other way is using  genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) .)
3053     */
3054    // syntactic sugar
3055    public SequenceReferenceSeqComponent addReferenceSeq() { //3
3056      SequenceReferenceSeqComponent t = new SequenceReferenceSeqComponent();
3057      if (this.referenceSeq == null)
3058        this.referenceSeq = new ArrayList<SequenceReferenceSeqComponent>();
3059      this.referenceSeq.add(t);
3060      return t;
3061    }
3062
3063    // syntactic sugar
3064    public Sequence addReferenceSeq(SequenceReferenceSeqComponent t) { //3
3065      if (t == null)
3066        return this;
3067      if (this.referenceSeq == null)
3068        this.referenceSeq = new ArrayList<SequenceReferenceSeqComponent>();
3069      this.referenceSeq.add(t);
3070      return this;
3071    }
3072
3073    /**
3074     * @return {@link #variation} (Variation info in this sequence.)
3075     */
3076    public SequenceVariationComponent getVariation() { 
3077      if (this.variation == null)
3078        if (Configuration.errorOnAutoCreate())
3079          throw new Error("Attempt to auto-create Sequence.variation");
3080        else if (Configuration.doAutoCreate())
3081          this.variation = new SequenceVariationComponent(); // cc
3082      return this.variation;
3083    }
3084
3085    public boolean hasVariation() { 
3086      return this.variation != null && !this.variation.isEmpty();
3087    }
3088
3089    /**
3090     * @param value {@link #variation} (Variation info in this sequence.)
3091     */
3092    public Sequence setVariation(SequenceVariationComponent value) { 
3093      this.variation = value;
3094      return this;
3095    }
3096
3097    /**
3098     * @return {@link #quality} (Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing.)
3099     */
3100    public List<SequenceQualityComponent> getQuality() { 
3101      if (this.quality == null)
3102        this.quality = new ArrayList<SequenceQualityComponent>();
3103      return this.quality;
3104    }
3105
3106    public boolean hasQuality() { 
3107      if (this.quality == null)
3108        return false;
3109      for (SequenceQualityComponent item : this.quality)
3110        if (!item.isEmpty())
3111          return true;
3112      return false;
3113    }
3114
3115    /**
3116     * @return {@link #quality} (Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing.)
3117     */
3118    // syntactic sugar
3119    public SequenceQualityComponent addQuality() { //3
3120      SequenceQualityComponent t = new SequenceQualityComponent();
3121      if (this.quality == null)
3122        this.quality = new ArrayList<SequenceQualityComponent>();
3123      this.quality.add(t);
3124      return t;
3125    }
3126
3127    // syntactic sugar
3128    public Sequence addQuality(SequenceQualityComponent t) { //3
3129      if (t == null)
3130        return this;
3131      if (this.quality == null)
3132        this.quality = new ArrayList<SequenceQualityComponent>();
3133      this.quality.add(t);
3134      return this;
3135    }
3136
3137    /**
3138     * @return {@link #allelicState} (The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA.)
3139     */
3140    public CodeableConcept getAllelicState() { 
3141      if (this.allelicState == null)
3142        if (Configuration.errorOnAutoCreate())
3143          throw new Error("Attempt to auto-create Sequence.allelicState");
3144        else if (Configuration.doAutoCreate())
3145          this.allelicState = new CodeableConcept(); // cc
3146      return this.allelicState;
3147    }
3148
3149    public boolean hasAllelicState() { 
3150      return this.allelicState != null && !this.allelicState.isEmpty();
3151    }
3152
3153    /**
3154     * @param value {@link #allelicState} (The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA.)
3155     */
3156    public Sequence setAllelicState(CodeableConcept value) { 
3157      this.allelicState = value;
3158      return this;
3159    }
3160
3161    /**
3162     * @return {@link #allelicFrequency} (Allele frequencies.). This is the underlying object with id, value and extensions. The accessor "getAllelicFrequency" gives direct access to the value
3163     */
3164    public DecimalType getAllelicFrequencyElement() { 
3165      if (this.allelicFrequency == null)
3166        if (Configuration.errorOnAutoCreate())
3167          throw new Error("Attempt to auto-create Sequence.allelicFrequency");
3168        else if (Configuration.doAutoCreate())
3169          this.allelicFrequency = new DecimalType(); // bb
3170      return this.allelicFrequency;
3171    }
3172
3173    public boolean hasAllelicFrequencyElement() { 
3174      return this.allelicFrequency != null && !this.allelicFrequency.isEmpty();
3175    }
3176
3177    public boolean hasAllelicFrequency() { 
3178      return this.allelicFrequency != null && !this.allelicFrequency.isEmpty();
3179    }
3180
3181    /**
3182     * @param value {@link #allelicFrequency} (Allele frequencies.). This is the underlying object with id, value and extensions. The accessor "getAllelicFrequency" gives direct access to the value
3183     */
3184    public Sequence setAllelicFrequencyElement(DecimalType value) { 
3185      this.allelicFrequency = value;
3186      return this;
3187    }
3188
3189    /**
3190     * @return Allele frequencies.
3191     */
3192    public BigDecimal getAllelicFrequency() { 
3193      return this.allelicFrequency == null ? null : this.allelicFrequency.getValue();
3194    }
3195
3196    /**
3197     * @param value Allele frequencies.
3198     */
3199    public Sequence setAllelicFrequency(BigDecimal value) { 
3200      if (value == null)
3201        this.allelicFrequency = null;
3202      else {
3203        if (this.allelicFrequency == null)
3204          this.allelicFrequency = new DecimalType();
3205        this.allelicFrequency.setValue(value);
3206      }
3207      return this;
3208    }
3209
3210    /**
3211     * @param value Allele frequencies.
3212     */
3213    public Sequence setAllelicFrequency(long value) { 
3214          this.allelicFrequency = new DecimalType();
3215        this.allelicFrequency.setValue(value);
3216      return this;
3217    }
3218
3219    /**
3220     * @param value Allele frequencies.
3221     */
3222    public Sequence setAllelicFrequency(double value) { 
3223          this.allelicFrequency = new DecimalType();
3224        this.allelicFrequency.setValue(value);
3225      return this;
3226    }
3227
3228    /**
3229     * @return {@link #copyNumberEvent} (Values: amplificaiton / deletion / LOH.)
3230     */
3231    public CodeableConcept getCopyNumberEvent() { 
3232      if (this.copyNumberEvent == null)
3233        if (Configuration.errorOnAutoCreate())
3234          throw new Error("Attempt to auto-create Sequence.copyNumberEvent");
3235        else if (Configuration.doAutoCreate())
3236          this.copyNumberEvent = new CodeableConcept(); // cc
3237      return this.copyNumberEvent;
3238    }
3239
3240    public boolean hasCopyNumberEvent() { 
3241      return this.copyNumberEvent != null && !this.copyNumberEvent.isEmpty();
3242    }
3243
3244    /**
3245     * @param value {@link #copyNumberEvent} (Values: amplificaiton / deletion / LOH.)
3246     */
3247    public Sequence setCopyNumberEvent(CodeableConcept value) { 
3248      this.copyNumberEvent = value;
3249      return this;
3250    }
3251
3252    /**
3253     * @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
3254     */
3255    public IntegerType getReadCoverageElement() { 
3256      if (this.readCoverage == null)
3257        if (Configuration.errorOnAutoCreate())
3258          throw new Error("Attempt to auto-create Sequence.readCoverage");
3259        else if (Configuration.doAutoCreate())
3260          this.readCoverage = new IntegerType(); // bb
3261      return this.readCoverage;
3262    }
3263
3264    public boolean hasReadCoverageElement() { 
3265      return this.readCoverage != null && !this.readCoverage.isEmpty();
3266    }
3267
3268    public boolean hasReadCoverage() { 
3269      return this.readCoverage != null && !this.readCoverage.isEmpty();
3270    }
3271
3272    /**
3273     * @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
3274     */
3275    public Sequence setReadCoverageElement(IntegerType value) { 
3276      this.readCoverage = value;
3277      return this;
3278    }
3279
3280    /**
3281     * @return Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.
3282     */
3283    public int getReadCoverage() { 
3284      return this.readCoverage == null || this.readCoverage.isEmpty() ? 0 : this.readCoverage.getValue();
3285    }
3286
3287    /**
3288     * @param value Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.
3289     */
3290    public Sequence setReadCoverage(int value) { 
3291        if (this.readCoverage == null)
3292          this.readCoverage = new IntegerType();
3293        this.readCoverage.setValue(value);
3294      return this;
3295    }
3296
3297    /**
3298     * @return {@link #repository} (Configurations of the external repository.)
3299     */
3300    public List<SequenceRepositoryComponent> getRepository() { 
3301      if (this.repository == null)
3302        this.repository = new ArrayList<SequenceRepositoryComponent>();
3303      return this.repository;
3304    }
3305
3306    public boolean hasRepository() { 
3307      if (this.repository == null)
3308        return false;
3309      for (SequenceRepositoryComponent item : this.repository)
3310        if (!item.isEmpty())
3311          return true;
3312      return false;
3313    }
3314
3315    /**
3316     * @return {@link #repository} (Configurations of the external repository.)
3317     */
3318    // syntactic sugar
3319    public SequenceRepositoryComponent addRepository() { //3
3320      SequenceRepositoryComponent t = new SequenceRepositoryComponent();
3321      if (this.repository == null)
3322        this.repository = new ArrayList<SequenceRepositoryComponent>();
3323      this.repository.add(t);
3324      return t;
3325    }
3326
3327    // syntactic sugar
3328    public Sequence addRepository(SequenceRepositoryComponent t) { //3
3329      if (t == null)
3330        return this;
3331      if (this.repository == null)
3332        this.repository = new ArrayList<SequenceRepositoryComponent>();
3333      this.repository.add(t);
3334      return this;
3335    }
3336
3337    /**
3338     * @return {@link #pointer} (Pointer to next atomic sequence which at most contains one variation.)
3339     */
3340    public List<Reference> getPointer() { 
3341      if (this.pointer == null)
3342        this.pointer = new ArrayList<Reference>();
3343      return this.pointer;
3344    }
3345
3346    public boolean hasPointer() { 
3347      if (this.pointer == null)
3348        return false;
3349      for (Reference item : this.pointer)
3350        if (!item.isEmpty())
3351          return true;
3352      return false;
3353    }
3354
3355    /**
3356     * @return {@link #pointer} (Pointer to next atomic sequence which at most contains one variation.)
3357     */
3358    // syntactic sugar
3359    public Reference addPointer() { //3
3360      Reference t = new Reference();
3361      if (this.pointer == null)
3362        this.pointer = new ArrayList<Reference>();
3363      this.pointer.add(t);
3364      return t;
3365    }
3366
3367    // syntactic sugar
3368    public Sequence addPointer(Reference t) { //3
3369      if (t == null)
3370        return this;
3371      if (this.pointer == null)
3372        this.pointer = new ArrayList<Reference>();
3373      this.pointer.add(t);
3374      return this;
3375    }
3376
3377    /**
3378     * @return {@link #pointer} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Pointer to next atomic sequence which at most contains one variation.)
3379     */
3380    public List<Sequence> getPointerTarget() { 
3381      if (this.pointerTarget == null)
3382        this.pointerTarget = new ArrayList<Sequence>();
3383      return this.pointerTarget;
3384    }
3385
3386    // syntactic sugar
3387    /**
3388     * @return {@link #pointer} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Pointer to next atomic sequence which at most contains one variation.)
3389     */
3390    public Sequence addPointerTarget() { 
3391      Sequence r = new Sequence();
3392      if (this.pointerTarget == null)
3393        this.pointerTarget = new ArrayList<Sequence>();
3394      this.pointerTarget.add(r);
3395      return r;
3396    }
3397
3398    /**
3399     * @return {@link #observedSeq} (Observed Sequence.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value
3400     */
3401    public StringType getObservedSeqElement() { 
3402      if (this.observedSeq == null)
3403        if (Configuration.errorOnAutoCreate())
3404          throw new Error("Attempt to auto-create Sequence.observedSeq");
3405        else if (Configuration.doAutoCreate())
3406          this.observedSeq = new StringType(); // bb
3407      return this.observedSeq;
3408    }
3409
3410    public boolean hasObservedSeqElement() { 
3411      return this.observedSeq != null && !this.observedSeq.isEmpty();
3412    }
3413
3414    public boolean hasObservedSeq() { 
3415      return this.observedSeq != null && !this.observedSeq.isEmpty();
3416    }
3417
3418    /**
3419     * @param value {@link #observedSeq} (Observed Sequence.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value
3420     */
3421    public Sequence setObservedSeqElement(StringType value) { 
3422      this.observedSeq = value;
3423      return this;
3424    }
3425
3426    /**
3427     * @return Observed Sequence.
3428     */
3429    public String getObservedSeq() { 
3430      return this.observedSeq == null ? null : this.observedSeq.getValue();
3431    }
3432
3433    /**
3434     * @param value Observed Sequence.
3435     */
3436    public Sequence setObservedSeq(String value) { 
3437      if (Utilities.noString(value))
3438        this.observedSeq = null;
3439      else {
3440        if (this.observedSeq == null)
3441          this.observedSeq = new StringType();
3442        this.observedSeq.setValue(value);
3443      }
3444      return this;
3445    }
3446
3447    /**
3448     * @return {@link #observation} (Analysis of the sequence.)
3449     */
3450    public Reference getObservation() { 
3451      if (this.observation == null)
3452        if (Configuration.errorOnAutoCreate())
3453          throw new Error("Attempt to auto-create Sequence.observation");
3454        else if (Configuration.doAutoCreate())
3455          this.observation = new Reference(); // cc
3456      return this.observation;
3457    }
3458
3459    public boolean hasObservation() { 
3460      return this.observation != null && !this.observation.isEmpty();
3461    }
3462
3463    /**
3464     * @param value {@link #observation} (Analysis of the sequence.)
3465     */
3466    public Sequence setObservation(Reference value) { 
3467      this.observation = value;
3468      return this;
3469    }
3470
3471    /**
3472     * @return {@link #observation} 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. (Analysis of the sequence.)
3473     */
3474    public Observation getObservationTarget() { 
3475      if (this.observationTarget == null)
3476        if (Configuration.errorOnAutoCreate())
3477          throw new Error("Attempt to auto-create Sequence.observation");
3478        else if (Configuration.doAutoCreate())
3479          this.observationTarget = new Observation(); // aa
3480      return this.observationTarget;
3481    }
3482
3483    /**
3484     * @param value {@link #observation} 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. (Analysis of the sequence.)
3485     */
3486    public Sequence setObservationTarget(Observation value) { 
3487      this.observationTarget = value;
3488      return this;
3489    }
3490
3491    /**
3492     * @return {@link #structureVariation} (Structural variant.)
3493     */
3494    public SequenceStructureVariationComponent getStructureVariation() { 
3495      if (this.structureVariation == null)
3496        if (Configuration.errorOnAutoCreate())
3497          throw new Error("Attempt to auto-create Sequence.structureVariation");
3498        else if (Configuration.doAutoCreate())
3499          this.structureVariation = new SequenceStructureVariationComponent(); // cc
3500      return this.structureVariation;
3501    }
3502
3503    public boolean hasStructureVariation() { 
3504      return this.structureVariation != null && !this.structureVariation.isEmpty();
3505    }
3506
3507    /**
3508     * @param value {@link #structureVariation} (Structural variant.)
3509     */
3510    public Sequence setStructureVariation(SequenceStructureVariationComponent value) { 
3511      this.structureVariation = value;
3512      return this;
3513    }
3514
3515      protected void listChildren(List<Property> childrenList) {
3516        super.listChildren(childrenList);
3517        childrenList.add(new Property("type", "code", "Amino acid / cDNA transcript / RNA variation.", 0, java.lang.Integer.MAX_VALUE, type));
3518        childrenList.add(new Property("patient", "Reference(Patient)", "The patient, or group of patients whose sequencing results are described by this resource.", 0, java.lang.Integer.MAX_VALUE, patient));
3519        childrenList.add(new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, java.lang.Integer.MAX_VALUE, specimen));
3520        childrenList.add(new Property("device", "Reference(Device)", "The method for sequencing, for example, chip information.", 0, java.lang.Integer.MAX_VALUE, device));
3521        childrenList.add(new Property("quantity", "Quantity", "Quantity of the sequence.", 0, java.lang.Integer.MAX_VALUE, quantity));
3522        childrenList.add(new Property("species", "CodeableConcept", "The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria.", 0, java.lang.Integer.MAX_VALUE, species));
3523        childrenList.add(new Property("referenceSeq", "", "Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined.  The other way is using  genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) .", 0, java.lang.Integer.MAX_VALUE, referenceSeq));
3524        childrenList.add(new Property("variation", "", "Variation info in this sequence.", 0, java.lang.Integer.MAX_VALUE, variation));
3525        childrenList.add(new Property("quality", "", "Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing.", 0, java.lang.Integer.MAX_VALUE, quality));
3526        childrenList.add(new Property("allelicState", "CodeableConcept", "The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA.", 0, java.lang.Integer.MAX_VALUE, allelicState));
3527        childrenList.add(new Property("allelicFrequency", "decimal", "Allele frequencies.", 0, java.lang.Integer.MAX_VALUE, allelicFrequency));
3528        childrenList.add(new Property("copyNumberEvent", "CodeableConcept", "Values: amplificaiton / deletion / LOH.", 0, java.lang.Integer.MAX_VALUE, copyNumberEvent));
3529        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));
3530        childrenList.add(new Property("repository", "", "Configurations of the external repository.", 0, java.lang.Integer.MAX_VALUE, repository));
3531        childrenList.add(new Property("pointer", "Reference(Sequence)", "Pointer to next atomic sequence which at most contains one variation.", 0, java.lang.Integer.MAX_VALUE, pointer));
3532        childrenList.add(new Property("observedSeq", "string", "Observed Sequence.", 0, java.lang.Integer.MAX_VALUE, observedSeq));
3533        childrenList.add(new Property("observation", "Reference(Observation)", "Analysis of the sequence.", 0, java.lang.Integer.MAX_VALUE, observation));
3534        childrenList.add(new Property("structureVariation", "", "Structural variant.", 0, java.lang.Integer.MAX_VALUE, structureVariation));
3535      }
3536
3537      @Override
3538      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3539        switch (hash) {
3540        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<SequenceType>
3541        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
3542        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : new Base[] {this.specimen}; // Reference
3543        case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference
3544        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
3545        case -2008465092: /*species*/ return this.species == null ? new Base[0] : new Base[] {this.species}; // CodeableConcept
3546        case -502547180: /*referenceSeq*/ return this.referenceSeq == null ? new Base[0] : this.referenceSeq.toArray(new Base[this.referenceSeq.size()]); // SequenceReferenceSeqComponent
3547        case -81944045: /*variation*/ return this.variation == null ? new Base[0] : new Base[] {this.variation}; // SequenceVariationComponent
3548        case 651215103: /*quality*/ return this.quality == null ? new Base[0] : this.quality.toArray(new Base[this.quality.size()]); // SequenceQualityComponent
3549        case 2079026319: /*allelicState*/ return this.allelicState == null ? new Base[0] : new Base[] {this.allelicState}; // CodeableConcept
3550        case 8650330: /*allelicFrequency*/ return this.allelicFrequency == null ? new Base[0] : new Base[] {this.allelicFrequency}; // DecimalType
3551        case 960854556: /*copyNumberEvent*/ return this.copyNumberEvent == null ? new Base[0] : new Base[] {this.copyNumberEvent}; // CodeableConcept
3552        case -1798816354: /*readCoverage*/ return this.readCoverage == null ? new Base[0] : new Base[] {this.readCoverage}; // IntegerType
3553        case 1950800714: /*repository*/ return this.repository == null ? new Base[0] : this.repository.toArray(new Base[this.repository.size()]); // SequenceRepositoryComponent
3554        case -400605635: /*pointer*/ return this.pointer == null ? new Base[0] : this.pointer.toArray(new Base[this.pointer.size()]); // Reference
3555        case 125541495: /*observedSeq*/ return this.observedSeq == null ? new Base[0] : new Base[] {this.observedSeq}; // StringType
3556        case 122345516: /*observation*/ return this.observation == null ? new Base[0] : new Base[] {this.observation}; // Reference
3557        case 1886586336: /*structureVariation*/ return this.structureVariation == null ? new Base[0] : new Base[] {this.structureVariation}; // SequenceStructureVariationComponent
3558        default: return super.getProperty(hash, name, checkValid);
3559        }
3560
3561      }
3562
3563      @Override
3564      public void setProperty(int hash, String name, Base value) throws FHIRException {
3565        switch (hash) {
3566        case 3575610: // type
3567          this.type = new SequenceTypeEnumFactory().fromType(value); // Enumeration<SequenceType>
3568          break;
3569        case -791418107: // patient
3570          this.patient = castToReference(value); // Reference
3571          break;
3572        case -2132868344: // specimen
3573          this.specimen = castToReference(value); // Reference
3574          break;
3575        case -1335157162: // device
3576          this.device = castToReference(value); // Reference
3577          break;
3578        case -1285004149: // quantity
3579          this.quantity = castToQuantity(value); // Quantity
3580          break;
3581        case -2008465092: // species
3582          this.species = castToCodeableConcept(value); // CodeableConcept
3583          break;
3584        case -502547180: // referenceSeq
3585          this.getReferenceSeq().add((SequenceReferenceSeqComponent) value); // SequenceReferenceSeqComponent
3586          break;
3587        case -81944045: // variation
3588          this.variation = (SequenceVariationComponent) value; // SequenceVariationComponent
3589          break;
3590        case 651215103: // quality
3591          this.getQuality().add((SequenceQualityComponent) value); // SequenceQualityComponent
3592          break;
3593        case 2079026319: // allelicState
3594          this.allelicState = castToCodeableConcept(value); // CodeableConcept
3595          break;
3596        case 8650330: // allelicFrequency
3597          this.allelicFrequency = castToDecimal(value); // DecimalType
3598          break;
3599        case 960854556: // copyNumberEvent
3600          this.copyNumberEvent = castToCodeableConcept(value); // CodeableConcept
3601          break;
3602        case -1798816354: // readCoverage
3603          this.readCoverage = castToInteger(value); // IntegerType
3604          break;
3605        case 1950800714: // repository
3606          this.getRepository().add((SequenceRepositoryComponent) value); // SequenceRepositoryComponent
3607          break;
3608        case -400605635: // pointer
3609          this.getPointer().add(castToReference(value)); // Reference
3610          break;
3611        case 125541495: // observedSeq
3612          this.observedSeq = castToString(value); // StringType
3613          break;
3614        case 122345516: // observation
3615          this.observation = castToReference(value); // Reference
3616          break;
3617        case 1886586336: // structureVariation
3618          this.structureVariation = (SequenceStructureVariationComponent) value; // SequenceStructureVariationComponent
3619          break;
3620        default: super.setProperty(hash, name, value);
3621        }
3622
3623      }
3624
3625      @Override
3626      public void setProperty(String name, Base value) throws FHIRException {
3627        if (name.equals("type"))
3628          this.type = new SequenceTypeEnumFactory().fromType(value); // Enumeration<SequenceType>
3629        else if (name.equals("patient"))
3630          this.patient = castToReference(value); // Reference
3631        else if (name.equals("specimen"))
3632          this.specimen = castToReference(value); // Reference
3633        else if (name.equals("device"))
3634          this.device = castToReference(value); // Reference
3635        else if (name.equals("quantity"))
3636          this.quantity = castToQuantity(value); // Quantity
3637        else if (name.equals("species"))
3638          this.species = castToCodeableConcept(value); // CodeableConcept
3639        else if (name.equals("referenceSeq"))
3640          this.getReferenceSeq().add((SequenceReferenceSeqComponent) value);
3641        else if (name.equals("variation"))
3642          this.variation = (SequenceVariationComponent) value; // SequenceVariationComponent
3643        else if (name.equals("quality"))
3644          this.getQuality().add((SequenceQualityComponent) value);
3645        else if (name.equals("allelicState"))
3646          this.allelicState = castToCodeableConcept(value); // CodeableConcept
3647        else if (name.equals("allelicFrequency"))
3648          this.allelicFrequency = castToDecimal(value); // DecimalType
3649        else if (name.equals("copyNumberEvent"))
3650          this.copyNumberEvent = castToCodeableConcept(value); // CodeableConcept
3651        else if (name.equals("readCoverage"))
3652          this.readCoverage = castToInteger(value); // IntegerType
3653        else if (name.equals("repository"))
3654          this.getRepository().add((SequenceRepositoryComponent) value);
3655        else if (name.equals("pointer"))
3656          this.getPointer().add(castToReference(value));
3657        else if (name.equals("observedSeq"))
3658          this.observedSeq = castToString(value); // StringType
3659        else if (name.equals("observation"))
3660          this.observation = castToReference(value); // Reference
3661        else if (name.equals("structureVariation"))
3662          this.structureVariation = (SequenceStructureVariationComponent) value; // SequenceStructureVariationComponent
3663        else
3664          super.setProperty(name, value);
3665      }
3666
3667      @Override
3668      public Base makeProperty(int hash, String name) throws FHIRException {
3669        switch (hash) {
3670        case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration<SequenceType>
3671        case -791418107:  return getPatient(); // Reference
3672        case -2132868344:  return getSpecimen(); // Reference
3673        case -1335157162:  return getDevice(); // Reference
3674        case -1285004149:  return getQuantity(); // Quantity
3675        case -2008465092:  return getSpecies(); // CodeableConcept
3676        case -502547180:  return addReferenceSeq(); // SequenceReferenceSeqComponent
3677        case -81944045:  return getVariation(); // SequenceVariationComponent
3678        case 651215103:  return addQuality(); // SequenceQualityComponent
3679        case 2079026319:  return getAllelicState(); // CodeableConcept
3680        case 8650330: throw new FHIRException("Cannot make property allelicFrequency as it is not a complex type"); // DecimalType
3681        case 960854556:  return getCopyNumberEvent(); // CodeableConcept
3682        case -1798816354: throw new FHIRException("Cannot make property readCoverage as it is not a complex type"); // IntegerType
3683        case 1950800714:  return addRepository(); // SequenceRepositoryComponent
3684        case -400605635:  return addPointer(); // Reference
3685        case 125541495: throw new FHIRException("Cannot make property observedSeq as it is not a complex type"); // StringType
3686        case 122345516:  return getObservation(); // Reference
3687        case 1886586336:  return getStructureVariation(); // SequenceStructureVariationComponent
3688        default: return super.makeProperty(hash, name);
3689        }
3690
3691      }
3692
3693      @Override
3694      public Base addChild(String name) throws FHIRException {
3695        if (name.equals("type")) {
3696          throw new FHIRException("Cannot call addChild on a primitive type Sequence.type");
3697        }
3698        else if (name.equals("patient")) {
3699          this.patient = new Reference();
3700          return this.patient;
3701        }
3702        else if (name.equals("specimen")) {
3703          this.specimen = new Reference();
3704          return this.specimen;
3705        }
3706        else if (name.equals("device")) {
3707          this.device = new Reference();
3708          return this.device;
3709        }
3710        else if (name.equals("quantity")) {
3711          this.quantity = new Quantity();
3712          return this.quantity;
3713        }
3714        else if (name.equals("species")) {
3715          this.species = new CodeableConcept();
3716          return this.species;
3717        }
3718        else if (name.equals("referenceSeq")) {
3719          return addReferenceSeq();
3720        }
3721        else if (name.equals("variation")) {
3722          this.variation = new SequenceVariationComponent();
3723          return this.variation;
3724        }
3725        else if (name.equals("quality")) {
3726          return addQuality();
3727        }
3728        else if (name.equals("allelicState")) {
3729          this.allelicState = new CodeableConcept();
3730          return this.allelicState;
3731        }
3732        else if (name.equals("allelicFrequency")) {
3733          throw new FHIRException("Cannot call addChild on a primitive type Sequence.allelicFrequency");
3734        }
3735        else if (name.equals("copyNumberEvent")) {
3736          this.copyNumberEvent = new CodeableConcept();
3737          return this.copyNumberEvent;
3738        }
3739        else if (name.equals("readCoverage")) {
3740          throw new FHIRException("Cannot call addChild on a primitive type Sequence.readCoverage");
3741        }
3742        else if (name.equals("repository")) {
3743          return addRepository();
3744        }
3745        else if (name.equals("pointer")) {
3746          return addPointer();
3747        }
3748        else if (name.equals("observedSeq")) {
3749          throw new FHIRException("Cannot call addChild on a primitive type Sequence.observedSeq");
3750        }
3751        else if (name.equals("observation")) {
3752          this.observation = new Reference();
3753          return this.observation;
3754        }
3755        else if (name.equals("structureVariation")) {
3756          this.structureVariation = new SequenceStructureVariationComponent();
3757          return this.structureVariation;
3758        }
3759        else
3760          return super.addChild(name);
3761      }
3762
3763  public String fhirType() {
3764    return "Sequence";
3765
3766  }
3767
3768      public Sequence copy() {
3769        Sequence dst = new Sequence();
3770        copyValues(dst);
3771        dst.type = type == null ? null : type.copy();
3772        dst.patient = patient == null ? null : patient.copy();
3773        dst.specimen = specimen == null ? null : specimen.copy();
3774        dst.device = device == null ? null : device.copy();
3775        dst.quantity = quantity == null ? null : quantity.copy();
3776        dst.species = species == null ? null : species.copy();
3777        if (referenceSeq != null) {
3778          dst.referenceSeq = new ArrayList<SequenceReferenceSeqComponent>();
3779          for (SequenceReferenceSeqComponent i : referenceSeq)
3780            dst.referenceSeq.add(i.copy());
3781        };
3782        dst.variation = variation == null ? null : variation.copy();
3783        if (quality != null) {
3784          dst.quality = new ArrayList<SequenceQualityComponent>();
3785          for (SequenceQualityComponent i : quality)
3786            dst.quality.add(i.copy());
3787        };
3788        dst.allelicState = allelicState == null ? null : allelicState.copy();
3789        dst.allelicFrequency = allelicFrequency == null ? null : allelicFrequency.copy();
3790        dst.copyNumberEvent = copyNumberEvent == null ? null : copyNumberEvent.copy();
3791        dst.readCoverage = readCoverage == null ? null : readCoverage.copy();
3792        if (repository != null) {
3793          dst.repository = new ArrayList<SequenceRepositoryComponent>();
3794          for (SequenceRepositoryComponent i : repository)
3795            dst.repository.add(i.copy());
3796        };
3797        if (pointer != null) {
3798          dst.pointer = new ArrayList<Reference>();
3799          for (Reference i : pointer)
3800            dst.pointer.add(i.copy());
3801        };
3802        dst.observedSeq = observedSeq == null ? null : observedSeq.copy();
3803        dst.observation = observation == null ? null : observation.copy();
3804        dst.structureVariation = structureVariation == null ? null : structureVariation.copy();
3805        return dst;
3806      }
3807
3808      protected Sequence typedCopy() {
3809        return copy();
3810      }
3811
3812      @Override
3813      public boolean equalsDeep(Base other) {
3814        if (!super.equalsDeep(other))
3815          return false;
3816        if (!(other instanceof Sequence))
3817          return false;
3818        Sequence o = (Sequence) other;
3819        return compareDeep(type, o.type, true) && compareDeep(patient, o.patient, true) && compareDeep(specimen, o.specimen, true)
3820           && compareDeep(device, o.device, true) && compareDeep(quantity, o.quantity, true) && compareDeep(species, o.species, true)
3821           && compareDeep(referenceSeq, o.referenceSeq, true) && compareDeep(variation, o.variation, true)
3822           && compareDeep(quality, o.quality, true) && compareDeep(allelicState, o.allelicState, true) && compareDeep(allelicFrequency, o.allelicFrequency, true)
3823           && compareDeep(copyNumberEvent, o.copyNumberEvent, true) && compareDeep(readCoverage, o.readCoverage, true)
3824           && compareDeep(repository, o.repository, true) && compareDeep(pointer, o.pointer, true) && compareDeep(observedSeq, o.observedSeq, true)
3825           && compareDeep(observation, o.observation, true) && compareDeep(structureVariation, o.structureVariation, true)
3826          ;
3827      }
3828
3829      @Override
3830      public boolean equalsShallow(Base other) {
3831        if (!super.equalsShallow(other))
3832          return false;
3833        if (!(other instanceof Sequence))
3834          return false;
3835        Sequence o = (Sequence) other;
3836        return compareValues(type, o.type, true) && compareValues(allelicFrequency, o.allelicFrequency, true)
3837           && compareValues(readCoverage, o.readCoverage, true) && compareValues(observedSeq, o.observedSeq, true)
3838          ;
3839      }
3840
3841      public boolean isEmpty() {
3842        return super.isEmpty() && (type == null || type.isEmpty()) && (patient == null || patient.isEmpty())
3843           && (specimen == null || specimen.isEmpty()) && (device == null || device.isEmpty()) && (quantity == null || quantity.isEmpty())
3844           && (species == null || species.isEmpty()) && (referenceSeq == null || referenceSeq.isEmpty())
3845           && (variation == null || variation.isEmpty()) && (quality == null || quality.isEmpty()) && (allelicState == null || allelicState.isEmpty())
3846           && (allelicFrequency == null || allelicFrequency.isEmpty()) && (copyNumberEvent == null || copyNumberEvent.isEmpty())
3847           && (readCoverage == null || readCoverage.isEmpty()) && (repository == null || repository.isEmpty())
3848           && (pointer == null || pointer.isEmpty()) && (observedSeq == null || observedSeq.isEmpty())
3849           && (observation == null || observation.isEmpty()) && (structureVariation == null || structureVariation.isEmpty())
3850          ;
3851      }
3852
3853  @Override
3854  public ResourceType getResourceType() {
3855    return ResourceType.Sequence;
3856   }
3857
3858 /**
3859   * Search parameter: <b>patient</b>
3860   * <p>
3861   * Description: <b>The subject that the observation is about</b><br>
3862   * Type: <b>reference</b><br>
3863   * Path: <b>Sequence.patient</b><br>
3864   * </p>
3865   */
3866  @SearchParamDefinition(name="patient", path="Sequence.patient", description="The subject that the observation is about", type="reference" )
3867  public static final String SP_PATIENT = "patient";
3868 /**
3869   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3870   * <p>
3871   * Description: <b>The subject that the observation is about</b><br>
3872   * Type: <b>reference</b><br>
3873   * Path: <b>Sequence.patient</b><br>
3874   * </p>
3875   */
3876  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3877
3878/**
3879   * Constant for fluent queries to be used to add include statements. Specifies
3880   * the path value of "<b>Sequence:patient</b>".
3881   */
3882  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Sequence:patient").toLocked();
3883
3884 /**
3885   * Search parameter: <b>species</b>
3886   * <p>
3887   * Description: <b>The organism from which sample of the sequence was extracted.</b><br>
3888   * Type: <b>token</b><br>
3889   * Path: <b>Sequence.species</b><br>
3890   * </p>
3891   */
3892  @SearchParamDefinition(name="species", path="Sequence.species", description="The organism from which sample of the sequence was extracted.", type="token" )
3893  public static final String SP_SPECIES = "species";
3894 /**
3895   * <b>Fluent Client</b> search parameter constant for <b>species</b>
3896   * <p>
3897   * Description: <b>The organism from which sample of the sequence was extracted.</b><br>
3898   * Type: <b>token</b><br>
3899   * Path: <b>Sequence.species</b><br>
3900   * </p>
3901   */
3902  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIES = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIES);
3903
3904 /**
3905   * Search parameter: <b>coordinate</b>
3906   * <p>
3907   * Description: <b>Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`</b><br>
3908   * Type: <b>composite</b><br>
3909   * Path: <b></b><br>
3910   * </p>
3911   */
3912  @SearchParamDefinition(name="coordinate", path="", description="Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`", type="composite", compositeOf={"chromosome", "start"} )
3913  public static final String SP_COORDINATE = "coordinate";
3914 /**
3915   * <b>Fluent Client</b> search parameter constant for <b>coordinate</b>
3916   * <p>
3917   * Description: <b>Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`</b><br>
3918   * Type: <b>composite</b><br>
3919   * Path: <b></b><br>
3920   * </p>
3921   */
3922  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);
3923
3924 /**
3925   * Search parameter: <b>start</b>
3926   * <p>
3927   * Description: <b>Start position (0-based inclusive) of the sequence</b><br>
3928   * Type: <b>number</b><br>
3929   * Path: <b>Sequence.variation.start</b><br>
3930   * </p>
3931   */
3932  @SearchParamDefinition(name="start", path="Sequence.variation.start", description="Start position (0-based inclusive) of the sequence", type="number" )
3933  public static final String SP_START = "start";
3934 /**
3935   * <b>Fluent Client</b> search parameter constant for <b>start</b>
3936   * <p>
3937   * Description: <b>Start position (0-based inclusive) of the sequence</b><br>
3938   * Type: <b>number</b><br>
3939   * Path: <b>Sequence.variation.start</b><br>
3940   * </p>
3941   */
3942  public static final ca.uhn.fhir.rest.gclient.NumberClientParam START = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_START);
3943
3944 /**
3945   * Search parameter: <b>type</b>
3946   * <p>
3947   * Description: <b>The type of the variant: Amino acid / cDNA transcript / RNA variation.</b><br>
3948   * Type: <b>token</b><br>
3949   * Path: <b>Sequence.type</b><br>
3950   * </p>
3951   */
3952  @SearchParamDefinition(name="type", path="Sequence.type", description="The type of the variant: Amino acid / cDNA transcript / RNA variation.", type="token" )
3953  public static final String SP_TYPE = "type";
3954 /**
3955   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3956   * <p>
3957   * Description: <b>The type of the variant: Amino acid / cDNA transcript / RNA variation.</b><br>
3958   * Type: <b>token</b><br>
3959   * Path: <b>Sequence.type</b><br>
3960   * </p>
3961   */
3962  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
3963
3964 /**
3965   * Search parameter: <b>chromosome</b>
3966   * <p>
3967   * Description: <b>Chromosome of the sequence</b><br>
3968   * Type: <b>token</b><br>
3969   * Path: <b>Sequence.referenceSeq.chromosome</b><br>
3970   * </p>
3971   */
3972  @SearchParamDefinition(name="chromosome", path="Sequence.referenceSeq.chromosome", description="Chromosome of the sequence", type="token" )
3973  public static final String SP_CHROMOSOME = "chromosome";
3974 /**
3975   * <b>Fluent Client</b> search parameter constant for <b>chromosome</b>
3976   * <p>
3977   * Description: <b>Chromosome of the sequence</b><br>
3978   * Type: <b>token</b><br>
3979   * Path: <b>Sequence.referenceSeq.chromosome</b><br>
3980   * </p>
3981   */
3982  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHROMOSOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHROMOSOME);
3983
3984 /**
3985   * Search parameter: <b>end</b>
3986   * <p>
3987   * Description: <b>End position (0-based exclusive) of the sequence</b><br>
3988   * Type: <b>number</b><br>
3989   * Path: <b>Sequence.variation.end</b><br>
3990   * </p>
3991   */
3992  @SearchParamDefinition(name="end", path="Sequence.variation.end", description="End position (0-based exclusive) of the sequence", type="number" )
3993  public static final String SP_END = "end";
3994 /**
3995   * <b>Fluent Client</b> search parameter constant for <b>end</b>
3996   * <p>
3997   * Description: <b>End position (0-based exclusive) of the sequence</b><br>
3998   * Type: <b>number</b><br>
3999   * Path: <b>Sequence.variation.end</b><br>
4000   * </p>
4001   */
4002  public static final ca.uhn.fhir.rest.gclient.NumberClientParam END = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_END);
4003
4004
4005}