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 Base makeProperty(int hash, String name) throws FHIRException {
1401        switch (hash) {
1402        case -1618432855:  return addIdentifier(); 
1403        case -722961477:  return addMethodType(); 
1404        case -2131902710:  return addChangeType(); 
1405        case 1061239735:  return getGenomeBuild();
1406        case 8911915:  return getInstantiatesCanonicalElement();
1407        case -1926393373:  return getInstantiatesUriElement();
1408        case 110371416:  return getTitleElement();
1409        case 97604824:  return addFocus(); 
1410        case -2132868344:  return addSpecimen(); 
1411        case 3076014:  return getDateElement();
1412        case 3387378:  return addNote(); 
1413        case -1565516792:  return getProtocolPerformed();
1414        case 391791385:  return addRegionsStudied(); 
1415        case -2125803428:  return addRegionsCalled(); 
1416        case 100358090:  return addInput(); 
1417        case -1005512447:  return addOutput(); 
1418        case 481140686:  return addPerformer(); 
1419        case -1335157162:  return addDevice(); 
1420        default: return super.makeProperty(hash, name);
1421        }
1422
1423      }
1424
1425      @Override
1426      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1427        switch (hash) {
1428        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1429        case -722961477: /*methodType*/ return new String[] {"CodeableConcept"};
1430        case -2131902710: /*changeType*/ return new String[] {"CodeableConcept"};
1431        case 1061239735: /*genomeBuild*/ return new String[] {"CodeableConcept"};
1432        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
1433        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
1434        case 110371416: /*title*/ return new String[] {"string"};
1435        case 97604824: /*focus*/ return new String[] {"Reference"};
1436        case -2132868344: /*specimen*/ return new String[] {"Reference"};
1437        case 3076014: /*date*/ return new String[] {"dateTime"};
1438        case 3387378: /*note*/ return new String[] {"Annotation"};
1439        case -1565516792: /*protocolPerformed*/ return new String[] {"Reference"};
1440        case 391791385: /*regionsStudied*/ return new String[] {"Reference"};
1441        case -2125803428: /*regionsCalled*/ return new String[] {"Reference"};
1442        case 100358090: /*input*/ return new String[] {};
1443        case -1005512447: /*output*/ return new String[] {};
1444        case 481140686: /*performer*/ return new String[] {};
1445        case -1335157162: /*device*/ return new String[] {};
1446        default: return super.getTypesForProperty(hash, name);
1447        }
1448
1449      }
1450
1451      @Override
1452      public Base addChild(String name) throws FHIRException {
1453        if (name.equals("identifier")) {
1454          return addIdentifier();
1455        }
1456        else if (name.equals("methodType")) {
1457          return addMethodType();
1458        }
1459        else if (name.equals("changeType")) {
1460          return addChangeType();
1461        }
1462        else if (name.equals("genomeBuild")) {
1463          this.genomeBuild = new CodeableConcept();
1464          return this.genomeBuild;
1465        }
1466        else if (name.equals("instantiatesCanonical")) {
1467          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.analysis.instantiatesCanonical");
1468        }
1469        else if (name.equals("instantiatesUri")) {
1470          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.analysis.instantiatesUri");
1471        }
1472        else if (name.equals("title")) {
1473          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.analysis.title");
1474        }
1475        else if (name.equals("focus")) {
1476          return addFocus();
1477        }
1478        else if (name.equals("specimen")) {
1479          return addSpecimen();
1480        }
1481        else if (name.equals("date")) {
1482          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.analysis.date");
1483        }
1484        else if (name.equals("note")) {
1485          return addNote();
1486        }
1487        else if (name.equals("protocolPerformed")) {
1488          this.protocolPerformed = new Reference();
1489          return this.protocolPerformed;
1490        }
1491        else if (name.equals("regionsStudied")) {
1492          return addRegionsStudied();
1493        }
1494        else if (name.equals("regionsCalled")) {
1495          return addRegionsCalled();
1496        }
1497        else if (name.equals("input")) {
1498          return addInput();
1499        }
1500        else if (name.equals("output")) {
1501          return addOutput();
1502        }
1503        else if (name.equals("performer")) {
1504          return addPerformer();
1505        }
1506        else if (name.equals("device")) {
1507          return addDevice();
1508        }
1509        else
1510          return super.addChild(name);
1511      }
1512
1513      public GenomicStudyAnalysisComponent copy() {
1514        GenomicStudyAnalysisComponent dst = new GenomicStudyAnalysisComponent();
1515        copyValues(dst);
1516        return dst;
1517      }
1518
1519      public void copyValues(GenomicStudyAnalysisComponent dst) {
1520        super.copyValues(dst);
1521        if (identifier != null) {
1522          dst.identifier = new ArrayList<Identifier>();
1523          for (Identifier i : identifier)
1524            dst.identifier.add(i.copy());
1525        };
1526        if (methodType != null) {
1527          dst.methodType = new ArrayList<CodeableConcept>();
1528          for (CodeableConcept i : methodType)
1529            dst.methodType.add(i.copy());
1530        };
1531        if (changeType != null) {
1532          dst.changeType = new ArrayList<CodeableConcept>();
1533          for (CodeableConcept i : changeType)
1534            dst.changeType.add(i.copy());
1535        };
1536        dst.genomeBuild = genomeBuild == null ? null : genomeBuild.copy();
1537        dst.instantiatesCanonical = instantiatesCanonical == null ? null : instantiatesCanonical.copy();
1538        dst.instantiatesUri = instantiatesUri == null ? null : instantiatesUri.copy();
1539        dst.title = title == null ? null : title.copy();
1540        if (focus != null) {
1541          dst.focus = new ArrayList<Reference>();
1542          for (Reference i : focus)
1543            dst.focus.add(i.copy());
1544        };
1545        if (specimen != null) {
1546          dst.specimen = new ArrayList<Reference>();
1547          for (Reference i : specimen)
1548            dst.specimen.add(i.copy());
1549        };
1550        dst.date = date == null ? null : date.copy();
1551        if (note != null) {
1552          dst.note = new ArrayList<Annotation>();
1553          for (Annotation i : note)
1554            dst.note.add(i.copy());
1555        };
1556        dst.protocolPerformed = protocolPerformed == null ? null : protocolPerformed.copy();
1557        if (regionsStudied != null) {
1558          dst.regionsStudied = new ArrayList<Reference>();
1559          for (Reference i : regionsStudied)
1560            dst.regionsStudied.add(i.copy());
1561        };
1562        if (regionsCalled != null) {
1563          dst.regionsCalled = new ArrayList<Reference>();
1564          for (Reference i : regionsCalled)
1565            dst.regionsCalled.add(i.copy());
1566        };
1567        if (input != null) {
1568          dst.input = new ArrayList<GenomicStudyAnalysisInputComponent>();
1569          for (GenomicStudyAnalysisInputComponent i : input)
1570            dst.input.add(i.copy());
1571        };
1572        if (output != null) {
1573          dst.output = new ArrayList<GenomicStudyAnalysisOutputComponent>();
1574          for (GenomicStudyAnalysisOutputComponent i : output)
1575            dst.output.add(i.copy());
1576        };
1577        if (performer != null) {
1578          dst.performer = new ArrayList<GenomicStudyAnalysisPerformerComponent>();
1579          for (GenomicStudyAnalysisPerformerComponent i : performer)
1580            dst.performer.add(i.copy());
1581        };
1582        if (device != null) {
1583          dst.device = new ArrayList<GenomicStudyAnalysisDeviceComponent>();
1584          for (GenomicStudyAnalysisDeviceComponent i : device)
1585            dst.device.add(i.copy());
1586        };
1587      }
1588
1589      @Override
1590      public boolean equalsDeep(Base other_) {
1591        if (!super.equalsDeep(other_))
1592          return false;
1593        if (!(other_ instanceof GenomicStudyAnalysisComponent))
1594          return false;
1595        GenomicStudyAnalysisComponent o = (GenomicStudyAnalysisComponent) other_;
1596        return compareDeep(identifier, o.identifier, true) && compareDeep(methodType, o.methodType, true)
1597           && compareDeep(changeType, o.changeType, true) && compareDeep(genomeBuild, o.genomeBuild, true)
1598           && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true) && compareDeep(instantiatesUri, o.instantiatesUri, true)
1599           && compareDeep(title, o.title, true) && compareDeep(focus, o.focus, true) && compareDeep(specimen, o.specimen, true)
1600           && compareDeep(date, o.date, true) && compareDeep(note, o.note, true) && compareDeep(protocolPerformed, o.protocolPerformed, true)
1601           && compareDeep(regionsStudied, o.regionsStudied, true) && compareDeep(regionsCalled, o.regionsCalled, true)
1602           && compareDeep(input, o.input, true) && compareDeep(output, o.output, true) && compareDeep(performer, o.performer, true)
1603           && compareDeep(device, o.device, true);
1604      }
1605
1606      @Override
1607      public boolean equalsShallow(Base other_) {
1608        if (!super.equalsShallow(other_))
1609          return false;
1610        if (!(other_ instanceof GenomicStudyAnalysisComponent))
1611          return false;
1612        GenomicStudyAnalysisComponent o = (GenomicStudyAnalysisComponent) other_;
1613        return compareValues(instantiatesCanonical, o.instantiatesCanonical, true) && compareValues(instantiatesUri, o.instantiatesUri, true)
1614           && compareValues(title, o.title, true) && compareValues(date, o.date, true);
1615      }
1616
1617      public boolean isEmpty() {
1618        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, methodType, changeType
1619          , genomeBuild, instantiatesCanonical, instantiatesUri, title, focus, specimen, date
1620          , note, protocolPerformed, regionsStudied, regionsCalled, input, output, performer
1621          , device);
1622      }
1623
1624  public String fhirType() {
1625    return "GenomicStudy.analysis";
1626
1627  }
1628
1629  }
1630
1631    @Block()
1632    public static class GenomicStudyAnalysisInputComponent extends BackboneElement implements IBaseBackboneElement {
1633        /**
1634         * File containing input data.
1635         */
1636        @Child(name = "file", type = {DocumentReference.class}, order=1, min=0, max=1, modifier=false, summary=true)
1637        @Description(shortDefinition="File containing input data", formalDefinition="File containing input data." )
1638        protected Reference file;
1639
1640        /**
1641         * Type of input data, e.g., BAM, CRAM, or FASTA.
1642         */
1643        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1644        @Description(shortDefinition="Type of input data (e.g., BAM, CRAM, or FASTA)", formalDefinition="Type of input data, e.g., BAM, CRAM, or FASTA." )
1645        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/genomicstudy-dataformat")
1646        protected CodeableConcept type;
1647
1648        /**
1649         * The analysis event or other GenomicStudy that generated this input file.
1650         */
1651        @Child(name = "generatedBy", type = {Identifier.class, GenomicStudy.class}, order=3, min=0, max=1, modifier=false, summary=false)
1652        @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." )
1653        protected DataType generatedBy;
1654
1655        private static final long serialVersionUID = -650883036L;
1656
1657    /**
1658     * Constructor
1659     */
1660      public GenomicStudyAnalysisInputComponent() {
1661        super();
1662      }
1663
1664        /**
1665         * @return {@link #file} (File containing input data.)
1666         */
1667        public Reference getFile() { 
1668          if (this.file == null)
1669            if (Configuration.errorOnAutoCreate())
1670              throw new Error("Attempt to auto-create GenomicStudyAnalysisInputComponent.file");
1671            else if (Configuration.doAutoCreate())
1672              this.file = new Reference(); // cc
1673          return this.file;
1674        }
1675
1676        public boolean hasFile() { 
1677          return this.file != null && !this.file.isEmpty();
1678        }
1679
1680        /**
1681         * @param value {@link #file} (File containing input data.)
1682         */
1683        public GenomicStudyAnalysisInputComponent setFile(Reference value) { 
1684          this.file = value;
1685          return this;
1686        }
1687
1688        /**
1689         * @return {@link #type} (Type of input data, e.g., BAM, CRAM, or FASTA.)
1690         */
1691        public CodeableConcept getType() { 
1692          if (this.type == null)
1693            if (Configuration.errorOnAutoCreate())
1694              throw new Error("Attempt to auto-create GenomicStudyAnalysisInputComponent.type");
1695            else if (Configuration.doAutoCreate())
1696              this.type = new CodeableConcept(); // cc
1697          return this.type;
1698        }
1699
1700        public boolean hasType() { 
1701          return this.type != null && !this.type.isEmpty();
1702        }
1703
1704        /**
1705         * @param value {@link #type} (Type of input data, e.g., BAM, CRAM, or FASTA.)
1706         */
1707        public GenomicStudyAnalysisInputComponent setType(CodeableConcept value) { 
1708          this.type = value;
1709          return this;
1710        }
1711
1712        /**
1713         * @return {@link #generatedBy} (The analysis event or other GenomicStudy that generated this input file.)
1714         */
1715        public DataType getGeneratedBy() { 
1716          return this.generatedBy;
1717        }
1718
1719        /**
1720         * @return {@link #generatedBy} (The analysis event or other GenomicStudy that generated this input file.)
1721         */
1722        public Identifier getGeneratedByIdentifier() throws FHIRException { 
1723          if (this.generatedBy == null)
1724            this.generatedBy = new Identifier();
1725          if (!(this.generatedBy instanceof Identifier))
1726            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.generatedBy.getClass().getName()+" was encountered");
1727          return (Identifier) this.generatedBy;
1728        }
1729
1730        public boolean hasGeneratedByIdentifier() { 
1731          return this != null && this.generatedBy instanceof Identifier;
1732        }
1733
1734        /**
1735         * @return {@link #generatedBy} (The analysis event or other GenomicStudy that generated this input file.)
1736         */
1737        public Reference getGeneratedByReference() throws FHIRException { 
1738          if (this.generatedBy == null)
1739            this.generatedBy = new Reference();
1740          if (!(this.generatedBy instanceof Reference))
1741            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.generatedBy.getClass().getName()+" was encountered");
1742          return (Reference) this.generatedBy;
1743        }
1744
1745        public boolean hasGeneratedByReference() { 
1746          return this != null && this.generatedBy instanceof Reference;
1747        }
1748
1749        public boolean hasGeneratedBy() { 
1750          return this.generatedBy != null && !this.generatedBy.isEmpty();
1751        }
1752
1753        /**
1754         * @param value {@link #generatedBy} (The analysis event or other GenomicStudy that generated this input file.)
1755         */
1756        public GenomicStudyAnalysisInputComponent setGeneratedBy(DataType value) { 
1757          if (value != null && !(value instanceof Identifier || value instanceof Reference))
1758            throw new FHIRException("Not the right type for GenomicStudy.analysis.input.generatedBy[x]: "+value.fhirType());
1759          this.generatedBy = value;
1760          return this;
1761        }
1762
1763        protected void listChildren(List<Property> children) {
1764          super.listChildren(children);
1765          children.add(new Property("file", "Reference(DocumentReference)", "File containing input data.", 0, 1, file));
1766          children.add(new Property("type", "CodeableConcept", "Type of input data, e.g., BAM, CRAM, or FASTA.", 0, 1, type));
1767          children.add(new Property("generatedBy[x]", "Identifier|Reference(GenomicStudy)", "The analysis event or other GenomicStudy that generated this input file.", 0, 1, generatedBy));
1768        }
1769
1770        @Override
1771        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1772          switch (_hash) {
1773          case 3143036: /*file*/  return new Property("file", "Reference(DocumentReference)", "File containing input data.", 0, 1, file);
1774          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of input data, e.g., BAM, CRAM, or FASTA.", 0, 1, type);
1775          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);
1776          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);
1777          case 913138575: /*generatedByIdentifier*/  return new Property("generatedBy[x]", "Identifier", "The analysis event or other GenomicStudy that generated this input file.", 0, 1, generatedBy);
1778          case -1397681243: /*generatedByReference*/  return new Property("generatedBy[x]", "Reference(GenomicStudy)", "The analysis event or other GenomicStudy that generated this input file.", 0, 1, generatedBy);
1779          default: return super.getNamedProperty(_hash, _name, _checkValid);
1780          }
1781
1782        }
1783
1784      @Override
1785      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1786        switch (hash) {
1787        case 3143036: /*file*/ return this.file == null ? new Base[0] : new Base[] {this.file}; // Reference
1788        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1789        case 886733382: /*generatedBy*/ return this.generatedBy == null ? new Base[0] : new Base[] {this.generatedBy}; // DataType
1790        default: return super.getProperty(hash, name, checkValid);
1791        }
1792
1793      }
1794
1795      @Override
1796      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1797        switch (hash) {
1798        case 3143036: // file
1799          this.file = TypeConvertor.castToReference(value); // Reference
1800          return value;
1801        case 3575610: // type
1802          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1803          return value;
1804        case 886733382: // generatedBy
1805          this.generatedBy = TypeConvertor.castToType(value); // DataType
1806          return value;
1807        default: return super.setProperty(hash, name, value);
1808        }
1809
1810      }
1811
1812      @Override
1813      public Base setProperty(String name, Base value) throws FHIRException {
1814        if (name.equals("file")) {
1815          this.file = TypeConvertor.castToReference(value); // Reference
1816        } else if (name.equals("type")) {
1817          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1818        } else if (name.equals("generatedBy[x]")) {
1819          this.generatedBy = TypeConvertor.castToType(value); // DataType
1820        } else
1821          return super.setProperty(name, value);
1822        return value;
1823      }
1824
1825      @Override
1826      public Base makeProperty(int hash, String name) throws FHIRException {
1827        switch (hash) {
1828        case 3143036:  return getFile();
1829        case 3575610:  return getType();
1830        case -1669563270:  return getGeneratedBy();
1831        case 886733382:  return getGeneratedBy();
1832        default: return super.makeProperty(hash, name);
1833        }
1834
1835      }
1836
1837      @Override
1838      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1839        switch (hash) {
1840        case 3143036: /*file*/ return new String[] {"Reference"};
1841        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1842        case 886733382: /*generatedBy*/ return new String[] {"Identifier", "Reference"};
1843        default: return super.getTypesForProperty(hash, name);
1844        }
1845
1846      }
1847
1848      @Override
1849      public Base addChild(String name) throws FHIRException {
1850        if (name.equals("file")) {
1851          this.file = new Reference();
1852          return this.file;
1853        }
1854        else if (name.equals("type")) {
1855          this.type = new CodeableConcept();
1856          return this.type;
1857        }
1858        else if (name.equals("generatedByIdentifier")) {
1859          this.generatedBy = new Identifier();
1860          return this.generatedBy;
1861        }
1862        else if (name.equals("generatedByReference")) {
1863          this.generatedBy = new Reference();
1864          return this.generatedBy;
1865        }
1866        else
1867          return super.addChild(name);
1868      }
1869
1870      public GenomicStudyAnalysisInputComponent copy() {
1871        GenomicStudyAnalysisInputComponent dst = new GenomicStudyAnalysisInputComponent();
1872        copyValues(dst);
1873        return dst;
1874      }
1875
1876      public void copyValues(GenomicStudyAnalysisInputComponent dst) {
1877        super.copyValues(dst);
1878        dst.file = file == null ? null : file.copy();
1879        dst.type = type == null ? null : type.copy();
1880        dst.generatedBy = generatedBy == null ? null : generatedBy.copy();
1881      }
1882
1883      @Override
1884      public boolean equalsDeep(Base other_) {
1885        if (!super.equalsDeep(other_))
1886          return false;
1887        if (!(other_ instanceof GenomicStudyAnalysisInputComponent))
1888          return false;
1889        GenomicStudyAnalysisInputComponent o = (GenomicStudyAnalysisInputComponent) other_;
1890        return compareDeep(file, o.file, true) && compareDeep(type, o.type, true) && compareDeep(generatedBy, o.generatedBy, true)
1891          ;
1892      }
1893
1894      @Override
1895      public boolean equalsShallow(Base other_) {
1896        if (!super.equalsShallow(other_))
1897          return false;
1898        if (!(other_ instanceof GenomicStudyAnalysisInputComponent))
1899          return false;
1900        GenomicStudyAnalysisInputComponent o = (GenomicStudyAnalysisInputComponent) other_;
1901        return true;
1902      }
1903
1904      public boolean isEmpty() {
1905        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(file, type, generatedBy
1906          );
1907      }
1908
1909  public String fhirType() {
1910    return "GenomicStudy.analysis.input";
1911
1912  }
1913
1914  }
1915
1916    @Block()
1917    public static class GenomicStudyAnalysisOutputComponent extends BackboneElement implements IBaseBackboneElement {
1918        /**
1919         * File containing output data.
1920         */
1921        @Child(name = "file", type = {DocumentReference.class}, order=1, min=0, max=1, modifier=false, summary=true)
1922        @Description(shortDefinition="File containing output data", formalDefinition="File containing output data." )
1923        protected Reference file;
1924
1925        /**
1926         * Type of output data, e.g., VCF, MAF, or BAM.
1927         */
1928        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1929        @Description(shortDefinition="Type of output data (e.g., VCF, MAF, or BAM)", formalDefinition="Type of output data, e.g., VCF, MAF, or BAM." )
1930        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/genomicstudy-dataformat")
1931        protected CodeableConcept type;
1932
1933        private static final long serialVersionUID = -2075265800L;
1934
1935    /**
1936     * Constructor
1937     */
1938      public GenomicStudyAnalysisOutputComponent() {
1939        super();
1940      }
1941
1942        /**
1943         * @return {@link #file} (File containing output data.)
1944         */
1945        public Reference getFile() { 
1946          if (this.file == null)
1947            if (Configuration.errorOnAutoCreate())
1948              throw new Error("Attempt to auto-create GenomicStudyAnalysisOutputComponent.file");
1949            else if (Configuration.doAutoCreate())
1950              this.file = new Reference(); // cc
1951          return this.file;
1952        }
1953
1954        public boolean hasFile() { 
1955          return this.file != null && !this.file.isEmpty();
1956        }
1957
1958        /**
1959         * @param value {@link #file} (File containing output data.)
1960         */
1961        public GenomicStudyAnalysisOutputComponent setFile(Reference value) { 
1962          this.file = value;
1963          return this;
1964        }
1965
1966        /**
1967         * @return {@link #type} (Type of output data, e.g., VCF, MAF, or BAM.)
1968         */
1969        public CodeableConcept getType() { 
1970          if (this.type == null)
1971            if (Configuration.errorOnAutoCreate())
1972              throw new Error("Attempt to auto-create GenomicStudyAnalysisOutputComponent.type");
1973            else if (Configuration.doAutoCreate())
1974              this.type = new CodeableConcept(); // cc
1975          return this.type;
1976        }
1977
1978        public boolean hasType() { 
1979          return this.type != null && !this.type.isEmpty();
1980        }
1981
1982        /**
1983         * @param value {@link #type} (Type of output data, e.g., VCF, MAF, or BAM.)
1984         */
1985        public GenomicStudyAnalysisOutputComponent setType(CodeableConcept value) { 
1986          this.type = value;
1987          return this;
1988        }
1989
1990        protected void listChildren(List<Property> children) {
1991          super.listChildren(children);
1992          children.add(new Property("file", "Reference(DocumentReference)", "File containing output data.", 0, 1, file));
1993          children.add(new Property("type", "CodeableConcept", "Type of output data, e.g., VCF, MAF, or BAM.", 0, 1, type));
1994        }
1995
1996        @Override
1997        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1998          switch (_hash) {
1999          case 3143036: /*file*/  return new Property("file", "Reference(DocumentReference)", "File containing output data.", 0, 1, file);
2000          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of output data, e.g., VCF, MAF, or BAM.", 0, 1, type);
2001          default: return super.getNamedProperty(_hash, _name, _checkValid);
2002          }
2003
2004        }
2005
2006      @Override
2007      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2008        switch (hash) {
2009        case 3143036: /*file*/ return this.file == null ? new Base[0] : new Base[] {this.file}; // Reference
2010        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2011        default: return super.getProperty(hash, name, checkValid);
2012        }
2013
2014      }
2015
2016      @Override
2017      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2018        switch (hash) {
2019        case 3143036: // file
2020          this.file = TypeConvertor.castToReference(value); // Reference
2021          return value;
2022        case 3575610: // type
2023          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2024          return value;
2025        default: return super.setProperty(hash, name, value);
2026        }
2027
2028      }
2029
2030      @Override
2031      public Base setProperty(String name, Base value) throws FHIRException {
2032        if (name.equals("file")) {
2033          this.file = TypeConvertor.castToReference(value); // Reference
2034        } else if (name.equals("type")) {
2035          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2036        } else
2037          return super.setProperty(name, value);
2038        return value;
2039      }
2040
2041      @Override
2042      public Base makeProperty(int hash, String name) throws FHIRException {
2043        switch (hash) {
2044        case 3143036:  return getFile();
2045        case 3575610:  return getType();
2046        default: return super.makeProperty(hash, name);
2047        }
2048
2049      }
2050
2051      @Override
2052      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2053        switch (hash) {
2054        case 3143036: /*file*/ return new String[] {"Reference"};
2055        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2056        default: return super.getTypesForProperty(hash, name);
2057        }
2058
2059      }
2060
2061      @Override
2062      public Base addChild(String name) throws FHIRException {
2063        if (name.equals("file")) {
2064          this.file = new Reference();
2065          return this.file;
2066        }
2067        else if (name.equals("type")) {
2068          this.type = new CodeableConcept();
2069          return this.type;
2070        }
2071        else
2072          return super.addChild(name);
2073      }
2074
2075      public GenomicStudyAnalysisOutputComponent copy() {
2076        GenomicStudyAnalysisOutputComponent dst = new GenomicStudyAnalysisOutputComponent();
2077        copyValues(dst);
2078        return dst;
2079      }
2080
2081      public void copyValues(GenomicStudyAnalysisOutputComponent dst) {
2082        super.copyValues(dst);
2083        dst.file = file == null ? null : file.copy();
2084        dst.type = type == null ? null : type.copy();
2085      }
2086
2087      @Override
2088      public boolean equalsDeep(Base other_) {
2089        if (!super.equalsDeep(other_))
2090          return false;
2091        if (!(other_ instanceof GenomicStudyAnalysisOutputComponent))
2092          return false;
2093        GenomicStudyAnalysisOutputComponent o = (GenomicStudyAnalysisOutputComponent) other_;
2094        return compareDeep(file, o.file, true) && compareDeep(type, o.type, true);
2095      }
2096
2097      @Override
2098      public boolean equalsShallow(Base other_) {
2099        if (!super.equalsShallow(other_))
2100          return false;
2101        if (!(other_ instanceof GenomicStudyAnalysisOutputComponent))
2102          return false;
2103        GenomicStudyAnalysisOutputComponent o = (GenomicStudyAnalysisOutputComponent) other_;
2104        return true;
2105      }
2106
2107      public boolean isEmpty() {
2108        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(file, type);
2109      }
2110
2111  public String fhirType() {
2112    return "GenomicStudy.analysis.output";
2113
2114  }
2115
2116  }
2117
2118    @Block()
2119    public static class GenomicStudyAnalysisPerformerComponent extends BackboneElement implements IBaseBackboneElement {
2120        /**
2121         * The organization, healthcare professional, or others who participated in performing this analysis.
2122         */
2123        @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Organization.class, Device.class}, order=1, min=0, max=1, modifier=false, summary=false)
2124        @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." )
2125        protected Reference actor;
2126
2127        /**
2128         * Role of the actor for this analysis.
2129         */
2130        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2131        @Description(shortDefinition="Role of the actor for this analysis", formalDefinition="Role of the actor for this analysis." )
2132        protected CodeableConcept role;
2133
2134        private static final long serialVersionUID = 827444743L;
2135
2136    /**
2137     * Constructor
2138     */
2139      public GenomicStudyAnalysisPerformerComponent() {
2140        super();
2141      }
2142
2143        /**
2144         * @return {@link #actor} (The organization, healthcare professional, or others who participated in performing this analysis.)
2145         */
2146        public Reference getActor() { 
2147          if (this.actor == null)
2148            if (Configuration.errorOnAutoCreate())
2149              throw new Error("Attempt to auto-create GenomicStudyAnalysisPerformerComponent.actor");
2150            else if (Configuration.doAutoCreate())
2151              this.actor = new Reference(); // cc
2152          return this.actor;
2153        }
2154
2155        public boolean hasActor() { 
2156          return this.actor != null && !this.actor.isEmpty();
2157        }
2158
2159        /**
2160         * @param value {@link #actor} (The organization, healthcare professional, or others who participated in performing this analysis.)
2161         */
2162        public GenomicStudyAnalysisPerformerComponent setActor(Reference value) { 
2163          this.actor = value;
2164          return this;
2165        }
2166
2167        /**
2168         * @return {@link #role} (Role of the actor for this analysis.)
2169         */
2170        public CodeableConcept getRole() { 
2171          if (this.role == null)
2172            if (Configuration.errorOnAutoCreate())
2173              throw new Error("Attempt to auto-create GenomicStudyAnalysisPerformerComponent.role");
2174            else if (Configuration.doAutoCreate())
2175              this.role = new CodeableConcept(); // cc
2176          return this.role;
2177        }
2178
2179        public boolean hasRole() { 
2180          return this.role != null && !this.role.isEmpty();
2181        }
2182
2183        /**
2184         * @param value {@link #role} (Role of the actor for this analysis.)
2185         */
2186        public GenomicStudyAnalysisPerformerComponent setRole(CodeableConcept value) { 
2187          this.role = value;
2188          return this;
2189        }
2190
2191        protected void listChildren(List<Property> children) {
2192          super.listChildren(children);
2193          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));
2194          children.add(new Property("role", "CodeableConcept", "Role of the actor for this analysis.", 0, 1, role));
2195        }
2196
2197        @Override
2198        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2199          switch (_hash) {
2200          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);
2201          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Role of the actor for this analysis.", 0, 1, role);
2202          default: return super.getNamedProperty(_hash, _name, _checkValid);
2203          }
2204
2205        }
2206
2207      @Override
2208      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2209        switch (hash) {
2210        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
2211        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
2212        default: return super.getProperty(hash, name, checkValid);
2213        }
2214
2215      }
2216
2217      @Override
2218      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2219        switch (hash) {
2220        case 92645877: // actor
2221          this.actor = TypeConvertor.castToReference(value); // Reference
2222          return value;
2223        case 3506294: // role
2224          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2225          return value;
2226        default: return super.setProperty(hash, name, value);
2227        }
2228
2229      }
2230
2231      @Override
2232      public Base setProperty(String name, Base value) throws FHIRException {
2233        if (name.equals("actor")) {
2234          this.actor = TypeConvertor.castToReference(value); // Reference
2235        } else if (name.equals("role")) {
2236          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2237        } else
2238          return super.setProperty(name, value);
2239        return value;
2240      }
2241
2242      @Override
2243      public Base makeProperty(int hash, String name) throws FHIRException {
2244        switch (hash) {
2245        case 92645877:  return getActor();
2246        case 3506294:  return getRole();
2247        default: return super.makeProperty(hash, name);
2248        }
2249
2250      }
2251
2252      @Override
2253      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2254        switch (hash) {
2255        case 92645877: /*actor*/ return new String[] {"Reference"};
2256        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
2257        default: return super.getTypesForProperty(hash, name);
2258        }
2259
2260      }
2261
2262      @Override
2263      public Base addChild(String name) throws FHIRException {
2264        if (name.equals("actor")) {
2265          this.actor = new Reference();
2266          return this.actor;
2267        }
2268        else if (name.equals("role")) {
2269          this.role = new CodeableConcept();
2270          return this.role;
2271        }
2272        else
2273          return super.addChild(name);
2274      }
2275
2276      public GenomicStudyAnalysisPerformerComponent copy() {
2277        GenomicStudyAnalysisPerformerComponent dst = new GenomicStudyAnalysisPerformerComponent();
2278        copyValues(dst);
2279        return dst;
2280      }
2281
2282      public void copyValues(GenomicStudyAnalysisPerformerComponent dst) {
2283        super.copyValues(dst);
2284        dst.actor = actor == null ? null : actor.copy();
2285        dst.role = role == null ? null : role.copy();
2286      }
2287
2288      @Override
2289      public boolean equalsDeep(Base other_) {
2290        if (!super.equalsDeep(other_))
2291          return false;
2292        if (!(other_ instanceof GenomicStudyAnalysisPerformerComponent))
2293          return false;
2294        GenomicStudyAnalysisPerformerComponent o = (GenomicStudyAnalysisPerformerComponent) other_;
2295        return compareDeep(actor, o.actor, true) && compareDeep(role, o.role, true);
2296      }
2297
2298      @Override
2299      public boolean equalsShallow(Base other_) {
2300        if (!super.equalsShallow(other_))
2301          return false;
2302        if (!(other_ instanceof GenomicStudyAnalysisPerformerComponent))
2303          return false;
2304        GenomicStudyAnalysisPerformerComponent o = (GenomicStudyAnalysisPerformerComponent) other_;
2305        return true;
2306      }
2307
2308      public boolean isEmpty() {
2309        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(actor, role);
2310      }
2311
2312  public String fhirType() {
2313    return "GenomicStudy.analysis.performer";
2314
2315  }
2316
2317  }
2318
2319    @Block()
2320    public static class GenomicStudyAnalysisDeviceComponent extends BackboneElement implements IBaseBackboneElement {
2321        /**
2322         * Device used for the analysis.
2323         */
2324        @Child(name = "device", type = {Device.class}, order=1, min=0, max=1, modifier=false, summary=false)
2325        @Description(shortDefinition="Device used for the analysis", formalDefinition="Device used for the analysis." )
2326        protected Reference device;
2327
2328        /**
2329         * Specific function for the device used for the analysis.
2330         */
2331        @Child(name = "function", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2332        @Description(shortDefinition="Specific function for the device used for the analysis", formalDefinition="Specific function for the device used for the analysis." )
2333        protected CodeableConcept function;
2334
2335        private static final long serialVersionUID = 1643933108L;
2336
2337    /**
2338     * Constructor
2339     */
2340      public GenomicStudyAnalysisDeviceComponent() {
2341        super();
2342      }
2343
2344        /**
2345         * @return {@link #device} (Device used for the analysis.)
2346         */
2347        public Reference getDevice() { 
2348          if (this.device == null)
2349            if (Configuration.errorOnAutoCreate())
2350              throw new Error("Attempt to auto-create GenomicStudyAnalysisDeviceComponent.device");
2351            else if (Configuration.doAutoCreate())
2352              this.device = new Reference(); // cc
2353          return this.device;
2354        }
2355
2356        public boolean hasDevice() { 
2357          return this.device != null && !this.device.isEmpty();
2358        }
2359
2360        /**
2361         * @param value {@link #device} (Device used for the analysis.)
2362         */
2363        public GenomicStudyAnalysisDeviceComponent setDevice(Reference value) { 
2364          this.device = value;
2365          return this;
2366        }
2367
2368        /**
2369         * @return {@link #function} (Specific function for the device used for the analysis.)
2370         */
2371        public CodeableConcept getFunction() { 
2372          if (this.function == null)
2373            if (Configuration.errorOnAutoCreate())
2374              throw new Error("Attempt to auto-create GenomicStudyAnalysisDeviceComponent.function");
2375            else if (Configuration.doAutoCreate())
2376              this.function = new CodeableConcept(); // cc
2377          return this.function;
2378        }
2379
2380        public boolean hasFunction() { 
2381          return this.function != null && !this.function.isEmpty();
2382        }
2383
2384        /**
2385         * @param value {@link #function} (Specific function for the device used for the analysis.)
2386         */
2387        public GenomicStudyAnalysisDeviceComponent setFunction(CodeableConcept value) { 
2388          this.function = value;
2389          return this;
2390        }
2391
2392        protected void listChildren(List<Property> children) {
2393          super.listChildren(children);
2394          children.add(new Property("device", "Reference(Device)", "Device used for the analysis.", 0, 1, device));
2395          children.add(new Property("function", "CodeableConcept", "Specific function for the device used for the analysis.", 0, 1, function));
2396        }
2397
2398        @Override
2399        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2400          switch (_hash) {
2401          case -1335157162: /*device*/  return new Property("device", "Reference(Device)", "Device used for the analysis.", 0, 1, device);
2402          case 1380938712: /*function*/  return new Property("function", "CodeableConcept", "Specific function for the device used for the analysis.", 0, 1, function);
2403          default: return super.getNamedProperty(_hash, _name, _checkValid);
2404          }
2405
2406        }
2407
2408      @Override
2409      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2410        switch (hash) {
2411        case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference
2412        case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept
2413        default: return super.getProperty(hash, name, checkValid);
2414        }
2415
2416      }
2417
2418      @Override
2419      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2420        switch (hash) {
2421        case -1335157162: // device
2422          this.device = TypeConvertor.castToReference(value); // Reference
2423          return value;
2424        case 1380938712: // function
2425          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2426          return value;
2427        default: return super.setProperty(hash, name, value);
2428        }
2429
2430      }
2431
2432      @Override
2433      public Base setProperty(String name, Base value) throws FHIRException {
2434        if (name.equals("device")) {
2435          this.device = TypeConvertor.castToReference(value); // Reference
2436        } else if (name.equals("function")) {
2437          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2438        } else
2439          return super.setProperty(name, value);
2440        return value;
2441      }
2442
2443      @Override
2444      public Base makeProperty(int hash, String name) throws FHIRException {
2445        switch (hash) {
2446        case -1335157162:  return getDevice();
2447        case 1380938712:  return getFunction();
2448        default: return super.makeProperty(hash, name);
2449        }
2450
2451      }
2452
2453      @Override
2454      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2455        switch (hash) {
2456        case -1335157162: /*device*/ return new String[] {"Reference"};
2457        case 1380938712: /*function*/ return new String[] {"CodeableConcept"};
2458        default: return super.getTypesForProperty(hash, name);
2459        }
2460
2461      }
2462
2463      @Override
2464      public Base addChild(String name) throws FHIRException {
2465        if (name.equals("device")) {
2466          this.device = new Reference();
2467          return this.device;
2468        }
2469        else if (name.equals("function")) {
2470          this.function = new CodeableConcept();
2471          return this.function;
2472        }
2473        else
2474          return super.addChild(name);
2475      }
2476
2477      public GenomicStudyAnalysisDeviceComponent copy() {
2478        GenomicStudyAnalysisDeviceComponent dst = new GenomicStudyAnalysisDeviceComponent();
2479        copyValues(dst);
2480        return dst;
2481      }
2482
2483      public void copyValues(GenomicStudyAnalysisDeviceComponent dst) {
2484        super.copyValues(dst);
2485        dst.device = device == null ? null : device.copy();
2486        dst.function = function == null ? null : function.copy();
2487      }
2488
2489      @Override
2490      public boolean equalsDeep(Base other_) {
2491        if (!super.equalsDeep(other_))
2492          return false;
2493        if (!(other_ instanceof GenomicStudyAnalysisDeviceComponent))
2494          return false;
2495        GenomicStudyAnalysisDeviceComponent o = (GenomicStudyAnalysisDeviceComponent) other_;
2496        return compareDeep(device, o.device, true) && compareDeep(function, o.function, true);
2497      }
2498
2499      @Override
2500      public boolean equalsShallow(Base other_) {
2501        if (!super.equalsShallow(other_))
2502          return false;
2503        if (!(other_ instanceof GenomicStudyAnalysisDeviceComponent))
2504          return false;
2505        GenomicStudyAnalysisDeviceComponent o = (GenomicStudyAnalysisDeviceComponent) other_;
2506        return true;
2507      }
2508
2509      public boolean isEmpty() {
2510        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(device, function);
2511      }
2512
2513  public String fhirType() {
2514    return "GenomicStudy.analysis.device";
2515
2516  }
2517
2518  }
2519
2520    /**
2521     * Identifiers for this genomic study.
2522     */
2523    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2524    @Description(shortDefinition="Identifiers for this genomic study", formalDefinition="Identifiers for this genomic study." )
2525    protected List<Identifier> identifier;
2526
2527    /**
2528     * The status of the genomic study.
2529     */
2530    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
2531    @Description(shortDefinition="registered | available | cancelled | entered-in-error | unknown", formalDefinition="The status of the genomic study." )
2532    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/genomicstudy-status")
2533    protected Enumeration<GenomicStudyStatus> status;
2534
2535    /**
2536     * The type of the study, e.g., Familial variant segregation, Functional variation detection, or Gene expression profiling.
2537     */
2538    @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2539    @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." )
2540    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/genomicstudy-type")
2541    protected List<CodeableConcept> type;
2542
2543    /**
2544     * The primary subject of the genomic study.
2545     */
2546    @Child(name = "subject", type = {Patient.class, Group.class, Substance.class, BiologicallyDerivedProduct.class, NutritionProduct.class}, order=3, min=1, max=1, modifier=false, summary=true)
2547    @Description(shortDefinition="The primary subject of the genomic study", formalDefinition="The primary subject of the genomic study." )
2548    protected Reference subject;
2549
2550    /**
2551     * The healthcare event with which this genomics study is associated.
2552     */
2553    @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=true)
2554    @Description(shortDefinition="The healthcare event with which this genomics study is associated", formalDefinition="The healthcare event with which this genomics study is associated." )
2555    protected Reference encounter;
2556
2557    /**
2558     * When the genomic study was started.
2559     */
2560    @Child(name = "startDate", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2561    @Description(shortDefinition="When the genomic study was started", formalDefinition="When the genomic study was started." )
2562    protected DateTimeType startDate;
2563
2564    /**
2565     * Event resources that the genomic study is based on.
2566     */
2567    @Child(name = "basedOn", type = {ServiceRequest.class, Task.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2568    @Description(shortDefinition="Event resources that the genomic study is based on", formalDefinition="Event resources that the genomic study is based on." )
2569    protected List<Reference> basedOn;
2570
2571    /**
2572     * Healthcare professional who requested or referred the genomic study.
2573     */
2574    @Child(name = "referrer", type = {Practitioner.class, PractitionerRole.class}, order=7, min=0, max=1, modifier=false, summary=false)
2575    @Description(shortDefinition="Healthcare professional who requested or referred the genomic study", formalDefinition="Healthcare professional who requested or referred the genomic study." )
2576    protected Reference referrer;
2577
2578    /**
2579     * Healthcare professionals who interpreted the genomic study.
2580     */
2581    @Child(name = "interpreter", type = {Practitioner.class, PractitionerRole.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2582    @Description(shortDefinition="Healthcare professionals who interpreted the genomic study", formalDefinition="Healthcare professionals who interpreted the genomic study." )
2583    protected List<Reference> interpreter;
2584
2585    /**
2586     * Why the genomic study was performed.
2587     */
2588    @Child(name = "reason", type = {CodeableReference.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2589    @Description(shortDefinition="Why the genomic study was performed", formalDefinition="Why the genomic study was performed." )
2590    protected List<CodeableReference> reason;
2591
2592    /**
2593     * The defined protocol that describes the study.
2594     */
2595    @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=10, min=0, max=1, modifier=false, summary=false)
2596    @Description(shortDefinition="The defined protocol that describes the study", formalDefinition="The defined protocol that describes the study." )
2597    protected CanonicalType instantiatesCanonical;
2598
2599    /**
2600     * The URL pointing to an externally maintained protocol that describes the study.
2601     */
2602    @Child(name = "instantiatesUri", type = {UriType.class}, order=11, min=0, max=1, modifier=false, summary=false)
2603    @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." )
2604    protected UriType instantiatesUri;
2605
2606    /**
2607     * Comments related to the genomic study.
2608     */
2609    @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2610    @Description(shortDefinition="Comments related to the genomic study", formalDefinition="Comments related to the genomic study." )
2611    protected List<Annotation> note;
2612
2613    /**
2614     * Description of the genomic study.
2615     */
2616    @Child(name = "description", type = {MarkdownType.class}, order=13, min=0, max=1, modifier=false, summary=false)
2617    @Description(shortDefinition="Description of the genomic study", formalDefinition="Description of the genomic study." )
2618    protected MarkdownType description;
2619
2620    /**
2621     * The details about a specific analysis that was performed in this GenomicStudy.
2622     */
2623    @Child(name = "analysis", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2624    @Description(shortDefinition="Genomic Analysis Event", formalDefinition="The details about a specific analysis that was performed in this GenomicStudy." )
2625    protected List<GenomicStudyAnalysisComponent> analysis;
2626
2627    private static final long serialVersionUID = 644053021L;
2628
2629  /**
2630   * Constructor
2631   */
2632    public GenomicStudy() {
2633      super();
2634    }
2635
2636  /**
2637   * Constructor
2638   */
2639    public GenomicStudy(GenomicStudyStatus status, Reference subject) {
2640      super();
2641      this.setStatus(status);
2642      this.setSubject(subject);
2643    }
2644
2645    /**
2646     * @return {@link #identifier} (Identifiers for this genomic study.)
2647     */
2648    public List<Identifier> getIdentifier() { 
2649      if (this.identifier == null)
2650        this.identifier = new ArrayList<Identifier>();
2651      return this.identifier;
2652    }
2653
2654    /**
2655     * @return Returns a reference to <code>this</code> for easy method chaining
2656     */
2657    public GenomicStudy setIdentifier(List<Identifier> theIdentifier) { 
2658      this.identifier = theIdentifier;
2659      return this;
2660    }
2661
2662    public boolean hasIdentifier() { 
2663      if (this.identifier == null)
2664        return false;
2665      for (Identifier item : this.identifier)
2666        if (!item.isEmpty())
2667          return true;
2668      return false;
2669    }
2670
2671    public Identifier addIdentifier() { //3
2672      Identifier t = new Identifier();
2673      if (this.identifier == null)
2674        this.identifier = new ArrayList<Identifier>();
2675      this.identifier.add(t);
2676      return t;
2677    }
2678
2679    public GenomicStudy addIdentifier(Identifier t) { //3
2680      if (t == null)
2681        return this;
2682      if (this.identifier == null)
2683        this.identifier = new ArrayList<Identifier>();
2684      this.identifier.add(t);
2685      return this;
2686    }
2687
2688    /**
2689     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2690     */
2691    public Identifier getIdentifierFirstRep() { 
2692      if (getIdentifier().isEmpty()) {
2693        addIdentifier();
2694      }
2695      return getIdentifier().get(0);
2696    }
2697
2698    /**
2699     * @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
2700     */
2701    public Enumeration<GenomicStudyStatus> getStatusElement() { 
2702      if (this.status == null)
2703        if (Configuration.errorOnAutoCreate())
2704          throw new Error("Attempt to auto-create GenomicStudy.status");
2705        else if (Configuration.doAutoCreate())
2706          this.status = new Enumeration<GenomicStudyStatus>(new GenomicStudyStatusEnumFactory()); // bb
2707      return this.status;
2708    }
2709
2710    public boolean hasStatusElement() { 
2711      return this.status != null && !this.status.isEmpty();
2712    }
2713
2714    public boolean hasStatus() { 
2715      return this.status != null && !this.status.isEmpty();
2716    }
2717
2718    /**
2719     * @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
2720     */
2721    public GenomicStudy setStatusElement(Enumeration<GenomicStudyStatus> value) { 
2722      this.status = value;
2723      return this;
2724    }
2725
2726    /**
2727     * @return The status of the genomic study.
2728     */
2729    public GenomicStudyStatus getStatus() { 
2730      return this.status == null ? null : this.status.getValue();
2731    }
2732
2733    /**
2734     * @param value The status of the genomic study.
2735     */
2736    public GenomicStudy setStatus(GenomicStudyStatus value) { 
2737        if (this.status == null)
2738          this.status = new Enumeration<GenomicStudyStatus>(new GenomicStudyStatusEnumFactory());
2739        this.status.setValue(value);
2740      return this;
2741    }
2742
2743    /**
2744     * @return {@link #type} (The type of the study, e.g., Familial variant segregation, Functional variation detection, or Gene expression profiling.)
2745     */
2746    public List<CodeableConcept> getType() { 
2747      if (this.type == null)
2748        this.type = new ArrayList<CodeableConcept>();
2749      return this.type;
2750    }
2751
2752    /**
2753     * @return Returns a reference to <code>this</code> for easy method chaining
2754     */
2755    public GenomicStudy setType(List<CodeableConcept> theType) { 
2756      this.type = theType;
2757      return this;
2758    }
2759
2760    public boolean hasType() { 
2761      if (this.type == null)
2762        return false;
2763      for (CodeableConcept item : this.type)
2764        if (!item.isEmpty())
2765          return true;
2766      return false;
2767    }
2768
2769    public CodeableConcept addType() { //3
2770      CodeableConcept t = new CodeableConcept();
2771      if (this.type == null)
2772        this.type = new ArrayList<CodeableConcept>();
2773      this.type.add(t);
2774      return t;
2775    }
2776
2777    public GenomicStudy addType(CodeableConcept t) { //3
2778      if (t == null)
2779        return this;
2780      if (this.type == null)
2781        this.type = new ArrayList<CodeableConcept>();
2782      this.type.add(t);
2783      return this;
2784    }
2785
2786    /**
2787     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
2788     */
2789    public CodeableConcept getTypeFirstRep() { 
2790      if (getType().isEmpty()) {
2791        addType();
2792      }
2793      return getType().get(0);
2794    }
2795
2796    /**
2797     * @return {@link #subject} (The primary subject of the genomic study.)
2798     */
2799    public Reference getSubject() { 
2800      if (this.subject == null)
2801        if (Configuration.errorOnAutoCreate())
2802          throw new Error("Attempt to auto-create GenomicStudy.subject");
2803        else if (Configuration.doAutoCreate())
2804          this.subject = new Reference(); // cc
2805      return this.subject;
2806    }
2807
2808    public boolean hasSubject() { 
2809      return this.subject != null && !this.subject.isEmpty();
2810    }
2811
2812    /**
2813     * @param value {@link #subject} (The primary subject of the genomic study.)
2814     */
2815    public GenomicStudy setSubject(Reference value) { 
2816      this.subject = value;
2817      return this;
2818    }
2819
2820    /**
2821     * @return {@link #encounter} (The healthcare event with which this genomics study is associated.)
2822     */
2823    public Reference getEncounter() { 
2824      if (this.encounter == null)
2825        if (Configuration.errorOnAutoCreate())
2826          throw new Error("Attempt to auto-create GenomicStudy.encounter");
2827        else if (Configuration.doAutoCreate())
2828          this.encounter = new Reference(); // cc
2829      return this.encounter;
2830    }
2831
2832    public boolean hasEncounter() { 
2833      return this.encounter != null && !this.encounter.isEmpty();
2834    }
2835
2836    /**
2837     * @param value {@link #encounter} (The healthcare event with which this genomics study is associated.)
2838     */
2839    public GenomicStudy setEncounter(Reference value) { 
2840      this.encounter = value;
2841      return this;
2842    }
2843
2844    /**
2845     * @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
2846     */
2847    public DateTimeType getStartDateElement() { 
2848      if (this.startDate == null)
2849        if (Configuration.errorOnAutoCreate())
2850          throw new Error("Attempt to auto-create GenomicStudy.startDate");
2851        else if (Configuration.doAutoCreate())
2852          this.startDate = new DateTimeType(); // bb
2853      return this.startDate;
2854    }
2855
2856    public boolean hasStartDateElement() { 
2857      return this.startDate != null && !this.startDate.isEmpty();
2858    }
2859
2860    public boolean hasStartDate() { 
2861      return this.startDate != null && !this.startDate.isEmpty();
2862    }
2863
2864    /**
2865     * @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
2866     */
2867    public GenomicStudy setStartDateElement(DateTimeType value) { 
2868      this.startDate = value;
2869      return this;
2870    }
2871
2872    /**
2873     * @return When the genomic study was started.
2874     */
2875    public Date getStartDate() { 
2876      return this.startDate == null ? null : this.startDate.getValue();
2877    }
2878
2879    /**
2880     * @param value When the genomic study was started.
2881     */
2882    public GenomicStudy setStartDate(Date value) { 
2883      if (value == null)
2884        this.startDate = null;
2885      else {
2886        if (this.startDate == null)
2887          this.startDate = new DateTimeType();
2888        this.startDate.setValue(value);
2889      }
2890      return this;
2891    }
2892
2893    /**
2894     * @return {@link #basedOn} (Event resources that the genomic study is based on.)
2895     */
2896    public List<Reference> getBasedOn() { 
2897      if (this.basedOn == null)
2898        this.basedOn = new ArrayList<Reference>();
2899      return this.basedOn;
2900    }
2901
2902    /**
2903     * @return Returns a reference to <code>this</code> for easy method chaining
2904     */
2905    public GenomicStudy setBasedOn(List<Reference> theBasedOn) { 
2906      this.basedOn = theBasedOn;
2907      return this;
2908    }
2909
2910    public boolean hasBasedOn() { 
2911      if (this.basedOn == null)
2912        return false;
2913      for (Reference item : this.basedOn)
2914        if (!item.isEmpty())
2915          return true;
2916      return false;
2917    }
2918
2919    public Reference addBasedOn() { //3
2920      Reference t = new Reference();
2921      if (this.basedOn == null)
2922        this.basedOn = new ArrayList<Reference>();
2923      this.basedOn.add(t);
2924      return t;
2925    }
2926
2927    public GenomicStudy addBasedOn(Reference t) { //3
2928      if (t == null)
2929        return this;
2930      if (this.basedOn == null)
2931        this.basedOn = new ArrayList<Reference>();
2932      this.basedOn.add(t);
2933      return this;
2934    }
2935
2936    /**
2937     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
2938     */
2939    public Reference getBasedOnFirstRep() { 
2940      if (getBasedOn().isEmpty()) {
2941        addBasedOn();
2942      }
2943      return getBasedOn().get(0);
2944    }
2945
2946    /**
2947     * @return {@link #referrer} (Healthcare professional who requested or referred the genomic study.)
2948     */
2949    public Reference getReferrer() { 
2950      if (this.referrer == null)
2951        if (Configuration.errorOnAutoCreate())
2952          throw new Error("Attempt to auto-create GenomicStudy.referrer");
2953        else if (Configuration.doAutoCreate())
2954          this.referrer = new Reference(); // cc
2955      return this.referrer;
2956    }
2957
2958    public boolean hasReferrer() { 
2959      return this.referrer != null && !this.referrer.isEmpty();
2960    }
2961
2962    /**
2963     * @param value {@link #referrer} (Healthcare professional who requested or referred the genomic study.)
2964     */
2965    public GenomicStudy setReferrer(Reference value) { 
2966      this.referrer = value;
2967      return this;
2968    }
2969
2970    /**
2971     * @return {@link #interpreter} (Healthcare professionals who interpreted the genomic study.)
2972     */
2973    public List<Reference> getInterpreter() { 
2974      if (this.interpreter == null)
2975        this.interpreter = new ArrayList<Reference>();
2976      return this.interpreter;
2977    }
2978
2979    /**
2980     * @return Returns a reference to <code>this</code> for easy method chaining
2981     */
2982    public GenomicStudy setInterpreter(List<Reference> theInterpreter) { 
2983      this.interpreter = theInterpreter;
2984      return this;
2985    }
2986
2987    public boolean hasInterpreter() { 
2988      if (this.interpreter == null)
2989        return false;
2990      for (Reference item : this.interpreter)
2991        if (!item.isEmpty())
2992          return true;
2993      return false;
2994    }
2995
2996    public Reference addInterpreter() { //3
2997      Reference t = new Reference();
2998      if (this.interpreter == null)
2999        this.interpreter = new ArrayList<Reference>();
3000      this.interpreter.add(t);
3001      return t;
3002    }
3003
3004    public GenomicStudy addInterpreter(Reference t) { //3
3005      if (t == null)
3006        return this;
3007      if (this.interpreter == null)
3008        this.interpreter = new ArrayList<Reference>();
3009      this.interpreter.add(t);
3010      return this;
3011    }
3012
3013    /**
3014     * @return The first repetition of repeating field {@link #interpreter}, creating it if it does not already exist {3}
3015     */
3016    public Reference getInterpreterFirstRep() { 
3017      if (getInterpreter().isEmpty()) {
3018        addInterpreter();
3019      }
3020      return getInterpreter().get(0);
3021    }
3022
3023    /**
3024     * @return {@link #reason} (Why the genomic study was performed.)
3025     */
3026    public List<CodeableReference> getReason() { 
3027      if (this.reason == null)
3028        this.reason = new ArrayList<CodeableReference>();
3029      return this.reason;
3030    }
3031
3032    /**
3033     * @return Returns a reference to <code>this</code> for easy method chaining
3034     */
3035    public GenomicStudy setReason(List<CodeableReference> theReason) { 
3036      this.reason = theReason;
3037      return this;
3038    }
3039
3040    public boolean hasReason() { 
3041      if (this.reason == null)
3042        return false;
3043      for (CodeableReference item : this.reason)
3044        if (!item.isEmpty())
3045          return true;
3046      return false;
3047    }
3048
3049    public CodeableReference addReason() { //3
3050      CodeableReference t = new CodeableReference();
3051      if (this.reason == null)
3052        this.reason = new ArrayList<CodeableReference>();
3053      this.reason.add(t);
3054      return t;
3055    }
3056
3057    public GenomicStudy addReason(CodeableReference t) { //3
3058      if (t == null)
3059        return this;
3060      if (this.reason == null)
3061        this.reason = new ArrayList<CodeableReference>();
3062      this.reason.add(t);
3063      return this;
3064    }
3065
3066    /**
3067     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
3068     */
3069    public CodeableReference getReasonFirstRep() { 
3070      if (getReason().isEmpty()) {
3071        addReason();
3072      }
3073      return getReason().get(0);
3074    }
3075
3076    /**
3077     * @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
3078     */
3079    public CanonicalType getInstantiatesCanonicalElement() { 
3080      if (this.instantiatesCanonical == null)
3081        if (Configuration.errorOnAutoCreate())
3082          throw new Error("Attempt to auto-create GenomicStudy.instantiatesCanonical");
3083        else if (Configuration.doAutoCreate())
3084          this.instantiatesCanonical = new CanonicalType(); // bb
3085      return this.instantiatesCanonical;
3086    }
3087
3088    public boolean hasInstantiatesCanonicalElement() { 
3089      return this.instantiatesCanonical != null && !this.instantiatesCanonical.isEmpty();
3090    }
3091
3092    public boolean hasInstantiatesCanonical() { 
3093      return this.instantiatesCanonical != null && !this.instantiatesCanonical.isEmpty();
3094    }
3095
3096    /**
3097     * @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
3098     */
3099    public GenomicStudy setInstantiatesCanonicalElement(CanonicalType value) { 
3100      this.instantiatesCanonical = value;
3101      return this;
3102    }
3103
3104    /**
3105     * @return The defined protocol that describes the study.
3106     */
3107    public String getInstantiatesCanonical() { 
3108      return this.instantiatesCanonical == null ? null : this.instantiatesCanonical.getValue();
3109    }
3110
3111    /**
3112     * @param value The defined protocol that describes the study.
3113     */
3114    public GenomicStudy setInstantiatesCanonical(String value) { 
3115      if (Utilities.noString(value))
3116        this.instantiatesCanonical = null;
3117      else {
3118        if (this.instantiatesCanonical == null)
3119          this.instantiatesCanonical = new CanonicalType();
3120        this.instantiatesCanonical.setValue(value);
3121      }
3122      return this;
3123    }
3124
3125    /**
3126     * @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
3127     */
3128    public UriType getInstantiatesUriElement() { 
3129      if (this.instantiatesUri == null)
3130        if (Configuration.errorOnAutoCreate())
3131          throw new Error("Attempt to auto-create GenomicStudy.instantiatesUri");
3132        else if (Configuration.doAutoCreate())
3133          this.instantiatesUri = new UriType(); // bb
3134      return this.instantiatesUri;
3135    }
3136
3137    public boolean hasInstantiatesUriElement() { 
3138      return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
3139    }
3140
3141    public boolean hasInstantiatesUri() { 
3142      return this.instantiatesUri != null && !this.instantiatesUri.isEmpty();
3143    }
3144
3145    /**
3146     * @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
3147     */
3148    public GenomicStudy setInstantiatesUriElement(UriType value) { 
3149      this.instantiatesUri = value;
3150      return this;
3151    }
3152
3153    /**
3154     * @return The URL pointing to an externally maintained protocol that describes the study.
3155     */
3156    public String getInstantiatesUri() { 
3157      return this.instantiatesUri == null ? null : this.instantiatesUri.getValue();
3158    }
3159
3160    /**
3161     * @param value The URL pointing to an externally maintained protocol that describes the study.
3162     */
3163    public GenomicStudy setInstantiatesUri(String value) { 
3164      if (Utilities.noString(value))
3165        this.instantiatesUri = null;
3166      else {
3167        if (this.instantiatesUri == null)
3168          this.instantiatesUri = new UriType();
3169        this.instantiatesUri.setValue(value);
3170      }
3171      return this;
3172    }
3173
3174    /**
3175     * @return {@link #note} (Comments related to the genomic study.)
3176     */
3177    public List<Annotation> getNote() { 
3178      if (this.note == null)
3179        this.note = new ArrayList<Annotation>();
3180      return this.note;
3181    }
3182
3183    /**
3184     * @return Returns a reference to <code>this</code> for easy method chaining
3185     */
3186    public GenomicStudy setNote(List<Annotation> theNote) { 
3187      this.note = theNote;
3188      return this;
3189    }
3190
3191    public boolean hasNote() { 
3192      if (this.note == null)
3193        return false;
3194      for (Annotation item : this.note)
3195        if (!item.isEmpty())
3196          return true;
3197      return false;
3198    }
3199
3200    public Annotation addNote() { //3
3201      Annotation t = new Annotation();
3202      if (this.note == null)
3203        this.note = new ArrayList<Annotation>();
3204      this.note.add(t);
3205      return t;
3206    }
3207
3208    public GenomicStudy addNote(Annotation t) { //3
3209      if (t == null)
3210        return this;
3211      if (this.note == null)
3212        this.note = new ArrayList<Annotation>();
3213      this.note.add(t);
3214      return this;
3215    }
3216
3217    /**
3218     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
3219     */
3220    public Annotation getNoteFirstRep() { 
3221      if (getNote().isEmpty()) {
3222        addNote();
3223      }
3224      return getNote().get(0);
3225    }
3226
3227    /**
3228     * @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
3229     */
3230    public MarkdownType getDescriptionElement() { 
3231      if (this.description == null)
3232        if (Configuration.errorOnAutoCreate())
3233          throw new Error("Attempt to auto-create GenomicStudy.description");
3234        else if (Configuration.doAutoCreate())
3235          this.description = new MarkdownType(); // bb
3236      return this.description;
3237    }
3238
3239    public boolean hasDescriptionElement() { 
3240      return this.description != null && !this.description.isEmpty();
3241    }
3242
3243    public boolean hasDescription() { 
3244      return this.description != null && !this.description.isEmpty();
3245    }
3246
3247    /**
3248     * @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
3249     */
3250    public GenomicStudy setDescriptionElement(MarkdownType value) { 
3251      this.description = value;
3252      return this;
3253    }
3254
3255    /**
3256     * @return Description of the genomic study.
3257     */
3258    public String getDescription() { 
3259      return this.description == null ? null : this.description.getValue();
3260    }
3261
3262    /**
3263     * @param value Description of the genomic study.
3264     */
3265    public GenomicStudy setDescription(String value) { 
3266      if (Utilities.noString(value))
3267        this.description = null;
3268      else {
3269        if (this.description == null)
3270          this.description = new MarkdownType();
3271        this.description.setValue(value);
3272      }
3273      return this;
3274    }
3275
3276    /**
3277     * @return {@link #analysis} (The details about a specific analysis that was performed in this GenomicStudy.)
3278     */
3279    public List<GenomicStudyAnalysisComponent> getAnalysis() { 
3280      if (this.analysis == null)
3281        this.analysis = new ArrayList<GenomicStudyAnalysisComponent>();
3282      return this.analysis;
3283    }
3284
3285    /**
3286     * @return Returns a reference to <code>this</code> for easy method chaining
3287     */
3288    public GenomicStudy setAnalysis(List<GenomicStudyAnalysisComponent> theAnalysis) { 
3289      this.analysis = theAnalysis;
3290      return this;
3291    }
3292
3293    public boolean hasAnalysis() { 
3294      if (this.analysis == null)
3295        return false;
3296      for (GenomicStudyAnalysisComponent item : this.analysis)
3297        if (!item.isEmpty())
3298          return true;
3299      return false;
3300    }
3301
3302    public GenomicStudyAnalysisComponent addAnalysis() { //3
3303      GenomicStudyAnalysisComponent t = new GenomicStudyAnalysisComponent();
3304      if (this.analysis == null)
3305        this.analysis = new ArrayList<GenomicStudyAnalysisComponent>();
3306      this.analysis.add(t);
3307      return t;
3308    }
3309
3310    public GenomicStudy addAnalysis(GenomicStudyAnalysisComponent t) { //3
3311      if (t == null)
3312        return this;
3313      if (this.analysis == null)
3314        this.analysis = new ArrayList<GenomicStudyAnalysisComponent>();
3315      this.analysis.add(t);
3316      return this;
3317    }
3318
3319    /**
3320     * @return The first repetition of repeating field {@link #analysis}, creating it if it does not already exist {3}
3321     */
3322    public GenomicStudyAnalysisComponent getAnalysisFirstRep() { 
3323      if (getAnalysis().isEmpty()) {
3324        addAnalysis();
3325      }
3326      return getAnalysis().get(0);
3327    }
3328
3329      protected void listChildren(List<Property> children) {
3330        super.listChildren(children);
3331        children.add(new Property("identifier", "Identifier", "Identifiers for this genomic study.", 0, java.lang.Integer.MAX_VALUE, identifier));
3332        children.add(new Property("status", "code", "The status of the genomic study.", 0, 1, status));
3333        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));
3334        children.add(new Property("subject", "Reference(Patient|Group|Substance|BiologicallyDerivedProduct|NutritionProduct)", "The primary subject of the genomic study.", 0, 1, subject));
3335        children.add(new Property("encounter", "Reference(Encounter)", "The healthcare event with which this genomics study is associated.", 0, 1, encounter));
3336        children.add(new Property("startDate", "dateTime", "When the genomic study was started.", 0, 1, startDate));
3337        children.add(new Property("basedOn", "Reference(ServiceRequest|Task)", "Event resources that the genomic study is based on.", 0, java.lang.Integer.MAX_VALUE, basedOn));
3338        children.add(new Property("referrer", "Reference(Practitioner|PractitionerRole)", "Healthcare professional who requested or referred the genomic study.", 0, 1, referrer));
3339        children.add(new Property("interpreter", "Reference(Practitioner|PractitionerRole)", "Healthcare professionals who interpreted the genomic study.", 0, java.lang.Integer.MAX_VALUE, interpreter));
3340        children.add(new Property("reason", "CodeableReference(Condition|Observation)", "Why the genomic study was performed.", 0, java.lang.Integer.MAX_VALUE, reason));
3341        children.add(new Property("instantiatesCanonical", "canonical(PlanDefinition)", "The defined protocol that describes the study.", 0, 1, instantiatesCanonical));
3342        children.add(new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol that describes the study.", 0, 1, instantiatesUri));
3343        children.add(new Property("note", "Annotation", "Comments related to the genomic study.", 0, java.lang.Integer.MAX_VALUE, note));
3344        children.add(new Property("description", "markdown", "Description of the genomic study.", 0, 1, description));
3345        children.add(new Property("analysis", "", "The details about a specific analysis that was performed in this GenomicStudy.", 0, java.lang.Integer.MAX_VALUE, analysis));
3346      }
3347
3348      @Override
3349      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3350        switch (_hash) {
3351        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers for this genomic study.", 0, java.lang.Integer.MAX_VALUE, identifier);
3352        case -892481550: /*status*/  return new Property("status", "code", "The status of the genomic study.", 0, 1, status);
3353        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);
3354        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Substance|BiologicallyDerivedProduct|NutritionProduct)", "The primary subject of the genomic study.", 0, 1, subject);
3355        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The healthcare event with which this genomics study is associated.", 0, 1, encounter);
3356        case -2129778896: /*startDate*/  return new Property("startDate", "dateTime", "When the genomic study was started.", 0, 1, startDate);
3357        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);
3358        case -722568161: /*referrer*/  return new Property("referrer", "Reference(Practitioner|PractitionerRole)", "Healthcare professional who requested or referred the genomic study.", 0, 1, referrer);
3359        case -2008009094: /*interpreter*/  return new Property("interpreter", "Reference(Practitioner|PractitionerRole)", "Healthcare professionals who interpreted the genomic study.", 0, java.lang.Integer.MAX_VALUE, interpreter);
3360        case -934964668: /*reason*/  return new Property("reason", "CodeableReference(Condition|Observation)", "Why the genomic study was performed.", 0, java.lang.Integer.MAX_VALUE, reason);
3361        case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "canonical(PlanDefinition)", "The defined protocol that describes the study.", 0, 1, instantiatesCanonical);
3362        case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol that describes the study.", 0, 1, instantiatesUri);
3363        case 3387378: /*note*/  return new Property("note", "Annotation", "Comments related to the genomic study.", 0, java.lang.Integer.MAX_VALUE, note);
3364        case -1724546052: /*description*/  return new Property("description", "markdown", "Description of the genomic study.", 0, 1, description);
3365        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);
3366        default: return super.getNamedProperty(_hash, _name, _checkValid);
3367        }
3368
3369      }
3370
3371      @Override
3372      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3373        switch (hash) {
3374        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3375        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<GenomicStudyStatus>
3376        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
3377        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
3378        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
3379        case -2129778896: /*startDate*/ return this.startDate == null ? new Base[0] : new Base[] {this.startDate}; // DateTimeType
3380        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
3381        case -722568161: /*referrer*/ return this.referrer == null ? new Base[0] : new Base[] {this.referrer}; // Reference
3382        case -2008009094: /*interpreter*/ return this.interpreter == null ? new Base[0] : this.interpreter.toArray(new Base[this.interpreter.size()]); // Reference
3383        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
3384        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : new Base[] {this.instantiatesCanonical}; // CanonicalType
3385        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : new Base[] {this.instantiatesUri}; // UriType
3386        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
3387        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
3388        case -1024445732: /*analysis*/ return this.analysis == null ? new Base[0] : this.analysis.toArray(new Base[this.analysis.size()]); // GenomicStudyAnalysisComponent
3389        default: return super.getProperty(hash, name, checkValid);
3390        }
3391
3392      }
3393
3394      @Override
3395      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3396        switch (hash) {
3397        case -1618432855: // identifier
3398          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3399          return value;
3400        case -892481550: // status
3401          value = new GenomicStudyStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3402          this.status = (Enumeration) value; // Enumeration<GenomicStudyStatus>
3403          return value;
3404        case 3575610: // type
3405          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3406          return value;
3407        case -1867885268: // subject
3408          this.subject = TypeConvertor.castToReference(value); // Reference
3409          return value;
3410        case 1524132147: // encounter
3411          this.encounter = TypeConvertor.castToReference(value); // Reference
3412          return value;
3413        case -2129778896: // startDate
3414          this.startDate = TypeConvertor.castToDateTime(value); // DateTimeType
3415          return value;
3416        case -332612366: // basedOn
3417          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
3418          return value;
3419        case -722568161: // referrer
3420          this.referrer = TypeConvertor.castToReference(value); // Reference
3421          return value;
3422        case -2008009094: // interpreter
3423          this.getInterpreter().add(TypeConvertor.castToReference(value)); // Reference
3424          return value;
3425        case -934964668: // reason
3426          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
3427          return value;
3428        case 8911915: // instantiatesCanonical
3429          this.instantiatesCanonical = TypeConvertor.castToCanonical(value); // CanonicalType
3430          return value;
3431        case -1926393373: // instantiatesUri
3432          this.instantiatesUri = TypeConvertor.castToUri(value); // UriType
3433          return value;
3434        case 3387378: // note
3435          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
3436          return value;
3437        case -1724546052: // description
3438          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
3439          return value;
3440        case -1024445732: // analysis
3441          this.getAnalysis().add((GenomicStudyAnalysisComponent) value); // GenomicStudyAnalysisComponent
3442          return value;
3443        default: return super.setProperty(hash, name, value);
3444        }
3445
3446      }
3447
3448      @Override
3449      public Base setProperty(String name, Base value) throws FHIRException {
3450        if (name.equals("identifier")) {
3451          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3452        } else if (name.equals("status")) {
3453          value = new GenomicStudyStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3454          this.status = (Enumeration) value; // Enumeration<GenomicStudyStatus>
3455        } else if (name.equals("type")) {
3456          this.getType().add(TypeConvertor.castToCodeableConcept(value));
3457        } else if (name.equals("subject")) {
3458          this.subject = TypeConvertor.castToReference(value); // Reference
3459        } else if (name.equals("encounter")) {
3460          this.encounter = TypeConvertor.castToReference(value); // Reference
3461        } else if (name.equals("startDate")) {
3462          this.startDate = TypeConvertor.castToDateTime(value); // DateTimeType
3463        } else if (name.equals("basedOn")) {
3464          this.getBasedOn().add(TypeConvertor.castToReference(value));
3465        } else if (name.equals("referrer")) {
3466          this.referrer = TypeConvertor.castToReference(value); // Reference
3467        } else if (name.equals("interpreter")) {
3468          this.getInterpreter().add(TypeConvertor.castToReference(value));
3469        } else if (name.equals("reason")) {
3470          this.getReason().add(TypeConvertor.castToCodeableReference(value));
3471        } else if (name.equals("instantiatesCanonical")) {
3472          this.instantiatesCanonical = TypeConvertor.castToCanonical(value); // CanonicalType
3473        } else if (name.equals("instantiatesUri")) {
3474          this.instantiatesUri = TypeConvertor.castToUri(value); // UriType
3475        } else if (name.equals("note")) {
3476          this.getNote().add(TypeConvertor.castToAnnotation(value));
3477        } else if (name.equals("description")) {
3478          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
3479        } else if (name.equals("analysis")) {
3480          this.getAnalysis().add((GenomicStudyAnalysisComponent) value);
3481        } else
3482          return super.setProperty(name, value);
3483        return value;
3484      }
3485
3486      @Override
3487      public Base makeProperty(int hash, String name) throws FHIRException {
3488        switch (hash) {
3489        case -1618432855:  return addIdentifier(); 
3490        case -892481550:  return getStatusElement();
3491        case 3575610:  return addType(); 
3492        case -1867885268:  return getSubject();
3493        case 1524132147:  return getEncounter();
3494        case -2129778896:  return getStartDateElement();
3495        case -332612366:  return addBasedOn(); 
3496        case -722568161:  return getReferrer();
3497        case -2008009094:  return addInterpreter(); 
3498        case -934964668:  return addReason(); 
3499        case 8911915:  return getInstantiatesCanonicalElement();
3500        case -1926393373:  return getInstantiatesUriElement();
3501        case 3387378:  return addNote(); 
3502        case -1724546052:  return getDescriptionElement();
3503        case -1024445732:  return addAnalysis(); 
3504        default: return super.makeProperty(hash, name);
3505        }
3506
3507      }
3508
3509      @Override
3510      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3511        switch (hash) {
3512        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3513        case -892481550: /*status*/ return new String[] {"code"};
3514        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3515        case -1867885268: /*subject*/ return new String[] {"Reference"};
3516        case 1524132147: /*encounter*/ return new String[] {"Reference"};
3517        case -2129778896: /*startDate*/ return new String[] {"dateTime"};
3518        case -332612366: /*basedOn*/ return new String[] {"Reference"};
3519        case -722568161: /*referrer*/ return new String[] {"Reference"};
3520        case -2008009094: /*interpreter*/ return new String[] {"Reference"};
3521        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
3522        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
3523        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
3524        case 3387378: /*note*/ return new String[] {"Annotation"};
3525        case -1724546052: /*description*/ return new String[] {"markdown"};
3526        case -1024445732: /*analysis*/ return new String[] {};
3527        default: return super.getTypesForProperty(hash, name);
3528        }
3529
3530      }
3531
3532      @Override
3533      public Base addChild(String name) throws FHIRException {
3534        if (name.equals("identifier")) {
3535          return addIdentifier();
3536        }
3537        else if (name.equals("status")) {
3538          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.status");
3539        }
3540        else if (name.equals("type")) {
3541          return addType();
3542        }
3543        else if (name.equals("subject")) {
3544          this.subject = new Reference();
3545          return this.subject;
3546        }
3547        else if (name.equals("encounter")) {
3548          this.encounter = new Reference();
3549          return this.encounter;
3550        }
3551        else if (name.equals("startDate")) {
3552          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.startDate");
3553        }
3554        else if (name.equals("basedOn")) {
3555          return addBasedOn();
3556        }
3557        else if (name.equals("referrer")) {
3558          this.referrer = new Reference();
3559          return this.referrer;
3560        }
3561        else if (name.equals("interpreter")) {
3562          return addInterpreter();
3563        }
3564        else if (name.equals("reason")) {
3565          return addReason();
3566        }
3567        else if (name.equals("instantiatesCanonical")) {
3568          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.instantiatesCanonical");
3569        }
3570        else if (name.equals("instantiatesUri")) {
3571          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.instantiatesUri");
3572        }
3573        else if (name.equals("note")) {
3574          return addNote();
3575        }
3576        else if (name.equals("description")) {
3577          throw new FHIRException("Cannot call addChild on a singleton property GenomicStudy.description");
3578        }
3579        else if (name.equals("analysis")) {
3580          return addAnalysis();
3581        }
3582        else
3583          return super.addChild(name);
3584      }
3585
3586  public String fhirType() {
3587    return "GenomicStudy";
3588
3589  }
3590
3591      public GenomicStudy copy() {
3592        GenomicStudy dst = new GenomicStudy();
3593        copyValues(dst);
3594        return dst;
3595      }
3596
3597      public void copyValues(GenomicStudy dst) {
3598        super.copyValues(dst);
3599        if (identifier != null) {
3600          dst.identifier = new ArrayList<Identifier>();
3601          for (Identifier i : identifier)
3602            dst.identifier.add(i.copy());
3603        };
3604        dst.status = status == null ? null : status.copy();
3605        if (type != null) {
3606          dst.type = new ArrayList<CodeableConcept>();
3607          for (CodeableConcept i : type)
3608            dst.type.add(i.copy());
3609        };
3610        dst.subject = subject == null ? null : subject.copy();
3611        dst.encounter = encounter == null ? null : encounter.copy();
3612        dst.startDate = startDate == null ? null : startDate.copy();
3613        if (basedOn != null) {
3614          dst.basedOn = new ArrayList<Reference>();
3615          for (Reference i : basedOn)
3616            dst.basedOn.add(i.copy());
3617        };
3618        dst.referrer = referrer == null ? null : referrer.copy();
3619        if (interpreter != null) {
3620          dst.interpreter = new ArrayList<Reference>();
3621          for (Reference i : interpreter)
3622            dst.interpreter.add(i.copy());
3623        };
3624        if (reason != null) {
3625          dst.reason = new ArrayList<CodeableReference>();
3626          for (CodeableReference i : reason)
3627            dst.reason.add(i.copy());
3628        };
3629        dst.instantiatesCanonical = instantiatesCanonical == null ? null : instantiatesCanonical.copy();
3630        dst.instantiatesUri = instantiatesUri == null ? null : instantiatesUri.copy();
3631        if (note != null) {
3632          dst.note = new ArrayList<Annotation>();
3633          for (Annotation i : note)
3634            dst.note.add(i.copy());
3635        };
3636        dst.description = description == null ? null : description.copy();
3637        if (analysis != null) {
3638          dst.analysis = new ArrayList<GenomicStudyAnalysisComponent>();
3639          for (GenomicStudyAnalysisComponent i : analysis)
3640            dst.analysis.add(i.copy());
3641        };
3642      }
3643
3644      protected GenomicStudy typedCopy() {
3645        return copy();
3646      }
3647
3648      @Override
3649      public boolean equalsDeep(Base other_) {
3650        if (!super.equalsDeep(other_))
3651          return false;
3652        if (!(other_ instanceof GenomicStudy))
3653          return false;
3654        GenomicStudy o = (GenomicStudy) other_;
3655        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true)
3656           && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) && compareDeep(startDate, o.startDate, true)
3657           && compareDeep(basedOn, o.basedOn, true) && compareDeep(referrer, o.referrer, true) && compareDeep(interpreter, o.interpreter, true)
3658           && compareDeep(reason, o.reason, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
3659           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(note, o.note, true) && compareDeep(description, o.description, true)
3660           && compareDeep(analysis, o.analysis, true);
3661      }
3662
3663      @Override
3664      public boolean equalsShallow(Base other_) {
3665        if (!super.equalsShallow(other_))
3666          return false;
3667        if (!(other_ instanceof GenomicStudy))
3668          return false;
3669        GenomicStudy o = (GenomicStudy) other_;
3670        return compareValues(status, o.status, true) && compareValues(startDate, o.startDate, true) && compareValues(instantiatesCanonical, o.instantiatesCanonical, true)
3671           && compareValues(instantiatesUri, o.instantiatesUri, true) && compareValues(description, o.description, true)
3672          ;
3673      }
3674
3675      public boolean isEmpty() {
3676        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type
3677          , subject, encounter, startDate, basedOn, referrer, interpreter, reason, instantiatesCanonical
3678          , instantiatesUri, note, description, analysis);
3679      }
3680
3681  @Override
3682  public ResourceType getResourceType() {
3683    return ResourceType.GenomicStudy;
3684   }
3685
3686 /**
3687   * Search parameter: <b>focus</b>
3688   * <p>
3689   * Description: <b>What the genomic study analysis is about, when it is not about the subject of record</b><br>
3690   * Type: <b>reference</b><br>
3691   * Path: <b>GenomicStudy.analysis.focus</b><br>
3692   * </p>
3693   */
3694  @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 } )
3695  public static final String SP_FOCUS = "focus";
3696 /**
3697   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
3698   * <p>
3699   * Description: <b>What the genomic study analysis is about, when it is not about the subject of record</b><br>
3700   * Type: <b>reference</b><br>
3701   * Path: <b>GenomicStudy.analysis.focus</b><br>
3702   * </p>
3703   */
3704  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FOCUS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FOCUS);
3705
3706/**
3707   * Constant for fluent queries to be used to add include statements. Specifies
3708   * the path value of "<b>GenomicStudy:focus</b>".
3709   */
3710  public static final ca.uhn.fhir.model.api.Include INCLUDE_FOCUS = new ca.uhn.fhir.model.api.Include("GenomicStudy:focus").toLocked();
3711
3712 /**
3713   * Search parameter: <b>identifier</b>
3714   * <p>
3715   * Description: <b>Identifiers for the Study</b><br>
3716   * Type: <b>token</b><br>
3717   * Path: <b>GenomicStudy.identifier</b><br>
3718   * </p>
3719   */
3720  @SearchParamDefinition(name="identifier", path="GenomicStudy.identifier", description="Identifiers for the Study", type="token" )
3721  public static final String SP_IDENTIFIER = "identifier";
3722 /**
3723   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3724   * <p>
3725   * Description: <b>Identifiers for the Study</b><br>
3726   * Type: <b>token</b><br>
3727   * Path: <b>GenomicStudy.identifier</b><br>
3728   * </p>
3729   */
3730  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3731
3732 /**
3733   * Search parameter: <b>patient</b>
3734   * <p>
3735   * Description: <b>Who the study is about</b><br>
3736   * Type: <b>reference</b><br>
3737   * Path: <b>GenomicStudy.subject.where(resolve() is Patient)</b><br>
3738   * </p>
3739   */
3740  @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 } )
3741  public static final String SP_PATIENT = "patient";
3742 /**
3743   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3744   * <p>
3745   * Description: <b>Who the study is about</b><br>
3746   * Type: <b>reference</b><br>
3747   * Path: <b>GenomicStudy.subject.where(resolve() is Patient)</b><br>
3748   * </p>
3749   */
3750  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3751
3752/**
3753   * Constant for fluent queries to be used to add include statements. Specifies
3754   * the path value of "<b>GenomicStudy:patient</b>".
3755   */
3756  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("GenomicStudy:patient").toLocked();
3757
3758 /**
3759   * Search parameter: <b>status</b>
3760   * <p>
3761   * Description: <b>The status of the study</b><br>
3762   * Type: <b>token</b><br>
3763   * Path: <b>GenomicStudy.status</b><br>
3764   * </p>
3765   */
3766  @SearchParamDefinition(name="status", path="GenomicStudy.status", description="The status of the study", type="token" )
3767  public static final String SP_STATUS = "status";
3768 /**
3769   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3770   * <p>
3771   * Description: <b>The status of the study</b><br>
3772   * Type: <b>token</b><br>
3773   * Path: <b>GenomicStudy.status</b><br>
3774   * </p>
3775   */
3776  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3777
3778 /**
3779   * Search parameter: <b>subject</b>
3780   * <p>
3781   * Description: <b>Who the study is about</b><br>
3782   * Type: <b>reference</b><br>
3783   * Path: <b>GenomicStudy.subject</b><br>
3784   * </p>
3785   */
3786  @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 } )
3787  public static final String SP_SUBJECT = "subject";
3788 /**
3789   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3790   * <p>
3791   * Description: <b>Who the study is about</b><br>
3792   * Type: <b>reference</b><br>
3793   * Path: <b>GenomicStudy.subject</b><br>
3794   * </p>
3795   */
3796  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3797
3798/**
3799   * Constant for fluent queries to be used to add include statements. Specifies
3800   * the path value of "<b>GenomicStudy:subject</b>".
3801   */
3802  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("GenomicStudy:subject").toLocked();
3803
3804
3805}
3806