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 * A set of analyses performed to analyze and generate genomic data.
052 */
053@ResourceDef(name="GenomicStudy", profile="http://hl7.org/fhir/StructureDefinition/GenomicStudy")
054public class GenomicStudy extends DomainResource {
055
056    public enum GenomicStudyStatus {
057        /**
058         * The existence of the genomic study is registered, but there is nothing yet available.
059         */
060        REGISTERED, 
061        /**
062         * At least one instance has been associated with this genomic study.
063         */
064        AVAILABLE, 
065        /**
066         * The genomic study is unavailable because the genomic study was not started or not completed (also sometimes called \"aborted\").
067         */
068        CANCELLED, 
069        /**
070         * The genomic study has been withdrawn following a previous final release.  This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".).
071         */
072        ENTEREDINERROR, 
073        /**
074         * The system does not know which of the status values currently applies for this request. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, it's just not known which one.
075         */
076        UNKNOWN, 
077        /**
078         * added to help the parsers with the generic types
079         */
080        NULL;
081        public static GenomicStudyStatus fromCode(String codeString) throws FHIRException {
082            if (codeString == null || "".equals(codeString))
083                return null;
084        if ("registered".equals(codeString))
085          return REGISTERED;
086        if ("available".equals(codeString))
087          return AVAILABLE;
088        if ("cancelled".equals(codeString))
089          return CANCELLED;
090        if ("entered-in-error".equals(codeString))
091          return ENTEREDINERROR;
092        if ("unknown".equals(codeString))
093          return UNKNOWN;
094        if (Configuration.isAcceptInvalidEnums())
095          return null;
096        else
097          throw new FHIRException("Unknown GenomicStudyStatus code '"+codeString+"'");
098        }
099        public String toCode() {
100          switch (this) {
101            case REGISTERED: return "registered";
102            case AVAILABLE: return "available";
103            case CANCELLED: return "cancelled";
104            case ENTEREDINERROR: return "entered-in-error";
105            case UNKNOWN: return "unknown";
106            case NULL: return null;
107            default: return "?";
108          }
109        }
110        public String getSystem() {
111          switch (this) {
112            case REGISTERED: return "http://hl7.org/fhir/genomicstudy-status";
113            case AVAILABLE: return "http://hl7.org/fhir/genomicstudy-status";
114            case CANCELLED: return "http://hl7.org/fhir/genomicstudy-status";
115            case ENTEREDINERROR: return "http://hl7.org/fhir/genomicstudy-status";
116            case UNKNOWN: return "http://hl7.org/fhir/genomicstudy-status";
117            case NULL: return null;
118            default: return "?";
119          }
120        }
121        public String getDefinition() {
122          switch (this) {
123            case REGISTERED: return "The existence of the genomic study is registered, but there is nothing yet available.";
124            case AVAILABLE: return "At least one instance has been associated with this genomic study.";
125            case CANCELLED: return "The genomic study is unavailable because the genomic study was not started or not completed (also sometimes called \"aborted\").";
126            case ENTEREDINERROR: return "The genomic study has been withdrawn following a previous final release.  This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".).";
127            case UNKNOWN: return "The system does not know which of the status values currently applies for this request. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, it's just not known which one.";
128            case NULL: return null;
129            default: return "?";
130          }
131        }
132        public String getDisplay() {
133          switch (this) {
134            case REGISTERED: return "Registered";
135            case AVAILABLE: return "Available";
136            case CANCELLED: return "Cancelled";
137            case ENTEREDINERROR: return "Entered in Error";
138            case UNKNOWN: return "Unknown";
139            case NULL: return null;
140            default: return "?";
141          }
142        }
143    }
144
145  public static class GenomicStudyStatusEnumFactory implements EnumFactory<GenomicStudyStatus> {
146    public GenomicStudyStatus fromCode(String codeString) throws IllegalArgumentException {
147      if (codeString == null || "".equals(codeString))
148            if (codeString == null || "".equals(codeString))
149                return null;
150        if ("registered".equals(codeString))
151          return GenomicStudyStatus.REGISTERED;
152        if ("available".equals(codeString))
153          return GenomicStudyStatus.AVAILABLE;
154        if ("cancelled".equals(codeString))
155          return GenomicStudyStatus.CANCELLED;
156        if ("entered-in-error".equals(codeString))
157          return GenomicStudyStatus.ENTEREDINERROR;
158        if ("unknown".equals(codeString))
159          return GenomicStudyStatus.UNKNOWN;
160        throw new IllegalArgumentException("Unknown GenomicStudyStatus code '"+codeString+"'");
161        }
162        public Enumeration<GenomicStudyStatus> fromType(PrimitiveType<?> code) throws FHIRException {
163          if (code == null)
164            return null;
165          if (code.isEmpty())
166            return new Enumeration<GenomicStudyStatus>(this, GenomicStudyStatus.NULL, code);
167          String codeString = ((PrimitiveType) code).asStringValue();
168          if (codeString == null || "".equals(codeString))
169            return new Enumeration<GenomicStudyStatus>(this, GenomicStudyStatus.NULL, code);
170        if ("registered".equals(codeString))
171          return new Enumeration<GenomicStudyStatus>(this, GenomicStudyStatus.REGISTERED, code);
172        if ("available".equals(codeString))
173          return new Enumeration<GenomicStudyStatus>(this, GenomicStudyStatus.AVAILABLE, code);
174        if ("cancelled".equals(codeString))
175          return new Enumeration<GenomicStudyStatus>(this, GenomicStudyStatus.CANCELLED, code);
176        if ("entered-in-error".equals(codeString))
177          return new Enumeration<GenomicStudyStatus>(this, GenomicStudyStatus.ENTEREDINERROR, code);
178        if ("unknown".equals(codeString))
179          return new Enumeration<GenomicStudyStatus>(this, GenomicStudyStatus.UNKNOWN, code);
180        throw new FHIRException("Unknown GenomicStudyStatus code '"+codeString+"'");
181        }
182    public String toCode(GenomicStudyStatus code) {
183      if (code == GenomicStudyStatus.REGISTERED)
184        return "registered";
185      if (code == GenomicStudyStatus.AVAILABLE)
186        return "available";
187      if (code == GenomicStudyStatus.CANCELLED)
188        return "cancelled";
189      if (code == GenomicStudyStatus.ENTEREDINERROR)
190        return "entered-in-error";
191      if (code == GenomicStudyStatus.UNKNOWN)
192        return "unknown";
193      return "?";
194      }
195    public String toSystem(GenomicStudyStatus code) {
196      return code.getSystem();
197      }
198    }
199
200    @Block()
201    public static class GenomicStudyAnalysisComponent extends BackboneElement implements IBaseBackboneElement {
202        /**
203         * Identifiers for the analysis event.
204         */
205        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
206        @Description(shortDefinition="Identifiers for the analysis event", formalDefinition="Identifiers for the analysis event." )
207        protected List<Identifier> identifier;
208
209        /**
210         * Type of the methods used in the analysis, e.g., Fluorescence in situ hybridization (FISH), Karyotyping, or Microsatellite instability testing (MSI).
211         */
212        @Child(name = "methodType", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
213        @Description(shortDefinition="Type of the methods used in the analysis (e.g., FISH, Karyotyping, MSI)", formalDefinition="Type of the methods used in the analysis, e.g., Fluorescence in situ hybridization (FISH), Karyotyping, or Microsatellite instability testing (MSI)." )
214        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/genomicstudy-methodtype")
215        protected List<CodeableConcept> methodType;
216
217        /**
218         * Type of the genomic changes studied in the analysis, e.g., DNA, RNA, or amino acid change.
219         */
220        @Child(name = "changeType", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
221        @Description(shortDefinition="Type of the genomic changes studied in the analysis (e.g., DNA, RNA, or AA change)", formalDefinition="Type of the genomic changes studied in the analysis, e.g., DNA, RNA, or amino acid change." )
222        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/genomicstudy-changetype")
223        protected List<CodeableConcept> changeType;
224
225        /**
226         * The reference genome build that is used in this analysis.
227         */
228        @Child(name = "genomeBuild", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
229        @Description(shortDefinition="Genome build that is used in this analysis", formalDefinition="The reference genome build that is used in this analysis." )
230        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://loinc.org/vs/LL1040-6")
231        protected CodeableConcept genomeBuild;
232
233        /**
234         * The defined protocol that describes the analysis.
235         */
236        @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=5, min=0, max=1, modifier=false, summary=false)
237        @Description(shortDefinition="The defined protocol that describes the analysis", formalDefinition="The defined protocol that describes the analysis." )
238        protected CanonicalType instantiatesCanonical;
239
240        /**
241         * The URL pointing to an externally maintained protocol that describes the analysis.
242         */
243        @Child(name = "instantiatesUri", type = {UriType.class}, order=6, min=0, max=1, modifier=false, summary=false)
244        @Description(shortDefinition="The URL pointing to an externally maintained protocol that describes the analysis", formalDefinition="The URL pointing to an externally maintained protocol that describes the analysis." )
245        protected UriType instantiatesUri;
246
247        /**
248         * Name of the analysis event (human friendly).
249         */
250        @Child(name = "title", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
251        @Description(shortDefinition="Name of the analysis event (human friendly)", formalDefinition="Name of the analysis event (human friendly)." )
252        protected StringType title;
253
254        /**
255         * The focus of a genomic analysis 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 GenomicStudy.subject would be the child (proband) and the GenomicStudy.analysis.focus of a specific analysis would be the parent.
256         */
257        @Child(name = "focus", type = {Reference.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
258        @Description(shortDefinition="What the genomic analysis is about, when it is not about the subject of record", formalDefinition="The focus of a genomic analysis 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 GenomicStudy.subject would be the child (proband) and the GenomicStudy.analysis.focus of a specific analysis would be the parent." )
259        protected List<Reference> focus;
260
261        /**
262         * The specimen used in the analysis event.
263         */
264        @Child(name = "specimen", type = {Specimen.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
265        @Description(shortDefinition="The specimen used in the analysis event", formalDefinition="The specimen used in the analysis event." )
266        protected List<Reference> specimen;
267
268        /**
269         * The date of the analysis event.
270         */
271        @Child(name = "date", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=false)
272        @Description(shortDefinition="The date of the analysis event", formalDefinition="The date of the analysis event." )
273        protected DateTimeType date;
274
275        /**
276         * Any notes capture with the analysis event.
277         */
278        @Child(name = "note", type = {Annotation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
279        @Description(shortDefinition="Any notes capture with the analysis event", formalDefinition="Any notes capture with the analysis event." )
280        protected List<Annotation> note;
281
282        /**
283         * The protocol that was performed for the analysis event.
284         */
285        @Child(name = "protocolPerformed", type = {Procedure.class, Task.class}, order=12, min=0, max=1, modifier=false, summary=false)
286        @Description(shortDefinition="The protocol that was performed for the analysis event", formalDefinition="The protocol that was performed for the analysis event." )
287        protected Reference protocolPerformed;
288
289        /**
290         * The genomic regions to be studied in the analysis (BED file).
291         */
292        @Child(name = "regionsStudied", type = {DocumentReference.class, Observation.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
293        @Description(shortDefinition="The genomic regions to be studied in the analysis (BED file)", formalDefinition="The genomic regions to be studied in the analysis (BED file)." )
294        protected List<Reference> regionsStudied;
295
296        /**
297         * Genomic regions actually called in the analysis event (BED file).
298         */
299        @Child(name = "regionsCalled", type = {DocumentReference.class, Observation.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
300        @Description(shortDefinition="Genomic regions actually called in the analysis event (BED file)", formalDefinition="Genomic regions actually called in the analysis event (BED file)." )
301        protected List<Reference> regionsCalled;
302
303        /**
304         * Inputs for the analysis event.
305         */
306        @Child(name = "input", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
307        @Description(shortDefinition="Inputs for the analysis event", formalDefinition="Inputs for the analysis event." )
308        protected List<GenomicStudyAnalysisInputComponent> input;
309
310        /**
311         * Outputs for the analysis event.
312         */
313        @Child(name = "output", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
314        @Description(shortDefinition="Outputs for the analysis event", formalDefinition="Outputs for the analysis event." )
315        protected List<GenomicStudyAnalysisOutputComponent> output;
316
317        /**
318         * Performer for the analysis event.
319         */
320        @Child(name = "performer", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
321        @Description(shortDefinition="Performer for the analysis event", formalDefinition="Performer for the analysis event." )
322        protected List<GenomicStudyAnalysisPerformerComponent> performer;
323
324        /**
325         * Devices used for the analysis (e.g., instruments, software), with settings and parameters.
326         */
327        @Child(name = "device", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
328        @Description(shortDefinition="Devices used for the analysis (e.g., instruments, software), with settings and parameters", formalDefinition="Devices used for the analysis (e.g., instruments, software), with settings and parameters." )
329        protected List<GenomicStudyAnalysisDeviceComponent> device;
330
331        private static final long serialVersionUID = 467270310L;
332
333    /**
334     * Constructor
335     */
336      public GenomicStudyAnalysisComponent() {
337        super();
338      }
339
340        /**
341         * @return {@link #identifier} (Identifiers for the analysis event.)
342         */
343        public List<Identifier> getIdentifier() { 
344          if (this.identifier == null)
345            this.identifier = new ArrayList<Identifier>();
346          return this.identifier;
347        }
348
349        /**
350         * @return Returns a reference to <code>this</code> for easy method chaining
351         */
352        public GenomicStudyAnalysisComponent setIdentifier(List<Identifier> theIdentifier) { 
353          this.identifier = theIdentifier;
354          return this;
355        }
356
357        public boolean hasIdentifier() { 
358          if (this.identifier == null)
359            return false;
360          for (Identifier item : this.identifier)
361            if (!item.isEmpty())
362              return true;
363          return false;
364        }
365
366        public Identifier addIdentifier() { //3
367          Identifier t = new Identifier();
368          if (this.identifier == null)
369            this.identifier = new ArrayList<Identifier>();
370          this.identifier.add(t);
371          return t;
372        }
373
374        public GenomicStudyAnalysisComponent addIdentifier(Identifier t) { //3
375          if (t == null)
376            return this;
377          if (this.identifier == null)
378            this.identifier = new ArrayList<Identifier>();
379          this.identifier.add(t);
380          return this;
381        }
382
383        /**
384         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
385         */
386        public Identifier getIdentifierFirstRep() { 
387          if (getIdentifier().isEmpty()) {
388            addIdentifier();
389          }
390          return getIdentifier().get(0);
391        }
392
393        /**
394         * @return {@link #methodType} (Type of the methods used in the analysis, e.g., Fluorescence in situ hybridization (FISH), Karyotyping, or Microsatellite instability testing (MSI).)
395         */
396        public List<CodeableConcept> getMethodType() { 
397          if (this.methodType == null)
398            this.methodType = new ArrayList<CodeableConcept>();
399          return this.methodType;
400        }
401
402        /**
403         * @return Returns a reference to <code>this</code> for easy method chaining
404         */
405        public GenomicStudyAnalysisComponent setMethodType(List<CodeableConcept> theMethodType) { 
406          this.methodType = theMethodType;
407          return this;
408        }
409
410        public boolean hasMethodType() { 
411          if (this.methodType == null)
412            return false;
413          for (CodeableConcept item : this.methodType)
414            if (!item.isEmpty())
415              return true;
416          return false;
417        }
418
419        public CodeableConcept addMethodType() { //3
420          CodeableConcept t = new CodeableConcept();
421          if (this.methodType == null)
422            this.methodType = new ArrayList<CodeableConcept>();
423          this.methodType.add(t);
424          return t;
425        }
426
427        public GenomicStudyAnalysisComponent addMethodType(CodeableConcept t) { //3
428          if (t == null)
429            return this;
430          if (this.methodType == null)
431            this.methodType = new ArrayList<CodeableConcept>();
432          this.methodType.add(t);
433          return this;
434        }
435
436        /**
437         * @return The first repetition of repeating field {@link #methodType}, creating it if it does not already exist {3}
438         */
439        public CodeableConcept getMethodTypeFirstRep() { 
440          if (getMethodType().isEmpty()) {
441            addMethodType();
442          }
443          return getMethodType().get(0);
444        }
445
446        /**
447         * @return {@link #changeType} (Type of the genomic changes studied in the analysis, e.g., DNA, RNA, or amino acid change.)
448         */
449        public List<CodeableConcept> getChangeType() { 
450          if (this.changeType == null)
451            this.changeType = new ArrayList<CodeableConcept>();
452          return this.changeType;
453        }
454
455        /**
456         * @return Returns a reference to <code>this</code> for easy method chaining
457         */
458        public GenomicStudyAnalysisComponent setChangeType(List<CodeableConcept> theChangeType) { 
459          this.changeType = theChangeType;
460          return this;
461        }
462
463        public boolean hasChangeType() { 
464          if (this.changeType == null)
465            return false;
466          for (CodeableConcept item : this.changeType)
467            if (!item.isEmpty())
468              return true;
469          return false;
470        }
471
472        public CodeableConcept addChangeType() { //3
473          CodeableConcept t = new CodeableConcept();
474          if (this.changeType == null)
475            this.changeType = new ArrayList<CodeableConcept>();
476          this.changeType.add(t);
477          return t;
478        }
479
480        public GenomicStudyAnalysisComponent addChangeType(CodeableConcept t) { //3
481          if (t == null)
482            return this;
483          if (this.changeType == null)
484            this.changeType = new ArrayList<CodeableConcept>();
485          this.changeType.add(t);
486          return this;
487        }
488
489        /**
490         * @return The first repetition of repeating field {@link #changeType}, creating it if it does not already exist {3}
491         */
492        public CodeableConcept getChangeTypeFirstRep() { 
493          if (getChangeType().isEmpty()) {
494            addChangeType();
495          }
496          return getChangeType().get(0);
497        }
498
499        /**
500         * @return {@link #genomeBuild} (The reference genome build that is used in this analysis.)
501         */
502        public CodeableConcept getGenomeBuild() { 
503          if (this.genomeBuild == null)
504            if (Configuration.errorOnAutoCreate())
505              throw new Error("Attempt to auto-create GenomicStudyAnalysisComponent.genomeBuild");
506            else if (Configuration.doAutoCreate())
507              this.genomeBuild = new CodeableConcept(); // cc
508          return this.genomeBuild;
509        }
510
511        public boolean hasGenomeBuild() { 
512          return this.genomeBuild != null && !this.genomeBuild.isEmpty();
513        }
514
515        /**
516         * @param value {@link #genomeBuild} (The reference genome build that is used in this analysis.)
517         */
518        public GenomicStudyAnalysisComponent setGenomeBuild(CodeableConcept value) { 
519          this.genomeBuild = value;
520          return this;
521        }
522
523        /**
524         * @return {@link #instantiatesCanonical} (The defined protocol that describes the analysis.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesCanonical" gives direct access to the value
525         */
526        public CanonicalType getInstantiatesCanonicalElement() { 
527          if (this.instantiatesCanonical == null)
528            if (Configuration.errorOnAutoCreate())
529              throw new Error("Attempt to auto-create GenomicStudyAnalysisComponent.instantiatesCanonical");
530            else if (Configuration.doAutoCreate())
531              this.instantiatesCanonical = new CanonicalType(); // bb
532          return this.instantiatesCanonical;
533        }
534
535        public boolean hasInstantiatesCanonicalElement() { 
536          return this.instantiatesCanonical != null && !this.instantiatesCanonical.isEmpty();
537        }
538
539        public boolean hasInstantiatesCanonical() { 
540          return this.instantiatesCanonical != null && !this.instantiatesCanonical.isEmpty();
541        }
542
543        /**
544         * @param value {@link #instantiatesCanonical} (The defined protocol that describes the analysis.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesCanonical" gives direct access to the value
545         */
546        public GenomicStudyAnalysisComponent setInstantiatesCanonicalElement(CanonicalType value) { 
547          this.instantiatesCanonical = value;
548          return this;
549        }
550
551        /**
552         * @return The defined protocol that describes the analysis.
553         */
554        public String getInstantiatesCanonical() { 
555          return this.instantiatesCanonical == null ? null : this.instantiatesCanonical.getValue();
556        }
557
558        /**
559         * @param value The defined protocol that describes the analysis.
560         */
561        public GenomicStudyAnalysisComponent setInstantiatesCanonical(String value) { 
562          if (Utilities.noString(value))
563            this.instantiatesCanonical = null;
564          else {
565            if (this.instantiatesCanonical == null)
566              this.instantiatesCanonical = new CanonicalType();
567            this.instantiatesCanonical.setValue(value);
568          }
569          return this;
570        }
571
572        /**
573         * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol that describes the analysis.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesUri" gives direct access to the value
574         */
575        public UriType getInstantiatesUriElement() { 
576          if (this.instantiatesUri == null)
577            if (Configuration.errorOnAutoCreate())
578              throw new Error("Attempt to auto-create GenomicStudyAnalysisComponent.instantiatesUri");
579            else if (Configuration.doAutoCreate())
580              this.instantiatesUri = new UriType(); // bb
581          return this.instantiatesUri;
582        }
583
584        public boolean hasInstantiatesUriElement() { 
585          return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
586        }
587
588        public boolean hasInstantiatesUri() { 
589          return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
590        }
591
592        /**
593         * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol that describes the analysis.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesUri" gives direct access to the value
594         */
595        public GenomicStudyAnalysisComponent setInstantiatesUriElement(UriType value) { 
596          this.instantiatesUri = value;
597          return this;
598        }
599
600        /**
601         * @return The URL pointing to an externally maintained protocol that describes the analysis.
602         */
603        public String getInstantiatesUri() { 
604          return this.instantiatesUri == null ? null : this.instantiatesUri.getValue();
605        }
606
607        /**
608         * @param value The URL pointing to an externally maintained protocol that describes the analysis.
609         */
610        public GenomicStudyAnalysisComponent setInstantiatesUri(String value) { 
611          if (Utilities.noString(value))
612            this.instantiatesUri = null;
613          else {
614            if (this.instantiatesUri == null)
615              this.instantiatesUri = new UriType();
616            this.instantiatesUri.setValue(value);
617          }
618          return this;
619        }
620
621        /**
622         * @return {@link #title} (Name of the analysis event (human friendly).). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
623         */
624        public StringType getTitleElement() { 
625          if (this.title == null)
626            if (Configuration.errorOnAutoCreate())
627              throw new Error("Attempt to auto-create GenomicStudyAnalysisComponent.title");
628            else if (Configuration.doAutoCreate())
629              this.title = new StringType(); // bb
630          return this.title;
631        }
632
633        public boolean hasTitleElement() { 
634          return this.title != null && !this.title.isEmpty();
635        }
636
637        public boolean hasTitle() { 
638          return this.title != null && !this.title.isEmpty();
639        }
640
641        /**
642         * @param value {@link #title} (Name of the analysis event (human friendly).). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
643         */
644        public GenomicStudyAnalysisComponent setTitleElement(StringType value) { 
645          this.title = value;
646          return this;
647        }
648
649        /**
650         * @return Name of the analysis event (human friendly).
651         */
652        public String getTitle() { 
653          return this.title == null ? null : this.title.getValue();
654        }
655
656        /**
657         * @param value Name of the analysis event (human friendly).
658         */
659        public GenomicStudyAnalysisComponent setTitle(String value) { 
660          if (Utilities.noString(value))
661            this.title = null;
662          else {
663            if (this.title == null)
664              this.title = new StringType();
665            this.title.setValue(value);
666          }
667          return this;
668        }
669
670        /**
671         * @return {@link #focus} (The focus of a genomic analysis 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 GenomicStudy.subject would be the child (proband) and the GenomicStudy.analysis.focus of a specific analysis would be the parent.)
672         */
673        public List<Reference> getFocus() { 
674          if (this.focus == null)
675            this.focus = new ArrayList<Reference>();
676          return this.focus;
677        }
678
679        /**
680         * @return Returns a reference to <code>this</code> for easy method chaining
681         */
682        public GenomicStudyAnalysisComponent setFocus(List<Reference> theFocus) { 
683          this.focus = theFocus;
684          return this;
685        }
686
687        public boolean hasFocus() { 
688          if (this.focus == null)
689            return false;
690          for (Reference item : this.focus)
691            if (!item.isEmpty())
692              return true;
693          return false;
694        }
695
696        public Reference addFocus() { //3
697          Reference t = new Reference();
698          if (this.focus == null)
699            this.focus = new ArrayList<Reference>();
700          this.focus.add(t);
701          return t;
702        }
703
704        public GenomicStudyAnalysisComponent addFocus(Reference t) { //3
705          if (t == null)
706            return this;
707          if (this.focus == null)
708            this.focus = new ArrayList<Reference>();
709          this.focus.add(t);
710          return this;
711        }
712
713        /**
714         * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist {3}
715         */
716        public Reference getFocusFirstRep() { 
717          if (getFocus().isEmpty()) {
718            addFocus();
719          }
720          return getFocus().get(0);
721        }
722
723        /**
724         * @return {@link #specimen} (The specimen used in the analysis event.)
725         */
726        public List<Reference> getSpecimen() { 
727          if (this.specimen == null)
728            this.specimen = new ArrayList<Reference>();
729          return this.specimen;
730        }
731
732        /**
733         * @return Returns a reference to <code>this</code> for easy method chaining
734         */
735        public GenomicStudyAnalysisComponent setSpecimen(List<Reference> theSpecimen) { 
736          this.specimen = theSpecimen;
737          return this;
738        }
739
740        public boolean hasSpecimen() { 
741          if (this.specimen == null)
742            return false;
743          for (Reference item : this.specimen)
744            if (!item.isEmpty())
745              return true;
746          return false;
747        }
748
749        public Reference addSpecimen() { //3
750          Reference t = new Reference();
751          if (this.specimen == null)
752            this.specimen = new ArrayList<Reference>();
753          this.specimen.add(t);
754          return t;
755        }
756
757        public GenomicStudyAnalysisComponent addSpecimen(Reference t) { //3
758          if (t == null)
759            return this;
760          if (this.specimen == null)
761            this.specimen = new ArrayList<Reference>();
762          this.specimen.add(t);
763          return this;
764        }
765
766        /**
767         * @return The first repetition of repeating field {@link #specimen}, creating it if it does not already exist {3}
768         */
769        public Reference getSpecimenFirstRep() { 
770          if (getSpecimen().isEmpty()) {
771            addSpecimen();
772          }
773          return getSpecimen().get(0);
774        }
775
776        /**
777         * @return {@link #date} (The date of the analysis event.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
778         */
779        public DateTimeType getDateElement() { 
780          if (this.date == null)
781            if (Configuration.errorOnAutoCreate())
782              throw new Error("Attempt to auto-create GenomicStudyAnalysisComponent.date");
783            else if (Configuration.doAutoCreate())
784              this.date = new DateTimeType(); // bb
785          return this.date;
786        }
787
788        public boolean hasDateElement() { 
789          return this.date != null && !this.date.isEmpty();
790        }
791
792        public boolean hasDate() { 
793          return this.date != null && !this.date.isEmpty();
794        }
795
796        /**
797         * @param value {@link #date} (The date of the analysis event.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
798         */
799        public GenomicStudyAnalysisComponent setDateElement(DateTimeType value) { 
800          this.date = value;
801          return this;
802        }
803
804        /**
805         * @return The date of the analysis event.
806         */
807        public Date getDate() { 
808          return this.date == null ? null : this.date.getValue();
809        }
810
811        /**
812         * @param value The date of the analysis event.
813         */
814        public GenomicStudyAnalysisComponent setDate(Date value) { 
815          if (value == null)
816            this.date = null;
817          else {
818            if (this.date == null)
819              this.date = new DateTimeType();
820            this.date.setValue(value);
821          }
822          return this;
823        }
824
825        /**
826         * @return {@link #note} (Any notes capture with the analysis event.)
827         */
828        public List<Annotation> getNote() { 
829          if (this.note == null)
830            this.note = new ArrayList<Annotation>();
831          return this.note;
832        }
833
834        /**
835         * @return Returns a reference to <code>this</code> for easy method chaining
836         */
837        public GenomicStudyAnalysisComponent setNote(List<Annotation> theNote) { 
838          this.note = theNote;
839          return this;
840        }
841
842        public boolean hasNote() { 
843          if (this.note == null)
844            return false;
845          for (Annotation item : this.note)
846            if (!item.isEmpty())
847              return true;
848          return false;
849        }
850
851        public Annotation addNote() { //3
852          Annotation t = new Annotation();
853          if (this.note == null)
854            this.note = new ArrayList<Annotation>();
855          this.note.add(t);
856          return t;
857        }
858
859        public GenomicStudyAnalysisComponent addNote(Annotation t) { //3
860          if (t == null)
861            return this;
862          if (this.note == null)
863            this.note = new ArrayList<Annotation>();
864          this.note.add(t);
865          return this;
866        }
867
868        /**
869         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
870         */
871        public Annotation getNoteFirstRep() { 
872          if (getNote().isEmpty()) {
873            addNote();
874          }
875          return getNote().get(0);
876        }
877
878        /**
879         * @return {@link #protocolPerformed} (The protocol that was performed for the analysis event.)
880         */
881        public Reference getProtocolPerformed() { 
882          if (this.protocolPerformed == null)
883            if (Configuration.errorOnAutoCreate())
884              throw new Error("Attempt to auto-create GenomicStudyAnalysisComponent.protocolPerformed");
885            else if (Configuration.doAutoCreate())
886              this.protocolPerformed = new Reference(); // cc
887          return this.protocolPerformed;
888        }
889
890        public boolean hasProtocolPerformed() { 
891          return this.protocolPerformed != null && !this.protocolPerformed.isEmpty();
892        }
893
894        /**
895         * @param value {@link #protocolPerformed} (The protocol that was performed for the analysis event.)
896         */
897        public GenomicStudyAnalysisComponent setProtocolPerformed(Reference value) { 
898          this.protocolPerformed = value;
899          return this;
900        }
901
902        /**
903         * @return {@link #regionsStudied} (The genomic regions to be studied in the analysis (BED file).)
904         */
905        public List<Reference> getRegionsStudied() { 
906          if (this.regionsStudied == null)
907            this.regionsStudied = new ArrayList<Reference>();
908          return this.regionsStudied;
909        }
910
911        /**
912         * @return Returns a reference to <code>this</code> for easy method chaining
913         */
914        public GenomicStudyAnalysisComponent setRegionsStudied(List<Reference> theRegionsStudied) { 
915          this.regionsStudied = theRegionsStudied;
916          return this;
917        }
918
919        public boolean hasRegionsStudied() { 
920          if (this.regionsStudied == null)
921            return false;
922          for (Reference item : this.regionsStudied)
923            if (!item.isEmpty())
924              return true;
925          return false;
926        }
927
928        public Reference addRegionsStudied() { //3
929          Reference t = new Reference();
930          if (this.regionsStudied == null)
931            this.regionsStudied = new ArrayList<Reference>();
932          this.regionsStudied.add(t);
933          return t;
934        }
935
936        public GenomicStudyAnalysisComponent addRegionsStudied(Reference t) { //3
937          if (t == null)
938            return this;
939          if (this.regionsStudied == null)
940            this.regionsStudied = new ArrayList<Reference>();
941          this.regionsStudied.add(t);
942          return this;
943        }
944
945        /**
946         * @return The first repetition of repeating field {@link #regionsStudied}, creating it if it does not already exist {3}
947         */
948        public Reference getRegionsStudiedFirstRep() { 
949          if (getRegionsStudied().isEmpty()) {
950            addRegionsStudied();
951          }
952          return getRegionsStudied().get(0);
953        }
954
955        /**
956         * @return {@link #regionsCalled} (Genomic regions actually called in the analysis event (BED file).)
957         */
958        public List<Reference> getRegionsCalled() { 
959          if (this.regionsCalled == null)
960            this.regionsCalled = new ArrayList<Reference>();
961          return this.regionsCalled;
962        }
963
964        /**
965         * @return Returns a reference to <code>this</code> for easy method chaining
966         */
967        public GenomicStudyAnalysisComponent setRegionsCalled(List<Reference> theRegionsCalled) { 
968          this.regionsCalled = theRegionsCalled;
969          return this;
970        }
971
972        public boolean hasRegionsCalled() { 
973          if (this.regionsCalled == null)
974            return false;
975          for (Reference item : this.regionsCalled)
976            if (!item.isEmpty())
977              return true;
978          return false;
979        }
980
981        public Reference addRegionsCalled() { //3
982          Reference t = new Reference();
983          if (this.regionsCalled == null)
984            this.regionsCalled = new ArrayList<Reference>();
985          this.regionsCalled.add(t);
986          return t;
987        }
988
989        public GenomicStudyAnalysisComponent addRegionsCalled(Reference t) { //3
990          if (t == null)
991            return this;
992          if (this.regionsCalled == null)
993            this.regionsCalled = new ArrayList<Reference>();
994          this.regionsCalled.add(t);
995          return this;
996        }
997
998        /**
999         * @return The first repetition of repeating field {@link #regionsCalled}, creating it if it does not already exist {3}
1000         */
1001        public Reference getRegionsCalledFirstRep() { 
1002          if (getRegionsCalled().isEmpty()) {
1003            addRegionsCalled();
1004          }
1005          return getRegionsCalled().get(0);
1006        }
1007
1008        /**
1009         * @return {@link #input} (Inputs for the analysis event.)
1010         */
1011        public List<GenomicStudyAnalysisInputComponent> getInput() { 
1012          if (this.input == null)
1013            this.input = new ArrayList<GenomicStudyAnalysisInputComponent>();
1014          return this.input;
1015        }
1016
1017        /**
1018         * @return Returns a reference to <code>this</code> for easy method chaining
1019         */
1020        public GenomicStudyAnalysisComponent setInput(List<GenomicStudyAnalysisInputComponent> theInput) { 
1021          this.input = theInput;
1022          return this;
1023        }
1024
1025        public boolean hasInput() { 
1026          if (this.input == null)
1027            return false;
1028          for (GenomicStudyAnalysisInputComponent item : this.input)
1029            if (!item.isEmpty())
1030              return true;
1031          return false;
1032        }
1033
1034        public GenomicStudyAnalysisInputComponent addInput() { //3
1035          GenomicStudyAnalysisInputComponent t = new GenomicStudyAnalysisInputComponent();
1036          if (this.input == null)
1037            this.input = new ArrayList<GenomicStudyAnalysisInputComponent>();
1038          this.input.add(t);
1039          return t;
1040        }
1041
1042        public GenomicStudyAnalysisComponent addInput(GenomicStudyAnalysisInputComponent t) { //3
1043          if (t == null)
1044            return this;
1045          if (this.input == null)
1046            this.input = new ArrayList<GenomicStudyAnalysisInputComponent>();
1047          this.input.add(t);
1048          return this;
1049        }
1050
1051        /**
1052         * @return The first repetition of repeating field {@link #input}, creating it if it does not already exist {3}
1053         */
1054        public GenomicStudyAnalysisInputComponent getInputFirstRep() { 
1055          if (getInput().isEmpty()) {
1056            addInput();
1057          }
1058          return getInput().get(0);
1059        }
1060
1061        /**
1062         * @return {@link #output} (Outputs for the analysis event.)
1063         */
1064        public List<GenomicStudyAnalysisOutputComponent> getOutput() { 
1065          if (this.output == null)
1066            this.output = new ArrayList<GenomicStudyAnalysisOutputComponent>();
1067          return this.output;
1068        }
1069
1070        /**
1071         * @return Returns a reference to <code>this</code> for easy method chaining
1072         */
1073        public GenomicStudyAnalysisComponent setOutput(List<GenomicStudyAnalysisOutputComponent> theOutput) { 
1074          this.output = theOutput;
1075          return this;
1076        }
1077
1078        public boolean hasOutput() { 
1079          if (this.output == null)
1080            return false;
1081          for (GenomicStudyAnalysisOutputComponent item : this.output)
1082            if (!item.isEmpty())
1083              return true;
1084          return false;
1085        }
1086
1087        public GenomicStudyAnalysisOutputComponent addOutput() { //3
1088          GenomicStudyAnalysisOutputComponent t = new GenomicStudyAnalysisOutputComponent();
1089          if (this.output == null)
1090            this.output = new ArrayList<GenomicStudyAnalysisOutputComponent>();
1091          this.output.add(t);
1092          return t;
1093        }
1094
1095        public GenomicStudyAnalysisComponent addOutput(GenomicStudyAnalysisOutputComponent t) { //3
1096          if (t == null)
1097            return this;
1098          if (this.output == null)
1099            this.output = new ArrayList<GenomicStudyAnalysisOutputComponent>();
1100          this.output.add(t);
1101          return this;
1102        }
1103
1104        /**
1105         * @return The first repetition of repeating field {@link #output}, creating it if it does not already exist {3}
1106         */
1107        public GenomicStudyAnalysisOutputComponent getOutputFirstRep() { 
1108          if (getOutput().isEmpty()) {
1109            addOutput();
1110          }
1111          return getOutput().get(0);
1112        }
1113
1114        /**
1115         * @return {@link #performer} (Performer for the analysis event.)
1116         */
1117        public List<GenomicStudyAnalysisPerformerComponent> getPerformer() { 
1118          if (this.performer == null)
1119            this.performer = new ArrayList<GenomicStudyAnalysisPerformerComponent>();
1120          return this.performer;
1121        }
1122
1123        /**
1124         * @return Returns a reference to <code>this</code> for easy method chaining
1125         */
1126        public GenomicStudyAnalysisComponent setPerformer(List<GenomicStudyAnalysisPerformerComponent> thePerformer) { 
1127          this.performer = thePerformer;
1128          return this;
1129        }
1130
1131        public boolean hasPerformer() { 
1132          if (this.performer == null)
1133            return false;
1134          for (GenomicStudyAnalysisPerformerComponent item : this.performer)
1135            if (!item.isEmpty())
1136              return true;
1137          return false;
1138        }
1139
1140        public GenomicStudyAnalysisPerformerComponent addPerformer() { //3
1141          GenomicStudyAnalysisPerformerComponent t = new GenomicStudyAnalysisPerformerComponent();
1142          if (this.performer == null)
1143            this.performer = new ArrayList<GenomicStudyAnalysisPerformerComponent>();
1144          this.performer.add(t);
1145          return t;
1146        }
1147
1148        public GenomicStudyAnalysisComponent addPerformer(GenomicStudyAnalysisPerformerComponent t) { //3
1149          if (t == null)
1150            return this;
1151          if (this.performer == null)
1152            this.performer = new ArrayList<GenomicStudyAnalysisPerformerComponent>();
1153          this.performer.add(t);
1154          return this;
1155        }
1156
1157        /**
1158         * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3}
1159         */
1160        public GenomicStudyAnalysisPerformerComponent getPerformerFirstRep() { 
1161          if (getPerformer().isEmpty()) {
1162            addPerformer();
1163          }
1164          return getPerformer().get(0);
1165        }
1166
1167        /**
1168         * @return {@link #device} (Devices used for the analysis (e.g., instruments, software), with settings and parameters.)
1169         */
1170        public List<GenomicStudyAnalysisDeviceComponent> getDevice() { 
1171          if (this.device == null)
1172            this.device = new ArrayList<GenomicStudyAnalysisDeviceComponent>();
1173          return this.device;
1174        }
1175
1176        /**
1177         * @return Returns a reference to <code>this</code> for easy method chaining
1178         */
1179        public GenomicStudyAnalysisComponent setDevice(List<GenomicStudyAnalysisDeviceComponent> theDevice) { 
1180          this.device = theDevice;
1181          return this;
1182        }
1183
1184        public boolean hasDevice() { 
1185          if (this.device == null)
1186            return false;
1187          for (GenomicStudyAnalysisDeviceComponent item : this.device)
1188            if (!item.isEmpty())
1189              return true;
1190          return false;
1191        }
1192
1193        public GenomicStudyAnalysisDeviceComponent addDevice() { //3
1194          GenomicStudyAnalysisDeviceComponent t = new GenomicStudyAnalysisDeviceComponent();
1195          if (this.device == null)
1196            this.device = new ArrayList<GenomicStudyAnalysisDeviceComponent>();
1197          this.device.add(t);
1198          return t;
1199        }
1200
1201        public GenomicStudyAnalysisComponent addDevice(GenomicStudyAnalysisDeviceComponent t) { //3
1202          if (t == null)
1203            return this;
1204          if (this.device == null)
1205            this.device = new ArrayList<GenomicStudyAnalysisDeviceComponent>();
1206          this.device.add(t);
1207          return this;
1208        }
1209
1210        /**
1211         * @return The first repetition of repeating field {@link #device}, creating it if it does not already exist {3}
1212         */
1213        public GenomicStudyAnalysisDeviceComponent getDeviceFirstRep() { 
1214          if (getDevice().isEmpty()) {
1215            addDevice();
1216          }
1217          return getDevice().get(0);
1218        }
1219
1220        protected void listChildren(List<Property> children) {
1221          super.listChildren(children);
1222          children.add(new Property("identifier", "Identifier", "Identifiers for the analysis event.", 0, java.lang.Integer.MAX_VALUE, identifier));
1223          children.add(new Property("methodType", "CodeableConcept", "Type of the methods used in the analysis, e.g., Fluorescence in situ hybridization (FISH), Karyotyping, or Microsatellite instability testing (MSI).", 0, java.lang.Integer.MAX_VALUE, methodType));
1224          children.add(new Property("changeType", "CodeableConcept", "Type of the genomic changes studied in the analysis, e.g., DNA, RNA, or amino acid change.", 0, java.lang.Integer.MAX_VALUE, changeType));
1225          children.add(new Property("genomeBuild", "CodeableConcept", "The reference genome build that is used in this analysis.", 0, 1, genomeBuild));
1226          children.add(new Property("instantiatesCanonical", "canonical(PlanDefinition|ActivityDefinition)", "The defined protocol that describes the analysis.", 0, 1, instantiatesCanonical));
1227          children.add(new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol that describes the analysis.", 0, 1, instantiatesUri));
1228          children.add(new Property("title", "string", "Name of the analysis event (human friendly).", 0, 1, title));
1229          children.add(new Property("focus", "Reference(Any)", "The focus of a genomic analysis 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 GenomicStudy.subject would be the child (proband) and the GenomicStudy.analysis.focus of a specific analysis would be the parent.", 0, java.lang.Integer.MAX_VALUE, focus));
1230          children.add(new Property("specimen", "Reference(Specimen)", "The specimen used in the analysis event.", 0, java.lang.Integer.MAX_VALUE, specimen));
1231          children.add(new Property("date", "dateTime", "The date of the analysis event.", 0, 1, date));
1232          children.add(new Property("note", "Annotation", "Any notes capture with the analysis event.", 0, java.lang.Integer.MAX_VALUE, note));
1233          children.add(new Property("protocolPerformed", "Reference(Procedure|Task)", "The protocol that was performed for the analysis event.", 0, 1, protocolPerformed));
1234          children.add(new Property("regionsStudied", "Reference(DocumentReference|Observation)", "The genomic regions to be studied in the analysis (BED file).", 0, java.lang.Integer.MAX_VALUE, regionsStudied));
1235          children.add(new Property("regionsCalled", "Reference(DocumentReference|Observation)", "Genomic regions actually called in the analysis event (BED file).", 0, java.lang.Integer.MAX_VALUE, regionsCalled));
1236          children.add(new Property("input", "", "Inputs for the analysis event.", 0, java.lang.Integer.MAX_VALUE, input));
1237          children.add(new Property("output", "", "Outputs for the analysis event.", 0, java.lang.Integer.MAX_VALUE, output));
1238          children.add(new Property("performer", "", "Performer for the analysis event.", 0, java.lang.Integer.MAX_VALUE, performer));
1239          children.add(new Property("device", "", "Devices used for the analysis (e.g., instruments, software), with settings and parameters.", 0, java.lang.Integer.MAX_VALUE, device));
1240        }
1241
1242        @Override
1243        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1244          switch (_hash) {
1245          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers for the analysis event.", 0, java.lang.Integer.MAX_VALUE, identifier);
1246          case -722961477: /*methodType*/  return new Property("methodType", "CodeableConcept", "Type of the methods used in the analysis, e.g., Fluorescence in situ hybridization (FISH), Karyotyping, or Microsatellite instability testing (MSI).", 0, java.lang.Integer.MAX_VALUE, methodType);
1247          case -2131902710: /*changeType*/  return new Property("changeType", "CodeableConcept", "Type of the genomic changes studied in the analysis, e.g., DNA, RNA, or amino acid change.", 0, java.lang.Integer.MAX_VALUE, changeType);
1248          case 1061239735: /*genomeBuild*/  return new Property("genomeBuild", "CodeableConcept", "The reference genome build that is used in this analysis.", 0, 1, genomeBuild);
1249          case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "canonical(PlanDefinition|ActivityDefinition)", "The defined protocol that describes the analysis.", 0, 1, instantiatesCanonical);
1250          case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol that describes the analysis.", 0, 1, instantiatesUri);
1251          case 110371416: /*title*/  return new Property("title", "string", "Name of the analysis event (human friendly).", 0, 1, title);
1252          case 97604824: /*focus*/  return new Property("focus", "Reference(Any)", "The focus of a genomic analysis 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 GenomicStudy.subject would be the child (proband) and the GenomicStudy.analysis.focus of a specific analysis would be the parent.", 0, java.lang.Integer.MAX_VALUE, focus);
1253          case -2132868344: /*specimen*/  return new Property("specimen", "Reference(Specimen)", "The specimen used in the analysis event.", 0, java.lang.Integer.MAX_VALUE, specimen);
1254          case 3076014: /*date*/  return new Property("date", "dateTime", "The date of the analysis event.", 0, 1, date);
1255          case 3387378: /*note*/  return new Property("note", "Annotation", "Any notes capture with the analysis event.", 0, java.lang.Integer.MAX_VALUE, note);
1256          case -1565516792: /*protocolPerformed*/  return new Property("protocolPerformed", "Reference(Procedure|Task)", "The protocol that was performed for the analysis event.", 0, 1, protocolPerformed);
1257          case 391791385: /*regionsStudied*/  return new Property("regionsStudied", "Reference(DocumentReference|Observation)", "The genomic regions to be studied in the analysis (BED file).", 0, java.lang.Integer.MAX_VALUE, regionsStudied);
1258          case -2125803428: /*regionsCalled*/  return new Property("regionsCalled", "Reference(DocumentReference|Observation)", "Genomic regions actually called in the analysis event (BED file).", 0, java.lang.Integer.MAX_VALUE, regionsCalled);
1259          case 100358090: /*input*/  return new Property("input", "", "Inputs for the analysis event.", 0, java.lang.Integer.MAX_VALUE, input);
1260          case -1005512447: /*output*/  return new Property("output", "", "Outputs for the analysis event.", 0, java.lang.Integer.MAX_VALUE, output);
1261          case 481140686: /*performer*/  return new Property("performer", "", "Performer for the analysis event.", 0, java.lang.Integer.MAX_VALUE, performer);
1262          case -1335157162: /*device*/  return new Property("device", "", "Devices used for the analysis (e.g., instruments, software), with settings and parameters.", 0, java.lang.Integer.MAX_VALUE, device);
1263          default: return super.getNamedProperty(_hash, _name, _checkValid);
1264          }
1265
1266        }
1267
1268      @Override
1269      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1270        switch (hash) {
1271        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1272        case -722961477: /*methodType*/ return this.methodType == null ? new Base[0] : this.methodType.toArray(new Base[this.methodType.size()]); // CodeableConcept
1273        case -2131902710: /*changeType*/ return this.changeType == null ? new Base[0] : this.changeType.toArray(new Base[this.changeType.size()]); // CodeableConcept
1274        case 1061239735: /*genomeBuild*/ return this.genomeBuild == null ? new Base[0] : new Base[] {this.genomeBuild}; // CodeableConcept
1275        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : new Base[] {this.instantiatesCanonical}; // CanonicalType
1276        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : new Base[] {this.instantiatesUri}; // UriType
1277        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
1278        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // Reference
1279        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference
1280        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
1281        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1282        case -1565516792: /*protocolPerformed*/ return this.protocolPerformed == null ? new Base[0] : new Base[] {this.protocolPerformed}; // Reference
1283        case 391791385: /*regionsStudied*/ return this.regionsStudied == null ? new Base[0] : this.regionsStudied.toArray(new Base[this.regionsStudied.size()]); // Reference
1284        case -2125803428: /*regionsCalled*/ return this.regionsCalled == null ? new Base[0] : this.regionsCalled.toArray(new Base[this.regionsCalled.size()]); // Reference
1285        case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // GenomicStudyAnalysisInputComponent
1286        case -1005512447: /*output*/ return this.output == null ? new Base[0] : this.output.toArray(new Base[this.output.size()]); // GenomicStudyAnalysisOutputComponent
1287        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // GenomicStudyAnalysisPerformerComponent
1288        case -1335157162: /*device*/ return this.device == null ? new Base[0] : this.device.toArray(new Base[this.device.size()]); // GenomicStudyAnalysisDeviceComponent
1289        default: return super.getProperty(hash, name, checkValid);
1290        }
1291
1292      }
1293
1294      @Override
1295      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1296        switch (hash) {
1297        case -1618432855: // identifier
1298          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1299          return value;
1300        case -722961477: // methodType
1301          this.getMethodType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1302          return value;
1303        case -2131902710: // changeType
1304          this.getChangeType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1305          return value;
1306        case 1061239735: // genomeBuild
1307          this.genomeBuild = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1308          return value;
1309        case 8911915: // instantiatesCanonical
1310          this.instantiatesCanonical = TypeConvertor.castToCanonical(value); // CanonicalType
1311          return value;
1312        case -1926393373: // instantiatesUri
1313          this.instantiatesUri = TypeConvertor.castToUri(value); // UriType
1314          return value;
1315        case 110371416: // title
1316          this.title = TypeConvertor.castToString(value); // StringType
1317          return value;
1318        case 97604824: // focus
1319          this.getFocus().add(TypeConvertor.castToReference(value)); // Reference
1320          return value;
1321        case -2132868344: // specimen
1322          this.getSpecimen().add(TypeConvertor.castToReference(value)); // Reference
1323          return value;
1324        case 3076014: // date
1325          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
1326          return value;
1327        case 3387378: // note
1328          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
1329          return value;
1330        case -1565516792: // protocolPerformed
1331          this.protocolPerformed = TypeConvertor.castToReference(value); // Reference
1332          return value;
1333        case 391791385: // regionsStudied
1334          this.getRegionsStudied().add(TypeConvertor.castToReference(value)); // Reference
1335          return value;
1336        case -2125803428: // regionsCalled
1337          this.getRegionsCalled().add(TypeConvertor.castToReference(value)); // Reference
1338          return value;
1339        case 100358090: // input
1340          this.getInput().add((GenomicStudyAnalysisInputComponent) value); // GenomicStudyAnalysisInputComponent
1341          return value;
1342        case -1005512447: // output
1343          this.getOutput().add((GenomicStudyAnalysisOutputComponent) value); // GenomicStudyAnalysisOutputComponent
1344          return value;
1345        case 481140686: // performer
1346          this.getPerformer().add((GenomicStudyAnalysisPerformerComponent) value); // GenomicStudyAnalysisPerformerComponent
1347          return value;
1348        case -1335157162: // device
1349          this.getDevice().add((GenomicStudyAnalysisDeviceComponent) value); // GenomicStudyAnalysisDeviceComponent
1350          return value;
1351        default: return super.setProperty(hash, name, value);
1352        }
1353
1354      }
1355
1356      @Override
1357      public Base setProperty(String name, Base value) throws FHIRException {
1358        if (name.equals("identifier")) {
1359          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1360        } else if (name.equals("methodType")) {
1361          this.getMethodType().add(TypeConvertor.castToCodeableConcept(value));
1362        } else if (name.equals("changeType")) {
1363          this.getChangeType().add(TypeConvertor.castToCodeableConcept(value));
1364        } else if (name.equals("genomeBuild")) {
1365          this.genomeBuild = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1366        } else if (name.equals("instantiatesCanonical")) {
1367          this.instantiatesCanonical = TypeConvertor.castToCanonical(value); // CanonicalType
1368        } else if (name.equals("instantiatesUri")) {
1369          this.instantiatesUri = TypeConvertor.castToUri(value); // UriType
1370        } else if (name.equals("title")) {
1371          this.title = TypeConvertor.castToString(value); // StringType
1372        } else if (name.equals("focus")) {
1373          this.getFocus().add(TypeConvertor.castToReference(value));
1374        } else if (name.equals("specimen")) {
1375          this.getSpecimen().add(TypeConvertor.castToReference(value));
1376        } else if (name.equals("date")) {
1377          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
1378        } else if (name.equals("note")) {
1379          this.getNote().add(TypeConvertor.castToAnnotation(value));
1380        } else if (name.equals("protocolPerformed")) {
1381          this.protocolPerformed = TypeConvertor.castToReference(value); // Reference
1382        } else if (name.equals("regionsStudied")) {
1383          this.getRegionsStudied().add(TypeConvertor.castToReference(value));
1384        } else if (name.equals("regionsCalled")) {
1385          this.getRegionsCalled().add(TypeConvertor.castToReference(value));
1386        } else if (name.equals("input")) {
1387          this.getInput().add((GenomicStudyAnalysisInputComponent) value);
1388        } else if (name.equals("output")) {
1389          this.getOutput().add((GenomicStudyAnalysisOutputComponent) value);
1390        } else if (name.equals("performer")) {
1391          this.getPerformer().add((GenomicStudyAnalysisPerformerComponent) value);
1392        } else if (name.equals("device")) {
1393          this.getDevice().add((GenomicStudyAnalysisDeviceComponent) value);
1394        } else
1395          return super.setProperty(name, value);
1396        return value;
1397      }
1398
1399  @Override
1400  public void removeChild(String name, Base value) throws FHIRException {
1401        if (name.equals("identifier")) {
1402          this.getIdentifier().remove(value);
1403        } else if (name.equals("methodType")) {
1404          this.getMethodType().remove(value);
1405        } else if (name.equals("changeType")) {
1406          this.getChangeType().remove(value);
1407        } else if (name.equals("genomeBuild")) {
1408          this.genomeBuild = null;
1409        } else if (name.equals("instantiatesCanonical")) {
1410          this.instantiatesCanonical = null;
1411        } else if (name.equals("instantiatesUri")) {
1412          this.instantiatesUri = null;
1413        } else if (name.equals("title")) {
1414          this.title = null;
1415        } else if (name.equals("focus")) {
1416          this.getFocus().remove(value);
1417        } else if (name.equals("specimen")) {
1418          this.getSpecimen().remove(value);
1419        } else if (name.equals("date")) {
1420          this.date = null;
1421        } else if (name.equals("note")) {
1422          this.getNote().remove(value);
1423        } else if (name.equals("protocolPerformed")) {
1424          this.protocolPerformed = null;
1425        } else if (name.equals("regionsStudied")) {
1426          this.getRegionsStudied().remove(value);
1427        } else if (name.equals("regionsCalled")) {
1428          this.getRegionsCalled().remove(value);
1429        } else if (name.equals("input")) {
1430          this.getInput().remove((GenomicStudyAnalysisInputComponent) value);
1431        } else if (name.equals("output")) {
1432          this.getOutput().remove((GenomicStudyAnalysisOutputComponent) value);
1433        } else if (name.equals("performer")) {
1434          this.getPerformer().remove((GenomicStudyAnalysisPerformerComponent) value);
1435        } else if (name.equals("device")) {
1436          this.getDevice().remove((GenomicStudyAnalysisDeviceComponent) value);
1437        } else
1438          super.removeChild(name, value);
1439        
1440      }
1441
1442      @Override
1443      public Base makeProperty(int hash, String name) throws FHIRException {
1444        switch (hash) {
1445        case -1618432855:  return addIdentifier(); 
1446        case -722961477:  return addMethodType(); 
1447        case -2131902710:  return addChangeType(); 
1448        case 1061239735:  return getGenomeBuild();
1449        case 8911915:  return getInstantiatesCanonicalElement();
1450        case -1926393373:  return getInstantiatesUriElement();
1451        case 110371416:  return getTitleElement();
1452        case 97604824:  return addFocus(); 
1453        case -2132868344:  return addSpecimen(); 
1454        case 3076014:  return getDateElement();
1455        case 3387378:  return addNote(); 
1456        case -1565516792:  return getProtocolPerformed();
1457        case 391791385:  return addRegionsStudied(); 
1458        case -2125803428:  return addRegionsCalled(); 
1459        case 100358090:  return addInput(); 
1460        case -1005512447:  return addOutput(); 
1461        case 481140686:  return addPerformer(); 
1462        case -1335157162:  return addDevice(); 
1463        default: return super.makeProperty(hash, name);
1464        }
1465
1466      }
1467
1468      @Override
1469      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1470        switch (hash) {
1471        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1472        case -722961477: /*methodType*/ return new String[] {"CodeableConcept"};
1473        case -2131902710: /*changeType*/ return new String[] {"CodeableConcept"};
1474        case 1061239735: /*genomeBuild*/ return new String[] {"CodeableConcept"};
1475        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
1476        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
1477        case 110371416: /*title*/ return new String[] {"string"};
1478        case 97604824: /*focus*/ return new String[] {"Reference"};
1479        case -2132868344: /*specimen*/ return new String[] {"Reference"};
1480        case 3076014: /*date*/ return new String[] {"dateTime"};
1481        case 3387378: /*note*/ return new String[] {"Annotation"};
1482        case -1565516792: /*protocolPerformed*/ return new String[] {"Reference"};
1483        case 391791385: /*regionsStudied*/ return new String[] {"Reference"};
1484        case -2125803428: /*regionsCalled*/ return new String[] {"Reference"};
1485        case 100358090: /*input*/ return new String[] {};
1486        case -1005512447: /*output*/ return new String[] {};
1487        case 481140686: /*performer*/ return new String[] {};
1488        case -1335157162: /*device*/ return new String[] {};
1489        default: return super.getTypesForProperty(hash, name);
1490        }
1491
1492      }
1493
1494      @Override
1495      public Base addChild(String name) throws FHIRException {
1496        if (name.equals("identifier")) {
1497          return addIdentifier();
1498        }
1499        else if (name.equals("methodType")) {
1500          return addMethodType();
1501        }
1502        else if (name.equals("changeType")) {
1503          return addChangeType();
1504        }
1505        else if (name.equals("genomeBuild")) {
1506          this.genomeBuild = new CodeableConcept();
1507          return this.genomeBuild;
1508        }
1509        else if (name.equals("instantiatesCanonical")) {
1510          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.analysis.instantiatesCanonical");
1511        }
1512        else if (name.equals("instantiatesUri")) {
1513          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.analysis.instantiatesUri");
1514        }
1515        else if (name.equals("title")) {
1516          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.analysis.title");
1517        }
1518        else if (name.equals("focus")) {
1519          return addFocus();
1520        }
1521        else if (name.equals("specimen")) {
1522          return addSpecimen();
1523        }
1524        else if (name.equals("date")) {
1525          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.analysis.date");
1526        }
1527        else if (name.equals("note")) {
1528          return addNote();
1529        }
1530        else if (name.equals("protocolPerformed")) {
1531          this.protocolPerformed = new Reference();
1532          return this.protocolPerformed;
1533        }
1534        else if (name.equals("regionsStudied")) {
1535          return addRegionsStudied();
1536        }
1537        else if (name.equals("regionsCalled")) {
1538          return addRegionsCalled();
1539        }
1540        else if (name.equals("input")) {
1541          return addInput();
1542        }
1543        else if (name.equals("output")) {
1544          return addOutput();
1545        }
1546        else if (name.equals("performer")) {
1547          return addPerformer();
1548        }
1549        else if (name.equals("device")) {
1550          return addDevice();
1551        }
1552        else
1553          return super.addChild(name);
1554      }
1555
1556      public GenomicStudyAnalysisComponent copy() {
1557        GenomicStudyAnalysisComponent dst = new GenomicStudyAnalysisComponent();
1558        copyValues(dst);
1559        return dst;
1560      }
1561
1562      public void copyValues(GenomicStudyAnalysisComponent dst) {
1563        super.copyValues(dst);
1564        if (identifier != null) {
1565          dst.identifier = new ArrayList<Identifier>();
1566          for (Identifier i : identifier)
1567            dst.identifier.add(i.copy());
1568        };
1569        if (methodType != null) {
1570          dst.methodType = new ArrayList<CodeableConcept>();
1571          for (CodeableConcept i : methodType)
1572            dst.methodType.add(i.copy());
1573        };
1574        if (changeType != null) {
1575          dst.changeType = new ArrayList<CodeableConcept>();
1576          for (CodeableConcept i : changeType)
1577            dst.changeType.add(i.copy());
1578        };
1579        dst.genomeBuild = genomeBuild == null ? null : genomeBuild.copy();
1580        dst.instantiatesCanonical = instantiatesCanonical == null ? null : instantiatesCanonical.copy();
1581        dst.instantiatesUri = instantiatesUri == null ? null : instantiatesUri.copy();
1582        dst.title = title == null ? null : title.copy();
1583        if (focus != null) {
1584          dst.focus = new ArrayList<Reference>();
1585          for (Reference i : focus)
1586            dst.focus.add(i.copy());
1587        };
1588        if (specimen != null) {
1589          dst.specimen = new ArrayList<Reference>();
1590          for (Reference i : specimen)
1591            dst.specimen.add(i.copy());
1592        };
1593        dst.date = date == null ? null : date.copy();
1594        if (note != null) {
1595          dst.note = new ArrayList<Annotation>();
1596          for (Annotation i : note)
1597            dst.note.add(i.copy());
1598        };
1599        dst.protocolPerformed = protocolPerformed == null ? null : protocolPerformed.copy();
1600        if (regionsStudied != null) {
1601          dst.regionsStudied = new ArrayList<Reference>();
1602          for (Reference i : regionsStudied)
1603            dst.regionsStudied.add(i.copy());
1604        };
1605        if (regionsCalled != null) {
1606          dst.regionsCalled = new ArrayList<Reference>();
1607          for (Reference i : regionsCalled)
1608            dst.regionsCalled.add(i.copy());
1609        };
1610        if (input != null) {
1611          dst.input = new ArrayList<GenomicStudyAnalysisInputComponent>();
1612          for (GenomicStudyAnalysisInputComponent i : input)
1613            dst.input.add(i.copy());
1614        };
1615        if (output != null) {
1616          dst.output = new ArrayList<GenomicStudyAnalysisOutputComponent>();
1617          for (GenomicStudyAnalysisOutputComponent i : output)
1618            dst.output.add(i.copy());
1619        };
1620        if (performer != null) {
1621          dst.performer = new ArrayList<GenomicStudyAnalysisPerformerComponent>();
1622          for (GenomicStudyAnalysisPerformerComponent i : performer)
1623            dst.performer.add(i.copy());
1624        };
1625        if (device != null) {
1626          dst.device = new ArrayList<GenomicStudyAnalysisDeviceComponent>();
1627          for (GenomicStudyAnalysisDeviceComponent i : device)
1628            dst.device.add(i.copy());
1629        };
1630      }
1631
1632      @Override
1633      public boolean equalsDeep(Base other_) {
1634        if (!super.equalsDeep(other_))
1635          return false;
1636        if (!(other_ instanceof GenomicStudyAnalysisComponent))
1637          return false;
1638        GenomicStudyAnalysisComponent o = (GenomicStudyAnalysisComponent) other_;
1639        return compareDeep(identifier, o.identifier, true) && compareDeep(methodType, o.methodType, true)
1640           && compareDeep(changeType, o.changeType, true) && compareDeep(genomeBuild, o.genomeBuild, true)
1641           && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true) && compareDeep(instantiatesUri, o.instantiatesUri, true)
1642           && compareDeep(title, o.title, true) && compareDeep(focus, o.focus, true) && compareDeep(specimen, o.specimen, true)
1643           && compareDeep(date, o.date, true) && compareDeep(note, o.note, true) && compareDeep(protocolPerformed, o.protocolPerformed, true)
1644           && compareDeep(regionsStudied, o.regionsStudied, true) && compareDeep(regionsCalled, o.regionsCalled, true)
1645           && compareDeep(input, o.input, true) && compareDeep(output, o.output, true) && compareDeep(performer, o.performer, true)
1646           && compareDeep(device, o.device, true);
1647      }
1648
1649      @Override
1650      public boolean equalsShallow(Base other_) {
1651        if (!super.equalsShallow(other_))
1652          return false;
1653        if (!(other_ instanceof GenomicStudyAnalysisComponent))
1654          return false;
1655        GenomicStudyAnalysisComponent o = (GenomicStudyAnalysisComponent) other_;
1656        return compareValues(instantiatesCanonical, o.instantiatesCanonical, true) && compareValues(instantiatesUri, o.instantiatesUri, true)
1657           && compareValues(title, o.title, true) && compareValues(date, o.date, true);
1658      }
1659
1660      public boolean isEmpty() {
1661        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, methodType, changeType
1662          , genomeBuild, instantiatesCanonical, instantiatesUri, title, focus, specimen, date
1663          , note, protocolPerformed, regionsStudied, regionsCalled, input, output, performer
1664          , device);
1665      }
1666
1667  public String fhirType() {
1668    return "GenomicStudy.analysis";
1669
1670  }
1671
1672  }
1673
1674    @Block()
1675    public static class GenomicStudyAnalysisInputComponent extends BackboneElement implements IBaseBackboneElement {
1676        /**
1677         * File containing input data.
1678         */
1679        @Child(name = "file", type = {DocumentReference.class}, order=1, min=0, max=1, modifier=false, summary=true)
1680        @Description(shortDefinition="File containing input data", formalDefinition="File containing input data." )
1681        protected Reference file;
1682
1683        /**
1684         * Type of input data, e.g., BAM, CRAM, or FASTA.
1685         */
1686        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1687        @Description(shortDefinition="Type of input data (e.g., BAM, CRAM, or FASTA)", formalDefinition="Type of input data, e.g., BAM, CRAM, or FASTA." )
1688        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/genomicstudy-dataformat")
1689        protected CodeableConcept type;
1690
1691        /**
1692         * The analysis event or other GenomicStudy that generated this input file.
1693         */
1694        @Child(name = "generatedBy", type = {Identifier.class, GenomicStudy.class}, order=3, min=0, max=1, modifier=false, summary=false)
1695        @Description(shortDefinition="The analysis event or other GenomicStudy that generated this input file", formalDefinition="The analysis event or other GenomicStudy that generated this input file." )
1696        protected DataType generatedBy;
1697
1698        private static final long serialVersionUID = -650883036L;
1699
1700    /**
1701     * Constructor
1702     */
1703      public GenomicStudyAnalysisInputComponent() {
1704        super();
1705      }
1706
1707        /**
1708         * @return {@link #file} (File containing input data.)
1709         */
1710        public Reference getFile() { 
1711          if (this.file == null)
1712            if (Configuration.errorOnAutoCreate())
1713              throw new Error("Attempt to auto-create GenomicStudyAnalysisInputComponent.file");
1714            else if (Configuration.doAutoCreate())
1715              this.file = new Reference(); // cc
1716          return this.file;
1717        }
1718
1719        public boolean hasFile() { 
1720          return this.file != null && !this.file.isEmpty();
1721        }
1722
1723        /**
1724         * @param value {@link #file} (File containing input data.)
1725         */
1726        public GenomicStudyAnalysisInputComponent setFile(Reference value) { 
1727          this.file = value;
1728          return this;
1729        }
1730
1731        /**
1732         * @return {@link #type} (Type of input data, e.g., BAM, CRAM, or FASTA.)
1733         */
1734        public CodeableConcept getType() { 
1735          if (this.type == null)
1736            if (Configuration.errorOnAutoCreate())
1737              throw new Error("Attempt to auto-create GenomicStudyAnalysisInputComponent.type");
1738            else if (Configuration.doAutoCreate())
1739              this.type = new CodeableConcept(); // cc
1740          return this.type;
1741        }
1742
1743        public boolean hasType() { 
1744          return this.type != null && !this.type.isEmpty();
1745        }
1746
1747        /**
1748         * @param value {@link #type} (Type of input data, e.g., BAM, CRAM, or FASTA.)
1749         */
1750        public GenomicStudyAnalysisInputComponent setType(CodeableConcept value) { 
1751          this.type = value;
1752          return this;
1753        }
1754
1755        /**
1756         * @return {@link #generatedBy} (The analysis event or other GenomicStudy that generated this input file.)
1757         */
1758        public DataType getGeneratedBy() { 
1759          return this.generatedBy;
1760        }
1761
1762        /**
1763         * @return {@link #generatedBy} (The analysis event or other GenomicStudy that generated this input file.)
1764         */
1765        public Identifier getGeneratedByIdentifier() throws FHIRException { 
1766          if (this.generatedBy == null)
1767            this.generatedBy = new Identifier();
1768          if (!(this.generatedBy instanceof Identifier))
1769            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.generatedBy.getClass().getName()+" was encountered");
1770          return (Identifier) this.generatedBy;
1771        }
1772
1773        public boolean hasGeneratedByIdentifier() { 
1774          return this != null && this.generatedBy instanceof Identifier;
1775        }
1776
1777        /**
1778         * @return {@link #generatedBy} (The analysis event or other GenomicStudy that generated this input file.)
1779         */
1780        public Reference getGeneratedByReference() throws FHIRException { 
1781          if (this.generatedBy == null)
1782            this.generatedBy = new Reference();
1783          if (!(this.generatedBy instanceof Reference))
1784            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.generatedBy.getClass().getName()+" was encountered");
1785          return (Reference) this.generatedBy;
1786        }
1787
1788        public boolean hasGeneratedByReference() { 
1789          return this != null && this.generatedBy instanceof Reference;
1790        }
1791
1792        public boolean hasGeneratedBy() { 
1793          return this.generatedBy != null && !this.generatedBy.isEmpty();
1794        }
1795
1796        /**
1797         * @param value {@link #generatedBy} (The analysis event or other GenomicStudy that generated this input file.)
1798         */
1799        public GenomicStudyAnalysisInputComponent setGeneratedBy(DataType value) { 
1800          if (value != null && !(value instanceof Identifier || value instanceof Reference))
1801            throw new FHIRException("Not the right type for GenomicStudy.analysis.input.generatedBy[x]: "+value.fhirType());
1802          this.generatedBy = value;
1803          return this;
1804        }
1805
1806        protected void listChildren(List<Property> children) {
1807          super.listChildren(children);
1808          children.add(new Property("file", "Reference(DocumentReference)", "File containing input data.", 0, 1, file));
1809          children.add(new Property("type", "CodeableConcept", "Type of input data, e.g., BAM, CRAM, or FASTA.", 0, 1, type));
1810          children.add(new Property("generatedBy[x]", "Identifier|Reference(GenomicStudy)", "The analysis event or other GenomicStudy that generated this input file.", 0, 1, generatedBy));
1811        }
1812
1813        @Override
1814        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1815          switch (_hash) {
1816          case 3143036: /*file*/  return new Property("file", "Reference(DocumentReference)", "File containing input data.", 0, 1, file);
1817          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of input data, e.g., BAM, CRAM, or FASTA.", 0, 1, type);
1818          case -1669563270: /*generatedBy[x]*/  return new Property("generatedBy[x]", "Identifier|Reference(GenomicStudy)", "The analysis event or other GenomicStudy that generated this input file.", 0, 1, generatedBy);
1819          case 886733382: /*generatedBy*/  return new Property("generatedBy[x]", "Identifier|Reference(GenomicStudy)", "The analysis event or other GenomicStudy that generated this input file.", 0, 1, generatedBy);
1820          case 913138575: /*generatedByIdentifier*/  return new Property("generatedBy[x]", "Identifier", "The analysis event or other GenomicStudy that generated this input file.", 0, 1, generatedBy);
1821          case -1397681243: /*generatedByReference*/  return new Property("generatedBy[x]", "Reference(GenomicStudy)", "The analysis event or other GenomicStudy that generated this input file.", 0, 1, generatedBy);
1822          default: return super.getNamedProperty(_hash, _name, _checkValid);
1823          }
1824
1825        }
1826
1827      @Override
1828      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1829        switch (hash) {
1830        case 3143036: /*file*/ return this.file == null ? new Base[0] : new Base[] {this.file}; // Reference
1831        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1832        case 886733382: /*generatedBy*/ return this.generatedBy == null ? new Base[0] : new Base[] {this.generatedBy}; // DataType
1833        default: return super.getProperty(hash, name, checkValid);
1834        }
1835
1836      }
1837
1838      @Override
1839      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1840        switch (hash) {
1841        case 3143036: // file
1842          this.file = TypeConvertor.castToReference(value); // Reference
1843          return value;
1844        case 3575610: // type
1845          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1846          return value;
1847        case 886733382: // generatedBy
1848          this.generatedBy = TypeConvertor.castToType(value); // DataType
1849          return value;
1850        default: return super.setProperty(hash, name, value);
1851        }
1852
1853      }
1854
1855      @Override
1856      public Base setProperty(String name, Base value) throws FHIRException {
1857        if (name.equals("file")) {
1858          this.file = TypeConvertor.castToReference(value); // Reference
1859        } else if (name.equals("type")) {
1860          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1861        } else if (name.equals("generatedBy[x]")) {
1862          this.generatedBy = TypeConvertor.castToType(value); // DataType
1863        } else
1864          return super.setProperty(name, value);
1865        return value;
1866      }
1867
1868  @Override
1869  public void removeChild(String name, Base value) throws FHIRException {
1870        if (name.equals("file")) {
1871          this.file = null;
1872        } else if (name.equals("type")) {
1873          this.type = null;
1874        } else if (name.equals("generatedBy[x]")) {
1875          this.generatedBy = null;
1876        } else
1877          super.removeChild(name, value);
1878        
1879      }
1880
1881      @Override
1882      public Base makeProperty(int hash, String name) throws FHIRException {
1883        switch (hash) {
1884        case 3143036:  return getFile();
1885        case 3575610:  return getType();
1886        case -1669563270:  return getGeneratedBy();
1887        case 886733382:  return getGeneratedBy();
1888        default: return super.makeProperty(hash, name);
1889        }
1890
1891      }
1892
1893      @Override
1894      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1895        switch (hash) {
1896        case 3143036: /*file*/ return new String[] {"Reference"};
1897        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1898        case 886733382: /*generatedBy*/ return new String[] {"Identifier", "Reference"};
1899        default: return super.getTypesForProperty(hash, name);
1900        }
1901
1902      }
1903
1904      @Override
1905      public Base addChild(String name) throws FHIRException {
1906        if (name.equals("file")) {
1907          this.file = new Reference();
1908          return this.file;
1909        }
1910        else if (name.equals("type")) {
1911          this.type = new CodeableConcept();
1912          return this.type;
1913        }
1914        else if (name.equals("generatedByIdentifier")) {
1915          this.generatedBy = new Identifier();
1916          return this.generatedBy;
1917        }
1918        else if (name.equals("generatedByReference")) {
1919          this.generatedBy = new Reference();
1920          return this.generatedBy;
1921        }
1922        else
1923          return super.addChild(name);
1924      }
1925
1926      public GenomicStudyAnalysisInputComponent copy() {
1927        GenomicStudyAnalysisInputComponent dst = new GenomicStudyAnalysisInputComponent();
1928        copyValues(dst);
1929        return dst;
1930      }
1931
1932      public void copyValues(GenomicStudyAnalysisInputComponent dst) {
1933        super.copyValues(dst);
1934        dst.file = file == null ? null : file.copy();
1935        dst.type = type == null ? null : type.copy();
1936        dst.generatedBy = generatedBy == null ? null : generatedBy.copy();
1937      }
1938
1939      @Override
1940      public boolean equalsDeep(Base other_) {
1941        if (!super.equalsDeep(other_))
1942          return false;
1943        if (!(other_ instanceof GenomicStudyAnalysisInputComponent))
1944          return false;
1945        GenomicStudyAnalysisInputComponent o = (GenomicStudyAnalysisInputComponent) other_;
1946        return compareDeep(file, o.file, true) && compareDeep(type, o.type, true) && compareDeep(generatedBy, o.generatedBy, true)
1947          ;
1948      }
1949
1950      @Override
1951      public boolean equalsShallow(Base other_) {
1952        if (!super.equalsShallow(other_))
1953          return false;
1954        if (!(other_ instanceof GenomicStudyAnalysisInputComponent))
1955          return false;
1956        GenomicStudyAnalysisInputComponent o = (GenomicStudyAnalysisInputComponent) other_;
1957        return true;
1958      }
1959
1960      public boolean isEmpty() {
1961        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(file, type, generatedBy
1962          );
1963      }
1964
1965  public String fhirType() {
1966    return "GenomicStudy.analysis.input";
1967
1968  }
1969
1970  }
1971
1972    @Block()
1973    public static class GenomicStudyAnalysisOutputComponent extends BackboneElement implements IBaseBackboneElement {
1974        /**
1975         * File containing output data.
1976         */
1977        @Child(name = "file", type = {DocumentReference.class}, order=1, min=0, max=1, modifier=false, summary=true)
1978        @Description(shortDefinition="File containing output data", formalDefinition="File containing output data." )
1979        protected Reference file;
1980
1981        /**
1982         * Type of output data, e.g., VCF, MAF, or BAM.
1983         */
1984        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1985        @Description(shortDefinition="Type of output data (e.g., VCF, MAF, or BAM)", formalDefinition="Type of output data, e.g., VCF, MAF, or BAM." )
1986        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/genomicstudy-dataformat")
1987        protected CodeableConcept type;
1988
1989        private static final long serialVersionUID = -2075265800L;
1990
1991    /**
1992     * Constructor
1993     */
1994      public GenomicStudyAnalysisOutputComponent() {
1995        super();
1996      }
1997
1998        /**
1999         * @return {@link #file} (File containing output data.)
2000         */
2001        public Reference getFile() { 
2002          if (this.file == null)
2003            if (Configuration.errorOnAutoCreate())
2004              throw new Error("Attempt to auto-create GenomicStudyAnalysisOutputComponent.file");
2005            else if (Configuration.doAutoCreate())
2006              this.file = new Reference(); // cc
2007          return this.file;
2008        }
2009
2010        public boolean hasFile() { 
2011          return this.file != null && !this.file.isEmpty();
2012        }
2013
2014        /**
2015         * @param value {@link #file} (File containing output data.)
2016         */
2017        public GenomicStudyAnalysisOutputComponent setFile(Reference value) { 
2018          this.file = value;
2019          return this;
2020        }
2021
2022        /**
2023         * @return {@link #type} (Type of output data, e.g., VCF, MAF, or BAM.)
2024         */
2025        public CodeableConcept getType() { 
2026          if (this.type == null)
2027            if (Configuration.errorOnAutoCreate())
2028              throw new Error("Attempt to auto-create GenomicStudyAnalysisOutputComponent.type");
2029            else if (Configuration.doAutoCreate())
2030              this.type = new CodeableConcept(); // cc
2031          return this.type;
2032        }
2033
2034        public boolean hasType() { 
2035          return this.type != null && !this.type.isEmpty();
2036        }
2037
2038        /**
2039         * @param value {@link #type} (Type of output data, e.g., VCF, MAF, or BAM.)
2040         */
2041        public GenomicStudyAnalysisOutputComponent setType(CodeableConcept value) { 
2042          this.type = value;
2043          return this;
2044        }
2045
2046        protected void listChildren(List<Property> children) {
2047          super.listChildren(children);
2048          children.add(new Property("file", "Reference(DocumentReference)", "File containing output data.", 0, 1, file));
2049          children.add(new Property("type", "CodeableConcept", "Type of output data, e.g., VCF, MAF, or BAM.", 0, 1, type));
2050        }
2051
2052        @Override
2053        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2054          switch (_hash) {
2055          case 3143036: /*file*/  return new Property("file", "Reference(DocumentReference)", "File containing output data.", 0, 1, file);
2056          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of output data, e.g., VCF, MAF, or BAM.", 0, 1, type);
2057          default: return super.getNamedProperty(_hash, _name, _checkValid);
2058          }
2059
2060        }
2061
2062      @Override
2063      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2064        switch (hash) {
2065        case 3143036: /*file*/ return this.file == null ? new Base[0] : new Base[] {this.file}; // Reference
2066        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2067        default: return super.getProperty(hash, name, checkValid);
2068        }
2069
2070      }
2071
2072      @Override
2073      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2074        switch (hash) {
2075        case 3143036: // file
2076          this.file = TypeConvertor.castToReference(value); // Reference
2077          return value;
2078        case 3575610: // type
2079          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2080          return value;
2081        default: return super.setProperty(hash, name, value);
2082        }
2083
2084      }
2085
2086      @Override
2087      public Base setProperty(String name, Base value) throws FHIRException {
2088        if (name.equals("file")) {
2089          this.file = TypeConvertor.castToReference(value); // Reference
2090        } else if (name.equals("type")) {
2091          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2092        } else
2093          return super.setProperty(name, value);
2094        return value;
2095      }
2096
2097  @Override
2098  public void removeChild(String name, Base value) throws FHIRException {
2099        if (name.equals("file")) {
2100          this.file = null;
2101        } else if (name.equals("type")) {
2102          this.type = null;
2103        } else
2104          super.removeChild(name, value);
2105        
2106      }
2107
2108      @Override
2109      public Base makeProperty(int hash, String name) throws FHIRException {
2110        switch (hash) {
2111        case 3143036:  return getFile();
2112        case 3575610:  return getType();
2113        default: return super.makeProperty(hash, name);
2114        }
2115
2116      }
2117
2118      @Override
2119      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2120        switch (hash) {
2121        case 3143036: /*file*/ return new String[] {"Reference"};
2122        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2123        default: return super.getTypesForProperty(hash, name);
2124        }
2125
2126      }
2127
2128      @Override
2129      public Base addChild(String name) throws FHIRException {
2130        if (name.equals("file")) {
2131          this.file = new Reference();
2132          return this.file;
2133        }
2134        else if (name.equals("type")) {
2135          this.type = new CodeableConcept();
2136          return this.type;
2137        }
2138        else
2139          return super.addChild(name);
2140      }
2141
2142      public GenomicStudyAnalysisOutputComponent copy() {
2143        GenomicStudyAnalysisOutputComponent dst = new GenomicStudyAnalysisOutputComponent();
2144        copyValues(dst);
2145        return dst;
2146      }
2147
2148      public void copyValues(GenomicStudyAnalysisOutputComponent dst) {
2149        super.copyValues(dst);
2150        dst.file = file == null ? null : file.copy();
2151        dst.type = type == null ? null : type.copy();
2152      }
2153
2154      @Override
2155      public boolean equalsDeep(Base other_) {
2156        if (!super.equalsDeep(other_))
2157          return false;
2158        if (!(other_ instanceof GenomicStudyAnalysisOutputComponent))
2159          return false;
2160        GenomicStudyAnalysisOutputComponent o = (GenomicStudyAnalysisOutputComponent) other_;
2161        return compareDeep(file, o.file, true) && compareDeep(type, o.type, true);
2162      }
2163
2164      @Override
2165      public boolean equalsShallow(Base other_) {
2166        if (!super.equalsShallow(other_))
2167          return false;
2168        if (!(other_ instanceof GenomicStudyAnalysisOutputComponent))
2169          return false;
2170        GenomicStudyAnalysisOutputComponent o = (GenomicStudyAnalysisOutputComponent) other_;
2171        return true;
2172      }
2173
2174      public boolean isEmpty() {
2175        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(file, type);
2176      }
2177
2178  public String fhirType() {
2179    return "GenomicStudy.analysis.output";
2180
2181  }
2182
2183  }
2184
2185    @Block()
2186    public static class GenomicStudyAnalysisPerformerComponent extends BackboneElement implements IBaseBackboneElement {
2187        /**
2188         * The organization, healthcare professional, or others who participated in performing this analysis.
2189         */
2190        @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Organization.class, Device.class}, order=1, min=0, max=1, modifier=false, summary=false)
2191        @Description(shortDefinition="The organization, healthcare professional, or others who participated in performing this analysis", formalDefinition="The organization, healthcare professional, or others who participated in performing this analysis." )
2192        protected Reference actor;
2193
2194        /**
2195         * Role of the actor for this analysis.
2196         */
2197        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2198        @Description(shortDefinition="Role of the actor for this analysis", formalDefinition="Role of the actor for this analysis." )
2199        protected CodeableConcept role;
2200
2201        private static final long serialVersionUID = 827444743L;
2202
2203    /**
2204     * Constructor
2205     */
2206      public GenomicStudyAnalysisPerformerComponent() {
2207        super();
2208      }
2209
2210        /**
2211         * @return {@link #actor} (The organization, healthcare professional, or others who participated in performing this analysis.)
2212         */
2213        public Reference getActor() { 
2214          if (this.actor == null)
2215            if (Configuration.errorOnAutoCreate())
2216              throw new Error("Attempt to auto-create GenomicStudyAnalysisPerformerComponent.actor");
2217            else if (Configuration.doAutoCreate())
2218              this.actor = new Reference(); // cc
2219          return this.actor;
2220        }
2221
2222        public boolean hasActor() { 
2223          return this.actor != null && !this.actor.isEmpty();
2224        }
2225
2226        /**
2227         * @param value {@link #actor} (The organization, healthcare professional, or others who participated in performing this analysis.)
2228         */
2229        public GenomicStudyAnalysisPerformerComponent setActor(Reference value) { 
2230          this.actor = value;
2231          return this;
2232        }
2233
2234        /**
2235         * @return {@link #role} (Role of the actor for this analysis.)
2236         */
2237        public CodeableConcept getRole() { 
2238          if (this.role == null)
2239            if (Configuration.errorOnAutoCreate())
2240              throw new Error("Attempt to auto-create GenomicStudyAnalysisPerformerComponent.role");
2241            else if (Configuration.doAutoCreate())
2242              this.role = new CodeableConcept(); // cc
2243          return this.role;
2244        }
2245
2246        public boolean hasRole() { 
2247          return this.role != null && !this.role.isEmpty();
2248        }
2249
2250        /**
2251         * @param value {@link #role} (Role of the actor for this analysis.)
2252         */
2253        public GenomicStudyAnalysisPerformerComponent setRole(CodeableConcept value) { 
2254          this.role = value;
2255          return this;
2256        }
2257
2258        protected void listChildren(List<Property> children) {
2259          super.listChildren(children);
2260          children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|Device)", "The organization, healthcare professional, or others who participated in performing this analysis.", 0, 1, actor));
2261          children.add(new Property("role", "CodeableConcept", "Role of the actor for this analysis.", 0, 1, role));
2262        }
2263
2264        @Override
2265        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2266          switch (_hash) {
2267          case 92645877: /*actor*/  return new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|Device)", "The organization, healthcare professional, or others who participated in performing this analysis.", 0, 1, actor);
2268          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Role of the actor for this analysis.", 0, 1, role);
2269          default: return super.getNamedProperty(_hash, _name, _checkValid);
2270          }
2271
2272        }
2273
2274      @Override
2275      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2276        switch (hash) {
2277        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
2278        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
2279        default: return super.getProperty(hash, name, checkValid);
2280        }
2281
2282      }
2283
2284      @Override
2285      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2286        switch (hash) {
2287        case 92645877: // actor
2288          this.actor = TypeConvertor.castToReference(value); // Reference
2289          return value;
2290        case 3506294: // role
2291          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2292          return value;
2293        default: return super.setProperty(hash, name, value);
2294        }
2295
2296      }
2297
2298      @Override
2299      public Base setProperty(String name, Base value) throws FHIRException {
2300        if (name.equals("actor")) {
2301          this.actor = TypeConvertor.castToReference(value); // Reference
2302        } else if (name.equals("role")) {
2303          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2304        } else
2305          return super.setProperty(name, value);
2306        return value;
2307      }
2308
2309  @Override
2310  public void removeChild(String name, Base value) throws FHIRException {
2311        if (name.equals("actor")) {
2312          this.actor = null;
2313        } else if (name.equals("role")) {
2314          this.role = null;
2315        } else
2316          super.removeChild(name, value);
2317        
2318      }
2319
2320      @Override
2321      public Base makeProperty(int hash, String name) throws FHIRException {
2322        switch (hash) {
2323        case 92645877:  return getActor();
2324        case 3506294:  return getRole();
2325        default: return super.makeProperty(hash, name);
2326        }
2327
2328      }
2329
2330      @Override
2331      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2332        switch (hash) {
2333        case 92645877: /*actor*/ return new String[] {"Reference"};
2334        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
2335        default: return super.getTypesForProperty(hash, name);
2336        }
2337
2338      }
2339
2340      @Override
2341      public Base addChild(String name) throws FHIRException {
2342        if (name.equals("actor")) {
2343          this.actor = new Reference();
2344          return this.actor;
2345        }
2346        else if (name.equals("role")) {
2347          this.role = new CodeableConcept();
2348          return this.role;
2349        }
2350        else
2351          return super.addChild(name);
2352      }
2353
2354      public GenomicStudyAnalysisPerformerComponent copy() {
2355        GenomicStudyAnalysisPerformerComponent dst = new GenomicStudyAnalysisPerformerComponent();
2356        copyValues(dst);
2357        return dst;
2358      }
2359
2360      public void copyValues(GenomicStudyAnalysisPerformerComponent dst) {
2361        super.copyValues(dst);
2362        dst.actor = actor == null ? null : actor.copy();
2363        dst.role = role == null ? null : role.copy();
2364      }
2365
2366      @Override
2367      public boolean equalsDeep(Base other_) {
2368        if (!super.equalsDeep(other_))
2369          return false;
2370        if (!(other_ instanceof GenomicStudyAnalysisPerformerComponent))
2371          return false;
2372        GenomicStudyAnalysisPerformerComponent o = (GenomicStudyAnalysisPerformerComponent) other_;
2373        return compareDeep(actor, o.actor, true) && compareDeep(role, o.role, true);
2374      }
2375
2376      @Override
2377      public boolean equalsShallow(Base other_) {
2378        if (!super.equalsShallow(other_))
2379          return false;
2380        if (!(other_ instanceof GenomicStudyAnalysisPerformerComponent))
2381          return false;
2382        GenomicStudyAnalysisPerformerComponent o = (GenomicStudyAnalysisPerformerComponent) other_;
2383        return true;
2384      }
2385
2386      public boolean isEmpty() {
2387        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(actor, role);
2388      }
2389
2390  public String fhirType() {
2391    return "GenomicStudy.analysis.performer";
2392
2393  }
2394
2395  }
2396
2397    @Block()
2398    public static class GenomicStudyAnalysisDeviceComponent extends BackboneElement implements IBaseBackboneElement {
2399        /**
2400         * Device used for the analysis.
2401         */
2402        @Child(name = "device", type = {Device.class}, order=1, min=0, max=1, modifier=false, summary=false)
2403        @Description(shortDefinition="Device used for the analysis", formalDefinition="Device used for the analysis." )
2404        protected Reference device;
2405
2406        /**
2407         * Specific function for the device used for the analysis.
2408         */
2409        @Child(name = "function", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2410        @Description(shortDefinition="Specific function for the device used for the analysis", formalDefinition="Specific function for the device used for the analysis." )
2411        protected CodeableConcept function;
2412
2413        private static final long serialVersionUID = 1643933108L;
2414
2415    /**
2416     * Constructor
2417     */
2418      public GenomicStudyAnalysisDeviceComponent() {
2419        super();
2420      }
2421
2422        /**
2423         * @return {@link #device} (Device used for the analysis.)
2424         */
2425        public Reference getDevice() { 
2426          if (this.device == null)
2427            if (Configuration.errorOnAutoCreate())
2428              throw new Error("Attempt to auto-create GenomicStudyAnalysisDeviceComponent.device");
2429            else if (Configuration.doAutoCreate())
2430              this.device = new Reference(); // cc
2431          return this.device;
2432        }
2433
2434        public boolean hasDevice() { 
2435          return this.device != null && !this.device.isEmpty();
2436        }
2437
2438        /**
2439         * @param value {@link #device} (Device used for the analysis.)
2440         */
2441        public GenomicStudyAnalysisDeviceComponent setDevice(Reference value) { 
2442          this.device = value;
2443          return this;
2444        }
2445
2446        /**
2447         * @return {@link #function} (Specific function for the device used for the analysis.)
2448         */
2449        public CodeableConcept getFunction() { 
2450          if (this.function == null)
2451            if (Configuration.errorOnAutoCreate())
2452              throw new Error("Attempt to auto-create GenomicStudyAnalysisDeviceComponent.function");
2453            else if (Configuration.doAutoCreate())
2454              this.function = new CodeableConcept(); // cc
2455          return this.function;
2456        }
2457
2458        public boolean hasFunction() { 
2459          return this.function != null && !this.function.isEmpty();
2460        }
2461
2462        /**
2463         * @param value {@link #function} (Specific function for the device used for the analysis.)
2464         */
2465        public GenomicStudyAnalysisDeviceComponent setFunction(CodeableConcept value) { 
2466          this.function = value;
2467          return this;
2468        }
2469
2470        protected void listChildren(List<Property> children) {
2471          super.listChildren(children);
2472          children.add(new Property("device", "Reference(Device)", "Device used for the analysis.", 0, 1, device));
2473          children.add(new Property("function", "CodeableConcept", "Specific function for the device used for the analysis.", 0, 1, function));
2474        }
2475
2476        @Override
2477        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2478          switch (_hash) {
2479          case -1335157162: /*device*/  return new Property("device", "Reference(Device)", "Device used for the analysis.", 0, 1, device);
2480          case 1380938712: /*function*/  return new Property("function", "CodeableConcept", "Specific function for the device used for the analysis.", 0, 1, function);
2481          default: return super.getNamedProperty(_hash, _name, _checkValid);
2482          }
2483
2484        }
2485
2486      @Override
2487      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2488        switch (hash) {
2489        case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference
2490        case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept
2491        default: return super.getProperty(hash, name, checkValid);
2492        }
2493
2494      }
2495
2496      @Override
2497      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2498        switch (hash) {
2499        case -1335157162: // device
2500          this.device = TypeConvertor.castToReference(value); // Reference
2501          return value;
2502        case 1380938712: // function
2503          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2504          return value;
2505        default: return super.setProperty(hash, name, value);
2506        }
2507
2508      }
2509
2510      @Override
2511      public Base setProperty(String name, Base value) throws FHIRException {
2512        if (name.equals("device")) {
2513          this.device = TypeConvertor.castToReference(value); // Reference
2514        } else if (name.equals("function")) {
2515          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2516        } else
2517          return super.setProperty(name, value);
2518        return value;
2519      }
2520
2521  @Override
2522  public void removeChild(String name, Base value) throws FHIRException {
2523        if (name.equals("device")) {
2524          this.device = null;
2525        } else if (name.equals("function")) {
2526          this.function = null;
2527        } else
2528          super.removeChild(name, value);
2529        
2530      }
2531
2532      @Override
2533      public Base makeProperty(int hash, String name) throws FHIRException {
2534        switch (hash) {
2535        case -1335157162:  return getDevice();
2536        case 1380938712:  return getFunction();
2537        default: return super.makeProperty(hash, name);
2538        }
2539
2540      }
2541
2542      @Override
2543      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2544        switch (hash) {
2545        case -1335157162: /*device*/ return new String[] {"Reference"};
2546        case 1380938712: /*function*/ return new String[] {"CodeableConcept"};
2547        default: return super.getTypesForProperty(hash, name);
2548        }
2549
2550      }
2551
2552      @Override
2553      public Base addChild(String name) throws FHIRException {
2554        if (name.equals("device")) {
2555          this.device = new Reference();
2556          return this.device;
2557        }
2558        else if (name.equals("function")) {
2559          this.function = new CodeableConcept();
2560          return this.function;
2561        }
2562        else
2563          return super.addChild(name);
2564      }
2565
2566      public GenomicStudyAnalysisDeviceComponent copy() {
2567        GenomicStudyAnalysisDeviceComponent dst = new GenomicStudyAnalysisDeviceComponent();
2568        copyValues(dst);
2569        return dst;
2570      }
2571
2572      public void copyValues(GenomicStudyAnalysisDeviceComponent dst) {
2573        super.copyValues(dst);
2574        dst.device = device == null ? null : device.copy();
2575        dst.function = function == null ? null : function.copy();
2576      }
2577
2578      @Override
2579      public boolean equalsDeep(Base other_) {
2580        if (!super.equalsDeep(other_))
2581          return false;
2582        if (!(other_ instanceof GenomicStudyAnalysisDeviceComponent))
2583          return false;
2584        GenomicStudyAnalysisDeviceComponent o = (GenomicStudyAnalysisDeviceComponent) other_;
2585        return compareDeep(device, o.device, true) && compareDeep(function, o.function, true);
2586      }
2587
2588      @Override
2589      public boolean equalsShallow(Base other_) {
2590        if (!super.equalsShallow(other_))
2591          return false;
2592        if (!(other_ instanceof GenomicStudyAnalysisDeviceComponent))
2593          return false;
2594        GenomicStudyAnalysisDeviceComponent o = (GenomicStudyAnalysisDeviceComponent) other_;
2595        return true;
2596      }
2597
2598      public boolean isEmpty() {
2599        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(device, function);
2600      }
2601
2602  public String fhirType() {
2603    return "GenomicStudy.analysis.device";
2604
2605  }
2606
2607  }
2608
2609    /**
2610     * Identifiers for this genomic study.
2611     */
2612    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2613    @Description(shortDefinition="Identifiers for this genomic study", formalDefinition="Identifiers for this genomic study." )
2614    protected List<Identifier> identifier;
2615
2616    /**
2617     * The status of the genomic study.
2618     */
2619    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
2620    @Description(shortDefinition="registered | available | cancelled | entered-in-error | unknown", formalDefinition="The status of the genomic study." )
2621    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/genomicstudy-status")
2622    protected Enumeration<GenomicStudyStatus> status;
2623
2624    /**
2625     * The type of the study, e.g., Familial variant segregation, Functional variation detection, or Gene expression profiling.
2626     */
2627    @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2628    @Description(shortDefinition="The type of the study (e.g., Familial variant segregation, Functional variation detection, or Gene expression profiling)", formalDefinition="The type of the study, e.g., Familial variant segregation, Functional variation detection, or Gene expression profiling." )
2629    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/genomicstudy-type")
2630    protected List<CodeableConcept> type;
2631
2632    /**
2633     * The primary subject of the genomic study.
2634     */
2635    @Child(name = "subject", type = {Patient.class, Group.class, Substance.class, BiologicallyDerivedProduct.class, NutritionProduct.class}, order=3, min=1, max=1, modifier=false, summary=true)
2636    @Description(shortDefinition="The primary subject of the genomic study", formalDefinition="The primary subject of the genomic study." )
2637    protected Reference subject;
2638
2639    /**
2640     * The healthcare event with which this genomics study is associated.
2641     */
2642    @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=true)
2643    @Description(shortDefinition="The healthcare event with which this genomics study is associated", formalDefinition="The healthcare event with which this genomics study is associated." )
2644    protected Reference encounter;
2645
2646    /**
2647     * When the genomic study was started.
2648     */
2649    @Child(name = "startDate", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2650    @Description(shortDefinition="When the genomic study was started", formalDefinition="When the genomic study was started." )
2651    protected DateTimeType startDate;
2652
2653    /**
2654     * Event resources that the genomic study is based on.
2655     */
2656    @Child(name = "basedOn", type = {ServiceRequest.class, Task.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2657    @Description(shortDefinition="Event resources that the genomic study is based on", formalDefinition="Event resources that the genomic study is based on." )
2658    protected List<Reference> basedOn;
2659
2660    /**
2661     * Healthcare professional who requested or referred the genomic study.
2662     */
2663    @Child(name = "referrer", type = {Practitioner.class, PractitionerRole.class}, order=7, min=0, max=1, modifier=false, summary=false)
2664    @Description(shortDefinition="Healthcare professional who requested or referred the genomic study", formalDefinition="Healthcare professional who requested or referred the genomic study." )
2665    protected Reference referrer;
2666
2667    /**
2668     * Healthcare professionals who interpreted the genomic study.
2669     */
2670    @Child(name = "interpreter", type = {Practitioner.class, PractitionerRole.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2671    @Description(shortDefinition="Healthcare professionals who interpreted the genomic study", formalDefinition="Healthcare professionals who interpreted the genomic study." )
2672    protected List<Reference> interpreter;
2673
2674    /**
2675     * Why the genomic study was performed.
2676     */
2677    @Child(name = "reason", type = {CodeableReference.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2678    @Description(shortDefinition="Why the genomic study was performed", formalDefinition="Why the genomic study was performed." )
2679    protected List<CodeableReference> reason;
2680
2681    /**
2682     * The defined protocol that describes the study.
2683     */
2684    @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=10, min=0, max=1, modifier=false, summary=false)
2685    @Description(shortDefinition="The defined protocol that describes the study", formalDefinition="The defined protocol that describes the study." )
2686    protected CanonicalType instantiatesCanonical;
2687
2688    /**
2689     * The URL pointing to an externally maintained protocol that describes the study.
2690     */
2691    @Child(name = "instantiatesUri", type = {UriType.class}, order=11, min=0, max=1, modifier=false, summary=false)
2692    @Description(shortDefinition="The URL pointing to an externally maintained protocol that describes the study", formalDefinition="The URL pointing to an externally maintained protocol that describes the study." )
2693    protected UriType instantiatesUri;
2694
2695    /**
2696     * Comments related to the genomic study.
2697     */
2698    @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2699    @Description(shortDefinition="Comments related to the genomic study", formalDefinition="Comments related to the genomic study." )
2700    protected List<Annotation> note;
2701
2702    /**
2703     * Description of the genomic study.
2704     */
2705    @Child(name = "description", type = {MarkdownType.class}, order=13, min=0, max=1, modifier=false, summary=false)
2706    @Description(shortDefinition="Description of the genomic study", formalDefinition="Description of the genomic study." )
2707    protected MarkdownType description;
2708
2709    /**
2710     * The details about a specific analysis that was performed in this GenomicStudy.
2711     */
2712    @Child(name = "analysis", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2713    @Description(shortDefinition="Genomic Analysis Event", formalDefinition="The details about a specific analysis that was performed in this GenomicStudy." )
2714    protected List<GenomicStudyAnalysisComponent> analysis;
2715
2716    private static final long serialVersionUID = 644053021L;
2717
2718  /**
2719   * Constructor
2720   */
2721    public GenomicStudy() {
2722      super();
2723    }
2724
2725  /**
2726   * Constructor
2727   */
2728    public GenomicStudy(GenomicStudyStatus status, Reference subject) {
2729      super();
2730      this.setStatus(status);
2731      this.setSubject(subject);
2732    }
2733
2734    /**
2735     * @return {@link #identifier} (Identifiers for this genomic study.)
2736     */
2737    public List<Identifier> getIdentifier() { 
2738      if (this.identifier == null)
2739        this.identifier = new ArrayList<Identifier>();
2740      return this.identifier;
2741    }
2742
2743    /**
2744     * @return Returns a reference to <code>this</code> for easy method chaining
2745     */
2746    public GenomicStudy setIdentifier(List<Identifier> theIdentifier) { 
2747      this.identifier = theIdentifier;
2748      return this;
2749    }
2750
2751    public boolean hasIdentifier() { 
2752      if (this.identifier == null)
2753        return false;
2754      for (Identifier item : this.identifier)
2755        if (!item.isEmpty())
2756          return true;
2757      return false;
2758    }
2759
2760    public Identifier addIdentifier() { //3
2761      Identifier t = new Identifier();
2762      if (this.identifier == null)
2763        this.identifier = new ArrayList<Identifier>();
2764      this.identifier.add(t);
2765      return t;
2766    }
2767
2768    public GenomicStudy addIdentifier(Identifier t) { //3
2769      if (t == null)
2770        return this;
2771      if (this.identifier == null)
2772        this.identifier = new ArrayList<Identifier>();
2773      this.identifier.add(t);
2774      return this;
2775    }
2776
2777    /**
2778     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2779     */
2780    public Identifier getIdentifierFirstRep() { 
2781      if (getIdentifier().isEmpty()) {
2782        addIdentifier();
2783      }
2784      return getIdentifier().get(0);
2785    }
2786
2787    /**
2788     * @return {@link #status} (The status of the genomic study.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2789     */
2790    public Enumeration<GenomicStudyStatus> getStatusElement() { 
2791      if (this.status == null)
2792        if (Configuration.errorOnAutoCreate())
2793          throw new Error("Attempt to auto-create GenomicStudy.status");
2794        else if (Configuration.doAutoCreate())
2795          this.status = new Enumeration<GenomicStudyStatus>(new GenomicStudyStatusEnumFactory()); // bb
2796      return this.status;
2797    }
2798
2799    public boolean hasStatusElement() { 
2800      return this.status != null && !this.status.isEmpty();
2801    }
2802
2803    public boolean hasStatus() { 
2804      return this.status != null && !this.status.isEmpty();
2805    }
2806
2807    /**
2808     * @param value {@link #status} (The status of the genomic study.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2809     */
2810    public GenomicStudy setStatusElement(Enumeration<GenomicStudyStatus> value) { 
2811      this.status = value;
2812      return this;
2813    }
2814
2815    /**
2816     * @return The status of the genomic study.
2817     */
2818    public GenomicStudyStatus getStatus() { 
2819      return this.status == null ? null : this.status.getValue();
2820    }
2821
2822    /**
2823     * @param value The status of the genomic study.
2824     */
2825    public GenomicStudy setStatus(GenomicStudyStatus value) { 
2826        if (this.status == null)
2827          this.status = new Enumeration<GenomicStudyStatus>(new GenomicStudyStatusEnumFactory());
2828        this.status.setValue(value);
2829      return this;
2830    }
2831
2832    /**
2833     * @return {@link #type} (The type of the study, e.g., Familial variant segregation, Functional variation detection, or Gene expression profiling.)
2834     */
2835    public List<CodeableConcept> getType() { 
2836      if (this.type == null)
2837        this.type = new ArrayList<CodeableConcept>();
2838      return this.type;
2839    }
2840
2841    /**
2842     * @return Returns a reference to <code>this</code> for easy method chaining
2843     */
2844    public GenomicStudy setType(List<CodeableConcept> theType) { 
2845      this.type = theType;
2846      return this;
2847    }
2848
2849    public boolean hasType() { 
2850      if (this.type == null)
2851        return false;
2852      for (CodeableConcept item : this.type)
2853        if (!item.isEmpty())
2854          return true;
2855      return false;
2856    }
2857
2858    public CodeableConcept addType() { //3
2859      CodeableConcept t = new CodeableConcept();
2860      if (this.type == null)
2861        this.type = new ArrayList<CodeableConcept>();
2862      this.type.add(t);
2863      return t;
2864    }
2865
2866    public GenomicStudy addType(CodeableConcept t) { //3
2867      if (t == null)
2868        return this;
2869      if (this.type == null)
2870        this.type = new ArrayList<CodeableConcept>();
2871      this.type.add(t);
2872      return this;
2873    }
2874
2875    /**
2876     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
2877     */
2878    public CodeableConcept getTypeFirstRep() { 
2879      if (getType().isEmpty()) {
2880        addType();
2881      }
2882      return getType().get(0);
2883    }
2884
2885    /**
2886     * @return {@link #subject} (The primary subject of the genomic study.)
2887     */
2888    public Reference getSubject() { 
2889      if (this.subject == null)
2890        if (Configuration.errorOnAutoCreate())
2891          throw new Error("Attempt to auto-create GenomicStudy.subject");
2892        else if (Configuration.doAutoCreate())
2893          this.subject = new Reference(); // cc
2894      return this.subject;
2895    }
2896
2897    public boolean hasSubject() { 
2898      return this.subject != null && !this.subject.isEmpty();
2899    }
2900
2901    /**
2902     * @param value {@link #subject} (The primary subject of the genomic study.)
2903     */
2904    public GenomicStudy setSubject(Reference value) { 
2905      this.subject = value;
2906      return this;
2907    }
2908
2909    /**
2910     * @return {@link #encounter} (The healthcare event with which this genomics study is associated.)
2911     */
2912    public Reference getEncounter() { 
2913      if (this.encounter == null)
2914        if (Configuration.errorOnAutoCreate())
2915          throw new Error("Attempt to auto-create GenomicStudy.encounter");
2916        else if (Configuration.doAutoCreate())
2917          this.encounter = new Reference(); // cc
2918      return this.encounter;
2919    }
2920
2921    public boolean hasEncounter() { 
2922      return this.encounter != null && !this.encounter.isEmpty();
2923    }
2924
2925    /**
2926     * @param value {@link #encounter} (The healthcare event with which this genomics study is associated.)
2927     */
2928    public GenomicStudy setEncounter(Reference value) { 
2929      this.encounter = value;
2930      return this;
2931    }
2932
2933    /**
2934     * @return {@link #startDate} (When the genomic study was started.). This is the underlying object with id, value and extensions. The accessor "getStartDate" gives direct access to the value
2935     */
2936    public DateTimeType getStartDateElement() { 
2937      if (this.startDate == null)
2938        if (Configuration.errorOnAutoCreate())
2939          throw new Error("Attempt to auto-create GenomicStudy.startDate");
2940        else if (Configuration.doAutoCreate())
2941          this.startDate = new DateTimeType(); // bb
2942      return this.startDate;
2943    }
2944
2945    public boolean hasStartDateElement() { 
2946      return this.startDate != null && !this.startDate.isEmpty();
2947    }
2948
2949    public boolean hasStartDate() { 
2950      return this.startDate != null && !this.startDate.isEmpty();
2951    }
2952
2953    /**
2954     * @param value {@link #startDate} (When the genomic study was started.). This is the underlying object with id, value and extensions. The accessor "getStartDate" gives direct access to the value
2955     */
2956    public GenomicStudy setStartDateElement(DateTimeType value) { 
2957      this.startDate = value;
2958      return this;
2959    }
2960
2961    /**
2962     * @return When the genomic study was started.
2963     */
2964    public Date getStartDate() { 
2965      return this.startDate == null ? null : this.startDate.getValue();
2966    }
2967
2968    /**
2969     * @param value When the genomic study was started.
2970     */
2971    public GenomicStudy setStartDate(Date value) { 
2972      if (value == null)
2973        this.startDate = null;
2974      else {
2975        if (this.startDate == null)
2976          this.startDate = new DateTimeType();
2977        this.startDate.setValue(value);
2978      }
2979      return this;
2980    }
2981
2982    /**
2983     * @return {@link #basedOn} (Event resources that the genomic study is based on.)
2984     */
2985    public List<Reference> getBasedOn() { 
2986      if (this.basedOn == null)
2987        this.basedOn = new ArrayList<Reference>();
2988      return this.basedOn;
2989    }
2990
2991    /**
2992     * @return Returns a reference to <code>this</code> for easy method chaining
2993     */
2994    public GenomicStudy setBasedOn(List<Reference> theBasedOn) { 
2995      this.basedOn = theBasedOn;
2996      return this;
2997    }
2998
2999    public boolean hasBasedOn() { 
3000      if (this.basedOn == null)
3001        return false;
3002      for (Reference item : this.basedOn)
3003        if (!item.isEmpty())
3004          return true;
3005      return false;
3006    }
3007
3008    public Reference addBasedOn() { //3
3009      Reference t = new Reference();
3010      if (this.basedOn == null)
3011        this.basedOn = new ArrayList<Reference>();
3012      this.basedOn.add(t);
3013      return t;
3014    }
3015
3016    public GenomicStudy addBasedOn(Reference t) { //3
3017      if (t == null)
3018        return this;
3019      if (this.basedOn == null)
3020        this.basedOn = new ArrayList<Reference>();
3021      this.basedOn.add(t);
3022      return this;
3023    }
3024
3025    /**
3026     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
3027     */
3028    public Reference getBasedOnFirstRep() { 
3029      if (getBasedOn().isEmpty()) {
3030        addBasedOn();
3031      }
3032      return getBasedOn().get(0);
3033    }
3034
3035    /**
3036     * @return {@link #referrer} (Healthcare professional who requested or referred the genomic study.)
3037     */
3038    public Reference getReferrer() { 
3039      if (this.referrer == null)
3040        if (Configuration.errorOnAutoCreate())
3041          throw new Error("Attempt to auto-create GenomicStudy.referrer");
3042        else if (Configuration.doAutoCreate())
3043          this.referrer = new Reference(); // cc
3044      return this.referrer;
3045    }
3046
3047    public boolean hasReferrer() { 
3048      return this.referrer != null && !this.referrer.isEmpty();
3049    }
3050
3051    /**
3052     * @param value {@link #referrer} (Healthcare professional who requested or referred the genomic study.)
3053     */
3054    public GenomicStudy setReferrer(Reference value) { 
3055      this.referrer = value;
3056      return this;
3057    }
3058
3059    /**
3060     * @return {@link #interpreter} (Healthcare professionals who interpreted the genomic study.)
3061     */
3062    public List<Reference> getInterpreter() { 
3063      if (this.interpreter == null)
3064        this.interpreter = new ArrayList<Reference>();
3065      return this.interpreter;
3066    }
3067
3068    /**
3069     * @return Returns a reference to <code>this</code> for easy method chaining
3070     */
3071    public GenomicStudy setInterpreter(List<Reference> theInterpreter) { 
3072      this.interpreter = theInterpreter;
3073      return this;
3074    }
3075
3076    public boolean hasInterpreter() { 
3077      if (this.interpreter == null)
3078        return false;
3079      for (Reference item : this.interpreter)
3080        if (!item.isEmpty())
3081          return true;
3082      return false;
3083    }
3084
3085    public Reference addInterpreter() { //3
3086      Reference t = new Reference();
3087      if (this.interpreter == null)
3088        this.interpreter = new ArrayList<Reference>();
3089      this.interpreter.add(t);
3090      return t;
3091    }
3092
3093    public GenomicStudy addInterpreter(Reference t) { //3
3094      if (t == null)
3095        return this;
3096      if (this.interpreter == null)
3097        this.interpreter = new ArrayList<Reference>();
3098      this.interpreter.add(t);
3099      return this;
3100    }
3101
3102    /**
3103     * @return The first repetition of repeating field {@link #interpreter}, creating it if it does not already exist {3}
3104     */
3105    public Reference getInterpreterFirstRep() { 
3106      if (getInterpreter().isEmpty()) {
3107        addInterpreter();
3108      }
3109      return getInterpreter().get(0);
3110    }
3111
3112    /**
3113     * @return {@link #reason} (Why the genomic study was performed.)
3114     */
3115    public List<CodeableReference> getReason() { 
3116      if (this.reason == null)
3117        this.reason = new ArrayList<CodeableReference>();
3118      return this.reason;
3119    }
3120
3121    /**
3122     * @return Returns a reference to <code>this</code> for easy method chaining
3123     */
3124    public GenomicStudy setReason(List<CodeableReference> theReason) { 
3125      this.reason = theReason;
3126      return this;
3127    }
3128
3129    public boolean hasReason() { 
3130      if (this.reason == null)
3131        return false;
3132      for (CodeableReference item : this.reason)
3133        if (!item.isEmpty())
3134          return true;
3135      return false;
3136    }
3137
3138    public CodeableReference addReason() { //3
3139      CodeableReference t = new CodeableReference();
3140      if (this.reason == null)
3141        this.reason = new ArrayList<CodeableReference>();
3142      this.reason.add(t);
3143      return t;
3144    }
3145
3146    public GenomicStudy addReason(CodeableReference t) { //3
3147      if (t == null)
3148        return this;
3149      if (this.reason == null)
3150        this.reason = new ArrayList<CodeableReference>();
3151      this.reason.add(t);
3152      return this;
3153    }
3154
3155    /**
3156     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
3157     */
3158    public CodeableReference getReasonFirstRep() { 
3159      if (getReason().isEmpty()) {
3160        addReason();
3161      }
3162      return getReason().get(0);
3163    }
3164
3165    /**
3166     * @return {@link #instantiatesCanonical} (The defined protocol that describes the study.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesCanonical" gives direct access to the value
3167     */
3168    public CanonicalType getInstantiatesCanonicalElement() { 
3169      if (this.instantiatesCanonical == null)
3170        if (Configuration.errorOnAutoCreate())
3171          throw new Error("Attempt to auto-create GenomicStudy.instantiatesCanonical");
3172        else if (Configuration.doAutoCreate())
3173          this.instantiatesCanonical = new CanonicalType(); // bb
3174      return this.instantiatesCanonical;
3175    }
3176
3177    public boolean hasInstantiatesCanonicalElement() { 
3178      return this.instantiatesCanonical != null && !this.instantiatesCanonical.isEmpty();
3179    }
3180
3181    public boolean hasInstantiatesCanonical() { 
3182      return this.instantiatesCanonical != null && !this.instantiatesCanonical.isEmpty();
3183    }
3184
3185    /**
3186     * @param value {@link #instantiatesCanonical} (The defined protocol that describes the study.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesCanonical" gives direct access to the value
3187     */
3188    public GenomicStudy setInstantiatesCanonicalElement(CanonicalType value) { 
3189      this.instantiatesCanonical = value;
3190      return this;
3191    }
3192
3193    /**
3194     * @return The defined protocol that describes the study.
3195     */
3196    public String getInstantiatesCanonical() { 
3197      return this.instantiatesCanonical == null ? null : this.instantiatesCanonical.getValue();
3198    }
3199
3200    /**
3201     * @param value The defined protocol that describes the study.
3202     */
3203    public GenomicStudy setInstantiatesCanonical(String value) { 
3204      if (Utilities.noString(value))
3205        this.instantiatesCanonical = null;
3206      else {
3207        if (this.instantiatesCanonical == null)
3208          this.instantiatesCanonical = new CanonicalType();
3209        this.instantiatesCanonical.setValue(value);
3210      }
3211      return this;
3212    }
3213
3214    /**
3215     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol that describes the study.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesUri" gives direct access to the value
3216     */
3217    public UriType getInstantiatesUriElement() { 
3218      if (this.instantiatesUri == null)
3219        if (Configuration.errorOnAutoCreate())
3220          throw new Error("Attempt to auto-create GenomicStudy.instantiatesUri");
3221        else if (Configuration.doAutoCreate())
3222          this.instantiatesUri = new UriType(); // bb
3223      return this.instantiatesUri;
3224    }
3225
3226    public boolean hasInstantiatesUriElement() { 
3227      return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
3228    }
3229
3230    public boolean hasInstantiatesUri() { 
3231      return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
3232    }
3233
3234    /**
3235     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol that describes the study.). This is the underlying object with id, value and extensions. The accessor "getInstantiatesUri" gives direct access to the value
3236     */
3237    public GenomicStudy setInstantiatesUriElement(UriType value) { 
3238      this.instantiatesUri = value;
3239      return this;
3240    }
3241
3242    /**
3243     * @return The URL pointing to an externally maintained protocol that describes the study.
3244     */
3245    public String getInstantiatesUri() { 
3246      return this.instantiatesUri == null ? null : this.instantiatesUri.getValue();
3247    }
3248
3249    /**
3250     * @param value The URL pointing to an externally maintained protocol that describes the study.
3251     */
3252    public GenomicStudy setInstantiatesUri(String value) { 
3253      if (Utilities.noString(value))
3254        this.instantiatesUri = null;
3255      else {
3256        if (this.instantiatesUri == null)
3257          this.instantiatesUri = new UriType();
3258        this.instantiatesUri.setValue(value);
3259      }
3260      return this;
3261    }
3262
3263    /**
3264     * @return {@link #note} (Comments related to the genomic study.)
3265     */
3266    public List<Annotation> getNote() { 
3267      if (this.note == null)
3268        this.note = new ArrayList<Annotation>();
3269      return this.note;
3270    }
3271
3272    /**
3273     * @return Returns a reference to <code>this</code> for easy method chaining
3274     */
3275    public GenomicStudy setNote(List<Annotation> theNote) { 
3276      this.note = theNote;
3277      return this;
3278    }
3279
3280    public boolean hasNote() { 
3281      if (this.note == null)
3282        return false;
3283      for (Annotation item : this.note)
3284        if (!item.isEmpty())
3285          return true;
3286      return false;
3287    }
3288
3289    public Annotation addNote() { //3
3290      Annotation t = new Annotation();
3291      if (this.note == null)
3292        this.note = new ArrayList<Annotation>();
3293      this.note.add(t);
3294      return t;
3295    }
3296
3297    public GenomicStudy addNote(Annotation t) { //3
3298      if (t == null)
3299        return this;
3300      if (this.note == null)
3301        this.note = new ArrayList<Annotation>();
3302      this.note.add(t);
3303      return this;
3304    }
3305
3306    /**
3307     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
3308     */
3309    public Annotation getNoteFirstRep() { 
3310      if (getNote().isEmpty()) {
3311        addNote();
3312      }
3313      return getNote().get(0);
3314    }
3315
3316    /**
3317     * @return {@link #description} (Description of the genomic study.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3318     */
3319    public MarkdownType getDescriptionElement() { 
3320      if (this.description == null)
3321        if (Configuration.errorOnAutoCreate())
3322          throw new Error("Attempt to auto-create GenomicStudy.description");
3323        else if (Configuration.doAutoCreate())
3324          this.description = new MarkdownType(); // bb
3325      return this.description;
3326    }
3327
3328    public boolean hasDescriptionElement() { 
3329      return this.description != null && !this.description.isEmpty();
3330    }
3331
3332    public boolean hasDescription() { 
3333      return this.description != null && !this.description.isEmpty();
3334    }
3335
3336    /**
3337     * @param value {@link #description} (Description of the genomic study.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3338     */
3339    public GenomicStudy setDescriptionElement(MarkdownType value) { 
3340      this.description = value;
3341      return this;
3342    }
3343
3344    /**
3345     * @return Description of the genomic study.
3346     */
3347    public String getDescription() { 
3348      return this.description == null ? null : this.description.getValue();
3349    }
3350
3351    /**
3352     * @param value Description of the genomic study.
3353     */
3354    public GenomicStudy setDescription(String value) { 
3355      if (Utilities.noString(value))
3356        this.description = null;
3357      else {
3358        if (this.description == null)
3359          this.description = new MarkdownType();
3360        this.description.setValue(value);
3361      }
3362      return this;
3363    }
3364
3365    /**
3366     * @return {@link #analysis} (The details about a specific analysis that was performed in this GenomicStudy.)
3367     */
3368    public List<GenomicStudyAnalysisComponent> getAnalysis() { 
3369      if (this.analysis == null)
3370        this.analysis = new ArrayList<GenomicStudyAnalysisComponent>();
3371      return this.analysis;
3372    }
3373
3374    /**
3375     * @return Returns a reference to <code>this</code> for easy method chaining
3376     */
3377    public GenomicStudy setAnalysis(List<GenomicStudyAnalysisComponent> theAnalysis) { 
3378      this.analysis = theAnalysis;
3379      return this;
3380    }
3381
3382    public boolean hasAnalysis() { 
3383      if (this.analysis == null)
3384        return false;
3385      for (GenomicStudyAnalysisComponent item : this.analysis)
3386        if (!item.isEmpty())
3387          return true;
3388      return false;
3389    }
3390
3391    public GenomicStudyAnalysisComponent addAnalysis() { //3
3392      GenomicStudyAnalysisComponent t = new GenomicStudyAnalysisComponent();
3393      if (this.analysis == null)
3394        this.analysis = new ArrayList<GenomicStudyAnalysisComponent>();
3395      this.analysis.add(t);
3396      return t;
3397    }
3398
3399    public GenomicStudy addAnalysis(GenomicStudyAnalysisComponent t) { //3
3400      if (t == null)
3401        return this;
3402      if (this.analysis == null)
3403        this.analysis = new ArrayList<GenomicStudyAnalysisComponent>();
3404      this.analysis.add(t);
3405      return this;
3406    }
3407
3408    /**
3409     * @return The first repetition of repeating field {@link #analysis}, creating it if it does not already exist {3}
3410     */
3411    public GenomicStudyAnalysisComponent getAnalysisFirstRep() { 
3412      if (getAnalysis().isEmpty()) {
3413        addAnalysis();
3414      }
3415      return getAnalysis().get(0);
3416    }
3417
3418      protected void listChildren(List<Property> children) {
3419        super.listChildren(children);
3420        children.add(new Property("identifier", "Identifier", "Identifiers for this genomic study.", 0, java.lang.Integer.MAX_VALUE, identifier));
3421        children.add(new Property("status", "code", "The status of the genomic study.", 0, 1, status));
3422        children.add(new Property("type", "CodeableConcept", "The type of the study, e.g., Familial variant segregation, Functional variation detection, or Gene expression profiling.", 0, java.lang.Integer.MAX_VALUE, type));
3423        children.add(new Property("subject", "Reference(Patient|Group|Substance|BiologicallyDerivedProduct|NutritionProduct)", "The primary subject of the genomic study.", 0, 1, subject));
3424        children.add(new Property("encounter", "Reference(Encounter)", "The healthcare event with which this genomics study is associated.", 0, 1, encounter));
3425        children.add(new Property("startDate", "dateTime", "When the genomic study was started.", 0, 1, startDate));
3426        children.add(new Property("basedOn", "Reference(ServiceRequest|Task)", "Event resources that the genomic study is based on.", 0, java.lang.Integer.MAX_VALUE, basedOn));
3427        children.add(new Property("referrer", "Reference(Practitioner|PractitionerRole)", "Healthcare professional who requested or referred the genomic study.", 0, 1, referrer));
3428        children.add(new Property("interpreter", "Reference(Practitioner|PractitionerRole)", "Healthcare professionals who interpreted the genomic study.", 0, java.lang.Integer.MAX_VALUE, interpreter));
3429        children.add(new Property("reason", "CodeableReference(Condition|Observation)", "Why the genomic study was performed.", 0, java.lang.Integer.MAX_VALUE, reason));
3430        children.add(new Property("instantiatesCanonical", "canonical(PlanDefinition)", "The defined protocol that describes the study.", 0, 1, instantiatesCanonical));
3431        children.add(new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol that describes the study.", 0, 1, instantiatesUri));
3432        children.add(new Property("note", "Annotation", "Comments related to the genomic study.", 0, java.lang.Integer.MAX_VALUE, note));
3433        children.add(new Property("description", "markdown", "Description of the genomic study.", 0, 1, description));
3434        children.add(new Property("analysis", "", "The details about a specific analysis that was performed in this GenomicStudy.", 0, java.lang.Integer.MAX_VALUE, analysis));
3435      }
3436
3437      @Override
3438      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3439        switch (_hash) {
3440        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers for this genomic study.", 0, java.lang.Integer.MAX_VALUE, identifier);
3441        case -892481550: /*status*/  return new Property("status", "code", "The status of the genomic study.", 0, 1, status);
3442        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of the study, e.g., Familial variant segregation, Functional variation detection, or Gene expression profiling.", 0, java.lang.Integer.MAX_VALUE, type);
3443        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Substance|BiologicallyDerivedProduct|NutritionProduct)", "The primary subject of the genomic study.", 0, 1, subject);
3444        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The healthcare event with which this genomics study is associated.", 0, 1, encounter);
3445        case -2129778896: /*startDate*/  return new Property("startDate", "dateTime", "When the genomic study was started.", 0, 1, startDate);
3446        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(ServiceRequest|Task)", "Event resources that the genomic study is based on.", 0, java.lang.Integer.MAX_VALUE, basedOn);
3447        case -722568161: /*referrer*/  return new Property("referrer", "Reference(Practitioner|PractitionerRole)", "Healthcare professional who requested or referred the genomic study.", 0, 1, referrer);
3448        case -2008009094: /*interpreter*/  return new Property("interpreter", "Reference(Practitioner|PractitionerRole)", "Healthcare professionals who interpreted the genomic study.", 0, java.lang.Integer.MAX_VALUE, interpreter);
3449        case -934964668: /*reason*/  return new Property("reason", "CodeableReference(Condition|Observation)", "Why the genomic study was performed.", 0, java.lang.Integer.MAX_VALUE, reason);
3450        case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "canonical(PlanDefinition)", "The defined protocol that describes the study.", 0, 1, instantiatesCanonical);
3451        case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol that describes the study.", 0, 1, instantiatesUri);
3452        case 3387378: /*note*/  return new Property("note", "Annotation", "Comments related to the genomic study.", 0, java.lang.Integer.MAX_VALUE, note);
3453        case -1724546052: /*description*/  return new Property("description", "markdown", "Description of the genomic study.", 0, 1, description);
3454        case -1024445732: /*analysis*/  return new Property("analysis", "", "The details about a specific analysis that was performed in this GenomicStudy.", 0, java.lang.Integer.MAX_VALUE, analysis);
3455        default: return super.getNamedProperty(_hash, _name, _checkValid);
3456        }
3457
3458      }
3459
3460      @Override
3461      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3462        switch (hash) {
3463        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3464        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<GenomicStudyStatus>
3465        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
3466        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
3467        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
3468        case -2129778896: /*startDate*/ return this.startDate == null ? new Base[0] : new Base[] {this.startDate}; // DateTimeType
3469        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
3470        case -722568161: /*referrer*/ return this.referrer == null ? new Base[0] : new Base[] {this.referrer}; // Reference
3471        case -2008009094: /*interpreter*/ return this.interpreter == null ? new Base[0] : this.interpreter.toArray(new Base[this.interpreter.size()]); // Reference
3472        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
3473        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : new Base[] {this.instantiatesCanonical}; // CanonicalType
3474        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : new Base[] {this.instantiatesUri}; // UriType
3475        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
3476        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
3477        case -1024445732: /*analysis*/ return this.analysis == null ? new Base[0] : this.analysis.toArray(new Base[this.analysis.size()]); // GenomicStudyAnalysisComponent
3478        default: return super.getProperty(hash, name, checkValid);
3479        }
3480
3481      }
3482
3483      @Override
3484      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3485        switch (hash) {
3486        case -1618432855: // identifier
3487          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3488          return value;
3489        case -892481550: // status
3490          value = new GenomicStudyStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3491          this.status = (Enumeration) value; // Enumeration<GenomicStudyStatus>
3492          return value;
3493        case 3575610: // type
3494          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3495          return value;
3496        case -1867885268: // subject
3497          this.subject = TypeConvertor.castToReference(value); // Reference
3498          return value;
3499        case 1524132147: // encounter
3500          this.encounter = TypeConvertor.castToReference(value); // Reference
3501          return value;
3502        case -2129778896: // startDate
3503          this.startDate = TypeConvertor.castToDateTime(value); // DateTimeType
3504          return value;
3505        case -332612366: // basedOn
3506          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
3507          return value;
3508        case -722568161: // referrer
3509          this.referrer = TypeConvertor.castToReference(value); // Reference
3510          return value;
3511        case -2008009094: // interpreter
3512          this.getInterpreter().add(TypeConvertor.castToReference(value)); // Reference
3513          return value;
3514        case -934964668: // reason
3515          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
3516          return value;
3517        case 8911915: // instantiatesCanonical
3518          this.instantiatesCanonical = TypeConvertor.castToCanonical(value); // CanonicalType
3519          return value;
3520        case -1926393373: // instantiatesUri
3521          this.instantiatesUri = TypeConvertor.castToUri(value); // UriType
3522          return value;
3523        case 3387378: // note
3524          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
3525          return value;
3526        case -1724546052: // description
3527          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
3528          return value;
3529        case -1024445732: // analysis
3530          this.getAnalysis().add((GenomicStudyAnalysisComponent) value); // GenomicStudyAnalysisComponent
3531          return value;
3532        default: return super.setProperty(hash, name, value);
3533        }
3534
3535      }
3536
3537      @Override
3538      public Base setProperty(String name, Base value) throws FHIRException {
3539        if (name.equals("identifier")) {
3540          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3541        } else if (name.equals("status")) {
3542          value = new GenomicStudyStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3543          this.status = (Enumeration) value; // Enumeration<GenomicStudyStatus>
3544        } else if (name.equals("type")) {
3545          this.getType().add(TypeConvertor.castToCodeableConcept(value));
3546        } else if (name.equals("subject")) {
3547          this.subject = TypeConvertor.castToReference(value); // Reference
3548        } else if (name.equals("encounter")) {
3549          this.encounter = TypeConvertor.castToReference(value); // Reference
3550        } else if (name.equals("startDate")) {
3551          this.startDate = TypeConvertor.castToDateTime(value); // DateTimeType
3552        } else if (name.equals("basedOn")) {
3553          this.getBasedOn().add(TypeConvertor.castToReference(value));
3554        } else if (name.equals("referrer")) {
3555          this.referrer = TypeConvertor.castToReference(value); // Reference
3556        } else if (name.equals("interpreter")) {
3557          this.getInterpreter().add(TypeConvertor.castToReference(value));
3558        } else if (name.equals("reason")) {
3559          this.getReason().add(TypeConvertor.castToCodeableReference(value));
3560        } else if (name.equals("instantiatesCanonical")) {
3561          this.instantiatesCanonical = TypeConvertor.castToCanonical(value); // CanonicalType
3562        } else if (name.equals("instantiatesUri")) {
3563          this.instantiatesUri = TypeConvertor.castToUri(value); // UriType
3564        } else if (name.equals("note")) {
3565          this.getNote().add(TypeConvertor.castToAnnotation(value));
3566        } else if (name.equals("description")) {
3567          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
3568        } else if (name.equals("analysis")) {
3569          this.getAnalysis().add((GenomicStudyAnalysisComponent) value);
3570        } else
3571          return super.setProperty(name, value);
3572        return value;
3573      }
3574
3575  @Override
3576  public void removeChild(String name, Base value) throws FHIRException {
3577        if (name.equals("identifier")) {
3578          this.getIdentifier().remove(value);
3579        } else if (name.equals("status")) {
3580          value = new GenomicStudyStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3581          this.status = (Enumeration) value; // Enumeration<GenomicStudyStatus>
3582        } else if (name.equals("type")) {
3583          this.getType().remove(value);
3584        } else if (name.equals("subject")) {
3585          this.subject = null;
3586        } else if (name.equals("encounter")) {
3587          this.encounter = null;
3588        } else if (name.equals("startDate")) {
3589          this.startDate = null;
3590        } else if (name.equals("basedOn")) {
3591          this.getBasedOn().remove(value);
3592        } else if (name.equals("referrer")) {
3593          this.referrer = null;
3594        } else if (name.equals("interpreter")) {
3595          this.getInterpreter().remove(value);
3596        } else if (name.equals("reason")) {
3597          this.getReason().remove(value);
3598        } else if (name.equals("instantiatesCanonical")) {
3599          this.instantiatesCanonical = null;
3600        } else if (name.equals("instantiatesUri")) {
3601          this.instantiatesUri = null;
3602        } else if (name.equals("note")) {
3603          this.getNote().remove(value);
3604        } else if (name.equals("description")) {
3605          this.description = null;
3606        } else if (name.equals("analysis")) {
3607          this.getAnalysis().remove((GenomicStudyAnalysisComponent) value);
3608        } else
3609          super.removeChild(name, value);
3610        
3611      }
3612
3613      @Override
3614      public Base makeProperty(int hash, String name) throws FHIRException {
3615        switch (hash) {
3616        case -1618432855:  return addIdentifier(); 
3617        case -892481550:  return getStatusElement();
3618        case 3575610:  return addType(); 
3619        case -1867885268:  return getSubject();
3620        case 1524132147:  return getEncounter();
3621        case -2129778896:  return getStartDateElement();
3622        case -332612366:  return addBasedOn(); 
3623        case -722568161:  return getReferrer();
3624        case -2008009094:  return addInterpreter(); 
3625        case -934964668:  return addReason(); 
3626        case 8911915:  return getInstantiatesCanonicalElement();
3627        case -1926393373:  return getInstantiatesUriElement();
3628        case 3387378:  return addNote(); 
3629        case -1724546052:  return getDescriptionElement();
3630        case -1024445732:  return addAnalysis(); 
3631        default: return super.makeProperty(hash, name);
3632        }
3633
3634      }
3635
3636      @Override
3637      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3638        switch (hash) {
3639        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3640        case -892481550: /*status*/ return new String[] {"code"};
3641        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3642        case -1867885268: /*subject*/ return new String[] {"Reference"};
3643        case 1524132147: /*encounter*/ return new String[] {"Reference"};
3644        case -2129778896: /*startDate*/ return new String[] {"dateTime"};
3645        case -332612366: /*basedOn*/ return new String[] {"Reference"};
3646        case -722568161: /*referrer*/ return new String[] {"Reference"};
3647        case -2008009094: /*interpreter*/ return new String[] {"Reference"};
3648        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
3649        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
3650        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
3651        case 3387378: /*note*/ return new String[] {"Annotation"};
3652        case -1724546052: /*description*/ return new String[] {"markdown"};
3653        case -1024445732: /*analysis*/ return new String[] {};
3654        default: return super.getTypesForProperty(hash, name);
3655        }
3656
3657      }
3658
3659      @Override
3660      public Base addChild(String name) throws FHIRException {
3661        if (name.equals("identifier")) {
3662          return addIdentifier();
3663        }
3664        else if (name.equals("status")) {
3665          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.status");
3666        }
3667        else if (name.equals("type")) {
3668          return addType();
3669        }
3670        else if (name.equals("subject")) {
3671          this.subject = new Reference();
3672          return this.subject;
3673        }
3674        else if (name.equals("encounter")) {
3675          this.encounter = new Reference();
3676          return this.encounter;
3677        }
3678        else if (name.equals("startDate")) {
3679          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.startDate");
3680        }
3681        else if (name.equals("basedOn")) {
3682          return addBasedOn();
3683        }
3684        else if (name.equals("referrer")) {
3685          this.referrer = new Reference();
3686          return this.referrer;
3687        }
3688        else if (name.equals("interpreter")) {
3689          return addInterpreter();
3690        }
3691        else if (name.equals("reason")) {
3692          return addReason();
3693        }
3694        else if (name.equals("instantiatesCanonical")) {
3695          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.instantiatesCanonical");
3696        }
3697        else if (name.equals("instantiatesUri")) {
3698          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.instantiatesUri");
3699        }
3700        else if (name.equals("note")) {
3701          return addNote();
3702        }
3703        else if (name.equals("description")) {
3704          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.description");
3705        }
3706        else if (name.equals("analysis")) {
3707          return addAnalysis();
3708        }
3709        else
3710          return super.addChild(name);
3711      }
3712
3713  public String fhirType() {
3714    return "GenomicStudy";
3715
3716  }
3717
3718      public GenomicStudy copy() {
3719        GenomicStudy dst = new GenomicStudy();
3720        copyValues(dst);
3721        return dst;
3722      }
3723
3724      public void copyValues(GenomicStudy dst) {
3725        super.copyValues(dst);
3726        if (identifier != null) {
3727          dst.identifier = new ArrayList<Identifier>();
3728          for (Identifier i : identifier)
3729            dst.identifier.add(i.copy());
3730        };
3731        dst.status = status == null ? null : status.copy();
3732        if (type != null) {
3733          dst.type = new ArrayList<CodeableConcept>();
3734          for (CodeableConcept i : type)
3735            dst.type.add(i.copy());
3736        };
3737        dst.subject = subject == null ? null : subject.copy();
3738        dst.encounter = encounter == null ? null : encounter.copy();
3739        dst.startDate = startDate == null ? null : startDate.copy();
3740        if (basedOn != null) {
3741          dst.basedOn = new ArrayList<Reference>();
3742          for (Reference i : basedOn)
3743            dst.basedOn.add(i.copy());
3744        };
3745        dst.referrer = referrer == null ? null : referrer.copy();
3746        if (interpreter != null) {
3747          dst.interpreter = new ArrayList<Reference>();
3748          for (Reference i : interpreter)
3749            dst.interpreter.add(i.copy());
3750        };
3751        if (reason != null) {
3752          dst.reason = new ArrayList<CodeableReference>();
3753          for (CodeableReference i : reason)
3754            dst.reason.add(i.copy());
3755        };
3756        dst.instantiatesCanonical = instantiatesCanonical == null ? null : instantiatesCanonical.copy();
3757        dst.instantiatesUri = instantiatesUri == null ? null : instantiatesUri.copy();
3758        if (note != null) {
3759          dst.note = new ArrayList<Annotation>();
3760          for (Annotation i : note)
3761            dst.note.add(i.copy());
3762        };
3763        dst.description = description == null ? null : description.copy();
3764        if (analysis != null) {
3765          dst.analysis = new ArrayList<GenomicStudyAnalysisComponent>();
3766          for (GenomicStudyAnalysisComponent i : analysis)
3767            dst.analysis.add(i.copy());
3768        };
3769      }
3770
3771      protected GenomicStudy typedCopy() {
3772        return copy();
3773      }
3774
3775      @Override
3776      public boolean equalsDeep(Base other_) {
3777        if (!super.equalsDeep(other_))
3778          return false;
3779        if (!(other_ instanceof GenomicStudy))
3780          return false;
3781        GenomicStudy o = (GenomicStudy) other_;
3782        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true)
3783           && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) && compareDeep(startDate, o.startDate, true)
3784           && compareDeep(basedOn, o.basedOn, true) && compareDeep(referrer, o.referrer, true) && compareDeep(interpreter, o.interpreter, true)
3785           && compareDeep(reason, o.reason, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
3786           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(note, o.note, true) && compareDeep(description, o.description, true)
3787           && compareDeep(analysis, o.analysis, true);
3788      }
3789
3790      @Override
3791      public boolean equalsShallow(Base other_) {
3792        if (!super.equalsShallow(other_))
3793          return false;
3794        if (!(other_ instanceof GenomicStudy))
3795          return false;
3796        GenomicStudy o = (GenomicStudy) other_;
3797        return compareValues(status, o.status, true) && compareValues(startDate, o.startDate, true) && compareValues(instantiatesCanonical, o.instantiatesCanonical, true)
3798           && compareValues(instantiatesUri, o.instantiatesUri, true) && compareValues(description, o.description, true)
3799          ;
3800      }
3801
3802      public boolean isEmpty() {
3803        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type
3804          , subject, encounter, startDate, basedOn, referrer, interpreter, reason, instantiatesCanonical
3805          , instantiatesUri, note, description, analysis);
3806      }
3807
3808  @Override
3809  public ResourceType getResourceType() {
3810    return ResourceType.GenomicStudy;
3811   }
3812
3813 /**
3814   * Search parameter: <b>focus</b>
3815   * <p>
3816   * Description: <b>What the genomic study analysis is about, when it is not about the subject of record</b><br>
3817   * Type: <b>reference</b><br>
3818   * Path: <b>GenomicStudy.analysis.focus</b><br>
3819   * </p>
3820   */
3821  @SearchParamDefinition(name="focus", path="GenomicStudy.analysis.focus", description="What the genomic study analysis 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 } )
3822  public static final String SP_FOCUS = "focus";
3823 /**
3824   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
3825   * <p>
3826   * Description: <b>What the genomic study analysis is about, when it is not about the subject of record</b><br>
3827   * Type: <b>reference</b><br>
3828   * Path: <b>GenomicStudy.analysis.focus</b><br>
3829   * </p>
3830   */
3831  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FOCUS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FOCUS);
3832
3833/**
3834   * Constant for fluent queries to be used to add include statements. Specifies
3835   * the path value of "<b>GenomicStudy:focus</b>".
3836   */
3837  public static final ca.uhn.fhir.model.api.Include INCLUDE_FOCUS = new ca.uhn.fhir.model.api.Include("GenomicStudy:focus").toLocked();
3838
3839 /**
3840   * Search parameter: <b>identifier</b>
3841   * <p>
3842   * Description: <b>Identifiers for the Study</b><br>
3843   * Type: <b>token</b><br>
3844   * Path: <b>GenomicStudy.identifier</b><br>
3845   * </p>
3846   */
3847  @SearchParamDefinition(name="identifier", path="GenomicStudy.identifier", description="Identifiers for the Study", type="token" )
3848  public static final String SP_IDENTIFIER = "identifier";
3849 /**
3850   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3851   * <p>
3852   * Description: <b>Identifiers for the Study</b><br>
3853   * Type: <b>token</b><br>
3854   * Path: <b>GenomicStudy.identifier</b><br>
3855   * </p>
3856   */
3857  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3858
3859 /**
3860   * Search parameter: <b>patient</b>
3861   * <p>
3862   * Description: <b>Who the study is about</b><br>
3863   * Type: <b>reference</b><br>
3864   * Path: <b>GenomicStudy.subject.where(resolve() is Patient)</b><br>
3865   * </p>
3866   */
3867  @SearchParamDefinition(name="patient", path="GenomicStudy.subject.where(resolve() is Patient)", description="Who the study is about", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Patient.class } )
3868  public static final String SP_PATIENT = "patient";
3869 /**
3870   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3871   * <p>
3872   * Description: <b>Who the study is about</b><br>
3873   * Type: <b>reference</b><br>
3874   * Path: <b>GenomicStudy.subject.where(resolve() is Patient)</b><br>
3875   * </p>
3876   */
3877  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3878
3879/**
3880   * Constant for fluent queries to be used to add include statements. Specifies
3881   * the path value of "<b>GenomicStudy:patient</b>".
3882   */
3883  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("GenomicStudy:patient").toLocked();
3884
3885 /**
3886   * Search parameter: <b>status</b>
3887   * <p>
3888   * Description: <b>The status of the study</b><br>
3889   * Type: <b>token</b><br>
3890   * Path: <b>GenomicStudy.status</b><br>
3891   * </p>
3892   */
3893  @SearchParamDefinition(name="status", path="GenomicStudy.status", description="The status of the study", type="token" )
3894  public static final String SP_STATUS = "status";
3895 /**
3896   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3897   * <p>
3898   * Description: <b>The status of the study</b><br>
3899   * Type: <b>token</b><br>
3900   * Path: <b>GenomicStudy.status</b><br>
3901   * </p>
3902   */
3903  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3904
3905 /**
3906   * Search parameter: <b>subject</b>
3907   * <p>
3908   * Description: <b>Who the study is about</b><br>
3909   * Type: <b>reference</b><br>
3910   * Path: <b>GenomicStudy.subject</b><br>
3911   * </p>
3912   */
3913  @SearchParamDefinition(name="subject", path="GenomicStudy.subject", description="Who the study is about", type="reference", target={BiologicallyDerivedProduct.class, Group.class, NutritionProduct.class, Patient.class, Substance.class } )
3914  public static final String SP_SUBJECT = "subject";
3915 /**
3916   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3917   * <p>
3918   * Description: <b>Who the study is about</b><br>
3919   * Type: <b>reference</b><br>
3920   * Path: <b>GenomicStudy.subject</b><br>
3921   * </p>
3922   */
3923  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3924
3925/**
3926   * Constant for fluent queries to be used to add include statements. Specifies
3927   * the path value of "<b>GenomicStudy:subject</b>".
3928   */
3929  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("GenomicStudy:subject").toLocked();
3930
3931
3932}
3933