001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * Representation of a molecular sequence.
052 */
053@ResourceDef(name="MolecularSequence", profile="http://hl7.org/fhir/StructureDefinition/MolecularSequence")
054public class MolecularSequence extends DomainResource {
055
056    public enum OrientationType {
057        /**
058         * Sense orientation of reference sequence.
059         */
060        SENSE, 
061        /**
062         * Antisense orientation of reference sequence.
063         */
064        ANTISENSE, 
065        /**
066         * added to help the parsers with the generic types
067         */
068        NULL;
069        public static OrientationType fromCode(String codeString) throws FHIRException {
070            if (codeString == null || "".equals(codeString))
071                return null;
072        if ("sense".equals(codeString))
073          return SENSE;
074        if ("antisense".equals(codeString))
075          return ANTISENSE;
076        if (Configuration.isAcceptInvalidEnums())
077          return null;
078        else
079          throw new FHIRException("Unknown OrientationType code '"+codeString+"'");
080        }
081        public String toCode() {
082          switch (this) {
083            case SENSE: return "sense";
084            case ANTISENSE: return "antisense";
085            case NULL: return null;
086            default: return "?";
087          }
088        }
089        public String getSystem() {
090          switch (this) {
091            case SENSE: return "http://hl7.org/fhir/orientation-type";
092            case ANTISENSE: return "http://hl7.org/fhir/orientation-type";
093            case NULL: return null;
094            default: return "?";
095          }
096        }
097        public String getDefinition() {
098          switch (this) {
099            case SENSE: return "Sense orientation of reference sequence.";
100            case ANTISENSE: return "Antisense orientation of reference sequence.";
101            case NULL: return null;
102            default: return "?";
103          }
104        }
105        public String getDisplay() {
106          switch (this) {
107            case SENSE: return "Sense orientation of referenceSeq";
108            case ANTISENSE: return "Antisense orientation of referenceSeq";
109            case NULL: return null;
110            default: return "?";
111          }
112        }
113    }
114
115  public static class OrientationTypeEnumFactory implements EnumFactory<OrientationType> {
116    public OrientationType fromCode(String codeString) throws IllegalArgumentException {
117      if (codeString == null || "".equals(codeString))
118            if (codeString == null || "".equals(codeString))
119                return null;
120        if ("sense".equals(codeString))
121          return OrientationType.SENSE;
122        if ("antisense".equals(codeString))
123          return OrientationType.ANTISENSE;
124        throw new IllegalArgumentException("Unknown OrientationType code '"+codeString+"'");
125        }
126        public Enumeration<OrientationType> fromType(PrimitiveType<?> code) throws FHIRException {
127          if (code == null)
128            return null;
129          if (code.isEmpty())
130            return new Enumeration<OrientationType>(this, OrientationType.NULL, code);
131          String codeString = ((PrimitiveType) code).asStringValue();
132          if (codeString == null || "".equals(codeString))
133            return new Enumeration<OrientationType>(this, OrientationType.NULL, code);
134        if ("sense".equals(codeString))
135          return new Enumeration<OrientationType>(this, OrientationType.SENSE, code);
136        if ("antisense".equals(codeString))
137          return new Enumeration<OrientationType>(this, OrientationType.ANTISENSE, code);
138        throw new FHIRException("Unknown OrientationType code '"+codeString+"'");
139        }
140    public String toCode(OrientationType code) {
141      if (code == OrientationType.SENSE)
142        return "sense";
143      if (code == OrientationType.ANTISENSE)
144        return "antisense";
145      return "?";
146      }
147    public String toSystem(OrientationType code) {
148      return code.getSystem();
149      }
150    }
151
152    public enum SequenceType {
153        /**
154         * Amino acid sequence.
155         */
156        AA, 
157        /**
158         * DNA Sequence.
159         */
160        DNA, 
161        /**
162         * RNA Sequence.
163         */
164        RNA, 
165        /**
166         * added to help the parsers with the generic types
167         */
168        NULL;
169        public static SequenceType fromCode(String codeString) throws FHIRException {
170            if (codeString == null || "".equals(codeString))
171                return null;
172        if ("aa".equals(codeString))
173          return AA;
174        if ("dna".equals(codeString))
175          return DNA;
176        if ("rna".equals(codeString))
177          return RNA;
178        if (Configuration.isAcceptInvalidEnums())
179          return null;
180        else
181          throw new FHIRException("Unknown SequenceType code '"+codeString+"'");
182        }
183        public String toCode() {
184          switch (this) {
185            case AA: return "aa";
186            case DNA: return "dna";
187            case RNA: return "rna";
188            case NULL: return null;
189            default: return "?";
190          }
191        }
192        public String getSystem() {
193          switch (this) {
194            case AA: return "http://hl7.org/fhir/sequence-type";
195            case DNA: return "http://hl7.org/fhir/sequence-type";
196            case RNA: return "http://hl7.org/fhir/sequence-type";
197            case NULL: return null;
198            default: return "?";
199          }
200        }
201        public String getDefinition() {
202          switch (this) {
203            case AA: return "Amino acid sequence.";
204            case DNA: return "DNA Sequence.";
205            case RNA: return "RNA Sequence.";
206            case NULL: return null;
207            default: return "?";
208          }
209        }
210        public String getDisplay() {
211          switch (this) {
212            case AA: return "AA Sequence";
213            case DNA: return "DNA Sequence";
214            case RNA: return "RNA Sequence";
215            case NULL: return null;
216            default: return "?";
217          }
218        }
219    }
220
221  public static class SequenceTypeEnumFactory implements EnumFactory<SequenceType> {
222    public SequenceType fromCode(String codeString) throws IllegalArgumentException {
223      if (codeString == null || "".equals(codeString))
224            if (codeString == null || "".equals(codeString))
225                return null;
226        if ("aa".equals(codeString))
227          return SequenceType.AA;
228        if ("dna".equals(codeString))
229          return SequenceType.DNA;
230        if ("rna".equals(codeString))
231          return SequenceType.RNA;
232        throw new IllegalArgumentException("Unknown SequenceType code '"+codeString+"'");
233        }
234        public Enumeration<SequenceType> fromType(PrimitiveType<?> code) throws FHIRException {
235          if (code == null)
236            return null;
237          if (code.isEmpty())
238            return new Enumeration<SequenceType>(this, SequenceType.NULL, code);
239          String codeString = ((PrimitiveType) code).asStringValue();
240          if (codeString == null || "".equals(codeString))
241            return new Enumeration<SequenceType>(this, SequenceType.NULL, code);
242        if ("aa".equals(codeString))
243          return new Enumeration<SequenceType>(this, SequenceType.AA, code);
244        if ("dna".equals(codeString))
245          return new Enumeration<SequenceType>(this, SequenceType.DNA, code);
246        if ("rna".equals(codeString))
247          return new Enumeration<SequenceType>(this, SequenceType.RNA, code);
248        throw new FHIRException("Unknown SequenceType code '"+codeString+"'");
249        }
250    public String toCode(SequenceType code) {
251      if (code == SequenceType.AA)
252        return "aa";
253      if (code == SequenceType.DNA)
254        return "dna";
255      if (code == SequenceType.RNA)
256        return "rna";
257      return "?";
258      }
259    public String toSystem(SequenceType code) {
260      return code.getSystem();
261      }
262    }
263
264    public enum StrandType {
265        /**
266         * Watson strand of starting sequence.
267         */
268        WATSON, 
269        /**
270         * Crick strand of starting sequence.
271         */
272        CRICK, 
273        /**
274         * added to help the parsers with the generic types
275         */
276        NULL;
277        public static StrandType fromCode(String codeString) throws FHIRException {
278            if (codeString == null || "".equals(codeString))
279                return null;
280        if ("watson".equals(codeString))
281          return WATSON;
282        if ("crick".equals(codeString))
283          return CRICK;
284        if (Configuration.isAcceptInvalidEnums())
285          return null;
286        else
287          throw new FHIRException("Unknown StrandType code '"+codeString+"'");
288        }
289        public String toCode() {
290          switch (this) {
291            case WATSON: return "watson";
292            case CRICK: return "crick";
293            case NULL: return null;
294            default: return "?";
295          }
296        }
297        public String getSystem() {
298          switch (this) {
299            case WATSON: return "http://hl7.org/fhir/strand-type";
300            case CRICK: return "http://hl7.org/fhir/strand-type";
301            case NULL: return null;
302            default: return "?";
303          }
304        }
305        public String getDefinition() {
306          switch (this) {
307            case WATSON: return "Watson strand of starting sequence.";
308            case CRICK: return "Crick strand of starting sequence.";
309            case NULL: return null;
310            default: return "?";
311          }
312        }
313        public String getDisplay() {
314          switch (this) {
315            case WATSON: return "Watson strand of starting sequence";
316            case CRICK: return "Crick strand of starting sequence";
317            case NULL: return null;
318            default: return "?";
319          }
320        }
321    }
322
323  public static class StrandTypeEnumFactory implements EnumFactory<StrandType> {
324    public StrandType fromCode(String codeString) throws IllegalArgumentException {
325      if (codeString == null || "".equals(codeString))
326            if (codeString == null || "".equals(codeString))
327                return null;
328        if ("watson".equals(codeString))
329          return StrandType.WATSON;
330        if ("crick".equals(codeString))
331          return StrandType.CRICK;
332        throw new IllegalArgumentException("Unknown StrandType code '"+codeString+"'");
333        }
334        public Enumeration<StrandType> fromType(PrimitiveType<?> code) throws FHIRException {
335          if (code == null)
336            return null;
337          if (code.isEmpty())
338            return new Enumeration<StrandType>(this, StrandType.NULL, code);
339          String codeString = ((PrimitiveType) code).asStringValue();
340          if (codeString == null || "".equals(codeString))
341            return new Enumeration<StrandType>(this, StrandType.NULL, code);
342        if ("watson".equals(codeString))
343          return new Enumeration<StrandType>(this, StrandType.WATSON, code);
344        if ("crick".equals(codeString))
345          return new Enumeration<StrandType>(this, StrandType.CRICK, code);
346        throw new FHIRException("Unknown StrandType code '"+codeString+"'");
347        }
348    public String toCode(StrandType code) {
349      if (code == StrandType.WATSON)
350        return "watson";
351      if (code == StrandType.CRICK)
352        return "crick";
353      return "?";
354      }
355    public String toSystem(StrandType code) {
356      return code.getSystem();
357      }
358    }
359
360    @Block()
361    public static class MolecularSequenceRelativeComponent extends BackboneElement implements IBaseBackboneElement {
362        /**
363         * These are different ways of identifying nucleotides or amino acids within a sequence. Different databases and file types may use different systems. For detail definitions, see https://loinc.org/92822-6/ for more detail.
364         */
365        @Child(name = "coordinateSystem", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
366        @Description(shortDefinition="Ways of identifying nucleotides or amino acids within a sequence", formalDefinition="These are different ways of identifying nucleotides or amino acids within a sequence. Different databases and file types may use different systems. For detail definitions, see https://loinc.org/92822-6/ for more detail." )
367        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://loinc.org/LL5323-2/")
368        protected CodeableConcept coordinateSystem;
369
370        /**
371         * Indicates the order in which the sequence should be considered when putting multiple 'relative' elements together.
372         */
373        @Child(name = "ordinalPosition", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=false)
374        @Description(shortDefinition="Indicates the order in which the sequence should be considered when putting multiple 'relative' elements together", formalDefinition="Indicates the order in which the sequence should be considered when putting multiple 'relative' elements together." )
375        protected IntegerType ordinalPosition;
376
377        /**
378         * Indicates the nucleotide range in the composed sequence when multiple 'relative' elements are used together.
379         */
380        @Child(name = "sequenceRange", type = {Range.class}, order=3, min=0, max=1, modifier=false, summary=false)
381        @Description(shortDefinition="Indicates the nucleotide range in the composed sequence when multiple 'relative' elements are used together", formalDefinition="Indicates the nucleotide range in the composed sequence when multiple 'relative' elements are used together." )
382        protected Range sequenceRange;
383
384        /**
385         * A sequence that is used as a starting sequence to describe variants that are present in a sequence analyzed.
386         */
387        @Child(name = "startingSequence", type = {}, order=4, min=0, max=1, modifier=false, summary=true)
388        @Description(shortDefinition="A sequence used as starting sequence", formalDefinition="A sequence that is used as a starting sequence to describe variants that are present in a sequence analyzed." )
389        protected MolecularSequenceRelativeStartingSequenceComponent startingSequence;
390
391        /**
392         * Changes in sequence from the starting sequence.
393         */
394        @Child(name = "edit", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
395        @Description(shortDefinition="Changes in sequence from the starting sequence", formalDefinition="Changes in sequence from the starting sequence." )
396        protected List<MolecularSequenceRelativeEditComponent> edit;
397
398        private static final long serialVersionUID = -1455983973L;
399
400    /**
401     * Constructor
402     */
403      public MolecularSequenceRelativeComponent() {
404        super();
405      }
406
407    /**
408     * Constructor
409     */
410      public MolecularSequenceRelativeComponent(CodeableConcept coordinateSystem) {
411        super();
412        this.setCoordinateSystem(coordinateSystem);
413      }
414
415        /**
416         * @return {@link #coordinateSystem} (These are different ways of identifying nucleotides or amino acids within a sequence. Different databases and file types may use different systems. For detail definitions, see https://loinc.org/92822-6/ for more detail.)
417         */
418        public CodeableConcept getCoordinateSystem() { 
419          if (this.coordinateSystem == null)
420            if (Configuration.errorOnAutoCreate())
421              throw new Error("Attempt to auto-create MolecularSequenceRelativeComponent.coordinateSystem");
422            else if (Configuration.doAutoCreate())
423              this.coordinateSystem = new CodeableConcept(); // cc
424          return this.coordinateSystem;
425        }
426
427        public boolean hasCoordinateSystem() { 
428          return this.coordinateSystem != null && !this.coordinateSystem.isEmpty();
429        }
430
431        /**
432         * @param value {@link #coordinateSystem} (These are different ways of identifying nucleotides or amino acids within a sequence. Different databases and file types may use different systems. For detail definitions, see https://loinc.org/92822-6/ for more detail.)
433         */
434        public MolecularSequenceRelativeComponent setCoordinateSystem(CodeableConcept value) { 
435          this.coordinateSystem = value;
436          return this;
437        }
438
439        /**
440         * @return {@link #ordinalPosition} (Indicates the order in which the sequence should be considered when putting multiple 'relative' elements together.). This is the underlying object with id, value and extensions. The accessor "getOrdinalPosition" gives direct access to the value
441         */
442        public IntegerType getOrdinalPositionElement() { 
443          if (this.ordinalPosition == null)
444            if (Configuration.errorOnAutoCreate())
445              throw new Error("Attempt to auto-create MolecularSequenceRelativeComponent.ordinalPosition");
446            else if (Configuration.doAutoCreate())
447              this.ordinalPosition = new IntegerType(); // bb
448          return this.ordinalPosition;
449        }
450
451        public boolean hasOrdinalPositionElement() { 
452          return this.ordinalPosition != null && !this.ordinalPosition.isEmpty();
453        }
454
455        public boolean hasOrdinalPosition() { 
456          return this.ordinalPosition != null && !this.ordinalPosition.isEmpty();
457        }
458
459        /**
460         * @param value {@link #ordinalPosition} (Indicates the order in which the sequence should be considered when putting multiple 'relative' elements together.). This is the underlying object with id, value and extensions. The accessor "getOrdinalPosition" gives direct access to the value
461         */
462        public MolecularSequenceRelativeComponent setOrdinalPositionElement(IntegerType value) { 
463          this.ordinalPosition = value;
464          return this;
465        }
466
467        /**
468         * @return Indicates the order in which the sequence should be considered when putting multiple 'relative' elements together.
469         */
470        public int getOrdinalPosition() { 
471          return this.ordinalPosition == null || this.ordinalPosition.isEmpty() ? 0 : this.ordinalPosition.getValue();
472        }
473
474        /**
475         * @param value Indicates the order in which the sequence should be considered when putting multiple 'relative' elements together.
476         */
477        public MolecularSequenceRelativeComponent setOrdinalPosition(int value) { 
478            if (this.ordinalPosition == null)
479              this.ordinalPosition = new IntegerType();
480            this.ordinalPosition.setValue(value);
481          return this;
482        }
483
484        /**
485         * @return {@link #sequenceRange} (Indicates the nucleotide range in the composed sequence when multiple 'relative' elements are used together.)
486         */
487        public Range getSequenceRange() { 
488          if (this.sequenceRange == null)
489            if (Configuration.errorOnAutoCreate())
490              throw new Error("Attempt to auto-create MolecularSequenceRelativeComponent.sequenceRange");
491            else if (Configuration.doAutoCreate())
492              this.sequenceRange = new Range(); // cc
493          return this.sequenceRange;
494        }
495
496        public boolean hasSequenceRange() { 
497          return this.sequenceRange != null && !this.sequenceRange.isEmpty();
498        }
499
500        /**
501         * @param value {@link #sequenceRange} (Indicates the nucleotide range in the composed sequence when multiple 'relative' elements are used together.)
502         */
503        public MolecularSequenceRelativeComponent setSequenceRange(Range value) { 
504          this.sequenceRange = value;
505          return this;
506        }
507
508        /**
509         * @return {@link #startingSequence} (A sequence that is used as a starting sequence to describe variants that are present in a sequence analyzed.)
510         */
511        public MolecularSequenceRelativeStartingSequenceComponent getStartingSequence() { 
512          if (this.startingSequence == null)
513            if (Configuration.errorOnAutoCreate())
514              throw new Error("Attempt to auto-create MolecularSequenceRelativeComponent.startingSequence");
515            else if (Configuration.doAutoCreate())
516              this.startingSequence = new MolecularSequenceRelativeStartingSequenceComponent(); // cc
517          return this.startingSequence;
518        }
519
520        public boolean hasStartingSequence() { 
521          return this.startingSequence != null && !this.startingSequence.isEmpty();
522        }
523
524        /**
525         * @param value {@link #startingSequence} (A sequence that is used as a starting sequence to describe variants that are present in a sequence analyzed.)
526         */
527        public MolecularSequenceRelativeComponent setStartingSequence(MolecularSequenceRelativeStartingSequenceComponent value) { 
528          this.startingSequence = value;
529          return this;
530        }
531
532        /**
533         * @return {@link #edit} (Changes in sequence from the starting sequence.)
534         */
535        public List<MolecularSequenceRelativeEditComponent> getEdit() { 
536          if (this.edit == null)
537            this.edit = new ArrayList<MolecularSequenceRelativeEditComponent>();
538          return this.edit;
539        }
540
541        /**
542         * @return Returns a reference to <code>this</code> for easy method chaining
543         */
544        public MolecularSequenceRelativeComponent setEdit(List<MolecularSequenceRelativeEditComponent> theEdit) { 
545          this.edit = theEdit;
546          return this;
547        }
548
549        public boolean hasEdit() { 
550          if (this.edit == null)
551            return false;
552          for (MolecularSequenceRelativeEditComponent item : this.edit)
553            if (!item.isEmpty())
554              return true;
555          return false;
556        }
557
558        public MolecularSequenceRelativeEditComponent addEdit() { //3
559          MolecularSequenceRelativeEditComponent t = new MolecularSequenceRelativeEditComponent();
560          if (this.edit == null)
561            this.edit = new ArrayList<MolecularSequenceRelativeEditComponent>();
562          this.edit.add(t);
563          return t;
564        }
565
566        public MolecularSequenceRelativeComponent addEdit(MolecularSequenceRelativeEditComponent t) { //3
567          if (t == null)
568            return this;
569          if (this.edit == null)
570            this.edit = new ArrayList<MolecularSequenceRelativeEditComponent>();
571          this.edit.add(t);
572          return this;
573        }
574
575        /**
576         * @return The first repetition of repeating field {@link #edit}, creating it if it does not already exist {3}
577         */
578        public MolecularSequenceRelativeEditComponent getEditFirstRep() { 
579          if (getEdit().isEmpty()) {
580            addEdit();
581          }
582          return getEdit().get(0);
583        }
584
585        protected void listChildren(List<Property> children) {
586          super.listChildren(children);
587          children.add(new Property("coordinateSystem", "CodeableConcept", "These are different ways of identifying nucleotides or amino acids within a sequence. Different databases and file types may use different systems. For detail definitions, see https://loinc.org/92822-6/ for more detail.", 0, 1, coordinateSystem));
588          children.add(new Property("ordinalPosition", "integer", "Indicates the order in which the sequence should be considered when putting multiple 'relative' elements together.", 0, 1, ordinalPosition));
589          children.add(new Property("sequenceRange", "Range", "Indicates the nucleotide range in the composed sequence when multiple 'relative' elements are used together.", 0, 1, sequenceRange));
590          children.add(new Property("startingSequence", "", "A sequence that is used as a starting sequence to describe variants that are present in a sequence analyzed.", 0, 1, startingSequence));
591          children.add(new Property("edit", "", "Changes in sequence from the starting sequence.", 0, java.lang.Integer.MAX_VALUE, edit));
592        }
593
594        @Override
595        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
596          switch (_hash) {
597          case 354212295: /*coordinateSystem*/  return new Property("coordinateSystem", "CodeableConcept", "These are different ways of identifying nucleotides or amino acids within a sequence. Different databases and file types may use different systems. For detail definitions, see https://loinc.org/92822-6/ for more detail.", 0, 1, coordinateSystem);
598          case 626439866: /*ordinalPosition*/  return new Property("ordinalPosition", "integer", "Indicates the order in which the sequence should be considered when putting multiple 'relative' elements together.", 0, 1, ordinalPosition);
599          case -733314564: /*sequenceRange*/  return new Property("sequenceRange", "Range", "Indicates the nucleotide range in the composed sequence when multiple 'relative' elements are used together.", 0, 1, sequenceRange);
600          case 1493400609: /*startingSequence*/  return new Property("startingSequence", "", "A sequence that is used as a starting sequence to describe variants that are present in a sequence analyzed.", 0, 1, startingSequence);
601          case 3108362: /*edit*/  return new Property("edit", "", "Changes in sequence from the starting sequence.", 0, java.lang.Integer.MAX_VALUE, edit);
602          default: return super.getNamedProperty(_hash, _name, _checkValid);
603          }
604
605        }
606
607      @Override
608      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
609        switch (hash) {
610        case 354212295: /*coordinateSystem*/ return this.coordinateSystem == null ? new Base[0] : new Base[] {this.coordinateSystem}; // CodeableConcept
611        case 626439866: /*ordinalPosition*/ return this.ordinalPosition == null ? new Base[0] : new Base[] {this.ordinalPosition}; // IntegerType
612        case -733314564: /*sequenceRange*/ return this.sequenceRange == null ? new Base[0] : new Base[] {this.sequenceRange}; // Range
613        case 1493400609: /*startingSequence*/ return this.startingSequence == null ? new Base[0] : new Base[] {this.startingSequence}; // MolecularSequenceRelativeStartingSequenceComponent
614        case 3108362: /*edit*/ return this.edit == null ? new Base[0] : this.edit.toArray(new Base[this.edit.size()]); // MolecularSequenceRelativeEditComponent
615        default: return super.getProperty(hash, name, checkValid);
616        }
617
618      }
619
620      @Override
621      public Base setProperty(int hash, String name, Base value) throws FHIRException {
622        switch (hash) {
623        case 354212295: // coordinateSystem
624          this.coordinateSystem = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
625          return value;
626        case 626439866: // ordinalPosition
627          this.ordinalPosition = TypeConvertor.castToInteger(value); // IntegerType
628          return value;
629        case -733314564: // sequenceRange
630          this.sequenceRange = TypeConvertor.castToRange(value); // Range
631          return value;
632        case 1493400609: // startingSequence
633          this.startingSequence = (MolecularSequenceRelativeStartingSequenceComponent) value; // MolecularSequenceRelativeStartingSequenceComponent
634          return value;
635        case 3108362: // edit
636          this.getEdit().add((MolecularSequenceRelativeEditComponent) value); // MolecularSequenceRelativeEditComponent
637          return value;
638        default: return super.setProperty(hash, name, value);
639        }
640
641      }
642
643      @Override
644      public Base setProperty(String name, Base value) throws FHIRException {
645        if (name.equals("coordinateSystem")) {
646          this.coordinateSystem = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
647        } else if (name.equals("ordinalPosition")) {
648          this.ordinalPosition = TypeConvertor.castToInteger(value); // IntegerType
649        } else if (name.equals("sequenceRange")) {
650          this.sequenceRange = TypeConvertor.castToRange(value); // Range
651        } else if (name.equals("startingSequence")) {
652          this.startingSequence = (MolecularSequenceRelativeStartingSequenceComponent) value; // MolecularSequenceRelativeStartingSequenceComponent
653        } else if (name.equals("edit")) {
654          this.getEdit().add((MolecularSequenceRelativeEditComponent) value);
655        } else
656          return super.setProperty(name, value);
657        return value;
658      }
659
660      @Override
661      public Base makeProperty(int hash, String name) throws FHIRException {
662        switch (hash) {
663        case 354212295:  return getCoordinateSystem();
664        case 626439866:  return getOrdinalPositionElement();
665        case -733314564:  return getSequenceRange();
666        case 1493400609:  return getStartingSequence();
667        case 3108362:  return addEdit(); 
668        default: return super.makeProperty(hash, name);
669        }
670
671      }
672
673      @Override
674      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
675        switch (hash) {
676        case 354212295: /*coordinateSystem*/ return new String[] {"CodeableConcept"};
677        case 626439866: /*ordinalPosition*/ return new String[] {"integer"};
678        case -733314564: /*sequenceRange*/ return new String[] {"Range"};
679        case 1493400609: /*startingSequence*/ return new String[] {};
680        case 3108362: /*edit*/ return new String[] {};
681        default: return super.getTypesForProperty(hash, name);
682        }
683
684      }
685
686      @Override
687      public Base addChild(String name) throws FHIRException {
688        if (name.equals("coordinateSystem")) {
689          this.coordinateSystem = new CodeableConcept();
690          return this.coordinateSystem;
691        }
692        else if (name.equals("ordinalPosition")) {
693          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.relative.ordinalPosition");
694        }
695        else if (name.equals("sequenceRange")) {
696          this.sequenceRange = new Range();
697          return this.sequenceRange;
698        }
699        else if (name.equals("startingSequence")) {
700          this.startingSequence = new MolecularSequenceRelativeStartingSequenceComponent();
701          return this.startingSequence;
702        }
703        else if (name.equals("edit")) {
704          return addEdit();
705        }
706        else
707          return super.addChild(name);
708      }
709
710      public MolecularSequenceRelativeComponent copy() {
711        MolecularSequenceRelativeComponent dst = new MolecularSequenceRelativeComponent();
712        copyValues(dst);
713        return dst;
714      }
715
716      public void copyValues(MolecularSequenceRelativeComponent dst) {
717        super.copyValues(dst);
718        dst.coordinateSystem = coordinateSystem == null ? null : coordinateSystem.copy();
719        dst.ordinalPosition = ordinalPosition == null ? null : ordinalPosition.copy();
720        dst.sequenceRange = sequenceRange == null ? null : sequenceRange.copy();
721        dst.startingSequence = startingSequence == null ? null : startingSequence.copy();
722        if (edit != null) {
723          dst.edit = new ArrayList<MolecularSequenceRelativeEditComponent>();
724          for (MolecularSequenceRelativeEditComponent i : edit)
725            dst.edit.add(i.copy());
726        };
727      }
728
729      @Override
730      public boolean equalsDeep(Base other_) {
731        if (!super.equalsDeep(other_))
732          return false;
733        if (!(other_ instanceof MolecularSequenceRelativeComponent))
734          return false;
735        MolecularSequenceRelativeComponent o = (MolecularSequenceRelativeComponent) other_;
736        return compareDeep(coordinateSystem, o.coordinateSystem, true) && compareDeep(ordinalPosition, o.ordinalPosition, true)
737           && compareDeep(sequenceRange, o.sequenceRange, true) && compareDeep(startingSequence, o.startingSequence, true)
738           && compareDeep(edit, o.edit, true);
739      }
740
741      @Override
742      public boolean equalsShallow(Base other_) {
743        if (!super.equalsShallow(other_))
744          return false;
745        if (!(other_ instanceof MolecularSequenceRelativeComponent))
746          return false;
747        MolecularSequenceRelativeComponent o = (MolecularSequenceRelativeComponent) other_;
748        return compareValues(ordinalPosition, o.ordinalPosition, true);
749      }
750
751      public boolean isEmpty() {
752        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(coordinateSystem, ordinalPosition
753          , sequenceRange, startingSequence, edit);
754      }
755
756  public String fhirType() {
757    return "MolecularSequence.relative";
758
759  }
760
761  }
762
763    @Block()
764    public static class MolecularSequenceRelativeStartingSequenceComponent extends BackboneElement implements IBaseBackboneElement {
765        /**
766         * The genome assembly used for starting sequence, e.g. GRCh38.
767         */
768        @Child(name = "genomeAssembly", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
769        @Description(shortDefinition="The genome assembly used for starting sequence, e.g. GRCh38", formalDefinition="The genome assembly used for starting sequence, e.g. GRCh38." )
770        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://loinc.org/LL1040-6/")
771        protected CodeableConcept genomeAssembly;
772
773        /**
774         * Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).
775         */
776        @Child(name = "chromosome", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
777        @Description(shortDefinition="Chromosome Identifier", formalDefinition="Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340))." )
778        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://loinc.org/LL2938-0/")
779        protected CodeableConcept chromosome;
780
781        /**
782         * The reference sequence that represents the starting sequence.
783         */
784        @Child(name = "sequence", type = {CodeableConcept.class, StringType.class, MolecularSequence.class}, order=3, min=0, max=1, modifier=false, summary=true)
785        @Description(shortDefinition="The reference sequence that represents the starting sequence", formalDefinition="The reference sequence that represents the starting sequence." )
786        protected DataType sequence;
787
788        /**
789         * Start position of the window on the starting sequence. This value should honor the rules of the coordinateSystem.
790         */
791        @Child(name = "windowStart", type = {IntegerType.class}, order=4, min=0, max=1, modifier=false, summary=true)
792        @Description(shortDefinition="Start position of the window on the starting sequence", formalDefinition="Start position of the window on the starting sequence. This value should honor the rules of the coordinateSystem." )
793        protected IntegerType windowStart;
794
795        /**
796         * End position of the window on the starting sequence. This value should honor the rules of the  coordinateSystem.
797         */
798        @Child(name = "windowEnd", type = {IntegerType.class}, order=5, min=0, max=1, modifier=false, summary=true)
799        @Description(shortDefinition="End position of the window on the starting sequence", formalDefinition="End position of the window on the starting sequence. This value should honor the rules of the  coordinateSystem." )
800        protected IntegerType windowEnd;
801
802        /**
803         * A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the "sense" strand, and the opposite complementary strand is the "antisense" strand.
804         */
805        @Child(name = "orientation", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true)
806        @Description(shortDefinition="sense | antisense", formalDefinition="A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the \"sense\" strand, and the opposite complementary strand is the \"antisense\" strand." )
807        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/orientation-type")
808        protected Enumeration<OrientationType> orientation;
809
810        /**
811         * An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.
812         */
813        @Child(name = "strand", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
814        @Description(shortDefinition="watson | crick", formalDefinition="An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm." )
815        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/strand-type")
816        protected Enumeration<StrandType> strand;
817
818        private static final long serialVersionUID = 502438613L;
819
820    /**
821     * Constructor
822     */
823      public MolecularSequenceRelativeStartingSequenceComponent() {
824        super();
825      }
826
827        /**
828         * @return {@link #genomeAssembly} (The genome assembly used for starting sequence, e.g. GRCh38.)
829         */
830        public CodeableConcept getGenomeAssembly() { 
831          if (this.genomeAssembly == null)
832            if (Configuration.errorOnAutoCreate())
833              throw new Error("Attempt to auto-create MolecularSequenceRelativeStartingSequenceComponent.genomeAssembly");
834            else if (Configuration.doAutoCreate())
835              this.genomeAssembly = new CodeableConcept(); // cc
836          return this.genomeAssembly;
837        }
838
839        public boolean hasGenomeAssembly() { 
840          return this.genomeAssembly != null && !this.genomeAssembly.isEmpty();
841        }
842
843        /**
844         * @param value {@link #genomeAssembly} (The genome assembly used for starting sequence, e.g. GRCh38.)
845         */
846        public MolecularSequenceRelativeStartingSequenceComponent setGenomeAssembly(CodeableConcept value) { 
847          this.genomeAssembly = value;
848          return this;
849        }
850
851        /**
852         * @return {@link #chromosome} (Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).)
853         */
854        public CodeableConcept getChromosome() { 
855          if (this.chromosome == null)
856            if (Configuration.errorOnAutoCreate())
857              throw new Error("Attempt to auto-create MolecularSequenceRelativeStartingSequenceComponent.chromosome");
858            else if (Configuration.doAutoCreate())
859              this.chromosome = new CodeableConcept(); // cc
860          return this.chromosome;
861        }
862
863        public boolean hasChromosome() { 
864          return this.chromosome != null && !this.chromosome.isEmpty();
865        }
866
867        /**
868         * @param value {@link #chromosome} (Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).)
869         */
870        public MolecularSequenceRelativeStartingSequenceComponent setChromosome(CodeableConcept value) { 
871          this.chromosome = value;
872          return this;
873        }
874
875        /**
876         * @return {@link #sequence} (The reference sequence that represents the starting sequence.)
877         */
878        public DataType getSequence() { 
879          return this.sequence;
880        }
881
882        /**
883         * @return {@link #sequence} (The reference sequence that represents the starting sequence.)
884         */
885        public CodeableConcept getSequenceCodeableConcept() throws FHIRException { 
886          if (this.sequence == null)
887            this.sequence = new CodeableConcept();
888          if (!(this.sequence instanceof CodeableConcept))
889            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.sequence.getClass().getName()+" was encountered");
890          return (CodeableConcept) this.sequence;
891        }
892
893        public boolean hasSequenceCodeableConcept() { 
894          return this != null && this.sequence instanceof CodeableConcept;
895        }
896
897        /**
898         * @return {@link #sequence} (The reference sequence that represents the starting sequence.)
899         */
900        public StringType getSequenceStringType() throws FHIRException { 
901          if (this.sequence == null)
902            this.sequence = new StringType();
903          if (!(this.sequence instanceof StringType))
904            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.sequence.getClass().getName()+" was encountered");
905          return (StringType) this.sequence;
906        }
907
908        public boolean hasSequenceStringType() { 
909          return this != null && this.sequence instanceof StringType;
910        }
911
912        /**
913         * @return {@link #sequence} (The reference sequence that represents the starting sequence.)
914         */
915        public Reference getSequenceReference() throws FHIRException { 
916          if (this.sequence == null)
917            this.sequence = new Reference();
918          if (!(this.sequence instanceof Reference))
919            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.sequence.getClass().getName()+" was encountered");
920          return (Reference) this.sequence;
921        }
922
923        public boolean hasSequenceReference() { 
924          return this != null && this.sequence instanceof Reference;
925        }
926
927        public boolean hasSequence() { 
928          return this.sequence != null && !this.sequence.isEmpty();
929        }
930
931        /**
932         * @param value {@link #sequence} (The reference sequence that represents the starting sequence.)
933         */
934        public MolecularSequenceRelativeStartingSequenceComponent setSequence(DataType value) { 
935          if (value != null && !(value instanceof CodeableConcept || value instanceof StringType || value instanceof Reference))
936            throw new FHIRException("Not the right type for MolecularSequence.relative.startingSequence.sequence[x]: "+value.fhirType());
937          this.sequence = value;
938          return this;
939        }
940
941        /**
942         * @return {@link #windowStart} (Start position of the window on the starting sequence. This value should honor the rules of the coordinateSystem.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value
943         */
944        public IntegerType getWindowStartElement() { 
945          if (this.windowStart == null)
946            if (Configuration.errorOnAutoCreate())
947              throw new Error("Attempt to auto-create MolecularSequenceRelativeStartingSequenceComponent.windowStart");
948            else if (Configuration.doAutoCreate())
949              this.windowStart = new IntegerType(); // bb
950          return this.windowStart;
951        }
952
953        public boolean hasWindowStartElement() { 
954          return this.windowStart != null && !this.windowStart.isEmpty();
955        }
956
957        public boolean hasWindowStart() { 
958          return this.windowStart != null && !this.windowStart.isEmpty();
959        }
960
961        /**
962         * @param value {@link #windowStart} (Start position of the window on the starting sequence. This value should honor the rules of the coordinateSystem.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value
963         */
964        public MolecularSequenceRelativeStartingSequenceComponent setWindowStartElement(IntegerType value) { 
965          this.windowStart = value;
966          return this;
967        }
968
969        /**
970         * @return Start position of the window on the starting sequence. This value should honor the rules of the coordinateSystem.
971         */
972        public int getWindowStart() { 
973          return this.windowStart == null || this.windowStart.isEmpty() ? 0 : this.windowStart.getValue();
974        }
975
976        /**
977         * @param value Start position of the window on the starting sequence. This value should honor the rules of the coordinateSystem.
978         */
979        public MolecularSequenceRelativeStartingSequenceComponent setWindowStart(int value) { 
980            if (this.windowStart == null)
981              this.windowStart = new IntegerType();
982            this.windowStart.setValue(value);
983          return this;
984        }
985
986        /**
987         * @return {@link #windowEnd} (End position of the window on the starting sequence. This value should honor the rules of the  coordinateSystem.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value
988         */
989        public IntegerType getWindowEndElement() { 
990          if (this.windowEnd == null)
991            if (Configuration.errorOnAutoCreate())
992              throw new Error("Attempt to auto-create MolecularSequenceRelativeStartingSequenceComponent.windowEnd");
993            else if (Configuration.doAutoCreate())
994              this.windowEnd = new IntegerType(); // bb
995          return this.windowEnd;
996        }
997
998        public boolean hasWindowEndElement() { 
999          return this.windowEnd != null && !this.windowEnd.isEmpty();
1000        }
1001
1002        public boolean hasWindowEnd() { 
1003          return this.windowEnd != null && !this.windowEnd.isEmpty();
1004        }
1005
1006        /**
1007         * @param value {@link #windowEnd} (End position of the window on the starting sequence. This value should honor the rules of the  coordinateSystem.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value
1008         */
1009        public MolecularSequenceRelativeStartingSequenceComponent setWindowEndElement(IntegerType value) { 
1010          this.windowEnd = value;
1011          return this;
1012        }
1013
1014        /**
1015         * @return End position of the window on the starting sequence. This value should honor the rules of the  coordinateSystem.
1016         */
1017        public int getWindowEnd() { 
1018          return this.windowEnd == null || this.windowEnd.isEmpty() ? 0 : this.windowEnd.getValue();
1019        }
1020
1021        /**
1022         * @param value End position of the window on the starting sequence. This value should honor the rules of the  coordinateSystem.
1023         */
1024        public MolecularSequenceRelativeStartingSequenceComponent setWindowEnd(int value) { 
1025            if (this.windowEnd == null)
1026              this.windowEnd = new IntegerType();
1027            this.windowEnd.setValue(value);
1028          return this;
1029        }
1030
1031        /**
1032         * @return {@link #orientation} (A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the "sense" strand, and the opposite complementary strand is the "antisense" strand.). This is the underlying object with id, value and extensions. The accessor "getOrientation" gives direct access to the value
1033         */
1034        public Enumeration<OrientationType> getOrientationElement() { 
1035          if (this.orientation == null)
1036            if (Configuration.errorOnAutoCreate())
1037              throw new Error("Attempt to auto-create MolecularSequenceRelativeStartingSequenceComponent.orientation");
1038            else if (Configuration.doAutoCreate())
1039              this.orientation = new Enumeration<OrientationType>(new OrientationTypeEnumFactory()); // bb
1040          return this.orientation;
1041        }
1042
1043        public boolean hasOrientationElement() { 
1044          return this.orientation != null && !this.orientation.isEmpty();
1045        }
1046
1047        public boolean hasOrientation() { 
1048          return this.orientation != null && !this.orientation.isEmpty();
1049        }
1050
1051        /**
1052         * @param value {@link #orientation} (A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the "sense" strand, and the opposite complementary strand is the "antisense" strand.). This is the underlying object with id, value and extensions. The accessor "getOrientation" gives direct access to the value
1053         */
1054        public MolecularSequenceRelativeStartingSequenceComponent setOrientationElement(Enumeration<OrientationType> value) { 
1055          this.orientation = value;
1056          return this;
1057        }
1058
1059        /**
1060         * @return A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the "sense" strand, and the opposite complementary strand is the "antisense" strand.
1061         */
1062        public OrientationType getOrientation() { 
1063          return this.orientation == null ? null : this.orientation.getValue();
1064        }
1065
1066        /**
1067         * @param value A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the "sense" strand, and the opposite complementary strand is the "antisense" strand.
1068         */
1069        public MolecularSequenceRelativeStartingSequenceComponent setOrientation(OrientationType value) { 
1070          if (value == null)
1071            this.orientation = null;
1072          else {
1073            if (this.orientation == null)
1074              this.orientation = new Enumeration<OrientationType>(new OrientationTypeEnumFactory());
1075            this.orientation.setValue(value);
1076          }
1077          return this;
1078        }
1079
1080        /**
1081         * @return {@link #strand} (An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.). This is the underlying object with id, value and extensions. The accessor "getStrand" gives direct access to the value
1082         */
1083        public Enumeration<StrandType> getStrandElement() { 
1084          if (this.strand == null)
1085            if (Configuration.errorOnAutoCreate())
1086              throw new Error("Attempt to auto-create MolecularSequenceRelativeStartingSequenceComponent.strand");
1087            else if (Configuration.doAutoCreate())
1088              this.strand = new Enumeration<StrandType>(new StrandTypeEnumFactory()); // bb
1089          return this.strand;
1090        }
1091
1092        public boolean hasStrandElement() { 
1093          return this.strand != null && !this.strand.isEmpty();
1094        }
1095
1096        public boolean hasStrand() { 
1097          return this.strand != null && !this.strand.isEmpty();
1098        }
1099
1100        /**
1101         * @param value {@link #strand} (An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.). This is the underlying object with id, value and extensions. The accessor "getStrand" gives direct access to the value
1102         */
1103        public MolecularSequenceRelativeStartingSequenceComponent setStrandElement(Enumeration<StrandType> value) { 
1104          this.strand = value;
1105          return this;
1106        }
1107
1108        /**
1109         * @return An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.
1110         */
1111        public StrandType getStrand() { 
1112          return this.strand == null ? null : this.strand.getValue();
1113        }
1114
1115        /**
1116         * @param value An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.
1117         */
1118        public MolecularSequenceRelativeStartingSequenceComponent setStrand(StrandType value) { 
1119          if (value == null)
1120            this.strand = null;
1121          else {
1122            if (this.strand == null)
1123              this.strand = new Enumeration<StrandType>(new StrandTypeEnumFactory());
1124            this.strand.setValue(value);
1125          }
1126          return this;
1127        }
1128
1129        protected void listChildren(List<Property> children) {
1130          super.listChildren(children);
1131          children.add(new Property("genomeAssembly", "CodeableConcept", "The genome assembly used for starting sequence, e.g. GRCh38.", 0, 1, genomeAssembly));
1132          children.add(new Property("chromosome", "CodeableConcept", "Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).", 0, 1, chromosome));
1133          children.add(new Property("sequence[x]", "CodeableConcept|string|Reference(MolecularSequence)", "The reference sequence that represents the starting sequence.", 0, 1, sequence));
1134          children.add(new Property("windowStart", "integer", "Start position of the window on the starting sequence. This value should honor the rules of the coordinateSystem.", 0, 1, windowStart));
1135          children.add(new Property("windowEnd", "integer", "End position of the window on the starting sequence. This value should honor the rules of the  coordinateSystem.", 0, 1, windowEnd));
1136          children.add(new Property("orientation", "code", "A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the \"sense\" strand, and the opposite complementary strand is the \"antisense\" strand.", 0, 1, orientation));
1137          children.add(new Property("strand", "code", "An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.", 0, 1, strand));
1138        }
1139
1140        @Override
1141        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1142          switch (_hash) {
1143          case 1196021757: /*genomeAssembly*/  return new Property("genomeAssembly", "CodeableConcept", "The genome assembly used for starting sequence, e.g. GRCh38.", 0, 1, genomeAssembly);
1144          case -1499470472: /*chromosome*/  return new Property("chromosome", "CodeableConcept", "Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).", 0, 1, chromosome);
1145          case -805222113: /*sequence[x]*/  return new Property("sequence[x]", "CodeableConcept|string|Reference(MolecularSequence)", "The reference sequence that represents the starting sequence.", 0, 1, sequence);
1146          case 1349547969: /*sequence*/  return new Property("sequence[x]", "CodeableConcept|string|Reference(MolecularSequence)", "The reference sequence that represents the starting sequence.", 0, 1, sequence);
1147          case 1508480416: /*sequenceCodeableConcept*/  return new Property("sequence[x]", "CodeableConcept", "The reference sequence that represents the starting sequence.", 0, 1, sequence);
1148          case -1211617486: /*sequenceString*/  return new Property("sequence[x]", "string", "The reference sequence that represents the starting sequence.", 0, 1, sequence);
1149          case -1127149430: /*sequenceReference*/  return new Property("sequence[x]", "Reference(MolecularSequence)", "The reference sequence that represents the starting sequence.", 0, 1, sequence);
1150          case 1903685202: /*windowStart*/  return new Property("windowStart", "integer", "Start position of the window on the starting sequence. This value should honor the rules of the coordinateSystem.", 0, 1, windowStart);
1151          case -217026869: /*windowEnd*/  return new Property("windowEnd", "integer", "End position of the window on the starting sequence. This value should honor the rules of the  coordinateSystem.", 0, 1, windowEnd);
1152          case -1439500848: /*orientation*/  return new Property("orientation", "code", "A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the \"sense\" strand, and the opposite complementary strand is the \"antisense\" strand.", 0, 1, orientation);
1153          case -891993594: /*strand*/  return new Property("strand", "code", "An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.", 0, 1, strand);
1154          default: return super.getNamedProperty(_hash, _name, _checkValid);
1155          }
1156
1157        }
1158
1159      @Override
1160      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1161        switch (hash) {
1162        case 1196021757: /*genomeAssembly*/ return this.genomeAssembly == null ? new Base[0] : new Base[] {this.genomeAssembly}; // CodeableConcept
1163        case -1499470472: /*chromosome*/ return this.chromosome == null ? new Base[0] : new Base[] {this.chromosome}; // CodeableConcept
1164        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // DataType
1165        case 1903685202: /*windowStart*/ return this.windowStart == null ? new Base[0] : new Base[] {this.windowStart}; // IntegerType
1166        case -217026869: /*windowEnd*/ return this.windowEnd == null ? new Base[0] : new Base[] {this.windowEnd}; // IntegerType
1167        case -1439500848: /*orientation*/ return this.orientation == null ? new Base[0] : new Base[] {this.orientation}; // Enumeration<OrientationType>
1168        case -891993594: /*strand*/ return this.strand == null ? new Base[0] : new Base[] {this.strand}; // Enumeration<StrandType>
1169        default: return super.getProperty(hash, name, checkValid);
1170        }
1171
1172      }
1173
1174      @Override
1175      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1176        switch (hash) {
1177        case 1196021757: // genomeAssembly
1178          this.genomeAssembly = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1179          return value;
1180        case -1499470472: // chromosome
1181          this.chromosome = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1182          return value;
1183        case 1349547969: // sequence
1184          this.sequence = TypeConvertor.castToType(value); // DataType
1185          return value;
1186        case 1903685202: // windowStart
1187          this.windowStart = TypeConvertor.castToInteger(value); // IntegerType
1188          return value;
1189        case -217026869: // windowEnd
1190          this.windowEnd = TypeConvertor.castToInteger(value); // IntegerType
1191          return value;
1192        case -1439500848: // orientation
1193          value = new OrientationTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1194          this.orientation = (Enumeration) value; // Enumeration<OrientationType>
1195          return value;
1196        case -891993594: // strand
1197          value = new StrandTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1198          this.strand = (Enumeration) value; // Enumeration<StrandType>
1199          return value;
1200        default: return super.setProperty(hash, name, value);
1201        }
1202
1203      }
1204
1205      @Override
1206      public Base setProperty(String name, Base value) throws FHIRException {
1207        if (name.equals("genomeAssembly")) {
1208          this.genomeAssembly = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1209        } else if (name.equals("chromosome")) {
1210          this.chromosome = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1211        } else if (name.equals("sequence[x]")) {
1212          this.sequence = TypeConvertor.castToType(value); // DataType
1213        } else if (name.equals("windowStart")) {
1214          this.windowStart = TypeConvertor.castToInteger(value); // IntegerType
1215        } else if (name.equals("windowEnd")) {
1216          this.windowEnd = TypeConvertor.castToInteger(value); // IntegerType
1217        } else if (name.equals("orientation")) {
1218          value = new OrientationTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1219          this.orientation = (Enumeration) value; // Enumeration<OrientationType>
1220        } else if (name.equals("strand")) {
1221          value = new StrandTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1222          this.strand = (Enumeration) value; // Enumeration<StrandType>
1223        } else
1224          return super.setProperty(name, value);
1225        return value;
1226      }
1227
1228      @Override
1229      public Base makeProperty(int hash, String name) throws FHIRException {
1230        switch (hash) {
1231        case 1196021757:  return getGenomeAssembly();
1232        case -1499470472:  return getChromosome();
1233        case -805222113:  return getSequence();
1234        case 1349547969:  return getSequence();
1235        case 1903685202:  return getWindowStartElement();
1236        case -217026869:  return getWindowEndElement();
1237        case -1439500848:  return getOrientationElement();
1238        case -891993594:  return getStrandElement();
1239        default: return super.makeProperty(hash, name);
1240        }
1241
1242      }
1243
1244      @Override
1245      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1246        switch (hash) {
1247        case 1196021757: /*genomeAssembly*/ return new String[] {"CodeableConcept"};
1248        case -1499470472: /*chromosome*/ return new String[] {"CodeableConcept"};
1249        case 1349547969: /*sequence*/ return new String[] {"CodeableConcept", "string", "Reference"};
1250        case 1903685202: /*windowStart*/ return new String[] {"integer"};
1251        case -217026869: /*windowEnd*/ return new String[] {"integer"};
1252        case -1439500848: /*orientation*/ return new String[] {"code"};
1253        case -891993594: /*strand*/ return new String[] {"code"};
1254        default: return super.getTypesForProperty(hash, name);
1255        }
1256
1257      }
1258
1259      @Override
1260      public Base addChild(String name) throws FHIRException {
1261        if (name.equals("genomeAssembly")) {
1262          this.genomeAssembly = new CodeableConcept();
1263          return this.genomeAssembly;
1264        }
1265        else if (name.equals("chromosome")) {
1266          this.chromosome = new CodeableConcept();
1267          return this.chromosome;
1268        }
1269        else if (name.equals("sequenceCodeableConcept")) {
1270          this.sequence = new CodeableConcept();
1271          return this.sequence;
1272        }
1273        else if (name.equals("sequenceString")) {
1274          this.sequence = new StringType();
1275          return this.sequence;
1276        }
1277        else if (name.equals("sequenceReference")) {
1278          this.sequence = new Reference();
1279          return this.sequence;
1280        }
1281        else if (name.equals("windowStart")) {
1282          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.relative.startingSequence.windowStart");
1283        }
1284        else if (name.equals("windowEnd")) {
1285          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.relative.startingSequence.windowEnd");
1286        }
1287        else if (name.equals("orientation")) {
1288          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.relative.startingSequence.orientation");
1289        }
1290        else if (name.equals("strand")) {
1291          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.relative.startingSequence.strand");
1292        }
1293        else
1294          return super.addChild(name);
1295      }
1296
1297      public MolecularSequenceRelativeStartingSequenceComponent copy() {
1298        MolecularSequenceRelativeStartingSequenceComponent dst = new MolecularSequenceRelativeStartingSequenceComponent();
1299        copyValues(dst);
1300        return dst;
1301      }
1302
1303      public void copyValues(MolecularSequenceRelativeStartingSequenceComponent dst) {
1304        super.copyValues(dst);
1305        dst.genomeAssembly = genomeAssembly == null ? null : genomeAssembly.copy();
1306        dst.chromosome = chromosome == null ? null : chromosome.copy();
1307        dst.sequence = sequence == null ? null : sequence.copy();
1308        dst.windowStart = windowStart == null ? null : windowStart.copy();
1309        dst.windowEnd = windowEnd == null ? null : windowEnd.copy();
1310        dst.orientation = orientation == null ? null : orientation.copy();
1311        dst.strand = strand == null ? null : strand.copy();
1312      }
1313
1314      @Override
1315      public boolean equalsDeep(Base other_) {
1316        if (!super.equalsDeep(other_))
1317          return false;
1318        if (!(other_ instanceof MolecularSequenceRelativeStartingSequenceComponent))
1319          return false;
1320        MolecularSequenceRelativeStartingSequenceComponent o = (MolecularSequenceRelativeStartingSequenceComponent) other_;
1321        return compareDeep(genomeAssembly, o.genomeAssembly, true) && compareDeep(chromosome, o.chromosome, true)
1322           && compareDeep(sequence, o.sequence, true) && compareDeep(windowStart, o.windowStart, true) && compareDeep(windowEnd, o.windowEnd, true)
1323           && compareDeep(orientation, o.orientation, true) && compareDeep(strand, o.strand, true);
1324      }
1325
1326      @Override
1327      public boolean equalsShallow(Base other_) {
1328        if (!super.equalsShallow(other_))
1329          return false;
1330        if (!(other_ instanceof MolecularSequenceRelativeStartingSequenceComponent))
1331          return false;
1332        MolecularSequenceRelativeStartingSequenceComponent o = (MolecularSequenceRelativeStartingSequenceComponent) other_;
1333        return compareValues(windowStart, o.windowStart, true) && compareValues(windowEnd, o.windowEnd, true)
1334           && compareValues(orientation, o.orientation, true) && compareValues(strand, o.strand, true);
1335      }
1336
1337      public boolean isEmpty() {
1338        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(genomeAssembly, chromosome
1339          , sequence, windowStart, windowEnd, orientation, strand);
1340      }
1341
1342  public String fhirType() {
1343    return "MolecularSequence.relative.startingSequence";
1344
1345  }
1346
1347  }
1348
1349    @Block()
1350    public static class MolecularSequenceRelativeEditComponent extends BackboneElement implements IBaseBackboneElement {
1351        /**
1352         * Start position of the edit on the starting sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.
1353         */
1354        @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1355        @Description(shortDefinition="Start position of the edit on the starting sequence", formalDefinition="Start position of the edit on the starting sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive." )
1356        protected IntegerType start;
1357
1358        /**
1359         * End position of the edit on the starting sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.
1360         */
1361        @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1362        @Description(shortDefinition="End position of the edit on the starting sequence", formalDefinition="End position of the edit on the starting sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position." )
1363        protected IntegerType end;
1364
1365        /**
1366         * Allele that was observed. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.
1367         */
1368        @Child(name = "replacementSequence", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1369        @Description(shortDefinition="Allele that was observed", formalDefinition="Allele that was observed. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end." )
1370        protected StringType replacementSequence;
1371
1372        /**
1373         * Allele in the starting sequence. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the starting sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.
1374         */
1375        @Child(name = "replacedSequence", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1376        @Description(shortDefinition="Allele in the starting sequence", formalDefinition="Allele in the starting sequence. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the starting sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end." )
1377        protected StringType replacedSequence;
1378
1379        private static final long serialVersionUID = 550127909L;
1380
1381    /**
1382     * Constructor
1383     */
1384      public MolecularSequenceRelativeEditComponent() {
1385        super();
1386      }
1387
1388        /**
1389         * @return {@link #start} (Start position of the edit on the starting sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
1390         */
1391        public IntegerType getStartElement() { 
1392          if (this.start == null)
1393            if (Configuration.errorOnAutoCreate())
1394              throw new Error("Attempt to auto-create MolecularSequenceRelativeEditComponent.start");
1395            else if (Configuration.doAutoCreate())
1396              this.start = new IntegerType(); // bb
1397          return this.start;
1398        }
1399
1400        public boolean hasStartElement() { 
1401          return this.start != null && !this.start.isEmpty();
1402        }
1403
1404        public boolean hasStart() { 
1405          return this.start != null && !this.start.isEmpty();
1406        }
1407
1408        /**
1409         * @param value {@link #start} (Start position of the edit on the starting sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value
1410         */
1411        public MolecularSequenceRelativeEditComponent setStartElement(IntegerType value) { 
1412          this.start = value;
1413          return this;
1414        }
1415
1416        /**
1417         * @return Start position of the edit on the starting sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.
1418         */
1419        public int getStart() { 
1420          return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue();
1421        }
1422
1423        /**
1424         * @param value Start position of the edit on the starting sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.
1425         */
1426        public MolecularSequenceRelativeEditComponent setStart(int value) { 
1427            if (this.start == null)
1428              this.start = new IntegerType();
1429            this.start.setValue(value);
1430          return this;
1431        }
1432
1433        /**
1434         * @return {@link #end} (End position of the edit on the starting sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
1435         */
1436        public IntegerType getEndElement() { 
1437          if (this.end == null)
1438            if (Configuration.errorOnAutoCreate())
1439              throw new Error("Attempt to auto-create MolecularSequenceRelativeEditComponent.end");
1440            else if (Configuration.doAutoCreate())
1441              this.end = new IntegerType(); // bb
1442          return this.end;
1443        }
1444
1445        public boolean hasEndElement() { 
1446          return this.end != null && !this.end.isEmpty();
1447        }
1448
1449        public boolean hasEnd() { 
1450          return this.end != null && !this.end.isEmpty();
1451        }
1452
1453        /**
1454         * @param value {@link #end} (End position of the edit on the starting sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value
1455         */
1456        public MolecularSequenceRelativeEditComponent setEndElement(IntegerType value) { 
1457          this.end = value;
1458          return this;
1459        }
1460
1461        /**
1462         * @return End position of the edit on the starting sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.
1463         */
1464        public int getEnd() { 
1465          return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue();
1466        }
1467
1468        /**
1469         * @param value End position of the edit on the starting sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.
1470         */
1471        public MolecularSequenceRelativeEditComponent setEnd(int value) { 
1472            if (this.end == null)
1473              this.end = new IntegerType();
1474            this.end.setValue(value);
1475          return this;
1476        }
1477
1478        /**
1479         * @return {@link #replacementSequence} (Allele that was observed. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.). This is the underlying object with id, value and extensions. The accessor "getReplacementSequence" gives direct access to the value
1480         */
1481        public StringType getReplacementSequenceElement() { 
1482          if (this.replacementSequence == null)
1483            if (Configuration.errorOnAutoCreate())
1484              throw new Error("Attempt to auto-create MolecularSequenceRelativeEditComponent.replacementSequence");
1485            else if (Configuration.doAutoCreate())
1486              this.replacementSequence = new StringType(); // bb
1487          return this.replacementSequence;
1488        }
1489
1490        public boolean hasReplacementSequenceElement() { 
1491          return this.replacementSequence != null && !this.replacementSequence.isEmpty();
1492        }
1493
1494        public boolean hasReplacementSequence() { 
1495          return this.replacementSequence != null && !this.replacementSequence.isEmpty();
1496        }
1497
1498        /**
1499         * @param value {@link #replacementSequence} (Allele that was observed. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.). This is the underlying object with id, value and extensions. The accessor "getReplacementSequence" gives direct access to the value
1500         */
1501        public MolecularSequenceRelativeEditComponent setReplacementSequenceElement(StringType value) { 
1502          this.replacementSequence = value;
1503          return this;
1504        }
1505
1506        /**
1507         * @return Allele that was observed. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.
1508         */
1509        public String getReplacementSequence() { 
1510          return this.replacementSequence == null ? null : this.replacementSequence.getValue();
1511        }
1512
1513        /**
1514         * @param value Allele that was observed. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.
1515         */
1516        public MolecularSequenceRelativeEditComponent setReplacementSequence(String value) { 
1517          if (Utilities.noString(value))
1518            this.replacementSequence = null;
1519          else {
1520            if (this.replacementSequence == null)
1521              this.replacementSequence = new StringType();
1522            this.replacementSequence.setValue(value);
1523          }
1524          return this;
1525        }
1526
1527        /**
1528         * @return {@link #replacedSequence} (Allele in the starting sequence. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the starting sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.). This is the underlying object with id, value and extensions. The accessor "getReplacedSequence" gives direct access to the value
1529         */
1530        public StringType getReplacedSequenceElement() { 
1531          if (this.replacedSequence == null)
1532            if (Configuration.errorOnAutoCreate())
1533              throw new Error("Attempt to auto-create MolecularSequenceRelativeEditComponent.replacedSequence");
1534            else if (Configuration.doAutoCreate())
1535              this.replacedSequence = new StringType(); // bb
1536          return this.replacedSequence;
1537        }
1538
1539        public boolean hasReplacedSequenceElement() { 
1540          return this.replacedSequence != null && !this.replacedSequence.isEmpty();
1541        }
1542
1543        public boolean hasReplacedSequence() { 
1544          return this.replacedSequence != null && !this.replacedSequence.isEmpty();
1545        }
1546
1547        /**
1548         * @param value {@link #replacedSequence} (Allele in the starting sequence. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the starting sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.). This is the underlying object with id, value and extensions. The accessor "getReplacedSequence" gives direct access to the value
1549         */
1550        public MolecularSequenceRelativeEditComponent setReplacedSequenceElement(StringType value) { 
1551          this.replacedSequence = value;
1552          return this;
1553        }
1554
1555        /**
1556         * @return Allele in the starting sequence. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the starting sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.
1557         */
1558        public String getReplacedSequence() { 
1559          return this.replacedSequence == null ? null : this.replacedSequence.getValue();
1560        }
1561
1562        /**
1563         * @param value Allele in the starting sequence. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the starting sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.
1564         */
1565        public MolecularSequenceRelativeEditComponent setReplacedSequence(String value) { 
1566          if (Utilities.noString(value))
1567            this.replacedSequence = null;
1568          else {
1569            if (this.replacedSequence == null)
1570              this.replacedSequence = new StringType();
1571            this.replacedSequence.setValue(value);
1572          }
1573          return this;
1574        }
1575
1576        protected void listChildren(List<Property> children) {
1577          super.listChildren(children);
1578          children.add(new Property("start", "integer", "Start position of the edit on the starting sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, 1, start));
1579          children.add(new Property("end", "integer", "End position of the edit on the starting sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.", 0, 1, end));
1580          children.add(new Property("replacementSequence", "string", "Allele that was observed. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.", 0, 1, replacementSequence));
1581          children.add(new Property("replacedSequence", "string", "Allele in the starting sequence. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the starting sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.", 0, 1, replacedSequence));
1582        }
1583
1584        @Override
1585        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1586          switch (_hash) {
1587          case 109757538: /*start*/  return new Property("start", "integer", "Start position of the edit on the starting sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.", 0, 1, start);
1588          case 100571: /*end*/  return new Property("end", "integer", "End position of the edit on the starting sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.", 0, 1, end);
1589          case -1784940557: /*replacementSequence*/  return new Property("replacementSequence", "string", "Allele that was observed. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.", 0, 1, replacementSequence);
1590          case 1972719633: /*replacedSequence*/  return new Property("replacedSequence", "string", "Allele in the starting sequence. Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the starting sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.", 0, 1, replacedSequence);
1591          default: return super.getNamedProperty(_hash, _name, _checkValid);
1592          }
1593
1594        }
1595
1596      @Override
1597      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1598        switch (hash) {
1599        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType
1600        case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType
1601        case -1784940557: /*replacementSequence*/ return this.replacementSequence == null ? new Base[0] : new Base[] {this.replacementSequence}; // StringType
1602        case 1972719633: /*replacedSequence*/ return this.replacedSequence == null ? new Base[0] : new Base[] {this.replacedSequence}; // StringType
1603        default: return super.getProperty(hash, name, checkValid);
1604        }
1605
1606      }
1607
1608      @Override
1609      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1610        switch (hash) {
1611        case 109757538: // start
1612          this.start = TypeConvertor.castToInteger(value); // IntegerType
1613          return value;
1614        case 100571: // end
1615          this.end = TypeConvertor.castToInteger(value); // IntegerType
1616          return value;
1617        case -1784940557: // replacementSequence
1618          this.replacementSequence = TypeConvertor.castToString(value); // StringType
1619          return value;
1620        case 1972719633: // replacedSequence
1621          this.replacedSequence = TypeConvertor.castToString(value); // StringType
1622          return value;
1623        default: return super.setProperty(hash, name, value);
1624        }
1625
1626      }
1627
1628      @Override
1629      public Base setProperty(String name, Base value) throws FHIRException {
1630        if (name.equals("start")) {
1631          this.start = TypeConvertor.castToInteger(value); // IntegerType
1632        } else if (name.equals("end")) {
1633          this.end = TypeConvertor.castToInteger(value); // IntegerType
1634        } else if (name.equals("replacementSequence")) {
1635          this.replacementSequence = TypeConvertor.castToString(value); // StringType
1636        } else if (name.equals("replacedSequence")) {
1637          this.replacedSequence = TypeConvertor.castToString(value); // StringType
1638        } else
1639          return super.setProperty(name, value);
1640        return value;
1641      }
1642
1643      @Override
1644      public Base makeProperty(int hash, String name) throws FHIRException {
1645        switch (hash) {
1646        case 109757538:  return getStartElement();
1647        case 100571:  return getEndElement();
1648        case -1784940557:  return getReplacementSequenceElement();
1649        case 1972719633:  return getReplacedSequenceElement();
1650        default: return super.makeProperty(hash, name);
1651        }
1652
1653      }
1654
1655      @Override
1656      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1657        switch (hash) {
1658        case 109757538: /*start*/ return new String[] {"integer"};
1659        case 100571: /*end*/ return new String[] {"integer"};
1660        case -1784940557: /*replacementSequence*/ return new String[] {"string"};
1661        case 1972719633: /*replacedSequence*/ return new String[] {"string"};
1662        default: return super.getTypesForProperty(hash, name);
1663        }
1664
1665      }
1666
1667      @Override
1668      public Base addChild(String name) throws FHIRException {
1669        if (name.equals("start")) {
1670          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.relative.edit.start");
1671        }
1672        else if (name.equals("end")) {
1673          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.relative.edit.end");
1674        }
1675        else if (name.equals("replacementSequence")) {
1676          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.relative.edit.replacementSequence");
1677        }
1678        else if (name.equals("replacedSequence")) {
1679          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.relative.edit.replacedSequence");
1680        }
1681        else
1682          return super.addChild(name);
1683      }
1684
1685      public MolecularSequenceRelativeEditComponent copy() {
1686        MolecularSequenceRelativeEditComponent dst = new MolecularSequenceRelativeEditComponent();
1687        copyValues(dst);
1688        return dst;
1689      }
1690
1691      public void copyValues(MolecularSequenceRelativeEditComponent dst) {
1692        super.copyValues(dst);
1693        dst.start = start == null ? null : start.copy();
1694        dst.end = end == null ? null : end.copy();
1695        dst.replacementSequence = replacementSequence == null ? null : replacementSequence.copy();
1696        dst.replacedSequence = replacedSequence == null ? null : replacedSequence.copy();
1697      }
1698
1699      @Override
1700      public boolean equalsDeep(Base other_) {
1701        if (!super.equalsDeep(other_))
1702          return false;
1703        if (!(other_ instanceof MolecularSequenceRelativeEditComponent))
1704          return false;
1705        MolecularSequenceRelativeEditComponent o = (MolecularSequenceRelativeEditComponent) other_;
1706        return compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(replacementSequence, o.replacementSequence, true)
1707           && compareDeep(replacedSequence, o.replacedSequence, true);
1708      }
1709
1710      @Override
1711      public boolean equalsShallow(Base other_) {
1712        if (!super.equalsShallow(other_))
1713          return false;
1714        if (!(other_ instanceof MolecularSequenceRelativeEditComponent))
1715          return false;
1716        MolecularSequenceRelativeEditComponent o = (MolecularSequenceRelativeEditComponent) other_;
1717        return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(replacementSequence, o.replacementSequence, true)
1718           && compareValues(replacedSequence, o.replacedSequence, true);
1719      }
1720
1721      public boolean isEmpty() {
1722        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(start, end, replacementSequence
1723          , replacedSequence);
1724      }
1725
1726  public String fhirType() {
1727    return "MolecularSequence.relative.edit";
1728
1729  }
1730
1731  }
1732
1733    /**
1734     * A unique identifier for this particular sequence instance.
1735     */
1736    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1737    @Description(shortDefinition="Unique ID for this particular sequence", formalDefinition="A unique identifier for this particular sequence instance." )
1738    protected List<Identifier> identifier;
1739
1740    /**
1741     * Amino Acid Sequence/ DNA Sequence / RNA Sequence.
1742     */
1743    @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1744    @Description(shortDefinition="aa | dna | rna", formalDefinition="Amino Acid Sequence/ DNA Sequence / RNA Sequence." )
1745    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/sequence-type")
1746    protected Enumeration<SequenceType> type;
1747
1748    /**
1749     * Indicates the subject this sequence is associated too.
1750     */
1751    @Child(name = "subject", type = {Patient.class, Group.class, Substance.class, BiologicallyDerivedProduct.class, NutritionProduct.class}, order=2, min=0, max=1, modifier=false, summary=true)
1752    @Description(shortDefinition="Subject this sequence is associated too", formalDefinition="Indicates the subject this sequence is associated too." )
1753    protected Reference subject;
1754
1755    /**
1756     * The actual focus of a molecular sequence when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, child, or sibling. For example, in trio testing, the subject would be the child (proband) and the focus would be the parent.
1757     */
1758    @Child(name = "focus", type = {Reference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1759    @Description(shortDefinition="What the molecular sequence is about, when it is not about the subject of record", formalDefinition="The actual focus of a molecular sequence when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, child, or sibling. For example, in trio testing, the subject would be the child (proband) and the focus would be the parent." )
1760    protected List<Reference> focus;
1761
1762    /**
1763     * Specimen used for sequencing.
1764     */
1765    @Child(name = "specimen", type = {Specimen.class}, order=4, min=0, max=1, modifier=false, summary=true)
1766    @Description(shortDefinition="Specimen used for sequencing", formalDefinition="Specimen used for sequencing." )
1767    protected Reference specimen;
1768
1769    /**
1770     * The method for sequencing, for example, chip information.
1771     */
1772    @Child(name = "device", type = {Device.class}, order=5, min=0, max=1, modifier=false, summary=true)
1773    @Description(shortDefinition="The method for sequencing", formalDefinition="The method for sequencing, for example, chip information." )
1774    protected Reference device;
1775
1776    /**
1777     * The organization or lab that should be responsible for this result.
1778     */
1779    @Child(name = "performer", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
1780    @Description(shortDefinition="Who should be responsible for test result", formalDefinition="The organization or lab that should be responsible for this result." )
1781    protected Reference performer;
1782
1783    /**
1784     * Sequence that was observed.
1785     */
1786    @Child(name = "literal", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1787    @Description(shortDefinition="Sequence that was observed", formalDefinition="Sequence that was observed." )
1788    protected StringType literal;
1789
1790    /**
1791     * Sequence that was observed as file content. Can be an actual file contents, or referenced by a URL to an external system.
1792     */
1793    @Child(name = "formatted", type = {Attachment.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1794    @Description(shortDefinition="Embedded file or a link (URL) which contains content to represent the sequence", formalDefinition="Sequence that was observed as file content. Can be an actual file contents, or referenced by a URL to an external system." )
1795    protected List<Attachment> formatted;
1796
1797    /**
1798     * A sequence defined relative to another sequence.
1799     */
1800    @Child(name = "relative", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1801    @Description(shortDefinition="A sequence defined relative to another sequence", formalDefinition="A sequence defined relative to another sequence." )
1802    protected List<MolecularSequenceRelativeComponent> relative;
1803
1804    private static final long serialVersionUID = 611205496L;
1805
1806  /**
1807   * Constructor
1808   */
1809    public MolecularSequence() {
1810      super();
1811    }
1812
1813    /**
1814     * @return {@link #identifier} (A unique identifier for this particular sequence instance.)
1815     */
1816    public List<Identifier> getIdentifier() { 
1817      if (this.identifier == null)
1818        this.identifier = new ArrayList<Identifier>();
1819      return this.identifier;
1820    }
1821
1822    /**
1823     * @return Returns a reference to <code>this</code> for easy method chaining
1824     */
1825    public MolecularSequence setIdentifier(List<Identifier> theIdentifier) { 
1826      this.identifier = theIdentifier;
1827      return this;
1828    }
1829
1830    public boolean hasIdentifier() { 
1831      if (this.identifier == null)
1832        return false;
1833      for (Identifier item : this.identifier)
1834        if (!item.isEmpty())
1835          return true;
1836      return false;
1837    }
1838
1839    public Identifier addIdentifier() { //3
1840      Identifier t = new Identifier();
1841      if (this.identifier == null)
1842        this.identifier = new ArrayList<Identifier>();
1843      this.identifier.add(t);
1844      return t;
1845    }
1846
1847    public MolecularSequence addIdentifier(Identifier t) { //3
1848      if (t == null)
1849        return this;
1850      if (this.identifier == null)
1851        this.identifier = new ArrayList<Identifier>();
1852      this.identifier.add(t);
1853      return this;
1854    }
1855
1856    /**
1857     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1858     */
1859    public Identifier getIdentifierFirstRep() { 
1860      if (getIdentifier().isEmpty()) {
1861        addIdentifier();
1862      }
1863      return getIdentifier().get(0);
1864    }
1865
1866    /**
1867     * @return {@link #type} (Amino Acid Sequence/ DNA Sequence / RNA Sequence.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1868     */
1869    public Enumeration<SequenceType> getTypeElement() { 
1870      if (this.type == null)
1871        if (Configuration.errorOnAutoCreate())
1872          throw new Error("Attempt to auto-create MolecularSequence.type");
1873        else if (Configuration.doAutoCreate())
1874          this.type = new Enumeration<SequenceType>(new SequenceTypeEnumFactory()); // bb
1875      return this.type;
1876    }
1877
1878    public boolean hasTypeElement() { 
1879      return this.type != null && !this.type.isEmpty();
1880    }
1881
1882    public boolean hasType() { 
1883      return this.type != null && !this.type.isEmpty();
1884    }
1885
1886    /**
1887     * @param value {@link #type} (Amino Acid Sequence/ DNA Sequence / RNA Sequence.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1888     */
1889    public MolecularSequence setTypeElement(Enumeration<SequenceType> value) { 
1890      this.type = value;
1891      return this;
1892    }
1893
1894    /**
1895     * @return Amino Acid Sequence/ DNA Sequence / RNA Sequence.
1896     */
1897    public SequenceType getType() { 
1898      return this.type == null ? null : this.type.getValue();
1899    }
1900
1901    /**
1902     * @param value Amino Acid Sequence/ DNA Sequence / RNA Sequence.
1903     */
1904    public MolecularSequence setType(SequenceType value) { 
1905      if (value == null)
1906        this.type = null;
1907      else {
1908        if (this.type == null)
1909          this.type = new Enumeration<SequenceType>(new SequenceTypeEnumFactory());
1910        this.type.setValue(value);
1911      }
1912      return this;
1913    }
1914
1915    /**
1916     * @return {@link #subject} (Indicates the subject this sequence is associated too.)
1917     */
1918    public Reference getSubject() { 
1919      if (this.subject == null)
1920        if (Configuration.errorOnAutoCreate())
1921          throw new Error("Attempt to auto-create MolecularSequence.subject");
1922        else if (Configuration.doAutoCreate())
1923          this.subject = new Reference(); // cc
1924      return this.subject;
1925    }
1926
1927    public boolean hasSubject() { 
1928      return this.subject != null && !this.subject.isEmpty();
1929    }
1930
1931    /**
1932     * @param value {@link #subject} (Indicates the subject this sequence is associated too.)
1933     */
1934    public MolecularSequence setSubject(Reference value) { 
1935      this.subject = value;
1936      return this;
1937    }
1938
1939    /**
1940     * @return {@link #focus} (The actual focus of a molecular sequence when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, child, or sibling. For example, in trio testing, the subject would be the child (proband) and the focus would be the parent.)
1941     */
1942    public List<Reference> getFocus() { 
1943      if (this.focus == null)
1944        this.focus = new ArrayList<Reference>();
1945      return this.focus;
1946    }
1947
1948    /**
1949     * @return Returns a reference to <code>this</code> for easy method chaining
1950     */
1951    public MolecularSequence setFocus(List<Reference> theFocus) { 
1952      this.focus = theFocus;
1953      return this;
1954    }
1955
1956    public boolean hasFocus() { 
1957      if (this.focus == null)
1958        return false;
1959      for (Reference item : this.focus)
1960        if (!item.isEmpty())
1961          return true;
1962      return false;
1963    }
1964
1965    public Reference addFocus() { //3
1966      Reference t = new Reference();
1967      if (this.focus == null)
1968        this.focus = new ArrayList<Reference>();
1969      this.focus.add(t);
1970      return t;
1971    }
1972
1973    public MolecularSequence addFocus(Reference t) { //3
1974      if (t == null)
1975        return this;
1976      if (this.focus == null)
1977        this.focus = new ArrayList<Reference>();
1978      this.focus.add(t);
1979      return this;
1980    }
1981
1982    /**
1983     * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist {3}
1984     */
1985    public Reference getFocusFirstRep() { 
1986      if (getFocus().isEmpty()) {
1987        addFocus();
1988      }
1989      return getFocus().get(0);
1990    }
1991
1992    /**
1993     * @return {@link #specimen} (Specimen used for sequencing.)
1994     */
1995    public Reference getSpecimen() { 
1996      if (this.specimen == null)
1997        if (Configuration.errorOnAutoCreate())
1998          throw new Error("Attempt to auto-create MolecularSequence.specimen");
1999        else if (Configuration.doAutoCreate())
2000          this.specimen = new Reference(); // cc
2001      return this.specimen;
2002    }
2003
2004    public boolean hasSpecimen() { 
2005      return this.specimen != null && !this.specimen.isEmpty();
2006    }
2007
2008    /**
2009     * @param value {@link #specimen} (Specimen used for sequencing.)
2010     */
2011    public MolecularSequence setSpecimen(Reference value) { 
2012      this.specimen = value;
2013      return this;
2014    }
2015
2016    /**
2017     * @return {@link #device} (The method for sequencing, for example, chip information.)
2018     */
2019    public Reference getDevice() { 
2020      if (this.device == null)
2021        if (Configuration.errorOnAutoCreate())
2022          throw new Error("Attempt to auto-create MolecularSequence.device");
2023        else if (Configuration.doAutoCreate())
2024          this.device = new Reference(); // cc
2025      return this.device;
2026    }
2027
2028    public boolean hasDevice() { 
2029      return this.device != null && !this.device.isEmpty();
2030    }
2031
2032    /**
2033     * @param value {@link #device} (The method for sequencing, for example, chip information.)
2034     */
2035    public MolecularSequence setDevice(Reference value) { 
2036      this.device = value;
2037      return this;
2038    }
2039
2040    /**
2041     * @return {@link #performer} (The organization or lab that should be responsible for this result.)
2042     */
2043    public Reference getPerformer() { 
2044      if (this.performer == null)
2045        if (Configuration.errorOnAutoCreate())
2046          throw new Error("Attempt to auto-create MolecularSequence.performer");
2047        else if (Configuration.doAutoCreate())
2048          this.performer = new Reference(); // cc
2049      return this.performer;
2050    }
2051
2052    public boolean hasPerformer() { 
2053      return this.performer != null && !this.performer.isEmpty();
2054    }
2055
2056    /**
2057     * @param value {@link #performer} (The organization or lab that should be responsible for this result.)
2058     */
2059    public MolecularSequence setPerformer(Reference value) { 
2060      this.performer = value;
2061      return this;
2062    }
2063
2064    /**
2065     * @return {@link #literal} (Sequence that was observed.). This is the underlying object with id, value and extensions. The accessor "getLiteral" gives direct access to the value
2066     */
2067    public StringType getLiteralElement() { 
2068      if (this.literal == null)
2069        if (Configuration.errorOnAutoCreate())
2070          throw new Error("Attempt to auto-create MolecularSequence.literal");
2071        else if (Configuration.doAutoCreate())
2072          this.literal = new StringType(); // bb
2073      return this.literal;
2074    }
2075
2076    public boolean hasLiteralElement() { 
2077      return this.literal != null && !this.literal.isEmpty();
2078    }
2079
2080    public boolean hasLiteral() { 
2081      return this.literal != null && !this.literal.isEmpty();
2082    }
2083
2084    /**
2085     * @param value {@link #literal} (Sequence that was observed.). This is the underlying object with id, value and extensions. The accessor "getLiteral" gives direct access to the value
2086     */
2087    public MolecularSequence setLiteralElement(StringType value) { 
2088      this.literal = value;
2089      return this;
2090    }
2091
2092    /**
2093     * @return Sequence that was observed.
2094     */
2095    public String getLiteral() { 
2096      return this.literal == null ? null : this.literal.getValue();
2097    }
2098
2099    /**
2100     * @param value Sequence that was observed.
2101     */
2102    public MolecularSequence setLiteral(String value) { 
2103      if (Utilities.noString(value))
2104        this.literal = null;
2105      else {
2106        if (this.literal == null)
2107          this.literal = new StringType();
2108        this.literal.setValue(value);
2109      }
2110      return this;
2111    }
2112
2113    /**
2114     * @return {@link #formatted} (Sequence that was observed as file content. Can be an actual file contents, or referenced by a URL to an external system.)
2115     */
2116    public List<Attachment> getFormatted() { 
2117      if (this.formatted == null)
2118        this.formatted = new ArrayList<Attachment>();
2119      return this.formatted;
2120    }
2121
2122    /**
2123     * @return Returns a reference to <code>this</code> for easy method chaining
2124     */
2125    public MolecularSequence setFormatted(List<Attachment> theFormatted) { 
2126      this.formatted = theFormatted;
2127      return this;
2128    }
2129
2130    public boolean hasFormatted() { 
2131      if (this.formatted == null)
2132        return false;
2133      for (Attachment item : this.formatted)
2134        if (!item.isEmpty())
2135          return true;
2136      return false;
2137    }
2138
2139    public Attachment addFormatted() { //3
2140      Attachment t = new Attachment();
2141      if (this.formatted == null)
2142        this.formatted = new ArrayList<Attachment>();
2143      this.formatted.add(t);
2144      return t;
2145    }
2146
2147    public MolecularSequence addFormatted(Attachment t) { //3
2148      if (t == null)
2149        return this;
2150      if (this.formatted == null)
2151        this.formatted = new ArrayList<Attachment>();
2152      this.formatted.add(t);
2153      return this;
2154    }
2155
2156    /**
2157     * @return The first repetition of repeating field {@link #formatted}, creating it if it does not already exist {3}
2158     */
2159    public Attachment getFormattedFirstRep() { 
2160      if (getFormatted().isEmpty()) {
2161        addFormatted();
2162      }
2163      return getFormatted().get(0);
2164    }
2165
2166    /**
2167     * @return {@link #relative} (A sequence defined relative to another sequence.)
2168     */
2169    public List<MolecularSequenceRelativeComponent> getRelative() { 
2170      if (this.relative == null)
2171        this.relative = new ArrayList<MolecularSequenceRelativeComponent>();
2172      return this.relative;
2173    }
2174
2175    /**
2176     * @return Returns a reference to <code>this</code> for easy method chaining
2177     */
2178    public MolecularSequence setRelative(List<MolecularSequenceRelativeComponent> theRelative) { 
2179      this.relative = theRelative;
2180      return this;
2181    }
2182
2183    public boolean hasRelative() { 
2184      if (this.relative == null)
2185        return false;
2186      for (MolecularSequenceRelativeComponent item : this.relative)
2187        if (!item.isEmpty())
2188          return true;
2189      return false;
2190    }
2191
2192    public MolecularSequenceRelativeComponent addRelative() { //3
2193      MolecularSequenceRelativeComponent t = new MolecularSequenceRelativeComponent();
2194      if (this.relative == null)
2195        this.relative = new ArrayList<MolecularSequenceRelativeComponent>();
2196      this.relative.add(t);
2197      return t;
2198    }
2199
2200    public MolecularSequence addRelative(MolecularSequenceRelativeComponent t) { //3
2201      if (t == null)
2202        return this;
2203      if (this.relative == null)
2204        this.relative = new ArrayList<MolecularSequenceRelativeComponent>();
2205      this.relative.add(t);
2206      return this;
2207    }
2208
2209    /**
2210     * @return The first repetition of repeating field {@link #relative}, creating it if it does not already exist {3}
2211     */
2212    public MolecularSequenceRelativeComponent getRelativeFirstRep() { 
2213      if (getRelative().isEmpty()) {
2214        addRelative();
2215      }
2216      return getRelative().get(0);
2217    }
2218
2219      protected void listChildren(List<Property> children) {
2220        super.listChildren(children);
2221        children.add(new Property("identifier", "Identifier", "A unique identifier for this particular sequence instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
2222        children.add(new Property("type", "code", "Amino Acid Sequence/ DNA Sequence / RNA Sequence.", 0, 1, type));
2223        children.add(new Property("subject", "Reference(Patient|Group|Substance|BiologicallyDerivedProduct|NutritionProduct)", "Indicates the subject this sequence is associated too.", 0, 1, subject));
2224        children.add(new Property("focus", "Reference(Any)", "The actual focus of a molecular sequence when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, child, or sibling. For example, in trio testing, the subject would be the child (proband) and the focus would be the parent.", 0, java.lang.Integer.MAX_VALUE, focus));
2225        children.add(new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, 1, specimen));
2226        children.add(new Property("device", "Reference(Device)", "The method for sequencing, for example, chip information.", 0, 1, device));
2227        children.add(new Property("performer", "Reference(Organization)", "The organization or lab that should be responsible for this result.", 0, 1, performer));
2228        children.add(new Property("literal", "string", "Sequence that was observed.", 0, 1, literal));
2229        children.add(new Property("formatted", "Attachment", "Sequence that was observed as file content. Can be an actual file contents, or referenced by a URL to an external system.", 0, java.lang.Integer.MAX_VALUE, formatted));
2230        children.add(new Property("relative", "", "A sequence defined relative to another sequence.", 0, java.lang.Integer.MAX_VALUE, relative));
2231      }
2232
2233      @Override
2234      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2235        switch (_hash) {
2236        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier for this particular sequence instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
2237        case 3575610: /*type*/  return new Property("type", "code", "Amino Acid Sequence/ DNA Sequence / RNA Sequence.", 0, 1, type);
2238        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Substance|BiologicallyDerivedProduct|NutritionProduct)", "Indicates the subject this sequence is associated too.", 0, 1, subject);
2239        case 97604824: /*focus*/  return new Property("focus", "Reference(Any)", "The actual focus of a molecular sequence when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, child, or sibling. For example, in trio testing, the subject would be the child (proband) and the focus would be the parent.", 0, java.lang.Integer.MAX_VALUE, focus);
2240        case -2132868344: /*specimen*/  return new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, 1, specimen);
2241        case -1335157162: /*device*/  return new Property("device", "Reference(Device)", "The method for sequencing, for example, chip information.", 0, 1, device);
2242        case 481140686: /*performer*/  return new Property("performer", "Reference(Organization)", "The organization or lab that should be responsible for this result.", 0, 1, performer);
2243        case 182460591: /*literal*/  return new Property("literal", "string", "Sequence that was observed.", 0, 1, literal);
2244        case 1811591356: /*formatted*/  return new Property("formatted", "Attachment", "Sequence that was observed as file content. Can be an actual file contents, or referenced by a URL to an external system.", 0, java.lang.Integer.MAX_VALUE, formatted);
2245        case -554435892: /*relative*/  return new Property("relative", "", "A sequence defined relative to another sequence.", 0, java.lang.Integer.MAX_VALUE, relative);
2246        default: return super.getNamedProperty(_hash, _name, _checkValid);
2247        }
2248
2249      }
2250
2251      @Override
2252      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2253        switch (hash) {
2254        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2255        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<SequenceType>
2256        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2257        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // Reference
2258        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : new Base[] {this.specimen}; // Reference
2259        case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference
2260        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference
2261        case 182460591: /*literal*/ return this.literal == null ? new Base[0] : new Base[] {this.literal}; // StringType
2262        case 1811591356: /*formatted*/ return this.formatted == null ? new Base[0] : this.formatted.toArray(new Base[this.formatted.size()]); // Attachment
2263        case -554435892: /*relative*/ return this.relative == null ? new Base[0] : this.relative.toArray(new Base[this.relative.size()]); // MolecularSequenceRelativeComponent
2264        default: return super.getProperty(hash, name, checkValid);
2265        }
2266
2267      }
2268
2269      @Override
2270      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2271        switch (hash) {
2272        case -1618432855: // identifier
2273          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2274          return value;
2275        case 3575610: // type
2276          value = new SequenceTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
2277          this.type = (Enumeration) value; // Enumeration<SequenceType>
2278          return value;
2279        case -1867885268: // subject
2280          this.subject = TypeConvertor.castToReference(value); // Reference
2281          return value;
2282        case 97604824: // focus
2283          this.getFocus().add(TypeConvertor.castToReference(value)); // Reference
2284          return value;
2285        case -2132868344: // specimen
2286          this.specimen = TypeConvertor.castToReference(value); // Reference
2287          return value;
2288        case -1335157162: // device
2289          this.device = TypeConvertor.castToReference(value); // Reference
2290          return value;
2291        case 481140686: // performer
2292          this.performer = TypeConvertor.castToReference(value); // Reference
2293          return value;
2294        case 182460591: // literal
2295          this.literal = TypeConvertor.castToString(value); // StringType
2296          return value;
2297        case 1811591356: // formatted
2298          this.getFormatted().add(TypeConvertor.castToAttachment(value)); // Attachment
2299          return value;
2300        case -554435892: // relative
2301          this.getRelative().add((MolecularSequenceRelativeComponent) value); // MolecularSequenceRelativeComponent
2302          return value;
2303        default: return super.setProperty(hash, name, value);
2304        }
2305
2306      }
2307
2308      @Override
2309      public Base setProperty(String name, Base value) throws FHIRException {
2310        if (name.equals("identifier")) {
2311          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2312        } else if (name.equals("type")) {
2313          value = new SequenceTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
2314          this.type = (Enumeration) value; // Enumeration<SequenceType>
2315        } else if (name.equals("subject")) {
2316          this.subject = TypeConvertor.castToReference(value); // Reference
2317        } else if (name.equals("focus")) {
2318          this.getFocus().add(TypeConvertor.castToReference(value));
2319        } else if (name.equals("specimen")) {
2320          this.specimen = TypeConvertor.castToReference(value); // Reference
2321        } else if (name.equals("device")) {
2322          this.device = TypeConvertor.castToReference(value); // Reference
2323        } else if (name.equals("performer")) {
2324          this.performer = TypeConvertor.castToReference(value); // Reference
2325        } else if (name.equals("literal")) {
2326          this.literal = TypeConvertor.castToString(value); // StringType
2327        } else if (name.equals("formatted")) {
2328          this.getFormatted().add(TypeConvertor.castToAttachment(value));
2329        } else if (name.equals("relative")) {
2330          this.getRelative().add((MolecularSequenceRelativeComponent) value);
2331        } else
2332          return super.setProperty(name, value);
2333        return value;
2334      }
2335
2336      @Override
2337      public Base makeProperty(int hash, String name) throws FHIRException {
2338        switch (hash) {
2339        case -1618432855:  return addIdentifier(); 
2340        case 3575610:  return getTypeElement();
2341        case -1867885268:  return getSubject();
2342        case 97604824:  return addFocus(); 
2343        case -2132868344:  return getSpecimen();
2344        case -1335157162:  return getDevice();
2345        case 481140686:  return getPerformer();
2346        case 182460591:  return getLiteralElement();
2347        case 1811591356:  return addFormatted(); 
2348        case -554435892:  return addRelative(); 
2349        default: return super.makeProperty(hash, name);
2350        }
2351
2352      }
2353
2354      @Override
2355      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2356        switch (hash) {
2357        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2358        case 3575610: /*type*/ return new String[] {"code"};
2359        case -1867885268: /*subject*/ return new String[] {"Reference"};
2360        case 97604824: /*focus*/ return new String[] {"Reference"};
2361        case -2132868344: /*specimen*/ return new String[] {"Reference"};
2362        case -1335157162: /*device*/ return new String[] {"Reference"};
2363        case 481140686: /*performer*/ return new String[] {"Reference"};
2364        case 182460591: /*literal*/ return new String[] {"string"};
2365        case 1811591356: /*formatted*/ return new String[] {"Attachment"};
2366        case -554435892: /*relative*/ return new String[] {};
2367        default: return super.getTypesForProperty(hash, name);
2368        }
2369
2370      }
2371
2372      @Override
2373      public Base addChild(String name) throws FHIRException {
2374        if (name.equals("identifier")) {
2375          return addIdentifier();
2376        }
2377        else if (name.equals("type")) {
2378          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.type");
2379        }
2380        else if (name.equals("subject")) {
2381          this.subject = new Reference();
2382          return this.subject;
2383        }
2384        else if (name.equals("focus")) {
2385          return addFocus();
2386        }
2387        else if (name.equals("specimen")) {
2388          this.specimen = new Reference();
2389          return this.specimen;
2390        }
2391        else if (name.equals("device")) {
2392          this.device = new Reference();
2393          return this.device;
2394        }
2395        else if (name.equals("performer")) {
2396          this.performer = new Reference();
2397          return this.performer;
2398        }
2399        else if (name.equals("literal")) {
2400          throw new FHIRException("Cannot call addChild on a singleton property MolecularSequence.literal");
2401        }
2402        else if (name.equals("formatted")) {
2403          return addFormatted();
2404        }
2405        else if (name.equals("relative")) {
2406          return addRelative();
2407        }
2408        else
2409          return super.addChild(name);
2410      }
2411
2412  public String fhirType() {
2413    return "MolecularSequence";
2414
2415  }
2416
2417      public MolecularSequence copy() {
2418        MolecularSequence dst = new MolecularSequence();
2419        copyValues(dst);
2420        return dst;
2421      }
2422
2423      public void copyValues(MolecularSequence dst) {
2424        super.copyValues(dst);
2425        if (identifier != null) {
2426          dst.identifier = new ArrayList<Identifier>();
2427          for (Identifier i : identifier)
2428            dst.identifier.add(i.copy());
2429        };
2430        dst.type = type == null ? null : type.copy();
2431        dst.subject = subject == null ? null : subject.copy();
2432        if (focus != null) {
2433          dst.focus = new ArrayList<Reference>();
2434          for (Reference i : focus)
2435            dst.focus.add(i.copy());
2436        };
2437        dst.specimen = specimen == null ? null : specimen.copy();
2438        dst.device = device == null ? null : device.copy();
2439        dst.performer = performer == null ? null : performer.copy();
2440        dst.literal = literal == null ? null : literal.copy();
2441        if (formatted != null) {
2442          dst.formatted = new ArrayList<Attachment>();
2443          for (Attachment i : formatted)
2444            dst.formatted.add(i.copy());
2445        };
2446        if (relative != null) {
2447          dst.relative = new ArrayList<MolecularSequenceRelativeComponent>();
2448          for (MolecularSequenceRelativeComponent i : relative)
2449            dst.relative.add(i.copy());
2450        };
2451      }
2452
2453      protected MolecularSequence typedCopy() {
2454        return copy();
2455      }
2456
2457      @Override
2458      public boolean equalsDeep(Base other_) {
2459        if (!super.equalsDeep(other_))
2460          return false;
2461        if (!(other_ instanceof MolecularSequence))
2462          return false;
2463        MolecularSequence o = (MolecularSequence) other_;
2464        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(subject, o.subject, true)
2465           && compareDeep(focus, o.focus, true) && compareDeep(specimen, o.specimen, true) && compareDeep(device, o.device, true)
2466           && compareDeep(performer, o.performer, true) && compareDeep(literal, o.literal, true) && compareDeep(formatted, o.formatted, true)
2467           && compareDeep(relative, o.relative, true);
2468      }
2469
2470      @Override
2471      public boolean equalsShallow(Base other_) {
2472        if (!super.equalsShallow(other_))
2473          return false;
2474        if (!(other_ instanceof MolecularSequence))
2475          return false;
2476        MolecularSequence o = (MolecularSequence) other_;
2477        return compareValues(type, o.type, true) && compareValues(literal, o.literal, true);
2478      }
2479
2480      public boolean isEmpty() {
2481        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, subject
2482          , focus, specimen, device, performer, literal, formatted, relative);
2483      }
2484
2485  @Override
2486  public ResourceType getResourceType() {
2487    return ResourceType.MolecularSequence;
2488   }
2489
2490 /**
2491   * Search parameter: <b>focus</b>
2492   * <p>
2493   * Description: <b>What the molecular sequence is about, when it is not about the subject of record</b><br>
2494   * Type: <b>reference</b><br>
2495   * Path: <b>MolecularSequence.focus</b><br>
2496   * </p>
2497   */
2498  @SearchParamDefinition(name="focus", path="MolecularSequence.focus", description="What the molecular sequence is about, when it is not about the subject of record", type="reference", target={Account.class, ActivityDefinition.class, ActorDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BiologicallyDerivedProductDispense.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceAssociation.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentReference.class, Encounter.class, EncounterHistory.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, FormularyItem.class, GenomicStudy.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryItem.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Parameters.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestOrchestration.class, Requirements.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestPlan.class, TestReport.class, TestScript.class, Transport.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
2499  public static final String SP_FOCUS = "focus";
2500 /**
2501   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
2502   * <p>
2503   * Description: <b>What the molecular sequence is about, when it is not about the subject of record</b><br>
2504   * Type: <b>reference</b><br>
2505   * Path: <b>MolecularSequence.focus</b><br>
2506   * </p>
2507   */
2508  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FOCUS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FOCUS);
2509
2510/**
2511   * Constant for fluent queries to be used to add include statements. Specifies
2512   * the path value of "<b>MolecularSequence:focus</b>".
2513   */
2514  public static final ca.uhn.fhir.model.api.Include INCLUDE_FOCUS = new ca.uhn.fhir.model.api.Include("MolecularSequence:focus").toLocked();
2515
2516 /**
2517   * Search parameter: <b>subject</b>
2518   * <p>
2519   * Description: <b>The subject that the sequence is about</b><br>
2520   * Type: <b>reference</b><br>
2521   * Path: <b>MolecularSequence.subject</b><br>
2522   * </p>
2523   */
2524  @SearchParamDefinition(name="subject", path="MolecularSequence.subject", description="The subject that the sequence is about", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={BiologicallyDerivedProduct.class, Group.class, NutritionProduct.class, Patient.class, Substance.class } )
2525  public static final String SP_SUBJECT = "subject";
2526 /**
2527   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2528   * <p>
2529   * Description: <b>The subject that the sequence is about</b><br>
2530   * Type: <b>reference</b><br>
2531   * Path: <b>MolecularSequence.subject</b><br>
2532   * </p>
2533   */
2534  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2535
2536/**
2537   * Constant for fluent queries to be used to add include statements. Specifies
2538   * the path value of "<b>MolecularSequence:subject</b>".
2539   */
2540  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("MolecularSequence:subject").toLocked();
2541
2542 /**
2543   * Search parameter: <b>identifier</b>
2544   * <p>
2545   * Description: <b>Multiple Resources: 
2546
2547* [Account](account.html): Account number
2548* [AdverseEvent](adverseevent.html): Business identifier for the event
2549* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2550* [Appointment](appointment.html): An Identifier of the Appointment
2551* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
2552* [Basic](basic.html): Business identifier
2553* [BodyStructure](bodystructure.html): Bodystructure identifier
2554* [CarePlan](careplan.html): External Ids for this plan
2555* [CareTeam](careteam.html): External Ids for this team
2556* [ChargeItem](chargeitem.html): Business Identifier for item
2557* [Claim](claim.html): The primary identifier of the financial resource
2558* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
2559* [ClinicalImpression](clinicalimpression.html): Business identifier
2560* [Communication](communication.html): Unique identifier
2561* [CommunicationRequest](communicationrequest.html): Unique identifier
2562* [Composition](composition.html): Version-independent identifier for the Composition
2563* [Condition](condition.html): A unique identifier of the condition record
2564* [Consent](consent.html): Identifier for this record (external references)
2565* [Contract](contract.html): The identity of the contract
2566* [Coverage](coverage.html): The primary identifier of the insured and the coverage
2567* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
2568* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
2569* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2570* [DeviceRequest](devicerequest.html): Business identifier for request/order
2571* [DeviceUsage](deviceusage.html): Search by identifier
2572* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2573* [DocumentReference](documentreference.html): Identifier of the attachment binary
2574* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2575* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
2576* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2577* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
2578* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2579* [Flag](flag.html): Business identifier
2580* [Goal](goal.html): External Ids for this goal
2581* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
2582* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
2583* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2584* [Immunization](immunization.html): Business identifier
2585* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
2586* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
2587* [Invoice](invoice.html): Business Identifier for item
2588* [List](list.html): Business identifier
2589* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
2590* [Medication](medication.html): Returns medications with this external identifier
2591* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2592* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2593* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2594* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
2595* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
2596* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
2597* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2598* [Observation](observation.html): The unique id for a particular observation
2599* [Person](person.html): A person Identifier
2600* [Procedure](procedure.html): A unique identifier for a procedure
2601* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
2602* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
2603* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
2604* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
2605* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2606* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2607* [Specimen](specimen.html): The unique identifier associated with the specimen
2608* [SupplyDelivery](supplydelivery.html): External identifier
2609* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2610* [Task](task.html): Search for a task instance by its business identifier
2611* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2612</b><br>
2613   * Type: <b>token</b><br>
2614   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
2615   * </p>
2616   */
2617  @SearchParamDefinition(name="identifier", path="Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [Account](account.html): Account number\r\n* [AdverseEvent](adverseevent.html): Business identifier for the event\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [Appointment](appointment.html): An Identifier of the Appointment\r\n* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response\r\n* [Basic](basic.html): Business identifier\r\n* [BodyStructure](bodystructure.html): Bodystructure identifier\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [ChargeItem](chargeitem.html): Business Identifier for item\r\n* [Claim](claim.html): The primary identifier of the financial resource\r\n* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse\r\n* [ClinicalImpression](clinicalimpression.html): Business identifier\r\n* [Communication](communication.html): Unique identifier\r\n* [CommunicationRequest](communicationrequest.html): Unique identifier\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [Contract](contract.html): The identity of the contract\r\n* [Coverage](coverage.html): The primary identifier of the insured and the coverage\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DeviceUsage](deviceusage.html): Search by identifier\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Flag](flag.html): Business identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response\r\n* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier\r\n* [Invoice](invoice.html): Business Identifier for item\r\n* [List](list.html): Business identifier\r\n* [MeasureReport](measurereport.html): External identifier of the measure report to be returned\r\n* [Medication](medication.html): Returns medications with this external identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationStatement](medicationstatement.html): Return statements with this external identifier\r\n* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence\r\n* [NutritionIntake](nutritionintake.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Person](person.html): A person Identifier\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response\r\n* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson\r\n* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration\r\n* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [Specimen](specimen.html): The unique identifier associated with the specimen\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [Task](task.html): Search for a task instance by its business identifier\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
2618  public static final String SP_IDENTIFIER = "identifier";
2619 /**
2620   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2621   * <p>
2622   * Description: <b>Multiple Resources: 
2623
2624* [Account](account.html): Account number
2625* [AdverseEvent](adverseevent.html): Business identifier for the event
2626* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2627* [Appointment](appointment.html): An Identifier of the Appointment
2628* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
2629* [Basic](basic.html): Business identifier
2630* [BodyStructure](bodystructure.html): Bodystructure identifier
2631* [CarePlan](careplan.html): External Ids for this plan
2632* [CareTeam](careteam.html): External Ids for this team
2633* [ChargeItem](chargeitem.html): Business Identifier for item
2634* [Claim](claim.html): The primary identifier of the financial resource
2635* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
2636* [ClinicalImpression](clinicalimpression.html): Business identifier
2637* [Communication](communication.html): Unique identifier
2638* [CommunicationRequest](communicationrequest.html): Unique identifier
2639* [Composition](composition.html): Version-independent identifier for the Composition
2640* [Condition](condition.html): A unique identifier of the condition record
2641* [Consent](consent.html): Identifier for this record (external references)
2642* [Contract](contract.html): The identity of the contract
2643* [Coverage](coverage.html): The primary identifier of the insured and the coverage
2644* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
2645* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
2646* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2647* [DeviceRequest](devicerequest.html): Business identifier for request/order
2648* [DeviceUsage](deviceusage.html): Search by identifier
2649* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2650* [DocumentReference](documentreference.html): Identifier of the attachment binary
2651* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2652* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
2653* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2654* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
2655* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2656* [Flag](flag.html): Business identifier
2657* [Goal](goal.html): External Ids for this goal
2658* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
2659* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
2660* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2661* [Immunization](immunization.html): Business identifier
2662* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
2663* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
2664* [Invoice](invoice.html): Business Identifier for item
2665* [List](list.html): Business identifier
2666* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
2667* [Medication](medication.html): Returns medications with this external identifier
2668* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2669* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2670* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2671* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
2672* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
2673* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
2674* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2675* [Observation](observation.html): The unique id for a particular observation
2676* [Person](person.html): A person Identifier
2677* [Procedure](procedure.html): A unique identifier for a procedure
2678* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
2679* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
2680* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
2681* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
2682* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2683* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2684* [Specimen](specimen.html): The unique identifier associated with the specimen
2685* [SupplyDelivery](supplydelivery.html): External identifier
2686* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2687* [Task](task.html): Search for a task instance by its business identifier
2688* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2689</b><br>
2690   * Type: <b>token</b><br>
2691   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
2692   * </p>
2693   */
2694  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2695
2696 /**
2697   * Search parameter: <b>patient</b>
2698   * <p>
2699   * Description: <b>Multiple Resources: 
2700
2701* [Account](account.html): The entity that caused the expenses
2702* [AdverseEvent](adverseevent.html): Subject impacted by event
2703* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2704* [Appointment](appointment.html): One of the individuals of the appointment is this patient
2705* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
2706* [AuditEvent](auditevent.html): Where the activity involved patient data
2707* [Basic](basic.html): Identifies the focus of this resource
2708* [BodyStructure](bodystructure.html): Who this is about
2709* [CarePlan](careplan.html): Who the care plan is for
2710* [CareTeam](careteam.html): Who care team is for
2711* [ChargeItem](chargeitem.html): Individual service was done for/to
2712* [Claim](claim.html): Patient receiving the products or services
2713* [ClaimResponse](claimresponse.html): The subject of care
2714* [ClinicalImpression](clinicalimpression.html): Patient assessed
2715* [Communication](communication.html): Focus of message
2716* [CommunicationRequest](communicationrequest.html): Focus of message
2717* [Composition](composition.html): Who and/or what the composition is about
2718* [Condition](condition.html): Who has the condition?
2719* [Consent](consent.html): Who the consent applies to
2720* [Contract](contract.html): The identity of the subject of the contract (if a patient)
2721* [Coverage](coverage.html): Retrieve coverages for a patient
2722* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
2723* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
2724* [DetectedIssue](detectedissue.html): Associated patient
2725* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2726* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2727* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2728* [DocumentReference](documentreference.html): Who/what is the subject of the document
2729* [Encounter](encounter.html): The patient present at the encounter
2730* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
2731* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2732* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
2733* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2734* [Flag](flag.html): The identity of a subject to list flags for
2735* [Goal](goal.html): Who this goal is intended for
2736* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
2737* [ImagingSelection](imagingselection.html): Who the study is about
2738* [ImagingStudy](imagingstudy.html): Who the study is about
2739* [Immunization](immunization.html): The patient for the vaccination record
2740* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
2741* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
2742* [Invoice](invoice.html): Recipient(s) of goods and services
2743* [List](list.html): If all resources have the same subject
2744* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
2745* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2746* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2747* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2748* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
2749* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
2750* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
2751* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2752* [Observation](observation.html): The subject that the observation is about (if patient)
2753* [Person](person.html): The Person links to this Patient
2754* [Procedure](procedure.html): Search by subject - a patient
2755* [Provenance](provenance.html): Where the activity involved patient data
2756* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
2757* [RelatedPerson](relatedperson.html): The patient this related person is related to
2758* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
2759* [ResearchSubject](researchsubject.html): Who or what is part of study
2760* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2761* [ServiceRequest](servicerequest.html): Search by subject - a patient
2762* [Specimen](specimen.html): The patient the specimen comes from
2763* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2764* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
2765* [Task](task.html): Search by patient
2766* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2767</b><br>
2768   * Type: <b>reference</b><br>
2769   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
2770   * </p>
2771   */
2772  @SearchParamDefinition(name="patient", path="Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [Account](account.html): The entity that caused the expenses\r\n* [AdverseEvent](adverseevent.html): Subject impacted by event\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [Appointment](appointment.html): One of the individuals of the appointment is this patient\r\n* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient\r\n* [AuditEvent](auditevent.html): Where the activity involved patient data\r\n* [Basic](basic.html): Identifies the focus of this resource\r\n* [BodyStructure](bodystructure.html): Who this is about\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ChargeItem](chargeitem.html): Individual service was done for/to\r\n* [Claim](claim.html): Patient receiving the products or services\r\n* [ClaimResponse](claimresponse.html): The subject of care\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Communication](communication.html): Focus of message\r\n* [CommunicationRequest](communicationrequest.html): Focus of message\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [Contract](contract.html): The identity of the subject of the contract (if a patient)\r\n* [Coverage](coverage.html): Retrieve coverages for a patient\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results\r\n* [ImagingSelection](imagingselection.html): Who the study is about\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for\r\n* [Invoice](invoice.html): Recipient(s) of goods and services\r\n* [List](list.html): If all resources have the same subject\r\n* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.\r\n* [MolecularSequence](molecularsequence.html): The subject that the sequence is about\r\n* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Person](person.html): The Person links to this Patient\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [Provenance](provenance.html): Where the activity involved patient data\r\n* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response\r\n* [RelatedPerson](relatedperson.html): The patient this related person is related to\r\n* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations\r\n* [ResearchSubject](researchsubject.html): Who or what is part of study\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [Specimen](specimen.html): The patient the specimen comes from\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined\r\n* [Task](task.html): Search by patient\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", target={Patient.class } )
2773  public static final String SP_PATIENT = "patient";
2774 /**
2775   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2776   * <p>
2777   * Description: <b>Multiple Resources: 
2778
2779* [Account](account.html): The entity that caused the expenses
2780* [AdverseEvent](adverseevent.html): Subject impacted by event
2781* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2782* [Appointment](appointment.html): One of the individuals of the appointment is this patient
2783* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
2784* [AuditEvent](auditevent.html): Where the activity involved patient data
2785* [Basic](basic.html): Identifies the focus of this resource
2786* [BodyStructure](bodystructure.html): Who this is about
2787* [CarePlan](careplan.html): Who the care plan is for
2788* [CareTeam](careteam.html): Who care team is for
2789* [ChargeItem](chargeitem.html): Individual service was done for/to
2790* [Claim](claim.html): Patient receiving the products or services
2791* [ClaimResponse](claimresponse.html): The subject of care
2792* [ClinicalImpression](clinicalimpression.html): Patient assessed
2793* [Communication](communication.html): Focus of message
2794* [CommunicationRequest](communicationrequest.html): Focus of message
2795* [Composition](composition.html): Who and/or what the composition is about
2796* [Condition](condition.html): Who has the condition?
2797* [Consent](consent.html): Who the consent applies to
2798* [Contract](contract.html): The identity of the subject of the contract (if a patient)
2799* [Coverage](coverage.html): Retrieve coverages for a patient
2800* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
2801* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
2802* [DetectedIssue](detectedissue.html): Associated patient
2803* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2804* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2805* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2806* [DocumentReference](documentreference.html): Who/what is the subject of the document
2807* [Encounter](encounter.html): The patient present at the encounter
2808* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
2809* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2810* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
2811* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2812* [Flag](flag.html): The identity of a subject to list flags for
2813* [Goal](goal.html): Who this goal is intended for
2814* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
2815* [ImagingSelection](imagingselection.html): Who the study is about
2816* [ImagingStudy](imagingstudy.html): Who the study is about
2817* [Immunization](immunization.html): The patient for the vaccination record
2818* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
2819* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
2820* [Invoice](invoice.html): Recipient(s) of goods and services
2821* [List](list.html): If all resources have the same subject
2822* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
2823* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2824* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2825* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2826* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
2827* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
2828* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
2829* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2830* [Observation](observation.html): The subject that the observation is about (if patient)
2831* [Person](person.html): The Person links to this Patient
2832* [Procedure](procedure.html): Search by subject - a patient
2833* [Provenance](provenance.html): Where the activity involved patient data
2834* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
2835* [RelatedPerson](relatedperson.html): The patient this related person is related to
2836* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
2837* [ResearchSubject](researchsubject.html): Who or what is part of study
2838* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2839* [ServiceRequest](servicerequest.html): Search by subject - a patient
2840* [Specimen](specimen.html): The patient the specimen comes from
2841* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2842* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
2843* [Task](task.html): Search by patient
2844* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2845</b><br>
2846   * Type: <b>reference</b><br>
2847   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
2848   * </p>
2849   */
2850  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2851
2852/**
2853   * Constant for fluent queries to be used to add include statements. Specifies
2854   * the path value of "<b>MolecularSequence:patient</b>".
2855   */
2856  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MolecularSequence:patient").toLocked();
2857
2858 /**
2859   * Search parameter: <b>type</b>
2860   * <p>
2861   * Description: <b>Multiple Resources: 
2862
2863* [Account](account.html): E.g. patient, expense, depreciation
2864* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
2865* [Composition](composition.html): Kind of composition (LOINC if possible)
2866* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)
2867* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
2868* [Encounter](encounter.html): Specific type of encounter
2869* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
2870* [Invoice](invoice.html): Type of Invoice
2871* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type
2872* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence
2873* [Specimen](specimen.html): The specimen type
2874</b><br>
2875   * Type: <b>token</b><br>
2876   * Path: <b>Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type</b><br>
2877   * </p>
2878   */
2879  @SearchParamDefinition(name="type", path="Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type", description="Multiple Resources: \r\n\r\n* [Account](account.html): E.g. patient, expense, depreciation\r\n* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)\r\n* [Composition](composition.html): Kind of composition (LOINC if possible)\r\n* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)\r\n* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)\r\n* [Encounter](encounter.html): Specific type of encounter\r\n* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management\r\n* [Invoice](invoice.html): Type of Invoice\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type\r\n* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence\r\n* [Specimen](specimen.html): The specimen type\r\n", type="token" )
2880  public static final String SP_TYPE = "type";
2881 /**
2882   * <b>Fluent Client</b> search parameter constant for <b>type</b>
2883   * <p>
2884   * Description: <b>Multiple Resources: 
2885
2886* [Account](account.html): E.g. patient, expense, depreciation
2887* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
2888* [Composition](composition.html): Kind of composition (LOINC if possible)
2889* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)
2890* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
2891* [Encounter](encounter.html): Specific type of encounter
2892* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
2893* [Invoice](invoice.html): Type of Invoice
2894* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type
2895* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence
2896* [Specimen](specimen.html): The specimen type
2897</b><br>
2898   * Type: <b>token</b><br>
2899   * Path: <b>Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type</b><br>
2900   * </p>
2901   */
2902  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
2903
2904
2905}
2906