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 Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
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 process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.
052 */
053@ResourceDef(name="ResearchStudy", profile="http://hl7.org/fhir/StructureDefinition/ResearchStudy")
054public class ResearchStudy extends DomainResource {
055
056    @Block()
057    public static class ResearchStudyLabelComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * Kind of name.
060         */
061        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
062        @Description(shortDefinition="primary | official | scientific | plain-language | subtitle | short-title | acronym | earlier-title | language | auto-translated | human-use | machine-use | duplicate-uid", formalDefinition="Kind of name." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/title-type")
064        protected CodeableConcept type;
065
066        /**
067         * The name.
068         */
069        @Child(name = "value", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
070        @Description(shortDefinition="The name", formalDefinition="The name." )
071        protected StringType value;
072
073        private static final long serialVersionUID = 944223389L;
074
075    /**
076     * Constructor
077     */
078      public ResearchStudyLabelComponent() {
079        super();
080      }
081
082        /**
083         * @return {@link #type} (Kind of name.)
084         */
085        public CodeableConcept getType() { 
086          if (this.type == null)
087            if (Configuration.errorOnAutoCreate())
088              throw new Error("Attempt to auto-create ResearchStudyLabelComponent.type");
089            else if (Configuration.doAutoCreate())
090              this.type = new CodeableConcept(); // cc
091          return this.type;
092        }
093
094        public boolean hasType() { 
095          return this.type != null && !this.type.isEmpty();
096        }
097
098        /**
099         * @param value {@link #type} (Kind of name.)
100         */
101        public ResearchStudyLabelComponent setType(CodeableConcept value) { 
102          this.type = value;
103          return this;
104        }
105
106        /**
107         * @return {@link #value} (The name.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
108         */
109        public StringType getValueElement() { 
110          if (this.value == null)
111            if (Configuration.errorOnAutoCreate())
112              throw new Error("Attempt to auto-create ResearchStudyLabelComponent.value");
113            else if (Configuration.doAutoCreate())
114              this.value = new StringType(); // bb
115          return this.value;
116        }
117
118        public boolean hasValueElement() { 
119          return this.value != null && !this.value.isEmpty();
120        }
121
122        public boolean hasValue() { 
123          return this.value != null && !this.value.isEmpty();
124        }
125
126        /**
127         * @param value {@link #value} (The name.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
128         */
129        public ResearchStudyLabelComponent setValueElement(StringType value) { 
130          this.value = value;
131          return this;
132        }
133
134        /**
135         * @return The name.
136         */
137        public String getValue() { 
138          return this.value == null ? null : this.value.getValue();
139        }
140
141        /**
142         * @param value The name.
143         */
144        public ResearchStudyLabelComponent setValue(String value) { 
145          if (Utilities.noString(value))
146            this.value = null;
147          else {
148            if (this.value == null)
149              this.value = new StringType();
150            this.value.setValue(value);
151          }
152          return this;
153        }
154
155        protected void listChildren(List<Property> children) {
156          super.listChildren(children);
157          children.add(new Property("type", "CodeableConcept", "Kind of name.", 0, 1, type));
158          children.add(new Property("value", "string", "The name.", 0, 1, value));
159        }
160
161        @Override
162        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
163          switch (_hash) {
164          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Kind of name.", 0, 1, type);
165          case 111972721: /*value*/  return new Property("value", "string", "The name.", 0, 1, value);
166          default: return super.getNamedProperty(_hash, _name, _checkValid);
167          }
168
169        }
170
171      @Override
172      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
173        switch (hash) {
174        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
175        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
176        default: return super.getProperty(hash, name, checkValid);
177        }
178
179      }
180
181      @Override
182      public Base setProperty(int hash, String name, Base value) throws FHIRException {
183        switch (hash) {
184        case 3575610: // type
185          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
186          return value;
187        case 111972721: // value
188          this.value = TypeConvertor.castToString(value); // StringType
189          return value;
190        default: return super.setProperty(hash, name, value);
191        }
192
193      }
194
195      @Override
196      public Base setProperty(String name, Base value) throws FHIRException {
197        if (name.equals("type")) {
198          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
199        } else if (name.equals("value")) {
200          this.value = TypeConvertor.castToString(value); // StringType
201        } else
202          return super.setProperty(name, value);
203        return value;
204      }
205
206      @Override
207      public Base makeProperty(int hash, String name) throws FHIRException {
208        switch (hash) {
209        case 3575610:  return getType();
210        case 111972721:  return getValueElement();
211        default: return super.makeProperty(hash, name);
212        }
213
214      }
215
216      @Override
217      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
218        switch (hash) {
219        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
220        case 111972721: /*value*/ return new String[] {"string"};
221        default: return super.getTypesForProperty(hash, name);
222        }
223
224      }
225
226      @Override
227      public Base addChild(String name) throws FHIRException {
228        if (name.equals("type")) {
229          this.type = new CodeableConcept();
230          return this.type;
231        }
232        else if (name.equals("value")) {
233          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.label.value");
234        }
235        else
236          return super.addChild(name);
237      }
238
239      public ResearchStudyLabelComponent copy() {
240        ResearchStudyLabelComponent dst = new ResearchStudyLabelComponent();
241        copyValues(dst);
242        return dst;
243      }
244
245      public void copyValues(ResearchStudyLabelComponent dst) {
246        super.copyValues(dst);
247        dst.type = type == null ? null : type.copy();
248        dst.value = value == null ? null : value.copy();
249      }
250
251      @Override
252      public boolean equalsDeep(Base other_) {
253        if (!super.equalsDeep(other_))
254          return false;
255        if (!(other_ instanceof ResearchStudyLabelComponent))
256          return false;
257        ResearchStudyLabelComponent o = (ResearchStudyLabelComponent) other_;
258        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
259      }
260
261      @Override
262      public boolean equalsShallow(Base other_) {
263        if (!super.equalsShallow(other_))
264          return false;
265        if (!(other_ instanceof ResearchStudyLabelComponent))
266          return false;
267        ResearchStudyLabelComponent o = (ResearchStudyLabelComponent) other_;
268        return compareValues(value, o.value, true);
269      }
270
271      public boolean isEmpty() {
272        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value);
273      }
274
275  public String fhirType() {
276    return "ResearchStudy.label";
277
278  }
279
280  }
281
282    @Block()
283    public static class ResearchStudyFocusComponent extends BackboneElement implements IBaseBackboneElement {
284        /**
285         * Identification of product under study.  This may be any combination of code and/or name.
286         */
287        @Child(name = "productCode", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
288        @Description(shortDefinition="Identification of product under study", formalDefinition="Identification of product under study.  This may be any combination of code and/or name." )
289        protected CodeableConcept productCode;
290
291        /**
292         * Indicates whether the focus is a medication, a device, a procedure, a specific factor or some other intervention or characteristic.
293         */
294        @Child(name = "focusType", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
295        @Description(shortDefinition="medication | device | intervention | factor", formalDefinition="Indicates whether the focus is a medication, a device, a procedure, a specific factor or some other intervention or characteristic." )
296        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-focus-type")
297        protected List<CodeableConcept> focusType;
298
299        /**
300         * A factor corresponds to an independent variable manipulated by the experimentalist with the intention to affect biological systems in a way that can be measured by an assay.
301         */
302        @Child(name = "factor", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
303        @Description(shortDefinition="An independent variable manipulated by the experimentalist", formalDefinition="A factor corresponds to an independent variable manipulated by the experimentalist with the intention to affect biological systems in a way that can be measured by an assay." )
304        protected MarkdownType factor;
305
306        private static final long serialVersionUID = 1526347182L;
307
308    /**
309     * Constructor
310     */
311      public ResearchStudyFocusComponent() {
312        super();
313      }
314
315        /**
316         * @return {@link #productCode} (Identification of product under study.  This may be any combination of code and/or name.)
317         */
318        public CodeableConcept getProductCode() { 
319          if (this.productCode == null)
320            if (Configuration.errorOnAutoCreate())
321              throw new Error("Attempt to auto-create ResearchStudyFocusComponent.productCode");
322            else if (Configuration.doAutoCreate())
323              this.productCode = new CodeableConcept(); // cc
324          return this.productCode;
325        }
326
327        public boolean hasProductCode() { 
328          return this.productCode != null && !this.productCode.isEmpty();
329        }
330
331        /**
332         * @param value {@link #productCode} (Identification of product under study.  This may be any combination of code and/or name.)
333         */
334        public ResearchStudyFocusComponent setProductCode(CodeableConcept value) { 
335          this.productCode = value;
336          return this;
337        }
338
339        /**
340         * @return {@link #focusType} (Indicates whether the focus is a medication, a device, a procedure, a specific factor or some other intervention or characteristic.)
341         */
342        public List<CodeableConcept> getFocusType() { 
343          if (this.focusType == null)
344            this.focusType = new ArrayList<CodeableConcept>();
345          return this.focusType;
346        }
347
348        /**
349         * @return Returns a reference to <code>this</code> for easy method chaining
350         */
351        public ResearchStudyFocusComponent setFocusType(List<CodeableConcept> theFocusType) { 
352          this.focusType = theFocusType;
353          return this;
354        }
355
356        public boolean hasFocusType() { 
357          if (this.focusType == null)
358            return false;
359          for (CodeableConcept item : this.focusType)
360            if (!item.isEmpty())
361              return true;
362          return false;
363        }
364
365        public CodeableConcept addFocusType() { //3
366          CodeableConcept t = new CodeableConcept();
367          if (this.focusType == null)
368            this.focusType = new ArrayList<CodeableConcept>();
369          this.focusType.add(t);
370          return t;
371        }
372
373        public ResearchStudyFocusComponent addFocusType(CodeableConcept t) { //3
374          if (t == null)
375            return this;
376          if (this.focusType == null)
377            this.focusType = new ArrayList<CodeableConcept>();
378          this.focusType.add(t);
379          return this;
380        }
381
382        /**
383         * @return The first repetition of repeating field {@link #focusType}, creating it if it does not already exist {3}
384         */
385        public CodeableConcept getFocusTypeFirstRep() { 
386          if (getFocusType().isEmpty()) {
387            addFocusType();
388          }
389          return getFocusType().get(0);
390        }
391
392        /**
393         * @return {@link #factor} (A factor corresponds to an independent variable manipulated by the experimentalist with the intention to affect biological systems in a way that can be measured by an assay.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
394         */
395        public MarkdownType getFactorElement() { 
396          if (this.factor == null)
397            if (Configuration.errorOnAutoCreate())
398              throw new Error("Attempt to auto-create ResearchStudyFocusComponent.factor");
399            else if (Configuration.doAutoCreate())
400              this.factor = new MarkdownType(); // bb
401          return this.factor;
402        }
403
404        public boolean hasFactorElement() { 
405          return this.factor != null && !this.factor.isEmpty();
406        }
407
408        public boolean hasFactor() { 
409          return this.factor != null && !this.factor.isEmpty();
410        }
411
412        /**
413         * @param value {@link #factor} (A factor corresponds to an independent variable manipulated by the experimentalist with the intention to affect biological systems in a way that can be measured by an assay.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
414         */
415        public ResearchStudyFocusComponent setFactorElement(MarkdownType value) { 
416          this.factor = value;
417          return this;
418        }
419
420        /**
421         * @return A factor corresponds to an independent variable manipulated by the experimentalist with the intention to affect biological systems in a way that can be measured by an assay.
422         */
423        public String getFactor() { 
424          return this.factor == null ? null : this.factor.getValue();
425        }
426
427        /**
428         * @param value A factor corresponds to an independent variable manipulated by the experimentalist with the intention to affect biological systems in a way that can be measured by an assay.
429         */
430        public ResearchStudyFocusComponent setFactor(String value) { 
431          if (value == null)
432            this.factor = null;
433          else {
434            if (this.factor == null)
435              this.factor = new MarkdownType();
436            this.factor.setValue(value);
437          }
438          return this;
439        }
440
441        protected void listChildren(List<Property> children) {
442          super.listChildren(children);
443          children.add(new Property("productCode", "CodeableConcept", "Identification of product under study.  This may be any combination of code and/or name.", 0, 1, productCode));
444          children.add(new Property("focusType", "CodeableConcept", "Indicates whether the focus is a medication, a device, a procedure, a specific factor or some other intervention or characteristic.", 0, java.lang.Integer.MAX_VALUE, focusType));
445          children.add(new Property("factor", "markdown", "A factor corresponds to an independent variable manipulated by the experimentalist with the intention to affect biological systems in a way that can be measured by an assay.", 0, 1, factor));
446        }
447
448        @Override
449        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
450          switch (_hash) {
451          case -1492131972: /*productCode*/  return new Property("productCode", "CodeableConcept", "Identification of product under study.  This may be any combination of code and/or name.", 0, 1, productCode);
452          case 1628646450: /*focusType*/  return new Property("focusType", "CodeableConcept", "Indicates whether the focus is a medication, a device, a procedure, a specific factor or some other intervention or characteristic.", 0, java.lang.Integer.MAX_VALUE, focusType);
453          case -1282148017: /*factor*/  return new Property("factor", "markdown", "A factor corresponds to an independent variable manipulated by the experimentalist with the intention to affect biological systems in a way that can be measured by an assay.", 0, 1, factor);
454          default: return super.getNamedProperty(_hash, _name, _checkValid);
455          }
456
457        }
458
459      @Override
460      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
461        switch (hash) {
462        case -1492131972: /*productCode*/ return this.productCode == null ? new Base[0] : new Base[] {this.productCode}; // CodeableConcept
463        case 1628646450: /*focusType*/ return this.focusType == null ? new Base[0] : this.focusType.toArray(new Base[this.focusType.size()]); // CodeableConcept
464        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // MarkdownType
465        default: return super.getProperty(hash, name, checkValid);
466        }
467
468      }
469
470      @Override
471      public Base setProperty(int hash, String name, Base value) throws FHIRException {
472        switch (hash) {
473        case -1492131972: // productCode
474          this.productCode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
475          return value;
476        case 1628646450: // focusType
477          this.getFocusType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
478          return value;
479        case -1282148017: // factor
480          this.factor = TypeConvertor.castToMarkdown(value); // MarkdownType
481          return value;
482        default: return super.setProperty(hash, name, value);
483        }
484
485      }
486
487      @Override
488      public Base setProperty(String name, Base value) throws FHIRException {
489        if (name.equals("productCode")) {
490          this.productCode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
491        } else if (name.equals("focusType")) {
492          this.getFocusType().add(TypeConvertor.castToCodeableConcept(value));
493        } else if (name.equals("factor")) {
494          this.factor = TypeConvertor.castToMarkdown(value); // MarkdownType
495        } else
496          return super.setProperty(name, value);
497        return value;
498      }
499
500      @Override
501      public Base makeProperty(int hash, String name) throws FHIRException {
502        switch (hash) {
503        case -1492131972:  return getProductCode();
504        case 1628646450:  return addFocusType(); 
505        case -1282148017:  return getFactorElement();
506        default: return super.makeProperty(hash, name);
507        }
508
509      }
510
511      @Override
512      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
513        switch (hash) {
514        case -1492131972: /*productCode*/ return new String[] {"CodeableConcept"};
515        case 1628646450: /*focusType*/ return new String[] {"CodeableConcept"};
516        case -1282148017: /*factor*/ return new String[] {"markdown"};
517        default: return super.getTypesForProperty(hash, name);
518        }
519
520      }
521
522      @Override
523      public Base addChild(String name) throws FHIRException {
524        if (name.equals("productCode")) {
525          this.productCode = new CodeableConcept();
526          return this.productCode;
527        }
528        else if (name.equals("focusType")) {
529          return addFocusType();
530        }
531        else if (name.equals("factor")) {
532          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.focus.factor");
533        }
534        else
535          return super.addChild(name);
536      }
537
538      public ResearchStudyFocusComponent copy() {
539        ResearchStudyFocusComponent dst = new ResearchStudyFocusComponent();
540        copyValues(dst);
541        return dst;
542      }
543
544      public void copyValues(ResearchStudyFocusComponent dst) {
545        super.copyValues(dst);
546        dst.productCode = productCode == null ? null : productCode.copy();
547        if (focusType != null) {
548          dst.focusType = new ArrayList<CodeableConcept>();
549          for (CodeableConcept i : focusType)
550            dst.focusType.add(i.copy());
551        };
552        dst.factor = factor == null ? null : factor.copy();
553      }
554
555      @Override
556      public boolean equalsDeep(Base other_) {
557        if (!super.equalsDeep(other_))
558          return false;
559        if (!(other_ instanceof ResearchStudyFocusComponent))
560          return false;
561        ResearchStudyFocusComponent o = (ResearchStudyFocusComponent) other_;
562        return compareDeep(productCode, o.productCode, true) && compareDeep(focusType, o.focusType, true)
563           && compareDeep(factor, o.factor, true);
564      }
565
566      @Override
567      public boolean equalsShallow(Base other_) {
568        if (!super.equalsShallow(other_))
569          return false;
570        if (!(other_ instanceof ResearchStudyFocusComponent))
571          return false;
572        ResearchStudyFocusComponent o = (ResearchStudyFocusComponent) other_;
573        return compareValues(factor, o.factor, true);
574      }
575
576      public boolean isEmpty() {
577        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(productCode, focusType, factor
578          );
579      }
580
581  public String fhirType() {
582    return "ResearchStudy.focus";
583
584  }
585
586  }
587
588    @Block()
589    public static class ResearchStudyClassificationComponent extends BackboneElement implements IBaseBackboneElement {
590        /**
591         * Type of classifier.
592         */
593        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
594        @Description(shortDefinition="phase | category | keyword ", formalDefinition="Type of classifier." )
595        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-classification-type")
596        protected CodeableConcept type;
597
598        /**
599         * Value of classifier.
600         */
601        @Child(name = "classifier", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
602        @Description(shortDefinition="n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | phase-2-phase-3 | phase-3 | phase-4", formalDefinition="Value of classifier." )
603        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-classifiers")
604        protected List<CodeableConcept> classifier;
605
606        private static final long serialVersionUID = -283121869L;
607
608    /**
609     * Constructor
610     */
611      public ResearchStudyClassificationComponent() {
612        super();
613      }
614
615        /**
616         * @return {@link #type} (Type of classifier.)
617         */
618        public CodeableConcept getType() { 
619          if (this.type == null)
620            if (Configuration.errorOnAutoCreate())
621              throw new Error("Attempt to auto-create ResearchStudyClassificationComponent.type");
622            else if (Configuration.doAutoCreate())
623              this.type = new CodeableConcept(); // cc
624          return this.type;
625        }
626
627        public boolean hasType() { 
628          return this.type != null && !this.type.isEmpty();
629        }
630
631        /**
632         * @param value {@link #type} (Type of classifier.)
633         */
634        public ResearchStudyClassificationComponent setType(CodeableConcept value) { 
635          this.type = value;
636          return this;
637        }
638
639        /**
640         * @return {@link #classifier} (Value of classifier.)
641         */
642        public List<CodeableConcept> getClassifier() { 
643          if (this.classifier == null)
644            this.classifier = new ArrayList<CodeableConcept>();
645          return this.classifier;
646        }
647
648        /**
649         * @return Returns a reference to <code>this</code> for easy method chaining
650         */
651        public ResearchStudyClassificationComponent setClassifier(List<CodeableConcept> theClassifier) { 
652          this.classifier = theClassifier;
653          return this;
654        }
655
656        public boolean hasClassifier() { 
657          if (this.classifier == null)
658            return false;
659          for (CodeableConcept item : this.classifier)
660            if (!item.isEmpty())
661              return true;
662          return false;
663        }
664
665        public CodeableConcept addClassifier() { //3
666          CodeableConcept t = new CodeableConcept();
667          if (this.classifier == null)
668            this.classifier = new ArrayList<CodeableConcept>();
669          this.classifier.add(t);
670          return t;
671        }
672
673        public ResearchStudyClassificationComponent addClassifier(CodeableConcept t) { //3
674          if (t == null)
675            return this;
676          if (this.classifier == null)
677            this.classifier = new ArrayList<CodeableConcept>();
678          this.classifier.add(t);
679          return this;
680        }
681
682        /**
683         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
684         */
685        public CodeableConcept getClassifierFirstRep() { 
686          if (getClassifier().isEmpty()) {
687            addClassifier();
688          }
689          return getClassifier().get(0);
690        }
691
692        protected void listChildren(List<Property> children) {
693          super.listChildren(children);
694          children.add(new Property("type", "CodeableConcept", "Type of classifier.", 0, 1, type));
695          children.add(new Property("classifier", "CodeableConcept", "Value of classifier.", 0, java.lang.Integer.MAX_VALUE, classifier));
696        }
697
698        @Override
699        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
700          switch (_hash) {
701          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of classifier.", 0, 1, type);
702          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "Value of classifier.", 0, java.lang.Integer.MAX_VALUE, classifier);
703          default: return super.getNamedProperty(_hash, _name, _checkValid);
704          }
705
706        }
707
708      @Override
709      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
710        switch (hash) {
711        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
712        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
713        default: return super.getProperty(hash, name, checkValid);
714        }
715
716      }
717
718      @Override
719      public Base setProperty(int hash, String name, Base value) throws FHIRException {
720        switch (hash) {
721        case 3575610: // type
722          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
723          return value;
724        case -281470431: // classifier
725          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
726          return value;
727        default: return super.setProperty(hash, name, value);
728        }
729
730      }
731
732      @Override
733      public Base setProperty(String name, Base value) throws FHIRException {
734        if (name.equals("type")) {
735          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
736        } else if (name.equals("classifier")) {
737          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
738        } else
739          return super.setProperty(name, value);
740        return value;
741      }
742
743      @Override
744      public Base makeProperty(int hash, String name) throws FHIRException {
745        switch (hash) {
746        case 3575610:  return getType();
747        case -281470431:  return addClassifier(); 
748        default: return super.makeProperty(hash, name);
749        }
750
751      }
752
753      @Override
754      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
755        switch (hash) {
756        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
757        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
758        default: return super.getTypesForProperty(hash, name);
759        }
760
761      }
762
763      @Override
764      public Base addChild(String name) throws FHIRException {
765        if (name.equals("type")) {
766          this.type = new CodeableConcept();
767          return this.type;
768        }
769        else if (name.equals("classifier")) {
770          return addClassifier();
771        }
772        else
773          return super.addChild(name);
774      }
775
776      public ResearchStudyClassificationComponent copy() {
777        ResearchStudyClassificationComponent dst = new ResearchStudyClassificationComponent();
778        copyValues(dst);
779        return dst;
780      }
781
782      public void copyValues(ResearchStudyClassificationComponent dst) {
783        super.copyValues(dst);
784        dst.type = type == null ? null : type.copy();
785        if (classifier != null) {
786          dst.classifier = new ArrayList<CodeableConcept>();
787          for (CodeableConcept i : classifier)
788            dst.classifier.add(i.copy());
789        };
790      }
791
792      @Override
793      public boolean equalsDeep(Base other_) {
794        if (!super.equalsDeep(other_))
795          return false;
796        if (!(other_ instanceof ResearchStudyClassificationComponent))
797          return false;
798        ResearchStudyClassificationComponent o = (ResearchStudyClassificationComponent) other_;
799        return compareDeep(type, o.type, true) && compareDeep(classifier, o.classifier, true);
800      }
801
802      @Override
803      public boolean equalsShallow(Base other_) {
804        if (!super.equalsShallow(other_))
805          return false;
806        if (!(other_ instanceof ResearchStudyClassificationComponent))
807          return false;
808        ResearchStudyClassificationComponent o = (ResearchStudyClassificationComponent) other_;
809        return true;
810      }
811
812      public boolean isEmpty() {
813        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, classifier);
814      }
815
816  public String fhirType() {
817    return "ResearchStudy.classification";
818
819  }
820
821  }
822
823    @Block()
824    public static class ResearchStudyAssociatedPartyComponent extends BackboneElement implements IBaseBackboneElement {
825        /**
826         * Name of associated party.
827         */
828        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
829        @Description(shortDefinition="Name of associated party", formalDefinition="Name of associated party." )
830        protected StringType name;
831
832        /**
833         * Type of association.
834         */
835        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false)
836        @Description(shortDefinition="sponsor | lead-sponsor | sponsor-investigator | primary-investigator | collaborator | funding-source | recruitment-contact | sub-investigator | study-director | study-chair", formalDefinition="Type of association." )
837        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-party-role")
838        protected CodeableConcept role;
839
840        /**
841         * Identifies the start date and the end date of the associated party in the role.
842         */
843        @Child(name = "period", type = {Period.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
844        @Description(shortDefinition="When active in the role", formalDefinition="Identifies the start date and the end date of the associated party in the role." )
845        protected List<Period> period;
846
847        /**
848         * Organisational type of association.
849         */
850        @Child(name = "classifier", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
851        @Description(shortDefinition="nih | fda", formalDefinition="Organisational type of association." )
852        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-party-org-type")
853        protected List<CodeableConcept> classifier;
854
855        /**
856         * Individual or organization associated with study (use practitionerRole to specify their organisation).
857         */
858        @Child(name = "party", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=false)
859        @Description(shortDefinition="Individual or organization associated with study (use practitionerRole to specify their organisation)", formalDefinition="Individual or organization associated with study (use practitionerRole to specify their organisation)." )
860        protected Reference party;
861
862        private static final long serialVersionUID = -1418550998L;
863
864    /**
865     * Constructor
866     */
867      public ResearchStudyAssociatedPartyComponent() {
868        super();
869      }
870
871    /**
872     * Constructor
873     */
874      public ResearchStudyAssociatedPartyComponent(CodeableConcept role) {
875        super();
876        this.setRole(role);
877      }
878
879        /**
880         * @return {@link #name} (Name of associated party.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
881         */
882        public StringType getNameElement() { 
883          if (this.name == null)
884            if (Configuration.errorOnAutoCreate())
885              throw new Error("Attempt to auto-create ResearchStudyAssociatedPartyComponent.name");
886            else if (Configuration.doAutoCreate())
887              this.name = new StringType(); // bb
888          return this.name;
889        }
890
891        public boolean hasNameElement() { 
892          return this.name != null && !this.name.isEmpty();
893        }
894
895        public boolean hasName() { 
896          return this.name != null && !this.name.isEmpty();
897        }
898
899        /**
900         * @param value {@link #name} (Name of associated party.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
901         */
902        public ResearchStudyAssociatedPartyComponent setNameElement(StringType value) { 
903          this.name = value;
904          return this;
905        }
906
907        /**
908         * @return Name of associated party.
909         */
910        public String getName() { 
911          return this.name == null ? null : this.name.getValue();
912        }
913
914        /**
915         * @param value Name of associated party.
916         */
917        public ResearchStudyAssociatedPartyComponent setName(String value) { 
918          if (Utilities.noString(value))
919            this.name = null;
920          else {
921            if (this.name == null)
922              this.name = new StringType();
923            this.name.setValue(value);
924          }
925          return this;
926        }
927
928        /**
929         * @return {@link #role} (Type of association.)
930         */
931        public CodeableConcept getRole() { 
932          if (this.role == null)
933            if (Configuration.errorOnAutoCreate())
934              throw new Error("Attempt to auto-create ResearchStudyAssociatedPartyComponent.role");
935            else if (Configuration.doAutoCreate())
936              this.role = new CodeableConcept(); // cc
937          return this.role;
938        }
939
940        public boolean hasRole() { 
941          return this.role != null && !this.role.isEmpty();
942        }
943
944        /**
945         * @param value {@link #role} (Type of association.)
946         */
947        public ResearchStudyAssociatedPartyComponent setRole(CodeableConcept value) { 
948          this.role = value;
949          return this;
950        }
951
952        /**
953         * @return {@link #period} (Identifies the start date and the end date of the associated party in the role.)
954         */
955        public List<Period> getPeriod() { 
956          if (this.period == null)
957            this.period = new ArrayList<Period>();
958          return this.period;
959        }
960
961        /**
962         * @return Returns a reference to <code>this</code> for easy method chaining
963         */
964        public ResearchStudyAssociatedPartyComponent setPeriod(List<Period> thePeriod) { 
965          this.period = thePeriod;
966          return this;
967        }
968
969        public boolean hasPeriod() { 
970          if (this.period == null)
971            return false;
972          for (Period item : this.period)
973            if (!item.isEmpty())
974              return true;
975          return false;
976        }
977
978        public Period addPeriod() { //3
979          Period t = new Period();
980          if (this.period == null)
981            this.period = new ArrayList<Period>();
982          this.period.add(t);
983          return t;
984        }
985
986        public ResearchStudyAssociatedPartyComponent addPeriod(Period t) { //3
987          if (t == null)
988            return this;
989          if (this.period == null)
990            this.period = new ArrayList<Period>();
991          this.period.add(t);
992          return this;
993        }
994
995        /**
996         * @return The first repetition of repeating field {@link #period}, creating it if it does not already exist {3}
997         */
998        public Period getPeriodFirstRep() { 
999          if (getPeriod().isEmpty()) {
1000            addPeriod();
1001          }
1002          return getPeriod().get(0);
1003        }
1004
1005        /**
1006         * @return {@link #classifier} (Organisational type of association.)
1007         */
1008        public List<CodeableConcept> getClassifier() { 
1009          if (this.classifier == null)
1010            this.classifier = new ArrayList<CodeableConcept>();
1011          return this.classifier;
1012        }
1013
1014        /**
1015         * @return Returns a reference to <code>this</code> for easy method chaining
1016         */
1017        public ResearchStudyAssociatedPartyComponent setClassifier(List<CodeableConcept> theClassifier) { 
1018          this.classifier = theClassifier;
1019          return this;
1020        }
1021
1022        public boolean hasClassifier() { 
1023          if (this.classifier == null)
1024            return false;
1025          for (CodeableConcept item : this.classifier)
1026            if (!item.isEmpty())
1027              return true;
1028          return false;
1029        }
1030
1031        public CodeableConcept addClassifier() { //3
1032          CodeableConcept t = new CodeableConcept();
1033          if (this.classifier == null)
1034            this.classifier = new ArrayList<CodeableConcept>();
1035          this.classifier.add(t);
1036          return t;
1037        }
1038
1039        public ResearchStudyAssociatedPartyComponent addClassifier(CodeableConcept t) { //3
1040          if (t == null)
1041            return this;
1042          if (this.classifier == null)
1043            this.classifier = new ArrayList<CodeableConcept>();
1044          this.classifier.add(t);
1045          return this;
1046        }
1047
1048        /**
1049         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
1050         */
1051        public CodeableConcept getClassifierFirstRep() { 
1052          if (getClassifier().isEmpty()) {
1053            addClassifier();
1054          }
1055          return getClassifier().get(0);
1056        }
1057
1058        /**
1059         * @return {@link #party} (Individual or organization associated with study (use practitionerRole to specify their organisation).)
1060         */
1061        public Reference getParty() { 
1062          if (this.party == null)
1063            if (Configuration.errorOnAutoCreate())
1064              throw new Error("Attempt to auto-create ResearchStudyAssociatedPartyComponent.party");
1065            else if (Configuration.doAutoCreate())
1066              this.party = new Reference(); // cc
1067          return this.party;
1068        }
1069
1070        public boolean hasParty() { 
1071          return this.party != null && !this.party.isEmpty();
1072        }
1073
1074        /**
1075         * @param value {@link #party} (Individual or organization associated with study (use practitionerRole to specify their organisation).)
1076         */
1077        public ResearchStudyAssociatedPartyComponent setParty(Reference value) { 
1078          this.party = value;
1079          return this;
1080        }
1081
1082        protected void listChildren(List<Property> children) {
1083          super.listChildren(children);
1084          children.add(new Property("name", "string", "Name of associated party.", 0, 1, name));
1085          children.add(new Property("role", "CodeableConcept", "Type of association.", 0, 1, role));
1086          children.add(new Property("period", "Period", "Identifies the start date and the end date of the associated party in the role.", 0, java.lang.Integer.MAX_VALUE, period));
1087          children.add(new Property("classifier", "CodeableConcept", "Organisational type of association.", 0, java.lang.Integer.MAX_VALUE, classifier));
1088          children.add(new Property("party", "Reference(Practitioner|PractitionerRole|Organization)", "Individual or organization associated with study (use practitionerRole to specify their organisation).", 0, 1, party));
1089        }
1090
1091        @Override
1092        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1093          switch (_hash) {
1094          case 3373707: /*name*/  return new Property("name", "string", "Name of associated party.", 0, 1, name);
1095          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Type of association.", 0, 1, role);
1096          case -991726143: /*period*/  return new Property("period", "Period", "Identifies the start date and the end date of the associated party in the role.", 0, java.lang.Integer.MAX_VALUE, period);
1097          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "Organisational type of association.", 0, java.lang.Integer.MAX_VALUE, classifier);
1098          case 106437350: /*party*/  return new Property("party", "Reference(Practitioner|PractitionerRole|Organization)", "Individual or organization associated with study (use practitionerRole to specify their organisation).", 0, 1, party);
1099          default: return super.getNamedProperty(_hash, _name, _checkValid);
1100          }
1101
1102        }
1103
1104      @Override
1105      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1106        switch (hash) {
1107        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1108        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
1109        case -991726143: /*period*/ return this.period == null ? new Base[0] : this.period.toArray(new Base[this.period.size()]); // Period
1110        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
1111        case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference
1112        default: return super.getProperty(hash, name, checkValid);
1113        }
1114
1115      }
1116
1117      @Override
1118      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1119        switch (hash) {
1120        case 3373707: // name
1121          this.name = TypeConvertor.castToString(value); // StringType
1122          return value;
1123        case 3506294: // role
1124          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1125          return value;
1126        case -991726143: // period
1127          this.getPeriod().add(TypeConvertor.castToPeriod(value)); // Period
1128          return value;
1129        case -281470431: // classifier
1130          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1131          return value;
1132        case 106437350: // party
1133          this.party = TypeConvertor.castToReference(value); // Reference
1134          return value;
1135        default: return super.setProperty(hash, name, value);
1136        }
1137
1138      }
1139
1140      @Override
1141      public Base setProperty(String name, Base value) throws FHIRException {
1142        if (name.equals("name")) {
1143          this.name = TypeConvertor.castToString(value); // StringType
1144        } else if (name.equals("role")) {
1145          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1146        } else if (name.equals("period")) {
1147          this.getPeriod().add(TypeConvertor.castToPeriod(value));
1148        } else if (name.equals("classifier")) {
1149          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
1150        } else if (name.equals("party")) {
1151          this.party = TypeConvertor.castToReference(value); // Reference
1152        } else
1153          return super.setProperty(name, value);
1154        return value;
1155      }
1156
1157      @Override
1158      public Base makeProperty(int hash, String name) throws FHIRException {
1159        switch (hash) {
1160        case 3373707:  return getNameElement();
1161        case 3506294:  return getRole();
1162        case -991726143:  return addPeriod(); 
1163        case -281470431:  return addClassifier(); 
1164        case 106437350:  return getParty();
1165        default: return super.makeProperty(hash, name);
1166        }
1167
1168      }
1169
1170      @Override
1171      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1172        switch (hash) {
1173        case 3373707: /*name*/ return new String[] {"string"};
1174        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
1175        case -991726143: /*period*/ return new String[] {"Period"};
1176        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
1177        case 106437350: /*party*/ return new String[] {"Reference"};
1178        default: return super.getTypesForProperty(hash, name);
1179        }
1180
1181      }
1182
1183      @Override
1184      public Base addChild(String name) throws FHIRException {
1185        if (name.equals("name")) {
1186          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.associatedParty.name");
1187        }
1188        else if (name.equals("role")) {
1189          this.role = new CodeableConcept();
1190          return this.role;
1191        }
1192        else if (name.equals("period")) {
1193          return addPeriod();
1194        }
1195        else if (name.equals("classifier")) {
1196          return addClassifier();
1197        }
1198        else if (name.equals("party")) {
1199          this.party = new Reference();
1200          return this.party;
1201        }
1202        else
1203          return super.addChild(name);
1204      }
1205
1206      public ResearchStudyAssociatedPartyComponent copy() {
1207        ResearchStudyAssociatedPartyComponent dst = new ResearchStudyAssociatedPartyComponent();
1208        copyValues(dst);
1209        return dst;
1210      }
1211
1212      public void copyValues(ResearchStudyAssociatedPartyComponent dst) {
1213        super.copyValues(dst);
1214        dst.name = name == null ? null : name.copy();
1215        dst.role = role == null ? null : role.copy();
1216        if (period != null) {
1217          dst.period = new ArrayList<Period>();
1218          for (Period i : period)
1219            dst.period.add(i.copy());
1220        };
1221        if (classifier != null) {
1222          dst.classifier = new ArrayList<CodeableConcept>();
1223          for (CodeableConcept i : classifier)
1224            dst.classifier.add(i.copy());
1225        };
1226        dst.party = party == null ? null : party.copy();
1227      }
1228
1229      @Override
1230      public boolean equalsDeep(Base other_) {
1231        if (!super.equalsDeep(other_))
1232          return false;
1233        if (!(other_ instanceof ResearchStudyAssociatedPartyComponent))
1234          return false;
1235        ResearchStudyAssociatedPartyComponent o = (ResearchStudyAssociatedPartyComponent) other_;
1236        return compareDeep(name, o.name, true) && compareDeep(role, o.role, true) && compareDeep(period, o.period, true)
1237           && compareDeep(classifier, o.classifier, true) && compareDeep(party, o.party, true);
1238      }
1239
1240      @Override
1241      public boolean equalsShallow(Base other_) {
1242        if (!super.equalsShallow(other_))
1243          return false;
1244        if (!(other_ instanceof ResearchStudyAssociatedPartyComponent))
1245          return false;
1246        ResearchStudyAssociatedPartyComponent o = (ResearchStudyAssociatedPartyComponent) other_;
1247        return compareValues(name, o.name, true);
1248      }
1249
1250      public boolean isEmpty() {
1251        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, role, period, classifier
1252          , party);
1253      }
1254
1255  public String fhirType() {
1256    return "ResearchStudy.associatedParty";
1257
1258  }
1259
1260  }
1261
1262    @Block()
1263    public static class ResearchStudyStatusDateComponent extends BackboneElement implements IBaseBackboneElement {
1264        /**
1265         * Label for status or state.
1266         */
1267        @Child(name = "activity", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1268        @Description(shortDefinition="Record-Verification | Overall-Study | Primary-Outcome-Data-Collection | Registration-Submission | Registration-Submission-QC | Registration-Posting | Results-Submission | Results-Submission-QC | Results-Posting | Disposition-Submission | Disposition-Submission-QC | Disposition-Posting | Update-Submission | Update-Posting", formalDefinition="Label for status or state." )
1269        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-statusDate-activity")
1270        protected CodeableConcept activity;
1271
1272        /**
1273         * Actual if true else anticipated.
1274         */
1275        @Child(name = "actual", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1276        @Description(shortDefinition="Actual if true else anticipated", formalDefinition="Actual if true else anticipated." )
1277        protected BooleanType actual;
1278
1279        /**
1280         * Date range.
1281         */
1282        @Child(name = "period", type = {Period.class}, order=3, min=1, max=1, modifier=false, summary=false)
1283        @Description(shortDefinition="Date range", formalDefinition="Date range." )
1284        protected Period period;
1285
1286        private static final long serialVersionUID = 1123586924L;
1287
1288    /**
1289     * Constructor
1290     */
1291      public ResearchStudyStatusDateComponent() {
1292        super();
1293      }
1294
1295    /**
1296     * Constructor
1297     */
1298      public ResearchStudyStatusDateComponent(CodeableConcept activity, Period period) {
1299        super();
1300        this.setActivity(activity);
1301        this.setPeriod(period);
1302      }
1303
1304        /**
1305         * @return {@link #activity} (Label for status or state.)
1306         */
1307        public CodeableConcept getActivity() { 
1308          if (this.activity == null)
1309            if (Configuration.errorOnAutoCreate())
1310              throw new Error("Attempt to auto-create ResearchStudyStatusDateComponent.activity");
1311            else if (Configuration.doAutoCreate())
1312              this.activity = new CodeableConcept(); // cc
1313          return this.activity;
1314        }
1315
1316        public boolean hasActivity() { 
1317          return this.activity != null && !this.activity.isEmpty();
1318        }
1319
1320        /**
1321         * @param value {@link #activity} (Label for status or state.)
1322         */
1323        public ResearchStudyStatusDateComponent setActivity(CodeableConcept value) { 
1324          this.activity = value;
1325          return this;
1326        }
1327
1328        /**
1329         * @return {@link #actual} (Actual if true else anticipated.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
1330         */
1331        public BooleanType getActualElement() { 
1332          if (this.actual == null)
1333            if (Configuration.errorOnAutoCreate())
1334              throw new Error("Attempt to auto-create ResearchStudyStatusDateComponent.actual");
1335            else if (Configuration.doAutoCreate())
1336              this.actual = new BooleanType(); // bb
1337          return this.actual;
1338        }
1339
1340        public boolean hasActualElement() { 
1341          return this.actual != null && !this.actual.isEmpty();
1342        }
1343
1344        public boolean hasActual() { 
1345          return this.actual != null && !this.actual.isEmpty();
1346        }
1347
1348        /**
1349         * @param value {@link #actual} (Actual if true else anticipated.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
1350         */
1351        public ResearchStudyStatusDateComponent setActualElement(BooleanType value) { 
1352          this.actual = value;
1353          return this;
1354        }
1355
1356        /**
1357         * @return Actual if true else anticipated.
1358         */
1359        public boolean getActual() { 
1360          return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue();
1361        }
1362
1363        /**
1364         * @param value Actual if true else anticipated.
1365         */
1366        public ResearchStudyStatusDateComponent setActual(boolean value) { 
1367            if (this.actual == null)
1368              this.actual = new BooleanType();
1369            this.actual.setValue(value);
1370          return this;
1371        }
1372
1373        /**
1374         * @return {@link #period} (Date range.)
1375         */
1376        public Period getPeriod() { 
1377          if (this.period == null)
1378            if (Configuration.errorOnAutoCreate())
1379              throw new Error("Attempt to auto-create ResearchStudyStatusDateComponent.period");
1380            else if (Configuration.doAutoCreate())
1381              this.period = new Period(); // cc
1382          return this.period;
1383        }
1384
1385        public boolean hasPeriod() { 
1386          return this.period != null && !this.period.isEmpty();
1387        }
1388
1389        /**
1390         * @param value {@link #period} (Date range.)
1391         */
1392        public ResearchStudyStatusDateComponent setPeriod(Period value) { 
1393          this.period = value;
1394          return this;
1395        }
1396
1397        protected void listChildren(List<Property> children) {
1398          super.listChildren(children);
1399          children.add(new Property("activity", "CodeableConcept", "Label for status or state.", 0, 1, activity));
1400          children.add(new Property("actual", "boolean", "Actual if true else anticipated.", 0, 1, actual));
1401          children.add(new Property("period", "Period", "Date range.", 0, 1, period));
1402        }
1403
1404        @Override
1405        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1406          switch (_hash) {
1407          case -1655966961: /*activity*/  return new Property("activity", "CodeableConcept", "Label for status or state.", 0, 1, activity);
1408          case -1422939762: /*actual*/  return new Property("actual", "boolean", "Actual if true else anticipated.", 0, 1, actual);
1409          case -991726143: /*period*/  return new Property("period", "Period", "Date range.", 0, 1, period);
1410          default: return super.getNamedProperty(_hash, _name, _checkValid);
1411          }
1412
1413        }
1414
1415      @Override
1416      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1417        switch (hash) {
1418        case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // CodeableConcept
1419        case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType
1420        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1421        default: return super.getProperty(hash, name, checkValid);
1422        }
1423
1424      }
1425
1426      @Override
1427      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1428        switch (hash) {
1429        case -1655966961: // activity
1430          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1431          return value;
1432        case -1422939762: // actual
1433          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
1434          return value;
1435        case -991726143: // period
1436          this.period = TypeConvertor.castToPeriod(value); // Period
1437          return value;
1438        default: return super.setProperty(hash, name, value);
1439        }
1440
1441      }
1442
1443      @Override
1444      public Base setProperty(String name, Base value) throws FHIRException {
1445        if (name.equals("activity")) {
1446          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1447        } else if (name.equals("actual")) {
1448          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
1449        } else if (name.equals("period")) {
1450          this.period = TypeConvertor.castToPeriod(value); // Period
1451        } else
1452          return super.setProperty(name, value);
1453        return value;
1454      }
1455
1456      @Override
1457      public Base makeProperty(int hash, String name) throws FHIRException {
1458        switch (hash) {
1459        case -1655966961:  return getActivity();
1460        case -1422939762:  return getActualElement();
1461        case -991726143:  return getPeriod();
1462        default: return super.makeProperty(hash, name);
1463        }
1464
1465      }
1466
1467      @Override
1468      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1469        switch (hash) {
1470        case -1655966961: /*activity*/ return new String[] {"CodeableConcept"};
1471        case -1422939762: /*actual*/ return new String[] {"boolean"};
1472        case -991726143: /*period*/ return new String[] {"Period"};
1473        default: return super.getTypesForProperty(hash, name);
1474        }
1475
1476      }
1477
1478      @Override
1479      public Base addChild(String name) throws FHIRException {
1480        if (name.equals("activity")) {
1481          this.activity = new CodeableConcept();
1482          return this.activity;
1483        }
1484        else if (name.equals("actual")) {
1485          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.statusDate.actual");
1486        }
1487        else if (name.equals("period")) {
1488          this.period = new Period();
1489          return this.period;
1490        }
1491        else
1492          return super.addChild(name);
1493      }
1494
1495      public ResearchStudyStatusDateComponent copy() {
1496        ResearchStudyStatusDateComponent dst = new ResearchStudyStatusDateComponent();
1497        copyValues(dst);
1498        return dst;
1499      }
1500
1501      public void copyValues(ResearchStudyStatusDateComponent dst) {
1502        super.copyValues(dst);
1503        dst.activity = activity == null ? null : activity.copy();
1504        dst.actual = actual == null ? null : actual.copy();
1505        dst.period = period == null ? null : period.copy();
1506      }
1507
1508      @Override
1509      public boolean equalsDeep(Base other_) {
1510        if (!super.equalsDeep(other_))
1511          return false;
1512        if (!(other_ instanceof ResearchStudyStatusDateComponent))
1513          return false;
1514        ResearchStudyStatusDateComponent o = (ResearchStudyStatusDateComponent) other_;
1515        return compareDeep(activity, o.activity, true) && compareDeep(actual, o.actual, true) && compareDeep(period, o.period, true)
1516          ;
1517      }
1518
1519      @Override
1520      public boolean equalsShallow(Base other_) {
1521        if (!super.equalsShallow(other_))
1522          return false;
1523        if (!(other_ instanceof ResearchStudyStatusDateComponent))
1524          return false;
1525        ResearchStudyStatusDateComponent o = (ResearchStudyStatusDateComponent) other_;
1526        return compareValues(actual, o.actual, true);
1527      }
1528
1529      public boolean isEmpty() {
1530        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(activity, actual, period
1531          );
1532      }
1533
1534  public String fhirType() {
1535    return "ResearchStudy.statusDate";
1536
1537  }
1538
1539  }
1540
1541    @Block()
1542    public static class ResearchStudyRecruitmentComponent extends BackboneElement implements IBaseBackboneElement {
1543        /**
1544         * Estimated total number of participants to be enrolled.
1545         */
1546        @Child(name = "targetNumber", type = {UnsignedIntType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1547        @Description(shortDefinition="Estimated total number of participants to be enrolled", formalDefinition="Estimated total number of participants to be enrolled." )
1548        protected UnsignedIntType targetNumber;
1549
1550        /**
1551         * Actual total number of participants enrolled in study.
1552         */
1553        @Child(name = "actualNumber", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1554        @Description(shortDefinition="Actual total number of participants enrolled in study", formalDefinition="Actual total number of participants enrolled in study." )
1555        protected UnsignedIntType actualNumber;
1556
1557        /**
1558         * Inclusion and exclusion criteria.
1559         */
1560        @Child(name = "eligibility", type = {Group.class, EvidenceVariable.class}, order=3, min=0, max=1, modifier=false, summary=false)
1561        @Description(shortDefinition="Inclusion and exclusion criteria", formalDefinition="Inclusion and exclusion criteria." )
1562        protected Reference eligibility;
1563
1564        /**
1565         * Group of participants who were enrolled in study.
1566         */
1567        @Child(name = "actualGroup", type = {Group.class}, order=4, min=0, max=1, modifier=false, summary=true)
1568        @Description(shortDefinition="Group of participants who were enrolled in study", formalDefinition="Group of participants who were enrolled in study." )
1569        protected Reference actualGroup;
1570
1571        private static final long serialVersionUID = 1483229827L;
1572
1573    /**
1574     * Constructor
1575     */
1576      public ResearchStudyRecruitmentComponent() {
1577        super();
1578      }
1579
1580        /**
1581         * @return {@link #targetNumber} (Estimated total number of participants to be enrolled.). This is the underlying object with id, value and extensions. The accessor "getTargetNumber" gives direct access to the value
1582         */
1583        public UnsignedIntType getTargetNumberElement() { 
1584          if (this.targetNumber == null)
1585            if (Configuration.errorOnAutoCreate())
1586              throw new Error("Attempt to auto-create ResearchStudyRecruitmentComponent.targetNumber");
1587            else if (Configuration.doAutoCreate())
1588              this.targetNumber = new UnsignedIntType(); // bb
1589          return this.targetNumber;
1590        }
1591
1592        public boolean hasTargetNumberElement() { 
1593          return this.targetNumber != null && !this.targetNumber.isEmpty();
1594        }
1595
1596        public boolean hasTargetNumber() { 
1597          return this.targetNumber != null && !this.targetNumber.isEmpty();
1598        }
1599
1600        /**
1601         * @param value {@link #targetNumber} (Estimated total number of participants to be enrolled.). This is the underlying object with id, value and extensions. The accessor "getTargetNumber" gives direct access to the value
1602         */
1603        public ResearchStudyRecruitmentComponent setTargetNumberElement(UnsignedIntType value) { 
1604          this.targetNumber = value;
1605          return this;
1606        }
1607
1608        /**
1609         * @return Estimated total number of participants to be enrolled.
1610         */
1611        public int getTargetNumber() { 
1612          return this.targetNumber == null || this.targetNumber.isEmpty() ? 0 : this.targetNumber.getValue();
1613        }
1614
1615        /**
1616         * @param value Estimated total number of participants to be enrolled.
1617         */
1618        public ResearchStudyRecruitmentComponent setTargetNumber(int value) { 
1619            if (this.targetNumber == null)
1620              this.targetNumber = new UnsignedIntType();
1621            this.targetNumber.setValue(value);
1622          return this;
1623        }
1624
1625        /**
1626         * @return {@link #actualNumber} (Actual total number of participants enrolled in study.). This is the underlying object with id, value and extensions. The accessor "getActualNumber" gives direct access to the value
1627         */
1628        public UnsignedIntType getActualNumberElement() { 
1629          if (this.actualNumber == null)
1630            if (Configuration.errorOnAutoCreate())
1631              throw new Error("Attempt to auto-create ResearchStudyRecruitmentComponent.actualNumber");
1632            else if (Configuration.doAutoCreate())
1633              this.actualNumber = new UnsignedIntType(); // bb
1634          return this.actualNumber;
1635        }
1636
1637        public boolean hasActualNumberElement() { 
1638          return this.actualNumber != null && !this.actualNumber.isEmpty();
1639        }
1640
1641        public boolean hasActualNumber() { 
1642          return this.actualNumber != null && !this.actualNumber.isEmpty();
1643        }
1644
1645        /**
1646         * @param value {@link #actualNumber} (Actual total number of participants enrolled in study.). This is the underlying object with id, value and extensions. The accessor "getActualNumber" gives direct access to the value
1647         */
1648        public ResearchStudyRecruitmentComponent setActualNumberElement(UnsignedIntType value) { 
1649          this.actualNumber = value;
1650          return this;
1651        }
1652
1653        /**
1654         * @return Actual total number of participants enrolled in study.
1655         */
1656        public int getActualNumber() { 
1657          return this.actualNumber == null || this.actualNumber.isEmpty() ? 0 : this.actualNumber.getValue();
1658        }
1659
1660        /**
1661         * @param value Actual total number of participants enrolled in study.
1662         */
1663        public ResearchStudyRecruitmentComponent setActualNumber(int value) { 
1664            if (this.actualNumber == null)
1665              this.actualNumber = new UnsignedIntType();
1666            this.actualNumber.setValue(value);
1667          return this;
1668        }
1669
1670        /**
1671         * @return {@link #eligibility} (Inclusion and exclusion criteria.)
1672         */
1673        public Reference getEligibility() { 
1674          if (this.eligibility == null)
1675            if (Configuration.errorOnAutoCreate())
1676              throw new Error("Attempt to auto-create ResearchStudyRecruitmentComponent.eligibility");
1677            else if (Configuration.doAutoCreate())
1678              this.eligibility = new Reference(); // cc
1679          return this.eligibility;
1680        }
1681
1682        public boolean hasEligibility() { 
1683          return this.eligibility != null && !this.eligibility.isEmpty();
1684        }
1685
1686        /**
1687         * @param value {@link #eligibility} (Inclusion and exclusion criteria.)
1688         */
1689        public ResearchStudyRecruitmentComponent setEligibility(Reference value) { 
1690          this.eligibility = value;
1691          return this;
1692        }
1693
1694        /**
1695         * @return {@link #actualGroup} (Group of participants who were enrolled in study.)
1696         */
1697        public Reference getActualGroup() { 
1698          if (this.actualGroup == null)
1699            if (Configuration.errorOnAutoCreate())
1700              throw new Error("Attempt to auto-create ResearchStudyRecruitmentComponent.actualGroup");
1701            else if (Configuration.doAutoCreate())
1702              this.actualGroup = new Reference(); // cc
1703          return this.actualGroup;
1704        }
1705
1706        public boolean hasActualGroup() { 
1707          return this.actualGroup != null && !this.actualGroup.isEmpty();
1708        }
1709
1710        /**
1711         * @param value {@link #actualGroup} (Group of participants who were enrolled in study.)
1712         */
1713        public ResearchStudyRecruitmentComponent setActualGroup(Reference value) { 
1714          this.actualGroup = value;
1715          return this;
1716        }
1717
1718        protected void listChildren(List<Property> children) {
1719          super.listChildren(children);
1720          children.add(new Property("targetNumber", "unsignedInt", "Estimated total number of participants to be enrolled.", 0, 1, targetNumber));
1721          children.add(new Property("actualNumber", "unsignedInt", "Actual total number of participants enrolled in study.", 0, 1, actualNumber));
1722          children.add(new Property("eligibility", "Reference(Group|EvidenceVariable)", "Inclusion and exclusion criteria.", 0, 1, eligibility));
1723          children.add(new Property("actualGroup", "Reference(Group)", "Group of participants who were enrolled in study.", 0, 1, actualGroup));
1724        }
1725
1726        @Override
1727        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1728          switch (_hash) {
1729          case -682948550: /*targetNumber*/  return new Property("targetNumber", "unsignedInt", "Estimated total number of participants to be enrolled.", 0, 1, targetNumber);
1730          case 746557047: /*actualNumber*/  return new Property("actualNumber", "unsignedInt", "Actual total number of participants enrolled in study.", 0, 1, actualNumber);
1731          case -930847859: /*eligibility*/  return new Property("eligibility", "Reference(Group|EvidenceVariable)", "Inclusion and exclusion criteria.", 0, 1, eligibility);
1732          case 1403004305: /*actualGroup*/  return new Property("actualGroup", "Reference(Group)", "Group of participants who were enrolled in study.", 0, 1, actualGroup);
1733          default: return super.getNamedProperty(_hash, _name, _checkValid);
1734          }
1735
1736        }
1737
1738      @Override
1739      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1740        switch (hash) {
1741        case -682948550: /*targetNumber*/ return this.targetNumber == null ? new Base[0] : new Base[] {this.targetNumber}; // UnsignedIntType
1742        case 746557047: /*actualNumber*/ return this.actualNumber == null ? new Base[0] : new Base[] {this.actualNumber}; // UnsignedIntType
1743        case -930847859: /*eligibility*/ return this.eligibility == null ? new Base[0] : new Base[] {this.eligibility}; // Reference
1744        case 1403004305: /*actualGroup*/ return this.actualGroup == null ? new Base[0] : new Base[] {this.actualGroup}; // Reference
1745        default: return super.getProperty(hash, name, checkValid);
1746        }
1747
1748      }
1749
1750      @Override
1751      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1752        switch (hash) {
1753        case -682948550: // targetNumber
1754          this.targetNumber = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1755          return value;
1756        case 746557047: // actualNumber
1757          this.actualNumber = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1758          return value;
1759        case -930847859: // eligibility
1760          this.eligibility = TypeConvertor.castToReference(value); // Reference
1761          return value;
1762        case 1403004305: // actualGroup
1763          this.actualGroup = TypeConvertor.castToReference(value); // Reference
1764          return value;
1765        default: return super.setProperty(hash, name, value);
1766        }
1767
1768      }
1769
1770      @Override
1771      public Base setProperty(String name, Base value) throws FHIRException {
1772        if (name.equals("targetNumber")) {
1773          this.targetNumber = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1774        } else if (name.equals("actualNumber")) {
1775          this.actualNumber = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1776        } else if (name.equals("eligibility")) {
1777          this.eligibility = TypeConvertor.castToReference(value); // Reference
1778        } else if (name.equals("actualGroup")) {
1779          this.actualGroup = TypeConvertor.castToReference(value); // Reference
1780        } else
1781          return super.setProperty(name, value);
1782        return value;
1783      }
1784
1785      @Override
1786      public Base makeProperty(int hash, String name) throws FHIRException {
1787        switch (hash) {
1788        case -682948550:  return getTargetNumberElement();
1789        case 746557047:  return getActualNumberElement();
1790        case -930847859:  return getEligibility();
1791        case 1403004305:  return getActualGroup();
1792        default: return super.makeProperty(hash, name);
1793        }
1794
1795      }
1796
1797      @Override
1798      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1799        switch (hash) {
1800        case -682948550: /*targetNumber*/ return new String[] {"unsignedInt"};
1801        case 746557047: /*actualNumber*/ return new String[] {"unsignedInt"};
1802        case -930847859: /*eligibility*/ return new String[] {"Reference"};
1803        case 1403004305: /*actualGroup*/ return new String[] {"Reference"};
1804        default: return super.getTypesForProperty(hash, name);
1805        }
1806
1807      }
1808
1809      @Override
1810      public Base addChild(String name) throws FHIRException {
1811        if (name.equals("targetNumber")) {
1812          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.recruitment.targetNumber");
1813        }
1814        else if (name.equals("actualNumber")) {
1815          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.recruitment.actualNumber");
1816        }
1817        else if (name.equals("eligibility")) {
1818          this.eligibility = new Reference();
1819          return this.eligibility;
1820        }
1821        else if (name.equals("actualGroup")) {
1822          this.actualGroup = new Reference();
1823          return this.actualGroup;
1824        }
1825        else
1826          return super.addChild(name);
1827      }
1828
1829      public ResearchStudyRecruitmentComponent copy() {
1830        ResearchStudyRecruitmentComponent dst = new ResearchStudyRecruitmentComponent();
1831        copyValues(dst);
1832        return dst;
1833      }
1834
1835      public void copyValues(ResearchStudyRecruitmentComponent dst) {
1836        super.copyValues(dst);
1837        dst.targetNumber = targetNumber == null ? null : targetNumber.copy();
1838        dst.actualNumber = actualNumber == null ? null : actualNumber.copy();
1839        dst.eligibility = eligibility == null ? null : eligibility.copy();
1840        dst.actualGroup = actualGroup == null ? null : actualGroup.copy();
1841      }
1842
1843      @Override
1844      public boolean equalsDeep(Base other_) {
1845        if (!super.equalsDeep(other_))
1846          return false;
1847        if (!(other_ instanceof ResearchStudyRecruitmentComponent))
1848          return false;
1849        ResearchStudyRecruitmentComponent o = (ResearchStudyRecruitmentComponent) other_;
1850        return compareDeep(targetNumber, o.targetNumber, true) && compareDeep(actualNumber, o.actualNumber, true)
1851           && compareDeep(eligibility, o.eligibility, true) && compareDeep(actualGroup, o.actualGroup, true)
1852          ;
1853      }
1854
1855      @Override
1856      public boolean equalsShallow(Base other_) {
1857        if (!super.equalsShallow(other_))
1858          return false;
1859        if (!(other_ instanceof ResearchStudyRecruitmentComponent))
1860          return false;
1861        ResearchStudyRecruitmentComponent o = (ResearchStudyRecruitmentComponent) other_;
1862        return compareValues(targetNumber, o.targetNumber, true) && compareValues(actualNumber, o.actualNumber, true)
1863          ;
1864      }
1865
1866      public boolean isEmpty() {
1867        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(targetNumber, actualNumber
1868          , eligibility, actualGroup);
1869      }
1870
1871  public String fhirType() {
1872    return "ResearchStudy.recruitment";
1873
1874  }
1875
1876  }
1877
1878    @Block()
1879    public static class ResearchStudyComparisonGroupComponent extends BackboneElement implements IBaseBackboneElement {
1880        /**
1881         * Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.
1882         */
1883        @Child(name = "identifier", type = {UriType.class, Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false)
1884        @Description(shortDefinition="Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily", formalDefinition="Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily." )
1885        protected DataType identifier;
1886
1887        /**
1888         * Unique, human-readable label for this comparisonGroup of the study.
1889         */
1890        @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
1891        @Description(shortDefinition="Label for study comparisonGroup", formalDefinition="Unique, human-readable label for this comparisonGroup of the study." )
1892        protected StringType name;
1893
1894        /**
1895         * Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater.
1896         */
1897        @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1898        @Description(shortDefinition="Categorization of study comparisonGroup", formalDefinition="Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater." )
1899        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-arm-type")
1900        protected CodeableConcept type;
1901
1902        /**
1903         * A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.
1904         */
1905        @Child(name = "description", type = {MarkdownType.class}, order=4, min=0, max=1, modifier=false, summary=false)
1906        @Description(shortDefinition="Short explanation of study path", formalDefinition="A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup." )
1907        protected MarkdownType description;
1908
1909        /**
1910         * Interventions or exposures in this comparisonGroup or cohort.
1911         */
1912        @Child(name = "intendedExposure", type = {EvidenceVariable.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1913        @Description(shortDefinition="Interventions or exposures in this comparisonGroup or cohort", formalDefinition="Interventions or exposures in this comparisonGroup or cohort." )
1914        protected List<Reference> intendedExposure;
1915
1916        /**
1917         * Group of participants who were enrolled in study comparisonGroup.
1918         */
1919        @Child(name = "observedGroup", type = {Group.class}, order=6, min=0, max=1, modifier=false, summary=false)
1920        @Description(shortDefinition="Group of participants who were enrolled in study comparisonGroup", formalDefinition="Group of participants who were enrolled in study comparisonGroup." )
1921        protected Reference observedGroup;
1922
1923        private static final long serialVersionUID = -600196662L;
1924
1925    /**
1926     * Constructor
1927     */
1928      public ResearchStudyComparisonGroupComponent() {
1929        super();
1930      }
1931
1932    /**
1933     * Constructor
1934     */
1935      public ResearchStudyComparisonGroupComponent(String name) {
1936        super();
1937        this.setName(name);
1938      }
1939
1940        /**
1941         * @return {@link #identifier} (Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.)
1942         */
1943        public DataType getIdentifier() { 
1944          return this.identifier;
1945        }
1946
1947        /**
1948         * @return {@link #identifier} (Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.)
1949         */
1950        public UriType getIdentifierUriType() throws FHIRException { 
1951          if (this.identifier == null)
1952            this.identifier = new UriType();
1953          if (!(this.identifier instanceof UriType))
1954            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.identifier.getClass().getName()+" was encountered");
1955          return (UriType) this.identifier;
1956        }
1957
1958        public boolean hasIdentifierUriType() { 
1959          return this != null && this.identifier instanceof UriType;
1960        }
1961
1962        /**
1963         * @return {@link #identifier} (Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.)
1964         */
1965        public Identifier getIdentifierIdentifier() throws FHIRException { 
1966          if (this.identifier == null)
1967            this.identifier = new Identifier();
1968          if (!(this.identifier instanceof Identifier))
1969            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.identifier.getClass().getName()+" was encountered");
1970          return (Identifier) this.identifier;
1971        }
1972
1973        public boolean hasIdentifierIdentifier() { 
1974          return this != null && this.identifier instanceof Identifier;
1975        }
1976
1977        public boolean hasIdentifier() { 
1978          return this.identifier != null && !this.identifier.isEmpty();
1979        }
1980
1981        /**
1982         * @param value {@link #identifier} (Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.)
1983         */
1984        public ResearchStudyComparisonGroupComponent setIdentifier(DataType value) { 
1985          if (value != null && !(value instanceof UriType || value instanceof Identifier))
1986            throw new Error("Not the right type for ResearchStudy.comparisonGroup.identifier[x]: "+value.fhirType());
1987          this.identifier = value;
1988          return this;
1989        }
1990
1991        /**
1992         * @return {@link #name} (Unique, human-readable label for this comparisonGroup of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1993         */
1994        public StringType getNameElement() { 
1995          if (this.name == null)
1996            if (Configuration.errorOnAutoCreate())
1997              throw new Error("Attempt to auto-create ResearchStudyComparisonGroupComponent.name");
1998            else if (Configuration.doAutoCreate())
1999              this.name = new StringType(); // bb
2000          return this.name;
2001        }
2002
2003        public boolean hasNameElement() { 
2004          return this.name != null && !this.name.isEmpty();
2005        }
2006
2007        public boolean hasName() { 
2008          return this.name != null && !this.name.isEmpty();
2009        }
2010
2011        /**
2012         * @param value {@link #name} (Unique, human-readable label for this comparisonGroup of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2013         */
2014        public ResearchStudyComparisonGroupComponent setNameElement(StringType value) { 
2015          this.name = value;
2016          return this;
2017        }
2018
2019        /**
2020         * @return Unique, human-readable label for this comparisonGroup of the study.
2021         */
2022        public String getName() { 
2023          return this.name == null ? null : this.name.getValue();
2024        }
2025
2026        /**
2027         * @param value Unique, human-readable label for this comparisonGroup of the study.
2028         */
2029        public ResearchStudyComparisonGroupComponent setName(String value) { 
2030            if (this.name == null)
2031              this.name = new StringType();
2032            this.name.setValue(value);
2033          return this;
2034        }
2035
2036        /**
2037         * @return {@link #type} (Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater.)
2038         */
2039        public CodeableConcept getType() { 
2040          if (this.type == null)
2041            if (Configuration.errorOnAutoCreate())
2042              throw new Error("Attempt to auto-create ResearchStudyComparisonGroupComponent.type");
2043            else if (Configuration.doAutoCreate())
2044              this.type = new CodeableConcept(); // cc
2045          return this.type;
2046        }
2047
2048        public boolean hasType() { 
2049          return this.type != null && !this.type.isEmpty();
2050        }
2051
2052        /**
2053         * @param value {@link #type} (Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater.)
2054         */
2055        public ResearchStudyComparisonGroupComponent setType(CodeableConcept value) { 
2056          this.type = value;
2057          return this;
2058        }
2059
2060        /**
2061         * @return {@link #description} (A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2062         */
2063        public MarkdownType getDescriptionElement() { 
2064          if (this.description == null)
2065            if (Configuration.errorOnAutoCreate())
2066              throw new Error("Attempt to auto-create ResearchStudyComparisonGroupComponent.description");
2067            else if (Configuration.doAutoCreate())
2068              this.description = new MarkdownType(); // bb
2069          return this.description;
2070        }
2071
2072        public boolean hasDescriptionElement() { 
2073          return this.description != null && !this.description.isEmpty();
2074        }
2075
2076        public boolean hasDescription() { 
2077          return this.description != null && !this.description.isEmpty();
2078        }
2079
2080        /**
2081         * @param value {@link #description} (A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2082         */
2083        public ResearchStudyComparisonGroupComponent setDescriptionElement(MarkdownType value) { 
2084          this.description = value;
2085          return this;
2086        }
2087
2088        /**
2089         * @return A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.
2090         */
2091        public String getDescription() { 
2092          return this.description == null ? null : this.description.getValue();
2093        }
2094
2095        /**
2096         * @param value A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.
2097         */
2098        public ResearchStudyComparisonGroupComponent setDescription(String value) { 
2099          if (value == null)
2100            this.description = null;
2101          else {
2102            if (this.description == null)
2103              this.description = new MarkdownType();
2104            this.description.setValue(value);
2105          }
2106          return this;
2107        }
2108
2109        /**
2110         * @return {@link #intendedExposure} (Interventions or exposures in this comparisonGroup or cohort.)
2111         */
2112        public List<Reference> getIntendedExposure() { 
2113          if (this.intendedExposure == null)
2114            this.intendedExposure = new ArrayList<Reference>();
2115          return this.intendedExposure;
2116        }
2117
2118        /**
2119         * @return Returns a reference to <code>this</code> for easy method chaining
2120         */
2121        public ResearchStudyComparisonGroupComponent setIntendedExposure(List<Reference> theIntendedExposure) { 
2122          this.intendedExposure = theIntendedExposure;
2123          return this;
2124        }
2125
2126        public boolean hasIntendedExposure() { 
2127          if (this.intendedExposure == null)
2128            return false;
2129          for (Reference item : this.intendedExposure)
2130            if (!item.isEmpty())
2131              return true;
2132          return false;
2133        }
2134
2135        public Reference addIntendedExposure() { //3
2136          Reference t = new Reference();
2137          if (this.intendedExposure == null)
2138            this.intendedExposure = new ArrayList<Reference>();
2139          this.intendedExposure.add(t);
2140          return t;
2141        }
2142
2143        public ResearchStudyComparisonGroupComponent addIntendedExposure(Reference t) { //3
2144          if (t == null)
2145            return this;
2146          if (this.intendedExposure == null)
2147            this.intendedExposure = new ArrayList<Reference>();
2148          this.intendedExposure.add(t);
2149          return this;
2150        }
2151
2152        /**
2153         * @return The first repetition of repeating field {@link #intendedExposure}, creating it if it does not already exist {3}
2154         */
2155        public Reference getIntendedExposureFirstRep() { 
2156          if (getIntendedExposure().isEmpty()) {
2157            addIntendedExposure();
2158          }
2159          return getIntendedExposure().get(0);
2160        }
2161
2162        /**
2163         * @return {@link #observedGroup} (Group of participants who were enrolled in study comparisonGroup.)
2164         */
2165        public Reference getObservedGroup() { 
2166          if (this.observedGroup == null)
2167            if (Configuration.errorOnAutoCreate())
2168              throw new Error("Attempt to auto-create ResearchStudyComparisonGroupComponent.observedGroup");
2169            else if (Configuration.doAutoCreate())
2170              this.observedGroup = new Reference(); // cc
2171          return this.observedGroup;
2172        }
2173
2174        public boolean hasObservedGroup() { 
2175          return this.observedGroup != null && !this.observedGroup.isEmpty();
2176        }
2177
2178        /**
2179         * @param value {@link #observedGroup} (Group of participants who were enrolled in study comparisonGroup.)
2180         */
2181        public ResearchStudyComparisonGroupComponent setObservedGroup(Reference value) { 
2182          this.observedGroup = value;
2183          return this;
2184        }
2185
2186        protected void listChildren(List<Property> children) {
2187          super.listChildren(children);
2188          children.add(new Property("identifier[x]", "uri|Identifier", "Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.", 0, 1, identifier));
2189          children.add(new Property("name", "string", "Unique, human-readable label for this comparisonGroup of the study.", 0, 1, name));
2190          children.add(new Property("type", "CodeableConcept", "Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater.", 0, 1, type));
2191          children.add(new Property("description", "markdown", "A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.", 0, 1, description));
2192          children.add(new Property("intendedExposure", "Reference(EvidenceVariable)", "Interventions or exposures in this comparisonGroup or cohort.", 0, java.lang.Integer.MAX_VALUE, intendedExposure));
2193          children.add(new Property("observedGroup", "Reference(Group)", "Group of participants who were enrolled in study comparisonGroup.", 0, 1, observedGroup));
2194        }
2195
2196        @Override
2197        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2198          switch (_hash) {
2199          case 569772855: /*identifier[x]*/  return new Property("identifier[x]", "uri|Identifier", "Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.", 0, 1, identifier);
2200          case -1618432855: /*identifier*/  return new Property("identifier[x]", "uri|Identifier", "Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.", 0, 1, identifier);
2201          case 569766915: /*identifierUri*/  return new Property("identifier[x]", "uri", "Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.", 0, 1, identifier);
2202          case -554289614: /*identifierIdentifier*/  return new Property("identifier[x]", "Identifier", "Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.", 0, 1, identifier);
2203          case 3373707: /*name*/  return new Property("name", "string", "Unique, human-readable label for this comparisonGroup of the study.", 0, 1, name);
2204          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater.", 0, 1, type);
2205          case -1724546052: /*description*/  return new Property("description", "markdown", "A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.", 0, 1, description);
2206          case -407218606: /*intendedExposure*/  return new Property("intendedExposure", "Reference(EvidenceVariable)", "Interventions or exposures in this comparisonGroup or cohort.", 0, java.lang.Integer.MAX_VALUE, intendedExposure);
2207          case 375599255: /*observedGroup*/  return new Property("observedGroup", "Reference(Group)", "Group of participants who were enrolled in study comparisonGroup.", 0, 1, observedGroup);
2208          default: return super.getNamedProperty(_hash, _name, _checkValid);
2209          }
2210
2211        }
2212
2213      @Override
2214      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2215        switch (hash) {
2216        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // DataType
2217        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2218        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2219        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2220        case -407218606: /*intendedExposure*/ return this.intendedExposure == null ? new Base[0] : this.intendedExposure.toArray(new Base[this.intendedExposure.size()]); // Reference
2221        case 375599255: /*observedGroup*/ return this.observedGroup == null ? new Base[0] : new Base[] {this.observedGroup}; // Reference
2222        default: return super.getProperty(hash, name, checkValid);
2223        }
2224
2225      }
2226
2227      @Override
2228      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2229        switch (hash) {
2230        case -1618432855: // identifier
2231          this.identifier = TypeConvertor.castToType(value); // DataType
2232          return value;
2233        case 3373707: // name
2234          this.name = TypeConvertor.castToString(value); // StringType
2235          return value;
2236        case 3575610: // type
2237          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2238          return value;
2239        case -1724546052: // description
2240          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2241          return value;
2242        case -407218606: // intendedExposure
2243          this.getIntendedExposure().add(TypeConvertor.castToReference(value)); // Reference
2244          return value;
2245        case 375599255: // observedGroup
2246          this.observedGroup = TypeConvertor.castToReference(value); // Reference
2247          return value;
2248        default: return super.setProperty(hash, name, value);
2249        }
2250
2251      }
2252
2253      @Override
2254      public Base setProperty(String name, Base value) throws FHIRException {
2255        if (name.equals("identifier[x]")) {
2256          this.identifier = TypeConvertor.castToType(value); // DataType
2257        } else if (name.equals("name")) {
2258          this.name = TypeConvertor.castToString(value); // StringType
2259        } else if (name.equals("type")) {
2260          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2261        } else if (name.equals("description")) {
2262          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2263        } else if (name.equals("intendedExposure")) {
2264          this.getIntendedExposure().add(TypeConvertor.castToReference(value));
2265        } else if (name.equals("observedGroup")) {
2266          this.observedGroup = TypeConvertor.castToReference(value); // Reference
2267        } else
2268          return super.setProperty(name, value);
2269        return value;
2270      }
2271
2272      @Override
2273      public Base makeProperty(int hash, String name) throws FHIRException {
2274        switch (hash) {
2275        case 569772855:  return getIdentifier();
2276        case -1618432855:  return getIdentifier();
2277        case 3373707:  return getNameElement();
2278        case 3575610:  return getType();
2279        case -1724546052:  return getDescriptionElement();
2280        case -407218606:  return addIntendedExposure(); 
2281        case 375599255:  return getObservedGroup();
2282        default: return super.makeProperty(hash, name);
2283        }
2284
2285      }
2286
2287      @Override
2288      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2289        switch (hash) {
2290        case -1618432855: /*identifier*/ return new String[] {"uri", "Identifier"};
2291        case 3373707: /*name*/ return new String[] {"string"};
2292        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2293        case -1724546052: /*description*/ return new String[] {"markdown"};
2294        case -407218606: /*intendedExposure*/ return new String[] {"Reference"};
2295        case 375599255: /*observedGroup*/ return new String[] {"Reference"};
2296        default: return super.getTypesForProperty(hash, name);
2297        }
2298
2299      }
2300
2301      @Override
2302      public Base addChild(String name) throws FHIRException {
2303        if (name.equals("identifierUri")) {
2304          this.identifier = new UriType();
2305          return this.identifier;
2306        }
2307        else if (name.equals("identifierIdentifier")) {
2308          this.identifier = new Identifier();
2309          return this.identifier;
2310        }
2311        else if (name.equals("name")) {
2312          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.comparisonGroup.name");
2313        }
2314        else if (name.equals("type")) {
2315          this.type = new CodeableConcept();
2316          return this.type;
2317        }
2318        else if (name.equals("description")) {
2319          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.comparisonGroup.description");
2320        }
2321        else if (name.equals("intendedExposure")) {
2322          return addIntendedExposure();
2323        }
2324        else if (name.equals("observedGroup")) {
2325          this.observedGroup = new Reference();
2326          return this.observedGroup;
2327        }
2328        else
2329          return super.addChild(name);
2330      }
2331
2332      public ResearchStudyComparisonGroupComponent copy() {
2333        ResearchStudyComparisonGroupComponent dst = new ResearchStudyComparisonGroupComponent();
2334        copyValues(dst);
2335        return dst;
2336      }
2337
2338      public void copyValues(ResearchStudyComparisonGroupComponent dst) {
2339        super.copyValues(dst);
2340        dst.identifier = identifier == null ? null : identifier.copy();
2341        dst.name = name == null ? null : name.copy();
2342        dst.type = type == null ? null : type.copy();
2343        dst.description = description == null ? null : description.copy();
2344        if (intendedExposure != null) {
2345          dst.intendedExposure = new ArrayList<Reference>();
2346          for (Reference i : intendedExposure)
2347            dst.intendedExposure.add(i.copy());
2348        };
2349        dst.observedGroup = observedGroup == null ? null : observedGroup.copy();
2350      }
2351
2352      @Override
2353      public boolean equalsDeep(Base other_) {
2354        if (!super.equalsDeep(other_))
2355          return false;
2356        if (!(other_ instanceof ResearchStudyComparisonGroupComponent))
2357          return false;
2358        ResearchStudyComparisonGroupComponent o = (ResearchStudyComparisonGroupComponent) other_;
2359        return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(type, o.type, true)
2360           && compareDeep(description, o.description, true) && compareDeep(intendedExposure, o.intendedExposure, true)
2361           && compareDeep(observedGroup, o.observedGroup, true);
2362      }
2363
2364      @Override
2365      public boolean equalsShallow(Base other_) {
2366        if (!super.equalsShallow(other_))
2367          return false;
2368        if (!(other_ instanceof ResearchStudyComparisonGroupComponent))
2369          return false;
2370        ResearchStudyComparisonGroupComponent o = (ResearchStudyComparisonGroupComponent) other_;
2371        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
2372      }
2373
2374      public boolean isEmpty() {
2375        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, name, type, description
2376          , intendedExposure, observedGroup);
2377      }
2378
2379  public String fhirType() {
2380    return "ResearchStudy.comparisonGroup";
2381
2382  }
2383
2384  }
2385
2386    @Block()
2387    public static class ResearchStudyObjectiveComponent extends BackboneElement implements IBaseBackboneElement {
2388        /**
2389         * Unique, human-readable label for this objective of the study.
2390         */
2391        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2392        @Description(shortDefinition="Label for the objective", formalDefinition="Unique, human-readable label for this objective of the study." )
2393        protected StringType name;
2394
2395        /**
2396         * The kind of study objective.
2397         */
2398        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2399        @Description(shortDefinition="primary | secondary | exploratory", formalDefinition="The kind of study objective." )
2400        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-objective-type")
2401        protected CodeableConcept type;
2402
2403        /**
2404         * Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).
2405         */
2406        @Child(name = "description", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2407        @Description(shortDefinition="Description of the objective", formalDefinition="Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description)." )
2408        protected MarkdownType description;
2409
2410        private static final long serialVersionUID = -1976083810L;
2411
2412    /**
2413     * Constructor
2414     */
2415      public ResearchStudyObjectiveComponent() {
2416        super();
2417      }
2418
2419        /**
2420         * @return {@link #name} (Unique, human-readable label for this objective of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2421         */
2422        public StringType getNameElement() { 
2423          if (this.name == null)
2424            if (Configuration.errorOnAutoCreate())
2425              throw new Error("Attempt to auto-create ResearchStudyObjectiveComponent.name");
2426            else if (Configuration.doAutoCreate())
2427              this.name = new StringType(); // bb
2428          return this.name;
2429        }
2430
2431        public boolean hasNameElement() { 
2432          return this.name != null && !this.name.isEmpty();
2433        }
2434
2435        public boolean hasName() { 
2436          return this.name != null && !this.name.isEmpty();
2437        }
2438
2439        /**
2440         * @param value {@link #name} (Unique, human-readable label for this objective of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2441         */
2442        public ResearchStudyObjectiveComponent setNameElement(StringType value) { 
2443          this.name = value;
2444          return this;
2445        }
2446
2447        /**
2448         * @return Unique, human-readable label for this objective of the study.
2449         */
2450        public String getName() { 
2451          return this.name == null ? null : this.name.getValue();
2452        }
2453
2454        /**
2455         * @param value Unique, human-readable label for this objective of the study.
2456         */
2457        public ResearchStudyObjectiveComponent setName(String value) { 
2458          if (Utilities.noString(value))
2459            this.name = null;
2460          else {
2461            if (this.name == null)
2462              this.name = new StringType();
2463            this.name.setValue(value);
2464          }
2465          return this;
2466        }
2467
2468        /**
2469         * @return {@link #type} (The kind of study objective.)
2470         */
2471        public CodeableConcept getType() { 
2472          if (this.type == null)
2473            if (Configuration.errorOnAutoCreate())
2474              throw new Error("Attempt to auto-create ResearchStudyObjectiveComponent.type");
2475            else if (Configuration.doAutoCreate())
2476              this.type = new CodeableConcept(); // cc
2477          return this.type;
2478        }
2479
2480        public boolean hasType() { 
2481          return this.type != null && !this.type.isEmpty();
2482        }
2483
2484        /**
2485         * @param value {@link #type} (The kind of study objective.)
2486         */
2487        public ResearchStudyObjectiveComponent setType(CodeableConcept value) { 
2488          this.type = value;
2489          return this;
2490        }
2491
2492        /**
2493         * @return {@link #description} (Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2494         */
2495        public MarkdownType getDescriptionElement() { 
2496          if (this.description == null)
2497            if (Configuration.errorOnAutoCreate())
2498              throw new Error("Attempt to auto-create ResearchStudyObjectiveComponent.description");
2499            else if (Configuration.doAutoCreate())
2500              this.description = new MarkdownType(); // bb
2501          return this.description;
2502        }
2503
2504        public boolean hasDescriptionElement() { 
2505          return this.description != null && !this.description.isEmpty();
2506        }
2507
2508        public boolean hasDescription() { 
2509          return this.description != null && !this.description.isEmpty();
2510        }
2511
2512        /**
2513         * @param value {@link #description} (Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2514         */
2515        public ResearchStudyObjectiveComponent setDescriptionElement(MarkdownType value) { 
2516          this.description = value;
2517          return this;
2518        }
2519
2520        /**
2521         * @return Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).
2522         */
2523        public String getDescription() { 
2524          return this.description == null ? null : this.description.getValue();
2525        }
2526
2527        /**
2528         * @param value Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).
2529         */
2530        public ResearchStudyObjectiveComponent setDescription(String value) { 
2531          if (value == null)
2532            this.description = null;
2533          else {
2534            if (this.description == null)
2535              this.description = new MarkdownType();
2536            this.description.setValue(value);
2537          }
2538          return this;
2539        }
2540
2541        protected void listChildren(List<Property> children) {
2542          super.listChildren(children);
2543          children.add(new Property("name", "string", "Unique, human-readable label for this objective of the study.", 0, 1, name));
2544          children.add(new Property("type", "CodeableConcept", "The kind of study objective.", 0, 1, type));
2545          children.add(new Property("description", "markdown", "Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).", 0, 1, description));
2546        }
2547
2548        @Override
2549        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2550          switch (_hash) {
2551          case 3373707: /*name*/  return new Property("name", "string", "Unique, human-readable label for this objective of the study.", 0, 1, name);
2552          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of study objective.", 0, 1, type);
2553          case -1724546052: /*description*/  return new Property("description", "markdown", "Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).", 0, 1, description);
2554          default: return super.getNamedProperty(_hash, _name, _checkValid);
2555          }
2556
2557        }
2558
2559      @Override
2560      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2561        switch (hash) {
2562        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2563        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2564        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2565        default: return super.getProperty(hash, name, checkValid);
2566        }
2567
2568      }
2569
2570      @Override
2571      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2572        switch (hash) {
2573        case 3373707: // name
2574          this.name = TypeConvertor.castToString(value); // StringType
2575          return value;
2576        case 3575610: // type
2577          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2578          return value;
2579        case -1724546052: // description
2580          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2581          return value;
2582        default: return super.setProperty(hash, name, value);
2583        }
2584
2585      }
2586
2587      @Override
2588      public Base setProperty(String name, Base value) throws FHIRException {
2589        if (name.equals("name")) {
2590          this.name = TypeConvertor.castToString(value); // StringType
2591        } else if (name.equals("type")) {
2592          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2593        } else if (name.equals("description")) {
2594          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2595        } else
2596          return super.setProperty(name, value);
2597        return value;
2598      }
2599
2600      @Override
2601      public Base makeProperty(int hash, String name) throws FHIRException {
2602        switch (hash) {
2603        case 3373707:  return getNameElement();
2604        case 3575610:  return getType();
2605        case -1724546052:  return getDescriptionElement();
2606        default: return super.makeProperty(hash, name);
2607        }
2608
2609      }
2610
2611      @Override
2612      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2613        switch (hash) {
2614        case 3373707: /*name*/ return new String[] {"string"};
2615        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2616        case -1724546052: /*description*/ return new String[] {"markdown"};
2617        default: return super.getTypesForProperty(hash, name);
2618        }
2619
2620      }
2621
2622      @Override
2623      public Base addChild(String name) throws FHIRException {
2624        if (name.equals("name")) {
2625          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.objective.name");
2626        }
2627        else if (name.equals("type")) {
2628          this.type = new CodeableConcept();
2629          return this.type;
2630        }
2631        else if (name.equals("description")) {
2632          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.objective.description");
2633        }
2634        else
2635          return super.addChild(name);
2636      }
2637
2638      public ResearchStudyObjectiveComponent copy() {
2639        ResearchStudyObjectiveComponent dst = new ResearchStudyObjectiveComponent();
2640        copyValues(dst);
2641        return dst;
2642      }
2643
2644      public void copyValues(ResearchStudyObjectiveComponent dst) {
2645        super.copyValues(dst);
2646        dst.name = name == null ? null : name.copy();
2647        dst.type = type == null ? null : type.copy();
2648        dst.description = description == null ? null : description.copy();
2649      }
2650
2651      @Override
2652      public boolean equalsDeep(Base other_) {
2653        if (!super.equalsDeep(other_))
2654          return false;
2655        if (!(other_ instanceof ResearchStudyObjectiveComponent))
2656          return false;
2657        ResearchStudyObjectiveComponent o = (ResearchStudyObjectiveComponent) other_;
2658        return compareDeep(name, o.name, true) && compareDeep(type, o.type, true) && compareDeep(description, o.description, true)
2659          ;
2660      }
2661
2662      @Override
2663      public boolean equalsShallow(Base other_) {
2664        if (!super.equalsShallow(other_))
2665          return false;
2666        if (!(other_ instanceof ResearchStudyObjectiveComponent))
2667          return false;
2668        ResearchStudyObjectiveComponent o = (ResearchStudyObjectiveComponent) other_;
2669        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
2670      }
2671
2672      public boolean isEmpty() {
2673        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type, description
2674          );
2675      }
2676
2677  public String fhirType() {
2678    return "ResearchStudy.objective";
2679
2680  }
2681
2682  }
2683
2684    @Block()
2685    public static class ResearchStudyOutcomeMeasureComponent extends BackboneElement implements IBaseBackboneElement {
2686        /**
2687         * Label for the outcome.
2688         */
2689        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2690        @Description(shortDefinition="Label for the outcome", formalDefinition="Label for the outcome." )
2691        protected StringType name;
2692
2693        /**
2694         * The parameter or characteristic being assessed as one of the values by which the study is assessed.
2695         */
2696        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2697        @Description(shortDefinition="primary | secondary | exploratory", formalDefinition="The parameter or characteristic being assessed as one of the values by which the study is assessed." )
2698        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-objective-type")
2699        protected List<CodeableConcept> type;
2700
2701        /**
2702         * Description of the outcome.
2703         */
2704        @Child(name = "description", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2705        @Description(shortDefinition="Description of the outcome", formalDefinition="Description of the outcome." )
2706        protected MarkdownType description;
2707
2708        /**
2709         * Structured outcome definition.
2710         */
2711        @Child(name = "reference", type = {EvidenceVariable.class}, order=4, min=0, max=1, modifier=false, summary=false)
2712        @Description(shortDefinition="Structured outcome definition", formalDefinition="Structured outcome definition." )
2713        protected Reference reference;
2714
2715        private static final long serialVersionUID = 1786559672L;
2716
2717    /**
2718     * Constructor
2719     */
2720      public ResearchStudyOutcomeMeasureComponent() {
2721        super();
2722      }
2723
2724        /**
2725         * @return {@link #name} (Label for the outcome.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2726         */
2727        public StringType getNameElement() { 
2728          if (this.name == null)
2729            if (Configuration.errorOnAutoCreate())
2730              throw new Error("Attempt to auto-create ResearchStudyOutcomeMeasureComponent.name");
2731            else if (Configuration.doAutoCreate())
2732              this.name = new StringType(); // bb
2733          return this.name;
2734        }
2735
2736        public boolean hasNameElement() { 
2737          return this.name != null && !this.name.isEmpty();
2738        }
2739
2740        public boolean hasName() { 
2741          return this.name != null && !this.name.isEmpty();
2742        }
2743
2744        /**
2745         * @param value {@link #name} (Label for the outcome.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2746         */
2747        public ResearchStudyOutcomeMeasureComponent setNameElement(StringType value) { 
2748          this.name = value;
2749          return this;
2750        }
2751
2752        /**
2753         * @return Label for the outcome.
2754         */
2755        public String getName() { 
2756          return this.name == null ? null : this.name.getValue();
2757        }
2758
2759        /**
2760         * @param value Label for the outcome.
2761         */
2762        public ResearchStudyOutcomeMeasureComponent setName(String value) { 
2763          if (Utilities.noString(value))
2764            this.name = null;
2765          else {
2766            if (this.name == null)
2767              this.name = new StringType();
2768            this.name.setValue(value);
2769          }
2770          return this;
2771        }
2772
2773        /**
2774         * @return {@link #type} (The parameter or characteristic being assessed as one of the values by which the study is assessed.)
2775         */
2776        public List<CodeableConcept> getType() { 
2777          if (this.type == null)
2778            this.type = new ArrayList<CodeableConcept>();
2779          return this.type;
2780        }
2781
2782        /**
2783         * @return Returns a reference to <code>this</code> for easy method chaining
2784         */
2785        public ResearchStudyOutcomeMeasureComponent setType(List<CodeableConcept> theType) { 
2786          this.type = theType;
2787          return this;
2788        }
2789
2790        public boolean hasType() { 
2791          if (this.type == null)
2792            return false;
2793          for (CodeableConcept item : this.type)
2794            if (!item.isEmpty())
2795              return true;
2796          return false;
2797        }
2798
2799        public CodeableConcept addType() { //3
2800          CodeableConcept t = new CodeableConcept();
2801          if (this.type == null)
2802            this.type = new ArrayList<CodeableConcept>();
2803          this.type.add(t);
2804          return t;
2805        }
2806
2807        public ResearchStudyOutcomeMeasureComponent addType(CodeableConcept t) { //3
2808          if (t == null)
2809            return this;
2810          if (this.type == null)
2811            this.type = new ArrayList<CodeableConcept>();
2812          this.type.add(t);
2813          return this;
2814        }
2815
2816        /**
2817         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
2818         */
2819        public CodeableConcept getTypeFirstRep() { 
2820          if (getType().isEmpty()) {
2821            addType();
2822          }
2823          return getType().get(0);
2824        }
2825
2826        /**
2827         * @return {@link #description} (Description of the outcome.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2828         */
2829        public MarkdownType getDescriptionElement() { 
2830          if (this.description == null)
2831            if (Configuration.errorOnAutoCreate())
2832              throw new Error("Attempt to auto-create ResearchStudyOutcomeMeasureComponent.description");
2833            else if (Configuration.doAutoCreate())
2834              this.description = new MarkdownType(); // bb
2835          return this.description;
2836        }
2837
2838        public boolean hasDescriptionElement() { 
2839          return this.description != null && !this.description.isEmpty();
2840        }
2841
2842        public boolean hasDescription() { 
2843          return this.description != null && !this.description.isEmpty();
2844        }
2845
2846        /**
2847         * @param value {@link #description} (Description of the outcome.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2848         */
2849        public ResearchStudyOutcomeMeasureComponent setDescriptionElement(MarkdownType value) { 
2850          this.description = value;
2851          return this;
2852        }
2853
2854        /**
2855         * @return Description of the outcome.
2856         */
2857        public String getDescription() { 
2858          return this.description == null ? null : this.description.getValue();
2859        }
2860
2861        /**
2862         * @param value Description of the outcome.
2863         */
2864        public ResearchStudyOutcomeMeasureComponent setDescription(String value) { 
2865          if (value == null)
2866            this.description = null;
2867          else {
2868            if (this.description == null)
2869              this.description = new MarkdownType();
2870            this.description.setValue(value);
2871          }
2872          return this;
2873        }
2874
2875        /**
2876         * @return {@link #reference} (Structured outcome definition.)
2877         */
2878        public Reference getReference() { 
2879          if (this.reference == null)
2880            if (Configuration.errorOnAutoCreate())
2881              throw new Error("Attempt to auto-create ResearchStudyOutcomeMeasureComponent.reference");
2882            else if (Configuration.doAutoCreate())
2883              this.reference = new Reference(); // cc
2884          return this.reference;
2885        }
2886
2887        public boolean hasReference() { 
2888          return this.reference != null && !this.reference.isEmpty();
2889        }
2890
2891        /**
2892         * @param value {@link #reference} (Structured outcome definition.)
2893         */
2894        public ResearchStudyOutcomeMeasureComponent setReference(Reference value) { 
2895          this.reference = value;
2896          return this;
2897        }
2898
2899        protected void listChildren(List<Property> children) {
2900          super.listChildren(children);
2901          children.add(new Property("name", "string", "Label for the outcome.", 0, 1, name));
2902          children.add(new Property("type", "CodeableConcept", "The parameter or characteristic being assessed as one of the values by which the study is assessed.", 0, java.lang.Integer.MAX_VALUE, type));
2903          children.add(new Property("description", "markdown", "Description of the outcome.", 0, 1, description));
2904          children.add(new Property("reference", "Reference(EvidenceVariable)", "Structured outcome definition.", 0, 1, reference));
2905        }
2906
2907        @Override
2908        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2909          switch (_hash) {
2910          case 3373707: /*name*/  return new Property("name", "string", "Label for the outcome.", 0, 1, name);
2911          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The parameter or characteristic being assessed as one of the values by which the study is assessed.", 0, java.lang.Integer.MAX_VALUE, type);
2912          case -1724546052: /*description*/  return new Property("description", "markdown", "Description of the outcome.", 0, 1, description);
2913          case -925155509: /*reference*/  return new Property("reference", "Reference(EvidenceVariable)", "Structured outcome definition.", 0, 1, reference);
2914          default: return super.getNamedProperty(_hash, _name, _checkValid);
2915          }
2916
2917        }
2918
2919      @Override
2920      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2921        switch (hash) {
2922        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2923        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
2924        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2925        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
2926        default: return super.getProperty(hash, name, checkValid);
2927        }
2928
2929      }
2930
2931      @Override
2932      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2933        switch (hash) {
2934        case 3373707: // name
2935          this.name = TypeConvertor.castToString(value); // StringType
2936          return value;
2937        case 3575610: // type
2938          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2939          return value;
2940        case -1724546052: // description
2941          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2942          return value;
2943        case -925155509: // reference
2944          this.reference = TypeConvertor.castToReference(value); // Reference
2945          return value;
2946        default: return super.setProperty(hash, name, value);
2947        }
2948
2949      }
2950
2951      @Override
2952      public Base setProperty(String name, Base value) throws FHIRException {
2953        if (name.equals("name")) {
2954          this.name = TypeConvertor.castToString(value); // StringType
2955        } else if (name.equals("type")) {
2956          this.getType().add(TypeConvertor.castToCodeableConcept(value));
2957        } else if (name.equals("description")) {
2958          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2959        } else if (name.equals("reference")) {
2960          this.reference = TypeConvertor.castToReference(value); // Reference
2961        } else
2962          return super.setProperty(name, value);
2963        return value;
2964      }
2965
2966      @Override
2967      public Base makeProperty(int hash, String name) throws FHIRException {
2968        switch (hash) {
2969        case 3373707:  return getNameElement();
2970        case 3575610:  return addType(); 
2971        case -1724546052:  return getDescriptionElement();
2972        case -925155509:  return getReference();
2973        default: return super.makeProperty(hash, name);
2974        }
2975
2976      }
2977
2978      @Override
2979      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2980        switch (hash) {
2981        case 3373707: /*name*/ return new String[] {"string"};
2982        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2983        case -1724546052: /*description*/ return new String[] {"markdown"};
2984        case -925155509: /*reference*/ return new String[] {"Reference"};
2985        default: return super.getTypesForProperty(hash, name);
2986        }
2987
2988      }
2989
2990      @Override
2991      public Base addChild(String name) throws FHIRException {
2992        if (name.equals("name")) {
2993          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.outcomeMeasure.name");
2994        }
2995        else if (name.equals("type")) {
2996          return addType();
2997        }
2998        else if (name.equals("description")) {
2999          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.outcomeMeasure.description");
3000        }
3001        else if (name.equals("reference")) {
3002          this.reference = new Reference();
3003          return this.reference;
3004        }
3005        else
3006          return super.addChild(name);
3007      }
3008
3009      public ResearchStudyOutcomeMeasureComponent copy() {
3010        ResearchStudyOutcomeMeasureComponent dst = new ResearchStudyOutcomeMeasureComponent();
3011        copyValues(dst);
3012        return dst;
3013      }
3014
3015      public void copyValues(ResearchStudyOutcomeMeasureComponent dst) {
3016        super.copyValues(dst);
3017        dst.name = name == null ? null : name.copy();
3018        if (type != null) {
3019          dst.type = new ArrayList<CodeableConcept>();
3020          for (CodeableConcept i : type)
3021            dst.type.add(i.copy());
3022        };
3023        dst.description = description == null ? null : description.copy();
3024        dst.reference = reference == null ? null : reference.copy();
3025      }
3026
3027      @Override
3028      public boolean equalsDeep(Base other_) {
3029        if (!super.equalsDeep(other_))
3030          return false;
3031        if (!(other_ instanceof ResearchStudyOutcomeMeasureComponent))
3032          return false;
3033        ResearchStudyOutcomeMeasureComponent o = (ResearchStudyOutcomeMeasureComponent) other_;
3034        return compareDeep(name, o.name, true) && compareDeep(type, o.type, true) && compareDeep(description, o.description, true)
3035           && compareDeep(reference, o.reference, true);
3036      }
3037
3038      @Override
3039      public boolean equalsShallow(Base other_) {
3040        if (!super.equalsShallow(other_))
3041          return false;
3042        if (!(other_ instanceof ResearchStudyOutcomeMeasureComponent))
3043          return false;
3044        ResearchStudyOutcomeMeasureComponent o = (ResearchStudyOutcomeMeasureComponent) other_;
3045        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
3046      }
3047
3048      public boolean isEmpty() {
3049        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type, description
3050          , reference);
3051      }
3052
3053  public String fhirType() {
3054    return "ResearchStudy.outcomeMeasure";
3055
3056  }
3057
3058  }
3059
3060    @Block()
3061    public static class ResearchStudyWebLocationComponent extends BackboneElement implements IBaseBackboneElement {
3062        /**
3063         * Describes the nature of the location being specified.
3064         */
3065        @Child(name = "classifier", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
3066        @Description(shortDefinition="registry-page|recruitment-page|contact-page", formalDefinition="Describes the nature of the location being specified." )
3067        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-url-classifier")
3068        protected CodeableConcept classifier;
3069
3070        /**
3071         * The location address.
3072         */
3073        @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false)
3074        @Description(shortDefinition="The location address", formalDefinition="The location address." )
3075        protected UriType url;
3076
3077        private static final long serialVersionUID = -1718812997L;
3078
3079    /**
3080     * Constructor
3081     */
3082      public ResearchStudyWebLocationComponent() {
3083        super();
3084      }
3085
3086    /**
3087     * Constructor
3088     */
3089      public ResearchStudyWebLocationComponent(String url) {
3090        super();
3091        this.setUrl(url);
3092      }
3093
3094        /**
3095         * @return {@link #classifier} (Describes the nature of the location being specified.)
3096         */
3097        public CodeableConcept getClassifier() { 
3098          if (this.classifier == null)
3099            if (Configuration.errorOnAutoCreate())
3100              throw new Error("Attempt to auto-create ResearchStudyWebLocationComponent.classifier");
3101            else if (Configuration.doAutoCreate())
3102              this.classifier = new CodeableConcept(); // cc
3103          return this.classifier;
3104        }
3105
3106        public boolean hasClassifier() { 
3107          return this.classifier != null && !this.classifier.isEmpty();
3108        }
3109
3110        /**
3111         * @param value {@link #classifier} (Describes the nature of the location being specified.)
3112         */
3113        public ResearchStudyWebLocationComponent setClassifier(CodeableConcept value) { 
3114          this.classifier = value;
3115          return this;
3116        }
3117
3118        /**
3119         * @return {@link #url} (The location address.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
3120         */
3121        public UriType getUrlElement() { 
3122          if (this.url == null)
3123            if (Configuration.errorOnAutoCreate())
3124              throw new Error("Attempt to auto-create ResearchStudyWebLocationComponent.url");
3125            else if (Configuration.doAutoCreate())
3126              this.url = new UriType(); // bb
3127          return this.url;
3128        }
3129
3130        public boolean hasUrlElement() { 
3131          return this.url != null && !this.url.isEmpty();
3132        }
3133
3134        public boolean hasUrl() { 
3135          return this.url != null && !this.url.isEmpty();
3136        }
3137
3138        /**
3139         * @param value {@link #url} (The location address.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
3140         */
3141        public ResearchStudyWebLocationComponent setUrlElement(UriType value) { 
3142          this.url = value;
3143          return this;
3144        }
3145
3146        /**
3147         * @return The location address.
3148         */
3149        public String getUrl() { 
3150          return this.url == null ? null : this.url.getValue();
3151        }
3152
3153        /**
3154         * @param value The location address.
3155         */
3156        public ResearchStudyWebLocationComponent setUrl(String value) { 
3157            if (this.url == null)
3158              this.url = new UriType();
3159            this.url.setValue(value);
3160          return this;
3161        }
3162
3163        protected void listChildren(List<Property> children) {
3164          super.listChildren(children);
3165          children.add(new Property("classifier", "CodeableConcept", "Describes the nature of the location being specified.", 0, 1, classifier));
3166          children.add(new Property("url", "uri", "The location address.", 0, 1, url));
3167        }
3168
3169        @Override
3170        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3171          switch (_hash) {
3172          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "Describes the nature of the location being specified.", 0, 1, classifier);
3173          case 116079: /*url*/  return new Property("url", "uri", "The location address.", 0, 1, url);
3174          default: return super.getNamedProperty(_hash, _name, _checkValid);
3175          }
3176
3177        }
3178
3179      @Override
3180      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3181        switch (hash) {
3182        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : new Base[] {this.classifier}; // CodeableConcept
3183        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3184        default: return super.getProperty(hash, name, checkValid);
3185        }
3186
3187      }
3188
3189      @Override
3190      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3191        switch (hash) {
3192        case -281470431: // classifier
3193          this.classifier = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3194          return value;
3195        case 116079: // url
3196          this.url = TypeConvertor.castToUri(value); // UriType
3197          return value;
3198        default: return super.setProperty(hash, name, value);
3199        }
3200
3201      }
3202
3203      @Override
3204      public Base setProperty(String name, Base value) throws FHIRException {
3205        if (name.equals("classifier")) {
3206          this.classifier = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3207        } else if (name.equals("url")) {
3208          this.url = TypeConvertor.castToUri(value); // UriType
3209        } else
3210          return super.setProperty(name, value);
3211        return value;
3212      }
3213
3214      @Override
3215      public Base makeProperty(int hash, String name) throws FHIRException {
3216        switch (hash) {
3217        case -281470431:  return getClassifier();
3218        case 116079:  return getUrlElement();
3219        default: return super.makeProperty(hash, name);
3220        }
3221
3222      }
3223
3224      @Override
3225      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3226        switch (hash) {
3227        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
3228        case 116079: /*url*/ return new String[] {"uri"};
3229        default: return super.getTypesForProperty(hash, name);
3230        }
3231
3232      }
3233
3234      @Override
3235      public Base addChild(String name) throws FHIRException {
3236        if (name.equals("classifier")) {
3237          this.classifier = new CodeableConcept();
3238          return this.classifier;
3239        }
3240        else if (name.equals("url")) {
3241          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.webLocation.url");
3242        }
3243        else
3244          return super.addChild(name);
3245      }
3246
3247      public ResearchStudyWebLocationComponent copy() {
3248        ResearchStudyWebLocationComponent dst = new ResearchStudyWebLocationComponent();
3249        copyValues(dst);
3250        return dst;
3251      }
3252
3253      public void copyValues(ResearchStudyWebLocationComponent dst) {
3254        super.copyValues(dst);
3255        dst.classifier = classifier == null ? null : classifier.copy();
3256        dst.url = url == null ? null : url.copy();
3257      }
3258
3259      @Override
3260      public boolean equalsDeep(Base other_) {
3261        if (!super.equalsDeep(other_))
3262          return false;
3263        if (!(other_ instanceof ResearchStudyWebLocationComponent))
3264          return false;
3265        ResearchStudyWebLocationComponent o = (ResearchStudyWebLocationComponent) other_;
3266        return compareDeep(classifier, o.classifier, true) && compareDeep(url, o.url, true);
3267      }
3268
3269      @Override
3270      public boolean equalsShallow(Base other_) {
3271        if (!super.equalsShallow(other_))
3272          return false;
3273        if (!(other_ instanceof ResearchStudyWebLocationComponent))
3274          return false;
3275        ResearchStudyWebLocationComponent o = (ResearchStudyWebLocationComponent) other_;
3276        return compareValues(url, o.url, true);
3277      }
3278
3279      public boolean isEmpty() {
3280        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(classifier, url);
3281      }
3282
3283  public String fhirType() {
3284    return "ResearchStudy.webLocation";
3285
3286  }
3287
3288  }
3289
3290    /**
3291     * Canonical identifier for this study resource, represented as a globally unique URI.
3292     */
3293    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=false)
3294    @Description(shortDefinition="Canonical identifier for this study resource", formalDefinition="Canonical identifier for this study resource, represented as a globally unique URI." )
3295    protected UriType url;
3296
3297    /**
3298     * Identifiers assigned to this research study by the sponsor or other systems.
3299     */
3300    @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3301    @Description(shortDefinition="Business Identifier for study", formalDefinition="Identifiers assigned to this research study by the sponsor or other systems." )
3302    protected List<Identifier> identifier;
3303
3304    /**
3305     * Business identifier for the study record.
3306     */
3307    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
3308    @Description(shortDefinition="Business identifier for the study record", formalDefinition="Business identifier for the study record." )
3309    protected StringType version;
3310
3311    /**
3312     * Name for this study (computer friendly).
3313     */
3314    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
3315    @Description(shortDefinition="Name for this study (computer friendly)", formalDefinition="Name for this study (computer friendly)." )
3316    protected StringType name;
3317
3318    /**
3319     * The human readable name of the research study.
3320     */
3321    @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
3322    @Description(shortDefinition="Human readable name of the study", formalDefinition="The human readable name of the research study." )
3323    protected StringType title;
3324
3325    /**
3326     * Additional names for the study.
3327     */
3328    @Child(name = "label", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3329    @Description(shortDefinition="Additional names for the study", formalDefinition="Additional names for the study." )
3330    protected List<ResearchStudyLabelComponent> label;
3331
3332    /**
3333     * The set of steps expected to be performed as part of the execution of the study.
3334     */
3335    @Child(name = "protocol", type = {PlanDefinition.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3336    @Description(shortDefinition="Steps followed in executing study", formalDefinition="The set of steps expected to be performed as part of the execution of the study." )
3337    protected List<Reference> protocol;
3338
3339    /**
3340     * A larger research study of which this particular study is a component or step.
3341     */
3342    @Child(name = "partOf", type = {ResearchStudy.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3343    @Description(shortDefinition="Part of larger study", formalDefinition="A larger research study of which this particular study is a component or step." )
3344    protected List<Reference> partOf;
3345
3346    /**
3347     * Citations, references and other related documents.
3348     */
3349    @Child(name = "relatedArtifact", type = {RelatedArtifact.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3350    @Description(shortDefinition="References and dependencies", formalDefinition="Citations, references and other related documents." )
3351    protected List<RelatedArtifact> relatedArtifact;
3352
3353    /**
3354     * The date (and optionally time) when the ResearchStudy Resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.
3355     */
3356    @Child(name = "date", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=false)
3357    @Description(shortDefinition="Date the resource last changed", formalDefinition="The date (and optionally time) when the ResearchStudy Resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes." )
3358    protected DateTimeType date;
3359
3360    /**
3361     * The publication state of the resource (not of the study).
3362     */
3363    @Child(name = "status", type = {CodeType.class}, order=10, min=1, max=1, modifier=true, summary=true)
3364    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The publication state of the resource (not of the study)." )
3365    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
3366    protected Enumeration<PublicationStatus> status;
3367
3368    /**
3369     * The type of study based upon the intent of the study activities. A classification of the intent of the study.
3370     */
3371    @Child(name = "primaryPurposeType", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=true)
3372    @Description(shortDefinition="treatment | prevention | diagnostic | supportive-care | screening | health-services-research | basic-science | device-feasibility", formalDefinition="The type of study based upon the intent of the study activities. A classification of the intent of the study." )
3373    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-prim-purp-type")
3374    protected CodeableConcept primaryPurposeType;
3375
3376    /**
3377     * The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.
3378     */
3379    @Child(name = "phase", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=true)
3380    @Description(shortDefinition="n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | phase-2-phase-3 | phase-3 | phase-4", formalDefinition="The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation." )
3381    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-phase")
3382    protected CodeableConcept phase;
3383
3384    /**
3385     * Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.
3386     */
3387    @Child(name = "category", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3388    @Description(shortDefinition="Classifications for the study", formalDefinition="Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc." )
3389    protected List<CodeableConcept> category;
3390
3391    /**
3392     * The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.
3393     */
3394    @Child(name = "focus", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3395    @Description(shortDefinition="Drugs, devices, etc. under study", formalDefinition="The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about." )
3396    protected List<ResearchStudyFocusComponent> focus;
3397
3398    /**
3399     * The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion "healthy volunteer", but the target condition code would be a Lupus SNOMED code.
3400     */
3401    @Child(name = "condition", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3402    @Description(shortDefinition="Condition being studied", formalDefinition="The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion \"healthy volunteer\", but the target condition code would be a Lupus SNOMED code." )
3403    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
3404    protected List<CodeableConcept> condition;
3405
3406    /**
3407     * Key terms to aid in searching for or filtering the study.
3408     */
3409    @Child(name = "keyword", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3410    @Description(shortDefinition="Used to search for the study", formalDefinition="Key terms to aid in searching for or filtering the study." )
3411    protected List<CodeableConcept> keyword;
3412
3413    /**
3414     * Indicates a country, state or other region where the study is taking place.
3415     */
3416    @Child(name = "location", type = {CodeableConcept.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3417    @Description(shortDefinition="Geographic region(s) for study", formalDefinition="Indicates a country, state or other region where the study is taking place." )
3418    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
3419    protected List<CodeableConcept> location;
3420
3421    /**
3422     * A brief summary of the study description.
3423     */
3424    @Child(name = "descriptionSummary", type = {MarkdownType.class}, order=18, min=0, max=1, modifier=false, summary=false)
3425    @Description(shortDefinition="A brief summary of the study description", formalDefinition="A brief summary of the study description." )
3426    protected MarkdownType descriptionSummary;
3427
3428    /**
3429     * A full description of how the study is being conducted.  For a description of what the study objectives are see ResearchStudy.objective.description.
3430     */
3431    @Child(name = "description", type = {MarkdownType.class}, order=19, min=0, max=1, modifier=false, summary=false)
3432    @Description(shortDefinition="What this is study doing", formalDefinition="A full description of how the study is being conducted.  For a description of what the study objectives are see ResearchStudy.objective.description." )
3433    protected MarkdownType description;
3434
3435    /**
3436     * Identifies the start date and the expected (or actual, depending on status) end date for the study.
3437     */
3438    @Child(name = "period", type = {Period.class}, order=20, min=0, max=1, modifier=false, summary=true)
3439    @Description(shortDefinition="When the study began and ended", formalDefinition="Identifies the start date and the expected (or actual, depending on status) end date for the study." )
3440    protected Period period;
3441
3442    /**
3443     * Contact details to assist a user in learning more about or engaging with the study.
3444     */
3445    @Child(name = "contact", type = {ContactDetail.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3446    @Description(shortDefinition="Contact details for the study", formalDefinition="Contact details to assist a user in learning more about or engaging with the study." )
3447    protected List<ContactDetail> contact;
3448
3449    /**
3450     * An organization that initiates the investigation and is legally responsible for the study.
3451     */
3452    @Child(name = "sponsor", type = {Organization.class}, order=22, min=0, max=1, modifier=false, summary=true)
3453    @Description(shortDefinition="Organization that initiates and is legally responsible for the study", formalDefinition="An organization that initiates the investigation and is legally responsible for the study." )
3454    protected Reference sponsor;
3455
3456    /**
3457     * A researcher in a study who oversees multiple aspects of the study, such as concept development, protocol writing, protocol submission for IRB approval, participant recruitment, informed consent, data collection, analysis, interpretation and presentation.
3458     */
3459    @Child(name = "principalInvestigator", type = {Practitioner.class, PractitionerRole.class}, order=23, min=0, max=1, modifier=false, summary=true)
3460    @Description(shortDefinition="Researcher who oversees multiple aspects of the study", formalDefinition="A researcher in a study who oversees multiple aspects of the study, such as concept development, protocol writing, protocol submission for IRB approval, participant recruitment, informed consent, data collection, analysis, interpretation and presentation." )
3461    protected Reference principalInvestigator;
3462
3463    /**
3464     * A facility in which study activities are conducted.
3465     */
3466    @Child(name = "site", type = {Location.class, ResearchStudy.class, Organization.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3467    @Description(shortDefinition="Facility where study activities are conducted", formalDefinition="A facility in which study activities are conducted." )
3468    protected List<Reference> site;
3469
3470    /**
3471     * Comments made about the study by the performer, subject or other participants.
3472     */
3473    @Child(name = "note", type = {Annotation.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3474    @Description(shortDefinition="Comments made about the study", formalDefinition="Comments made about the study by the performer, subject or other participants." )
3475    protected List<Annotation> note;
3476
3477    /**
3478     * Classification for the study.
3479     */
3480    @Child(name = "classification", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3481    @Description(shortDefinition="Classification for the study", formalDefinition="Classification for the study." )
3482    protected List<ResearchStudyClassificationComponent> classification;
3483
3484    /**
3485     * Sponsors, collaborators, and other parties.
3486     */
3487    @Child(name = "associatedParty", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3488    @Description(shortDefinition="Sponsors, collaborators, and other parties", formalDefinition="Sponsors, collaborators, and other parties." )
3489    protected List<ResearchStudyAssociatedPartyComponent> associatedParty;
3490
3491    /**
3492     * Current status of the study.
3493     */
3494    @Child(name = "currentState", type = {CodeableConcept.class}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3495    @Description(shortDefinition="active | active-but-not-recruiting | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | enrolling-by-invitation | in-review | not-yet-recruiting | recruiting | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | terminated | withdrawn", formalDefinition="Current status of the study." )
3496    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-status")
3497    protected List<CodeableConcept> currentState;
3498
3499    /**
3500     * Status of study with time for that status.
3501     */
3502    @Child(name = "statusDate", type = {}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3503    @Description(shortDefinition="Status of study with time for that status", formalDefinition="Status of study with time for that status." )
3504    protected List<ResearchStudyStatusDateComponent> statusDate;
3505
3506    /**
3507     * A description and/or code explaining the premature termination of the study.
3508     */
3509    @Child(name = "whyStopped", type = {CodeableConcept.class}, order=30, min=0, max=1, modifier=false, summary=true)
3510    @Description(shortDefinition="accrual-goal-met | closed-due-to-toxicity | closed-due-to-lack-of-study-progress | temporarily-closed-per-study-design", formalDefinition="A description and/or code explaining the premature termination of the study." )
3511    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-reason-stopped")
3512    protected CodeableConcept whyStopped;
3513
3514    /**
3515     * Target or actual group of participants enrolled in study.
3516     */
3517    @Child(name = "recruitment", type = {}, order=31, min=0, max=1, modifier=false, summary=true)
3518    @Description(shortDefinition="Target or actual group of participants enrolled in study", formalDefinition="Target or actual group of participants enrolled in study." )
3519    protected ResearchStudyRecruitmentComponent recruitment;
3520
3521    /**
3522     * Describes an expected sequence of events for one of the participants of a study.  E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up.
3523     */
3524    @Child(name = "comparisonGroup", type = {}, order=32, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3525    @Description(shortDefinition="Defined path through the study for a subject", formalDefinition="Describes an expected sequence of events for one of the participants of a study.  E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up." )
3526    protected List<ResearchStudyComparisonGroupComponent> comparisonGroup;
3527
3528    /**
3529     * A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study.
3530     */
3531    @Child(name = "objective", type = {}, order=33, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3532    @Description(shortDefinition="A goal for the study", formalDefinition="A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study." )
3533    protected List<ResearchStudyObjectiveComponent> objective;
3534
3535    /**
3536     * An outcome or planned variable to measure during the study.
3537     */
3538    @Child(name = "outcomeMeasure", type = {}, order=34, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3539    @Description(shortDefinition="An outcome or planned variable to measure during the study", formalDefinition="An outcome or planned variable to measure during the study." )
3540    protected List<ResearchStudyOutcomeMeasureComponent> outcomeMeasure;
3541
3542    /**
3543     * Link to one or more sets of results generated by the study.  Could also link to a research registry holding the results such as ClinicalTrials.gov.
3544     */
3545    @Child(name = "result", type = {EvidenceReport.class, Citation.class, DiagnosticReport.class}, order=35, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3546    @Description(shortDefinition="Link to results generated during the study", formalDefinition="Link to one or more sets of results generated by the study.  Could also link to a research registry holding the results such as ClinicalTrials.gov." )
3547    protected List<Reference> result;
3548
3549    /**
3550     * A general storage or archive location for the study.  This may contain an assortment of content which is not specified in advance.
3551     */
3552    @Child(name = "webLocation", type = {}, order=36, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3553    @Description(shortDefinition="Archive location for the study", formalDefinition="A general storage or archive location for the study.  This may contain an assortment of content which is not specified in advance." )
3554    protected List<ResearchStudyWebLocationComponent> webLocation;
3555
3556    private static final long serialVersionUID = 1378717503L;
3557
3558  /**
3559   * Constructor
3560   */
3561    public ResearchStudy() {
3562      super();
3563    }
3564
3565  /**
3566   * Constructor
3567   */
3568    public ResearchStudy(PublicationStatus status) {
3569      super();
3570      this.setStatus(status);
3571    }
3572
3573    /**
3574     * @return {@link #url} (Canonical identifier for this study resource, represented as a globally unique URI.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
3575     */
3576    public UriType getUrlElement() { 
3577      if (this.url == null)
3578        if (Configuration.errorOnAutoCreate())
3579          throw new Error("Attempt to auto-create ResearchStudy.url");
3580        else if (Configuration.doAutoCreate())
3581          this.url = new UriType(); // bb
3582      return this.url;
3583    }
3584
3585    public boolean hasUrlElement() { 
3586      return this.url != null && !this.url.isEmpty();
3587    }
3588
3589    public boolean hasUrl() { 
3590      return this.url != null && !this.url.isEmpty();
3591    }
3592
3593    /**
3594     * @param value {@link #url} (Canonical identifier for this study resource, represented as a globally unique URI.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
3595     */
3596    public ResearchStudy setUrlElement(UriType value) { 
3597      this.url = value;
3598      return this;
3599    }
3600
3601    /**
3602     * @return Canonical identifier for this study resource, represented as a globally unique URI.
3603     */
3604    public String getUrl() { 
3605      return this.url == null ? null : this.url.getValue();
3606    }
3607
3608    /**
3609     * @param value Canonical identifier for this study resource, represented as a globally unique URI.
3610     */
3611    public ResearchStudy setUrl(String value) { 
3612      if (Utilities.noString(value))
3613        this.url = null;
3614      else {
3615        if (this.url == null)
3616          this.url = new UriType();
3617        this.url.setValue(value);
3618      }
3619      return this;
3620    }
3621
3622    /**
3623     * @return {@link #identifier} (Identifiers assigned to this research study by the sponsor or other systems.)
3624     */
3625    public List<Identifier> getIdentifier() { 
3626      if (this.identifier == null)
3627        this.identifier = new ArrayList<Identifier>();
3628      return this.identifier;
3629    }
3630
3631    /**
3632     * @return Returns a reference to <code>this</code> for easy method chaining
3633     */
3634    public ResearchStudy setIdentifier(List<Identifier> theIdentifier) { 
3635      this.identifier = theIdentifier;
3636      return this;
3637    }
3638
3639    public boolean hasIdentifier() { 
3640      if (this.identifier == null)
3641        return false;
3642      for (Identifier item : this.identifier)
3643        if (!item.isEmpty())
3644          return true;
3645      return false;
3646    }
3647
3648    public Identifier addIdentifier() { //3
3649      Identifier t = new Identifier();
3650      if (this.identifier == null)
3651        this.identifier = new ArrayList<Identifier>();
3652      this.identifier.add(t);
3653      return t;
3654    }
3655
3656    public ResearchStudy addIdentifier(Identifier t) { //3
3657      if (t == null)
3658        return this;
3659      if (this.identifier == null)
3660        this.identifier = new ArrayList<Identifier>();
3661      this.identifier.add(t);
3662      return this;
3663    }
3664
3665    /**
3666     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
3667     */
3668    public Identifier getIdentifierFirstRep() { 
3669      if (getIdentifier().isEmpty()) {
3670        addIdentifier();
3671      }
3672      return getIdentifier().get(0);
3673    }
3674
3675    /**
3676     * @return {@link #version} (Business identifier for the study record.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
3677     */
3678    public StringType getVersionElement() { 
3679      if (this.version == null)
3680        if (Configuration.errorOnAutoCreate())
3681          throw new Error("Attempt to auto-create ResearchStudy.version");
3682        else if (Configuration.doAutoCreate())
3683          this.version = new StringType(); // bb
3684      return this.version;
3685    }
3686
3687    public boolean hasVersionElement() { 
3688      return this.version != null && !this.version.isEmpty();
3689    }
3690
3691    public boolean hasVersion() { 
3692      return this.version != null && !this.version.isEmpty();
3693    }
3694
3695    /**
3696     * @param value {@link #version} (Business identifier for the study record.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
3697     */
3698    public ResearchStudy setVersionElement(StringType value) { 
3699      this.version = value;
3700      return this;
3701    }
3702
3703    /**
3704     * @return Business identifier for the study record.
3705     */
3706    public String getVersion() { 
3707      return this.version == null ? null : this.version.getValue();
3708    }
3709
3710    /**
3711     * @param value Business identifier for the study record.
3712     */
3713    public ResearchStudy setVersion(String value) { 
3714      if (Utilities.noString(value))
3715        this.version = null;
3716      else {
3717        if (this.version == null)
3718          this.version = new StringType();
3719        this.version.setValue(value);
3720      }
3721      return this;
3722    }
3723
3724    /**
3725     * @return {@link #name} (Name for this study (computer friendly).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3726     */
3727    public StringType getNameElement() { 
3728      if (this.name == null)
3729        if (Configuration.errorOnAutoCreate())
3730          throw new Error("Attempt to auto-create ResearchStudy.name");
3731        else if (Configuration.doAutoCreate())
3732          this.name = new StringType(); // bb
3733      return this.name;
3734    }
3735
3736    public boolean hasNameElement() { 
3737      return this.name != null && !this.name.isEmpty();
3738    }
3739
3740    public boolean hasName() { 
3741      return this.name != null && !this.name.isEmpty();
3742    }
3743
3744    /**
3745     * @param value {@link #name} (Name for this study (computer friendly).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3746     */
3747    public ResearchStudy setNameElement(StringType value) { 
3748      this.name = value;
3749      return this;
3750    }
3751
3752    /**
3753     * @return Name for this study (computer friendly).
3754     */
3755    public String getName() { 
3756      return this.name == null ? null : this.name.getValue();
3757    }
3758
3759    /**
3760     * @param value Name for this study (computer friendly).
3761     */
3762    public ResearchStudy setName(String value) { 
3763      if (Utilities.noString(value))
3764        this.name = null;
3765      else {
3766        if (this.name == null)
3767          this.name = new StringType();
3768        this.name.setValue(value);
3769      }
3770      return this;
3771    }
3772
3773    /**
3774     * @return {@link #title} (The human readable name of the research study.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
3775     */
3776    public StringType getTitleElement() { 
3777      if (this.title == null)
3778        if (Configuration.errorOnAutoCreate())
3779          throw new Error("Attempt to auto-create ResearchStudy.title");
3780        else if (Configuration.doAutoCreate())
3781          this.title = new StringType(); // bb
3782      return this.title;
3783    }
3784
3785    public boolean hasTitleElement() { 
3786      return this.title != null && !this.title.isEmpty();
3787    }
3788
3789    public boolean hasTitle() { 
3790      return this.title != null && !this.title.isEmpty();
3791    }
3792
3793    /**
3794     * @param value {@link #title} (The human readable name of the research study.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
3795     */
3796    public ResearchStudy setTitleElement(StringType value) { 
3797      this.title = value;
3798      return this;
3799    }
3800
3801    /**
3802     * @return The human readable name of the research study.
3803     */
3804    public String getTitle() { 
3805      return this.title == null ? null : this.title.getValue();
3806    }
3807
3808    /**
3809     * @param value The human readable name of the research study.
3810     */
3811    public ResearchStudy setTitle(String value) { 
3812      if (Utilities.noString(value))
3813        this.title = null;
3814      else {
3815        if (this.title == null)
3816          this.title = new StringType();
3817        this.title.setValue(value);
3818      }
3819      return this;
3820    }
3821
3822    /**
3823     * @return {@link #label} (Additional names for the study.)
3824     */
3825    public List<ResearchStudyLabelComponent> getLabel() { 
3826      if (this.label == null)
3827        this.label = new ArrayList<ResearchStudyLabelComponent>();
3828      return this.label;
3829    }
3830
3831    /**
3832     * @return Returns a reference to <code>this</code> for easy method chaining
3833     */
3834    public ResearchStudy setLabel(List<ResearchStudyLabelComponent> theLabel) { 
3835      this.label = theLabel;
3836      return this;
3837    }
3838
3839    public boolean hasLabel() { 
3840      if (this.label == null)
3841        return false;
3842      for (ResearchStudyLabelComponent item : this.label)
3843        if (!item.isEmpty())
3844          return true;
3845      return false;
3846    }
3847
3848    public ResearchStudyLabelComponent addLabel() { //3
3849      ResearchStudyLabelComponent t = new ResearchStudyLabelComponent();
3850      if (this.label == null)
3851        this.label = new ArrayList<ResearchStudyLabelComponent>();
3852      this.label.add(t);
3853      return t;
3854    }
3855
3856    public ResearchStudy addLabel(ResearchStudyLabelComponent t) { //3
3857      if (t == null)
3858        return this;
3859      if (this.label == null)
3860        this.label = new ArrayList<ResearchStudyLabelComponent>();
3861      this.label.add(t);
3862      return this;
3863    }
3864
3865    /**
3866     * @return The first repetition of repeating field {@link #label}, creating it if it does not already exist {3}
3867     */
3868    public ResearchStudyLabelComponent getLabelFirstRep() { 
3869      if (getLabel().isEmpty()) {
3870        addLabel();
3871      }
3872      return getLabel().get(0);
3873    }
3874
3875    /**
3876     * @return {@link #protocol} (The set of steps expected to be performed as part of the execution of the study.)
3877     */
3878    public List<Reference> getProtocol() { 
3879      if (this.protocol == null)
3880        this.protocol = new ArrayList<Reference>();
3881      return this.protocol;
3882    }
3883
3884    /**
3885     * @return Returns a reference to <code>this</code> for easy method chaining
3886     */
3887    public ResearchStudy setProtocol(List<Reference> theProtocol) { 
3888      this.protocol = theProtocol;
3889      return this;
3890    }
3891
3892    public boolean hasProtocol() { 
3893      if (this.protocol == null)
3894        return false;
3895      for (Reference item : this.protocol)
3896        if (!item.isEmpty())
3897          return true;
3898      return false;
3899    }
3900
3901    public Reference addProtocol() { //3
3902      Reference t = new Reference();
3903      if (this.protocol == null)
3904        this.protocol = new ArrayList<Reference>();
3905      this.protocol.add(t);
3906      return t;
3907    }
3908
3909    public ResearchStudy addProtocol(Reference t) { //3
3910      if (t == null)
3911        return this;
3912      if (this.protocol == null)
3913        this.protocol = new ArrayList<Reference>();
3914      this.protocol.add(t);
3915      return this;
3916    }
3917
3918    /**
3919     * @return The first repetition of repeating field {@link #protocol}, creating it if it does not already exist {3}
3920     */
3921    public Reference getProtocolFirstRep() { 
3922      if (getProtocol().isEmpty()) {
3923        addProtocol();
3924      }
3925      return getProtocol().get(0);
3926    }
3927
3928    /**
3929     * @return {@link #partOf} (A larger research study of which this particular study is a component or step.)
3930     */
3931    public List<Reference> getPartOf() { 
3932      if (this.partOf == null)
3933        this.partOf = new ArrayList<Reference>();
3934      return this.partOf;
3935    }
3936
3937    /**
3938     * @return Returns a reference to <code>this</code> for easy method chaining
3939     */
3940    public ResearchStudy setPartOf(List<Reference> thePartOf) { 
3941      this.partOf = thePartOf;
3942      return this;
3943    }
3944
3945    public boolean hasPartOf() { 
3946      if (this.partOf == null)
3947        return false;
3948      for (Reference item : this.partOf)
3949        if (!item.isEmpty())
3950          return true;
3951      return false;
3952    }
3953
3954    public Reference addPartOf() { //3
3955      Reference t = new Reference();
3956      if (this.partOf == null)
3957        this.partOf = new ArrayList<Reference>();
3958      this.partOf.add(t);
3959      return t;
3960    }
3961
3962    public ResearchStudy addPartOf(Reference t) { //3
3963      if (t == null)
3964        return this;
3965      if (this.partOf == null)
3966        this.partOf = new ArrayList<Reference>();
3967      this.partOf.add(t);
3968      return this;
3969    }
3970
3971    /**
3972     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist {3}
3973     */
3974    public Reference getPartOfFirstRep() { 
3975      if (getPartOf().isEmpty()) {
3976        addPartOf();
3977      }
3978      return getPartOf().get(0);
3979    }
3980
3981    /**
3982     * @return {@link #relatedArtifact} (Citations, references and other related documents.)
3983     */
3984    public List<RelatedArtifact> getRelatedArtifact() { 
3985      if (this.relatedArtifact == null)
3986        this.relatedArtifact = new ArrayList<RelatedArtifact>();
3987      return this.relatedArtifact;
3988    }
3989
3990    /**
3991     * @return Returns a reference to <code>this</code> for easy method chaining
3992     */
3993    public ResearchStudy setRelatedArtifact(List<RelatedArtifact> theRelatedArtifact) { 
3994      this.relatedArtifact = theRelatedArtifact;
3995      return this;
3996    }
3997
3998    public boolean hasRelatedArtifact() { 
3999      if (this.relatedArtifact == null)
4000        return false;
4001      for (RelatedArtifact item : this.relatedArtifact)
4002        if (!item.isEmpty())
4003          return true;
4004      return false;
4005    }
4006
4007    public RelatedArtifact addRelatedArtifact() { //3
4008      RelatedArtifact t = new RelatedArtifact();
4009      if (this.relatedArtifact == null)
4010        this.relatedArtifact = new ArrayList<RelatedArtifact>();
4011      this.relatedArtifact.add(t);
4012      return t;
4013    }
4014
4015    public ResearchStudy addRelatedArtifact(RelatedArtifact t) { //3
4016      if (t == null)
4017        return this;
4018      if (this.relatedArtifact == null)
4019        this.relatedArtifact = new ArrayList<RelatedArtifact>();
4020      this.relatedArtifact.add(t);
4021      return this;
4022    }
4023
4024    /**
4025     * @return The first repetition of repeating field {@link #relatedArtifact}, creating it if it does not already exist {3}
4026     */
4027    public RelatedArtifact getRelatedArtifactFirstRep() { 
4028      if (getRelatedArtifact().isEmpty()) {
4029        addRelatedArtifact();
4030      }
4031      return getRelatedArtifact().get(0);
4032    }
4033
4034    /**
4035     * @return {@link #date} (The date (and optionally time) when the ResearchStudy Resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
4036     */
4037    public DateTimeType getDateElement() { 
4038      if (this.date == null)
4039        if (Configuration.errorOnAutoCreate())
4040          throw new Error("Attempt to auto-create ResearchStudy.date");
4041        else if (Configuration.doAutoCreate())
4042          this.date = new DateTimeType(); // bb
4043      return this.date;
4044    }
4045
4046    public boolean hasDateElement() { 
4047      return this.date != null && !this.date.isEmpty();
4048    }
4049
4050    public boolean hasDate() { 
4051      return this.date != null && !this.date.isEmpty();
4052    }
4053
4054    /**
4055     * @param value {@link #date} (The date (and optionally time) when the ResearchStudy Resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
4056     */
4057    public ResearchStudy setDateElement(DateTimeType value) { 
4058      this.date = value;
4059      return this;
4060    }
4061
4062    /**
4063     * @return The date (and optionally time) when the ResearchStudy Resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.
4064     */
4065    public Date getDate() { 
4066      return this.date == null ? null : this.date.getValue();
4067    }
4068
4069    /**
4070     * @param value The date (and optionally time) when the ResearchStudy Resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.
4071     */
4072    public ResearchStudy setDate(Date value) { 
4073      if (value == null)
4074        this.date = null;
4075      else {
4076        if (this.date == null)
4077          this.date = new DateTimeType();
4078        this.date.setValue(value);
4079      }
4080      return this;
4081    }
4082
4083    /**
4084     * @return {@link #status} (The publication state of the resource (not of the study).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
4085     */
4086    public Enumeration<PublicationStatus> getStatusElement() { 
4087      if (this.status == null)
4088        if (Configuration.errorOnAutoCreate())
4089          throw new Error("Attempt to auto-create ResearchStudy.status");
4090        else if (Configuration.doAutoCreate())
4091          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
4092      return this.status;
4093    }
4094
4095    public boolean hasStatusElement() { 
4096      return this.status != null && !this.status.isEmpty();
4097    }
4098
4099    public boolean hasStatus() { 
4100      return this.status != null && !this.status.isEmpty();
4101    }
4102
4103    /**
4104     * @param value {@link #status} (The publication state of the resource (not of the study).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
4105     */
4106    public ResearchStudy setStatusElement(Enumeration<PublicationStatus> value) { 
4107      this.status = value;
4108      return this;
4109    }
4110
4111    /**
4112     * @return The publication state of the resource (not of the study).
4113     */
4114    public PublicationStatus getStatus() { 
4115      return this.status == null ? null : this.status.getValue();
4116    }
4117
4118    /**
4119     * @param value The publication state of the resource (not of the study).
4120     */
4121    public ResearchStudy setStatus(PublicationStatus value) { 
4122        if (this.status == null)
4123          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
4124        this.status.setValue(value);
4125      return this;
4126    }
4127
4128    /**
4129     * @return {@link #primaryPurposeType} (The type of study based upon the intent of the study activities. A classification of the intent of the study.)
4130     */
4131    public CodeableConcept getPrimaryPurposeType() { 
4132      if (this.primaryPurposeType == null)
4133        if (Configuration.errorOnAutoCreate())
4134          throw new Error("Attempt to auto-create ResearchStudy.primaryPurposeType");
4135        else if (Configuration.doAutoCreate())
4136          this.primaryPurposeType = new CodeableConcept(); // cc
4137      return this.primaryPurposeType;
4138    }
4139
4140    public boolean hasPrimaryPurposeType() { 
4141      return this.primaryPurposeType != null && !this.primaryPurposeType.isEmpty();
4142    }
4143
4144    /**
4145     * @param value {@link #primaryPurposeType} (The type of study based upon the intent of the study activities. A classification of the intent of the study.)
4146     */
4147    public ResearchStudy setPrimaryPurposeType(CodeableConcept value) { 
4148      this.primaryPurposeType = value;
4149      return this;
4150    }
4151
4152    /**
4153     * @return {@link #phase} (The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.)
4154     */
4155    public CodeableConcept getPhase() { 
4156      if (this.phase == null)
4157        if (Configuration.errorOnAutoCreate())
4158          throw new Error("Attempt to auto-create ResearchStudy.phase");
4159        else if (Configuration.doAutoCreate())
4160          this.phase = new CodeableConcept(); // cc
4161      return this.phase;
4162    }
4163
4164    public boolean hasPhase() { 
4165      return this.phase != null && !this.phase.isEmpty();
4166    }
4167
4168    /**
4169     * @param value {@link #phase} (The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.)
4170     */
4171    public ResearchStudy setPhase(CodeableConcept value) { 
4172      this.phase = value;
4173      return this;
4174    }
4175
4176    /**
4177     * @return {@link #category} (Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.)
4178     */
4179    public List<CodeableConcept> getCategory() { 
4180      if (this.category == null)
4181        this.category = new ArrayList<CodeableConcept>();
4182      return this.category;
4183    }
4184
4185    /**
4186     * @return Returns a reference to <code>this</code> for easy method chaining
4187     */
4188    public ResearchStudy setCategory(List<CodeableConcept> theCategory) { 
4189      this.category = theCategory;
4190      return this;
4191    }
4192
4193    public boolean hasCategory() { 
4194      if (this.category == null)
4195        return false;
4196      for (CodeableConcept item : this.category)
4197        if (!item.isEmpty())
4198          return true;
4199      return false;
4200    }
4201
4202    public CodeableConcept addCategory() { //3
4203      CodeableConcept t = new CodeableConcept();
4204      if (this.category == null)
4205        this.category = new ArrayList<CodeableConcept>();
4206      this.category.add(t);
4207      return t;
4208    }
4209
4210    public ResearchStudy addCategory(CodeableConcept t) { //3
4211      if (t == null)
4212        return this;
4213      if (this.category == null)
4214        this.category = new ArrayList<CodeableConcept>();
4215      this.category.add(t);
4216      return this;
4217    }
4218
4219    /**
4220     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
4221     */
4222    public CodeableConcept getCategoryFirstRep() { 
4223      if (getCategory().isEmpty()) {
4224        addCategory();
4225      }
4226      return getCategory().get(0);
4227    }
4228
4229    /**
4230     * @return {@link #focus} (The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.)
4231     */
4232    public List<ResearchStudyFocusComponent> getFocus() { 
4233      if (this.focus == null)
4234        this.focus = new ArrayList<ResearchStudyFocusComponent>();
4235      return this.focus;
4236    }
4237
4238    /**
4239     * @return Returns a reference to <code>this</code> for easy method chaining
4240     */
4241    public ResearchStudy setFocus(List<ResearchStudyFocusComponent> theFocus) { 
4242      this.focus = theFocus;
4243      return this;
4244    }
4245
4246    public boolean hasFocus() { 
4247      if (this.focus == null)
4248        return false;
4249      for (ResearchStudyFocusComponent item : this.focus)
4250        if (!item.isEmpty())
4251          return true;
4252      return false;
4253    }
4254
4255    public ResearchStudyFocusComponent addFocus() { //3
4256      ResearchStudyFocusComponent t = new ResearchStudyFocusComponent();
4257      if (this.focus == null)
4258        this.focus = new ArrayList<ResearchStudyFocusComponent>();
4259      this.focus.add(t);
4260      return t;
4261    }
4262
4263    public ResearchStudy addFocus(ResearchStudyFocusComponent t) { //3
4264      if (t == null)
4265        return this;
4266      if (this.focus == null)
4267        this.focus = new ArrayList<ResearchStudyFocusComponent>();
4268      this.focus.add(t);
4269      return this;
4270    }
4271
4272    /**
4273     * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist {3}
4274     */
4275    public ResearchStudyFocusComponent getFocusFirstRep() { 
4276      if (getFocus().isEmpty()) {
4277        addFocus();
4278      }
4279      return getFocus().get(0);
4280    }
4281
4282    /**
4283     * @return {@link #condition} (The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion "healthy volunteer", but the target condition code would be a Lupus SNOMED code.)
4284     */
4285    public List<CodeableConcept> getCondition() { 
4286      if (this.condition == null)
4287        this.condition = new ArrayList<CodeableConcept>();
4288      return this.condition;
4289    }
4290
4291    /**
4292     * @return Returns a reference to <code>this</code> for easy method chaining
4293     */
4294    public ResearchStudy setCondition(List<CodeableConcept> theCondition) { 
4295      this.condition = theCondition;
4296      return this;
4297    }
4298
4299    public boolean hasCondition() { 
4300      if (this.condition == null)
4301        return false;
4302      for (CodeableConcept item : this.condition)
4303        if (!item.isEmpty())
4304          return true;
4305      return false;
4306    }
4307
4308    public CodeableConcept addCondition() { //3
4309      CodeableConcept t = new CodeableConcept();
4310      if (this.condition == null)
4311        this.condition = new ArrayList<CodeableConcept>();
4312      this.condition.add(t);
4313      return t;
4314    }
4315
4316    public ResearchStudy addCondition(CodeableConcept t) { //3
4317      if (t == null)
4318        return this;
4319      if (this.condition == null)
4320        this.condition = new ArrayList<CodeableConcept>();
4321      this.condition.add(t);
4322      return this;
4323    }
4324
4325    /**
4326     * @return The first repetition of repeating field {@link #condition}, creating it if it does not already exist {3}
4327     */
4328    public CodeableConcept getConditionFirstRep() { 
4329      if (getCondition().isEmpty()) {
4330        addCondition();
4331      }
4332      return getCondition().get(0);
4333    }
4334
4335    /**
4336     * @return {@link #keyword} (Key terms to aid in searching for or filtering the study.)
4337     */
4338    public List<CodeableConcept> getKeyword() { 
4339      if (this.keyword == null)
4340        this.keyword = new ArrayList<CodeableConcept>();
4341      return this.keyword;
4342    }
4343
4344    /**
4345     * @return Returns a reference to <code>this</code> for easy method chaining
4346     */
4347    public ResearchStudy setKeyword(List<CodeableConcept> theKeyword) { 
4348      this.keyword = theKeyword;
4349      return this;
4350    }
4351
4352    public boolean hasKeyword() { 
4353      if (this.keyword == null)
4354        return false;
4355      for (CodeableConcept item : this.keyword)
4356        if (!item.isEmpty())
4357          return true;
4358      return false;
4359    }
4360
4361    public CodeableConcept addKeyword() { //3
4362      CodeableConcept t = new CodeableConcept();
4363      if (this.keyword == null)
4364        this.keyword = new ArrayList<CodeableConcept>();
4365      this.keyword.add(t);
4366      return t;
4367    }
4368
4369    public ResearchStudy addKeyword(CodeableConcept t) { //3
4370      if (t == null)
4371        return this;
4372      if (this.keyword == null)
4373        this.keyword = new ArrayList<CodeableConcept>();
4374      this.keyword.add(t);
4375      return this;
4376    }
4377
4378    /**
4379     * @return The first repetition of repeating field {@link #keyword}, creating it if it does not already exist {3}
4380     */
4381    public CodeableConcept getKeywordFirstRep() { 
4382      if (getKeyword().isEmpty()) {
4383        addKeyword();
4384      }
4385      return getKeyword().get(0);
4386    }
4387
4388    /**
4389     * @return {@link #location} (Indicates a country, state or other region where the study is taking place.)
4390     */
4391    public List<CodeableConcept> getLocation() { 
4392      if (this.location == null)
4393        this.location = new ArrayList<CodeableConcept>();
4394      return this.location;
4395    }
4396
4397    /**
4398     * @return Returns a reference to <code>this</code> for easy method chaining
4399     */
4400    public ResearchStudy setLocation(List<CodeableConcept> theLocation) { 
4401      this.location = theLocation;
4402      return this;
4403    }
4404
4405    public boolean hasLocation() { 
4406      if (this.location == null)
4407        return false;
4408      for (CodeableConcept item : this.location)
4409        if (!item.isEmpty())
4410          return true;
4411      return false;
4412    }
4413
4414    public CodeableConcept addLocation() { //3
4415      CodeableConcept t = new CodeableConcept();
4416      if (this.location == null)
4417        this.location = new ArrayList<CodeableConcept>();
4418      this.location.add(t);
4419      return t;
4420    }
4421
4422    public ResearchStudy addLocation(CodeableConcept t) { //3
4423      if (t == null)
4424        return this;
4425      if (this.location == null)
4426        this.location = new ArrayList<CodeableConcept>();
4427      this.location.add(t);
4428      return this;
4429    }
4430
4431    /**
4432     * @return The first repetition of repeating field {@link #location}, creating it if it does not already exist {3}
4433     */
4434    public CodeableConcept getLocationFirstRep() { 
4435      if (getLocation().isEmpty()) {
4436        addLocation();
4437      }
4438      return getLocation().get(0);
4439    }
4440
4441    /**
4442     * @return {@link #descriptionSummary} (A brief summary of the study description.). This is the underlying object with id, value and extensions. The accessor "getDescriptionSummary" gives direct access to the value
4443     */
4444    public MarkdownType getDescriptionSummaryElement() { 
4445      if (this.descriptionSummary == null)
4446        if (Configuration.errorOnAutoCreate())
4447          throw new Error("Attempt to auto-create ResearchStudy.descriptionSummary");
4448        else if (Configuration.doAutoCreate())
4449          this.descriptionSummary = new MarkdownType(); // bb
4450      return this.descriptionSummary;
4451    }
4452
4453    public boolean hasDescriptionSummaryElement() { 
4454      return this.descriptionSummary != null && !this.descriptionSummary.isEmpty();
4455    }
4456
4457    public boolean hasDescriptionSummary() { 
4458      return this.descriptionSummary != null && !this.descriptionSummary.isEmpty();
4459    }
4460
4461    /**
4462     * @param value {@link #descriptionSummary} (A brief summary of the study description.). This is the underlying object with id, value and extensions. The accessor "getDescriptionSummary" gives direct access to the value
4463     */
4464    public ResearchStudy setDescriptionSummaryElement(MarkdownType value) { 
4465      this.descriptionSummary = value;
4466      return this;
4467    }
4468
4469    /**
4470     * @return A brief summary of the study description.
4471     */
4472    public String getDescriptionSummary() { 
4473      return this.descriptionSummary == null ? null : this.descriptionSummary.getValue();
4474    }
4475
4476    /**
4477     * @param value A brief summary of the study description.
4478     */
4479    public ResearchStudy setDescriptionSummary(String value) { 
4480      if (value == null)
4481        this.descriptionSummary = null;
4482      else {
4483        if (this.descriptionSummary == null)
4484          this.descriptionSummary = new MarkdownType();
4485        this.descriptionSummary.setValue(value);
4486      }
4487      return this;
4488    }
4489
4490    /**
4491     * @return {@link #description} (A full description of how the study is being conducted.  For a description of what the study objectives are see ResearchStudy.objective.description.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
4492     */
4493    public MarkdownType getDescriptionElement() { 
4494      if (this.description == null)
4495        if (Configuration.errorOnAutoCreate())
4496          throw new Error("Attempt to auto-create ResearchStudy.description");
4497        else if (Configuration.doAutoCreate())
4498          this.description = new MarkdownType(); // bb
4499      return this.description;
4500    }
4501
4502    public boolean hasDescriptionElement() { 
4503      return this.description != null && !this.description.isEmpty();
4504    }
4505
4506    public boolean hasDescription() { 
4507      return this.description != null && !this.description.isEmpty();
4508    }
4509
4510    /**
4511     * @param value {@link #description} (A full description of how the study is being conducted.  For a description of what the study objectives are see ResearchStudy.objective.description.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
4512     */
4513    public ResearchStudy setDescriptionElement(MarkdownType value) { 
4514      this.description = value;
4515      return this;
4516    }
4517
4518    /**
4519     * @return A full description of how the study is being conducted.  For a description of what the study objectives are see ResearchStudy.objective.description.
4520     */
4521    public String getDescription() { 
4522      return this.description == null ? null : this.description.getValue();
4523    }
4524
4525    /**
4526     * @param value A full description of how the study is being conducted.  For a description of what the study objectives are see ResearchStudy.objective.description.
4527     */
4528    public ResearchStudy setDescription(String value) { 
4529      if (value == null)
4530        this.description = null;
4531      else {
4532        if (this.description == null)
4533          this.description = new MarkdownType();
4534        this.description.setValue(value);
4535      }
4536      return this;
4537    }
4538
4539    /**
4540     * @return {@link #period} (Identifies the start date and the expected (or actual, depending on status) end date for the study.)
4541     */
4542    public Period getPeriod() { 
4543      if (this.period == null)
4544        if (Configuration.errorOnAutoCreate())
4545          throw new Error("Attempt to auto-create ResearchStudy.period");
4546        else if (Configuration.doAutoCreate())
4547          this.period = new Period(); // cc
4548      return this.period;
4549    }
4550
4551    public boolean hasPeriod() { 
4552      return this.period != null && !this.period.isEmpty();
4553    }
4554
4555    /**
4556     * @param value {@link #period} (Identifies the start date and the expected (or actual, depending on status) end date for the study.)
4557     */
4558    public ResearchStudy setPeriod(Period value) { 
4559      this.period = value;
4560      return this;
4561    }
4562
4563    /**
4564     * @return {@link #contact} (Contact details to assist a user in learning more about or engaging with the study.)
4565     */
4566    public List<ContactDetail> getContact() { 
4567      if (this.contact == null)
4568        this.contact = new ArrayList<ContactDetail>();
4569      return this.contact;
4570    }
4571
4572    /**
4573     * @return Returns a reference to <code>this</code> for easy method chaining
4574     */
4575    public ResearchStudy setContact(List<ContactDetail> theContact) { 
4576      this.contact = theContact;
4577      return this;
4578    }
4579
4580    public boolean hasContact() { 
4581      if (this.contact == null)
4582        return false;
4583      for (ContactDetail item : this.contact)
4584        if (!item.isEmpty())
4585          return true;
4586      return false;
4587    }
4588
4589    public ContactDetail addContact() { //3
4590      ContactDetail t = new ContactDetail();
4591      if (this.contact == null)
4592        this.contact = new ArrayList<ContactDetail>();
4593      this.contact.add(t);
4594      return t;
4595    }
4596
4597    public ResearchStudy addContact(ContactDetail t) { //3
4598      if (t == null)
4599        return this;
4600      if (this.contact == null)
4601        this.contact = new ArrayList<ContactDetail>();
4602      this.contact.add(t);
4603      return this;
4604    }
4605
4606    /**
4607     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist {3}
4608     */
4609    public ContactDetail getContactFirstRep() { 
4610      if (getContact().isEmpty()) {
4611        addContact();
4612      }
4613      return getContact().get(0);
4614    }
4615
4616    /**
4617     * @return {@link #sponsor} (An organization that initiates the investigation and is legally responsible for the study.)
4618     */
4619    public Reference getSponsor() { 
4620      if (this.sponsor == null)
4621        if (Configuration.errorOnAutoCreate())
4622          throw new Error("Attempt to auto-create ResearchStudy.sponsor");
4623        else if (Configuration.doAutoCreate())
4624          this.sponsor = new Reference(); // cc
4625      return this.sponsor;
4626    }
4627
4628    public boolean hasSponsor() { 
4629      return this.sponsor != null && !this.sponsor.isEmpty();
4630    }
4631
4632    /**
4633     * @param value {@link #sponsor} (An organization that initiates the investigation and is legally responsible for the study.)
4634     */
4635    public ResearchStudy setSponsor(Reference value) { 
4636      this.sponsor = value;
4637      return this;
4638    }
4639
4640    /**
4641     * @return {@link #principalInvestigator} (A researcher in a study who oversees multiple aspects of the study, such as concept development, protocol writing, protocol submission for IRB approval, participant recruitment, informed consent, data collection, analysis, interpretation and presentation.)
4642     */
4643    public Reference getPrincipalInvestigator() { 
4644      if (this.principalInvestigator == null)
4645        if (Configuration.errorOnAutoCreate())
4646          throw new Error("Attempt to auto-create ResearchStudy.principalInvestigator");
4647        else if (Configuration.doAutoCreate())
4648          this.principalInvestigator = new Reference(); // cc
4649      return this.principalInvestigator;
4650    }
4651
4652    public boolean hasPrincipalInvestigator() { 
4653      return this.principalInvestigator != null && !this.principalInvestigator.isEmpty();
4654    }
4655
4656    /**
4657     * @param value {@link #principalInvestigator} (A researcher in a study who oversees multiple aspects of the study, such as concept development, protocol writing, protocol submission for IRB approval, participant recruitment, informed consent, data collection, analysis, interpretation and presentation.)
4658     */
4659    public ResearchStudy setPrincipalInvestigator(Reference value) { 
4660      this.principalInvestigator = value;
4661      return this;
4662    }
4663
4664    /**
4665     * @return {@link #site} (A facility in which study activities are conducted.)
4666     */
4667    public List<Reference> getSite() { 
4668      if (this.site == null)
4669        this.site = new ArrayList<Reference>();
4670      return this.site;
4671    }
4672
4673    /**
4674     * @return Returns a reference to <code>this</code> for easy method chaining
4675     */
4676    public ResearchStudy setSite(List<Reference> theSite) { 
4677      this.site = theSite;
4678      return this;
4679    }
4680
4681    public boolean hasSite() { 
4682      if (this.site == null)
4683        return false;
4684      for (Reference item : this.site)
4685        if (!item.isEmpty())
4686          return true;
4687      return false;
4688    }
4689
4690    public Reference addSite() { //3
4691      Reference t = new Reference();
4692      if (this.site == null)
4693        this.site = new ArrayList<Reference>();
4694      this.site.add(t);
4695      return t;
4696    }
4697
4698    public ResearchStudy addSite(Reference t) { //3
4699      if (t == null)
4700        return this;
4701      if (this.site == null)
4702        this.site = new ArrayList<Reference>();
4703      this.site.add(t);
4704      return this;
4705    }
4706
4707    /**
4708     * @return The first repetition of repeating field {@link #site}, creating it if it does not already exist {3}
4709     */
4710    public Reference getSiteFirstRep() { 
4711      if (getSite().isEmpty()) {
4712        addSite();
4713      }
4714      return getSite().get(0);
4715    }
4716
4717    /**
4718     * @return {@link #note} (Comments made about the study by the performer, subject or other participants.)
4719     */
4720    public List<Annotation> getNote() { 
4721      if (this.note == null)
4722        this.note = new ArrayList<Annotation>();
4723      return this.note;
4724    }
4725
4726    /**
4727     * @return Returns a reference to <code>this</code> for easy method chaining
4728     */
4729    public ResearchStudy setNote(List<Annotation> theNote) { 
4730      this.note = theNote;
4731      return this;
4732    }
4733
4734    public boolean hasNote() { 
4735      if (this.note == null)
4736        return false;
4737      for (Annotation item : this.note)
4738        if (!item.isEmpty())
4739          return true;
4740      return false;
4741    }
4742
4743    public Annotation addNote() { //3
4744      Annotation t = new Annotation();
4745      if (this.note == null)
4746        this.note = new ArrayList<Annotation>();
4747      this.note.add(t);
4748      return t;
4749    }
4750
4751    public ResearchStudy addNote(Annotation t) { //3
4752      if (t == null)
4753        return this;
4754      if (this.note == null)
4755        this.note = new ArrayList<Annotation>();
4756      this.note.add(t);
4757      return this;
4758    }
4759
4760    /**
4761     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
4762     */
4763    public Annotation getNoteFirstRep() { 
4764      if (getNote().isEmpty()) {
4765        addNote();
4766      }
4767      return getNote().get(0);
4768    }
4769
4770    /**
4771     * @return {@link #classification} (Classification for the study.)
4772     */
4773    public List<ResearchStudyClassificationComponent> getClassification() { 
4774      if (this.classification == null)
4775        this.classification = new ArrayList<ResearchStudyClassificationComponent>();
4776      return this.classification;
4777    }
4778
4779    /**
4780     * @return Returns a reference to <code>this</code> for easy method chaining
4781     */
4782    public ResearchStudy setClassification(List<ResearchStudyClassificationComponent> theClassification) { 
4783      this.classification = theClassification;
4784      return this;
4785    }
4786
4787    public boolean hasClassification() { 
4788      if (this.classification == null)
4789        return false;
4790      for (ResearchStudyClassificationComponent item : this.classification)
4791        if (!item.isEmpty())
4792          return true;
4793      return false;
4794    }
4795
4796    public ResearchStudyClassificationComponent addClassification() { //3
4797      ResearchStudyClassificationComponent t = new ResearchStudyClassificationComponent();
4798      if (this.classification == null)
4799        this.classification = new ArrayList<ResearchStudyClassificationComponent>();
4800      this.classification.add(t);
4801      return t;
4802    }
4803
4804    public ResearchStudy addClassification(ResearchStudyClassificationComponent t) { //3
4805      if (t == null)
4806        return this;
4807      if (this.classification == null)
4808        this.classification = new ArrayList<ResearchStudyClassificationComponent>();
4809      this.classification.add(t);
4810      return this;
4811    }
4812
4813    /**
4814     * @return The first repetition of repeating field {@link #classification}, creating it if it does not already exist {3}
4815     */
4816    public ResearchStudyClassificationComponent getClassificationFirstRep() { 
4817      if (getClassification().isEmpty()) {
4818        addClassification();
4819      }
4820      return getClassification().get(0);
4821    }
4822
4823    /**
4824     * @return {@link #associatedParty} (Sponsors, collaborators, and other parties.)
4825     */
4826    public List<ResearchStudyAssociatedPartyComponent> getAssociatedParty() { 
4827      if (this.associatedParty == null)
4828        this.associatedParty = new ArrayList<ResearchStudyAssociatedPartyComponent>();
4829      return this.associatedParty;
4830    }
4831
4832    /**
4833     * @return Returns a reference to <code>this</code> for easy method chaining
4834     */
4835    public ResearchStudy setAssociatedParty(List<ResearchStudyAssociatedPartyComponent> theAssociatedParty) { 
4836      this.associatedParty = theAssociatedParty;
4837      return this;
4838    }
4839
4840    public boolean hasAssociatedParty() { 
4841      if (this.associatedParty == null)
4842        return false;
4843      for (ResearchStudyAssociatedPartyComponent item : this.associatedParty)
4844        if (!item.isEmpty())
4845          return true;
4846      return false;
4847    }
4848
4849    public ResearchStudyAssociatedPartyComponent addAssociatedParty() { //3
4850      ResearchStudyAssociatedPartyComponent t = new ResearchStudyAssociatedPartyComponent();
4851      if (this.associatedParty == null)
4852        this.associatedParty = new ArrayList<ResearchStudyAssociatedPartyComponent>();
4853      this.associatedParty.add(t);
4854      return t;
4855    }
4856
4857    public ResearchStudy addAssociatedParty(ResearchStudyAssociatedPartyComponent t) { //3
4858      if (t == null)
4859        return this;
4860      if (this.associatedParty == null)
4861        this.associatedParty = new ArrayList<ResearchStudyAssociatedPartyComponent>();
4862      this.associatedParty.add(t);
4863      return this;
4864    }
4865
4866    /**
4867     * @return The first repetition of repeating field {@link #associatedParty}, creating it if it does not already exist {3}
4868     */
4869    public ResearchStudyAssociatedPartyComponent getAssociatedPartyFirstRep() { 
4870      if (getAssociatedParty().isEmpty()) {
4871        addAssociatedParty();
4872      }
4873      return getAssociatedParty().get(0);
4874    }
4875
4876    /**
4877     * @return {@link #currentState} (Current status of the study.)
4878     */
4879    public List<CodeableConcept> getCurrentState() { 
4880      if (this.currentState == null)
4881        this.currentState = new ArrayList<CodeableConcept>();
4882      return this.currentState;
4883    }
4884
4885    /**
4886     * @return Returns a reference to <code>this</code> for easy method chaining
4887     */
4888    public ResearchStudy setCurrentState(List<CodeableConcept> theCurrentState) { 
4889      this.currentState = theCurrentState;
4890      return this;
4891    }
4892
4893    public boolean hasCurrentState() { 
4894      if (this.currentState == null)
4895        return false;
4896      for (CodeableConcept item : this.currentState)
4897        if (!item.isEmpty())
4898          return true;
4899      return false;
4900    }
4901
4902    public CodeableConcept addCurrentState() { //3
4903      CodeableConcept t = new CodeableConcept();
4904      if (this.currentState == null)
4905        this.currentState = new ArrayList<CodeableConcept>();
4906      this.currentState.add(t);
4907      return t;
4908    }
4909
4910    public ResearchStudy addCurrentState(CodeableConcept t) { //3
4911      if (t == null)
4912        return this;
4913      if (this.currentState == null)
4914        this.currentState = new ArrayList<CodeableConcept>();
4915      this.currentState.add(t);
4916      return this;
4917    }
4918
4919    /**
4920     * @return The first repetition of repeating field {@link #currentState}, creating it if it does not already exist {3}
4921     */
4922    public CodeableConcept getCurrentStateFirstRep() { 
4923      if (getCurrentState().isEmpty()) {
4924        addCurrentState();
4925      }
4926      return getCurrentState().get(0);
4927    }
4928
4929    /**
4930     * @return {@link #statusDate} (Status of study with time for that status.)
4931     */
4932    public List<ResearchStudyStatusDateComponent> getStatusDate() { 
4933      if (this.statusDate == null)
4934        this.statusDate = new ArrayList<ResearchStudyStatusDateComponent>();
4935      return this.statusDate;
4936    }
4937
4938    /**
4939     * @return Returns a reference to <code>this</code> for easy method chaining
4940     */
4941    public ResearchStudy setStatusDate(List<ResearchStudyStatusDateComponent> theStatusDate) { 
4942      this.statusDate = theStatusDate;
4943      return this;
4944    }
4945
4946    public boolean hasStatusDate() { 
4947      if (this.statusDate == null)
4948        return false;
4949      for (ResearchStudyStatusDateComponent item : this.statusDate)
4950        if (!item.isEmpty())
4951          return true;
4952      return false;
4953    }
4954
4955    public ResearchStudyStatusDateComponent addStatusDate() { //3
4956      ResearchStudyStatusDateComponent t = new ResearchStudyStatusDateComponent();
4957      if (this.statusDate == null)
4958        this.statusDate = new ArrayList<ResearchStudyStatusDateComponent>();
4959      this.statusDate.add(t);
4960      return t;
4961    }
4962
4963    public ResearchStudy addStatusDate(ResearchStudyStatusDateComponent t) { //3
4964      if (t == null)
4965        return this;
4966      if (this.statusDate == null)
4967        this.statusDate = new ArrayList<ResearchStudyStatusDateComponent>();
4968      this.statusDate.add(t);
4969      return this;
4970    }
4971
4972    /**
4973     * @return The first repetition of repeating field {@link #statusDate}, creating it if it does not already exist {3}
4974     */
4975    public ResearchStudyStatusDateComponent getStatusDateFirstRep() { 
4976      if (getStatusDate().isEmpty()) {
4977        addStatusDate();
4978      }
4979      return getStatusDate().get(0);
4980    }
4981
4982    /**
4983     * @return {@link #whyStopped} (A description and/or code explaining the premature termination of the study.)
4984     */
4985    public CodeableConcept getWhyStopped() { 
4986      if (this.whyStopped == null)
4987        if (Configuration.errorOnAutoCreate())
4988          throw new Error("Attempt to auto-create ResearchStudy.whyStopped");
4989        else if (Configuration.doAutoCreate())
4990          this.whyStopped = new CodeableConcept(); // cc
4991      return this.whyStopped;
4992    }
4993
4994    public boolean hasWhyStopped() { 
4995      return this.whyStopped != null && !this.whyStopped.isEmpty();
4996    }
4997
4998    /**
4999     * @param value {@link #whyStopped} (A description and/or code explaining the premature termination of the study.)
5000     */
5001    public ResearchStudy setWhyStopped(CodeableConcept value) { 
5002      this.whyStopped = value;
5003      return this;
5004    }
5005
5006    /**
5007     * @return {@link #recruitment} (Target or actual group of participants enrolled in study.)
5008     */
5009    public ResearchStudyRecruitmentComponent getRecruitment() { 
5010      if (this.recruitment == null)
5011        if (Configuration.errorOnAutoCreate())
5012          throw new Error("Attempt to auto-create ResearchStudy.recruitment");
5013        else if (Configuration.doAutoCreate())
5014          this.recruitment = new ResearchStudyRecruitmentComponent(); // cc
5015      return this.recruitment;
5016    }
5017
5018    public boolean hasRecruitment() { 
5019      return this.recruitment != null && !this.recruitment.isEmpty();
5020    }
5021
5022    /**
5023     * @param value {@link #recruitment} (Target or actual group of participants enrolled in study.)
5024     */
5025    public ResearchStudy setRecruitment(ResearchStudyRecruitmentComponent value) { 
5026      this.recruitment = value;
5027      return this;
5028    }
5029
5030    /**
5031     * @return {@link #comparisonGroup} (Describes an expected sequence of events for one of the participants of a study.  E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up.)
5032     */
5033    public List<ResearchStudyComparisonGroupComponent> getComparisonGroup() { 
5034      if (this.comparisonGroup == null)
5035        this.comparisonGroup = new ArrayList<ResearchStudyComparisonGroupComponent>();
5036      return this.comparisonGroup;
5037    }
5038
5039    /**
5040     * @return Returns a reference to <code>this</code> for easy method chaining
5041     */
5042    public ResearchStudy setComparisonGroup(List<ResearchStudyComparisonGroupComponent> theComparisonGroup) { 
5043      this.comparisonGroup = theComparisonGroup;
5044      return this;
5045    }
5046
5047    public boolean hasComparisonGroup() { 
5048      if (this.comparisonGroup == null)
5049        return false;
5050      for (ResearchStudyComparisonGroupComponent item : this.comparisonGroup)
5051        if (!item.isEmpty())
5052          return true;
5053      return false;
5054    }
5055
5056    public ResearchStudyComparisonGroupComponent addComparisonGroup() { //3
5057      ResearchStudyComparisonGroupComponent t = new ResearchStudyComparisonGroupComponent();
5058      if (this.comparisonGroup == null)
5059        this.comparisonGroup = new ArrayList<ResearchStudyComparisonGroupComponent>();
5060      this.comparisonGroup.add(t);
5061      return t;
5062    }
5063
5064    public ResearchStudy addComparisonGroup(ResearchStudyComparisonGroupComponent t) { //3
5065      if (t == null)
5066        return this;
5067      if (this.comparisonGroup == null)
5068        this.comparisonGroup = new ArrayList<ResearchStudyComparisonGroupComponent>();
5069      this.comparisonGroup.add(t);
5070      return this;
5071    }
5072
5073    /**
5074     * @return The first repetition of repeating field {@link #comparisonGroup}, creating it if it does not already exist {3}
5075     */
5076    public ResearchStudyComparisonGroupComponent getComparisonGroupFirstRep() { 
5077      if (getComparisonGroup().isEmpty()) {
5078        addComparisonGroup();
5079      }
5080      return getComparisonGroup().get(0);
5081    }
5082
5083    /**
5084     * @return {@link #objective} (A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study.)
5085     */
5086    public List<ResearchStudyObjectiveComponent> getObjective() { 
5087      if (this.objective == null)
5088        this.objective = new ArrayList<ResearchStudyObjectiveComponent>();
5089      return this.objective;
5090    }
5091
5092    /**
5093     * @return Returns a reference to <code>this</code> for easy method chaining
5094     */
5095    public ResearchStudy setObjective(List<ResearchStudyObjectiveComponent> theObjective) { 
5096      this.objective = theObjective;
5097      return this;
5098    }
5099
5100    public boolean hasObjective() { 
5101      if (this.objective == null)
5102        return false;
5103      for (ResearchStudyObjectiveComponent item : this.objective)
5104        if (!item.isEmpty())
5105          return true;
5106      return false;
5107    }
5108
5109    public ResearchStudyObjectiveComponent addObjective() { //3
5110      ResearchStudyObjectiveComponent t = new ResearchStudyObjectiveComponent();
5111      if (this.objective == null)
5112        this.objective = new ArrayList<ResearchStudyObjectiveComponent>();
5113      this.objective.add(t);
5114      return t;
5115    }
5116
5117    public ResearchStudy addObjective(ResearchStudyObjectiveComponent t) { //3
5118      if (t == null)
5119        return this;
5120      if (this.objective == null)
5121        this.objective = new ArrayList<ResearchStudyObjectiveComponent>();
5122      this.objective.add(t);
5123      return this;
5124    }
5125
5126    /**
5127     * @return The first repetition of repeating field {@link #objective}, creating it if it does not already exist {3}
5128     */
5129    public ResearchStudyObjectiveComponent getObjectiveFirstRep() { 
5130      if (getObjective().isEmpty()) {
5131        addObjective();
5132      }
5133      return getObjective().get(0);
5134    }
5135
5136    /**
5137     * @return {@link #outcomeMeasure} (An outcome or planned variable to measure during the study.)
5138     */
5139    public List<ResearchStudyOutcomeMeasureComponent> getOutcomeMeasure() { 
5140      if (this.outcomeMeasure == null)
5141        this.outcomeMeasure = new ArrayList<ResearchStudyOutcomeMeasureComponent>();
5142      return this.outcomeMeasure;
5143    }
5144
5145    /**
5146     * @return Returns a reference to <code>this</code> for easy method chaining
5147     */
5148    public ResearchStudy setOutcomeMeasure(List<ResearchStudyOutcomeMeasureComponent> theOutcomeMeasure) { 
5149      this.outcomeMeasure = theOutcomeMeasure;
5150      return this;
5151    }
5152
5153    public boolean hasOutcomeMeasure() { 
5154      if (this.outcomeMeasure == null)
5155        return false;
5156      for (ResearchStudyOutcomeMeasureComponent item : this.outcomeMeasure)
5157        if (!item.isEmpty())
5158          return true;
5159      return false;
5160    }
5161
5162    public ResearchStudyOutcomeMeasureComponent addOutcomeMeasure() { //3
5163      ResearchStudyOutcomeMeasureComponent t = new ResearchStudyOutcomeMeasureComponent();
5164      if (this.outcomeMeasure == null)
5165        this.outcomeMeasure = new ArrayList<ResearchStudyOutcomeMeasureComponent>();
5166      this.outcomeMeasure.add(t);
5167      return t;
5168    }
5169
5170    public ResearchStudy addOutcomeMeasure(ResearchStudyOutcomeMeasureComponent t) { //3
5171      if (t == null)
5172        return this;
5173      if (this.outcomeMeasure == null)
5174        this.outcomeMeasure = new ArrayList<ResearchStudyOutcomeMeasureComponent>();
5175      this.outcomeMeasure.add(t);
5176      return this;
5177    }
5178
5179    /**
5180     * @return The first repetition of repeating field {@link #outcomeMeasure}, creating it if it does not already exist {3}
5181     */
5182    public ResearchStudyOutcomeMeasureComponent getOutcomeMeasureFirstRep() { 
5183      if (getOutcomeMeasure().isEmpty()) {
5184        addOutcomeMeasure();
5185      }
5186      return getOutcomeMeasure().get(0);
5187    }
5188
5189    /**
5190     * @return {@link #result} (Link to one or more sets of results generated by the study.  Could also link to a research registry holding the results such as ClinicalTrials.gov.)
5191     */
5192    public List<Reference> getResult() { 
5193      if (this.result == null)
5194        this.result = new ArrayList<Reference>();
5195      return this.result;
5196    }
5197
5198    /**
5199     * @return Returns a reference to <code>this</code> for easy method chaining
5200     */
5201    public ResearchStudy setResult(List<Reference> theResult) { 
5202      this.result = theResult;
5203      return this;
5204    }
5205
5206    public boolean hasResult() { 
5207      if (this.result == null)
5208        return false;
5209      for (Reference item : this.result)
5210        if (!item.isEmpty())
5211          return true;
5212      return false;
5213    }
5214
5215    public Reference addResult() { //3
5216      Reference t = new Reference();
5217      if (this.result == null)
5218        this.result = new ArrayList<Reference>();
5219      this.result.add(t);
5220      return t;
5221    }
5222
5223    public ResearchStudy addResult(Reference t) { //3
5224      if (t == null)
5225        return this;
5226      if (this.result == null)
5227        this.result = new ArrayList<Reference>();
5228      this.result.add(t);
5229      return this;
5230    }
5231
5232    /**
5233     * @return The first repetition of repeating field {@link #result}, creating it if it does not already exist {3}
5234     */
5235    public Reference getResultFirstRep() { 
5236      if (getResult().isEmpty()) {
5237        addResult();
5238      }
5239      return getResult().get(0);
5240    }
5241
5242    /**
5243     * @return {@link #webLocation} (A general storage or archive location for the study.  This may contain an assortment of content which is not specified in advance.)
5244     */
5245    public List<ResearchStudyWebLocationComponent> getWebLocation() { 
5246      if (this.webLocation == null)
5247        this.webLocation = new ArrayList<ResearchStudyWebLocationComponent>();
5248      return this.webLocation;
5249    }
5250
5251    /**
5252     * @return Returns a reference to <code>this</code> for easy method chaining
5253     */
5254    public ResearchStudy setWebLocation(List<ResearchStudyWebLocationComponent> theWebLocation) { 
5255      this.webLocation = theWebLocation;
5256      return this;
5257    }
5258
5259    public boolean hasWebLocation() { 
5260      if (this.webLocation == null)
5261        return false;
5262      for (ResearchStudyWebLocationComponent item : this.webLocation)
5263        if (!item.isEmpty())
5264          return true;
5265      return false;
5266    }
5267
5268    public ResearchStudyWebLocationComponent addWebLocation() { //3
5269      ResearchStudyWebLocationComponent t = new ResearchStudyWebLocationComponent();
5270      if (this.webLocation == null)
5271        this.webLocation = new ArrayList<ResearchStudyWebLocationComponent>();
5272      this.webLocation.add(t);
5273      return t;
5274    }
5275
5276    public ResearchStudy addWebLocation(ResearchStudyWebLocationComponent t) { //3
5277      if (t == null)
5278        return this;
5279      if (this.webLocation == null)
5280        this.webLocation = new ArrayList<ResearchStudyWebLocationComponent>();
5281      this.webLocation.add(t);
5282      return this;
5283    }
5284
5285    /**
5286     * @return The first repetition of repeating field {@link #webLocation}, creating it if it does not already exist {3}
5287     */
5288    public ResearchStudyWebLocationComponent getWebLocationFirstRep() { 
5289      if (getWebLocation().isEmpty()) {
5290        addWebLocation();
5291      }
5292      return getWebLocation().get(0);
5293    }
5294
5295      protected void listChildren(List<Property> children) {
5296        super.listChildren(children);
5297        children.add(new Property("url", "uri", "Canonical identifier for this study resource, represented as a globally unique URI.", 0, 1, url));
5298        children.add(new Property("identifier", "Identifier", "Identifiers assigned to this research study by the sponsor or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier));
5299        children.add(new Property("version", "string", "Business identifier for the study record.", 0, 1, version));
5300        children.add(new Property("name", "string", "Name for this study (computer friendly).", 0, 1, name));
5301        children.add(new Property("title", "string", "The human readable name of the research study.", 0, 1, title));
5302        children.add(new Property("label", "", "Additional names for the study.", 0, java.lang.Integer.MAX_VALUE, label));
5303        children.add(new Property("protocol", "Reference(PlanDefinition)", "The set of steps expected to be performed as part of the execution of the study.", 0, java.lang.Integer.MAX_VALUE, protocol));
5304        children.add(new Property("partOf", "Reference(ResearchStudy)", "A larger research study of which this particular study is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf));
5305        children.add(new Property("relatedArtifact", "RelatedArtifact", "Citations, references and other related documents.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact));
5306        children.add(new Property("date", "dateTime", "The date (and optionally time) when the ResearchStudy Resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.", 0, 1, date));
5307        children.add(new Property("status", "code", "The publication state of the resource (not of the study).", 0, 1, status));
5308        children.add(new Property("primaryPurposeType", "CodeableConcept", "The type of study based upon the intent of the study activities. A classification of the intent of the study.", 0, 1, primaryPurposeType));
5309        children.add(new Property("phase", "CodeableConcept", "The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.", 0, 1, phase));
5310        children.add(new Property("category", "CodeableConcept", "Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.", 0, java.lang.Integer.MAX_VALUE, category));
5311        children.add(new Property("focus", "", "The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.", 0, java.lang.Integer.MAX_VALUE, focus));
5312        children.add(new Property("condition", "CodeableConcept", "The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion \"healthy volunteer\", but the target condition code would be a Lupus SNOMED code.", 0, java.lang.Integer.MAX_VALUE, condition));
5313        children.add(new Property("keyword", "CodeableConcept", "Key terms to aid in searching for or filtering the study.", 0, java.lang.Integer.MAX_VALUE, keyword));
5314        children.add(new Property("location", "CodeableConcept", "Indicates a country, state or other region where the study is taking place.", 0, java.lang.Integer.MAX_VALUE, location));
5315        children.add(new Property("descriptionSummary", "markdown", "A brief summary of the study description.", 0, 1, descriptionSummary));
5316        children.add(new Property("description", "markdown", "A full description of how the study is being conducted.  For a description of what the study objectives are see ResearchStudy.objective.description.", 0, 1, description));
5317        children.add(new Property("period", "Period", "Identifies the start date and the expected (or actual, depending on status) end date for the study.", 0, 1, period));
5318        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in learning more about or engaging with the study.", 0, java.lang.Integer.MAX_VALUE, contact));
5319        children.add(new Property("sponsor", "Reference(Organization)", "An organization that initiates the investigation and is legally responsible for the study.", 0, 1, sponsor));
5320        children.add(new Property("principalInvestigator", "Reference(Practitioner|PractitionerRole)", "A researcher in a study who oversees multiple aspects of the study, such as concept development, protocol writing, protocol submission for IRB approval, participant recruitment, informed consent, data collection, analysis, interpretation and presentation.", 0, 1, principalInvestigator));
5321        children.add(new Property("site", "Reference(Location|ResearchStudy|Organization)", "A facility in which study activities are conducted.", 0, java.lang.Integer.MAX_VALUE, site));
5322        children.add(new Property("note", "Annotation", "Comments made about the study by the performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note));
5323        children.add(new Property("classification", "", "Classification for the study.", 0, java.lang.Integer.MAX_VALUE, classification));
5324        children.add(new Property("associatedParty", "", "Sponsors, collaborators, and other parties.", 0, java.lang.Integer.MAX_VALUE, associatedParty));
5325        children.add(new Property("currentState", "CodeableConcept", "Current status of the study.", 0, java.lang.Integer.MAX_VALUE, currentState));
5326        children.add(new Property("statusDate", "", "Status of study with time for that status.", 0, java.lang.Integer.MAX_VALUE, statusDate));
5327        children.add(new Property("whyStopped", "CodeableConcept", "A description and/or code explaining the premature termination of the study.", 0, 1, whyStopped));
5328        children.add(new Property("recruitment", "", "Target or actual group of participants enrolled in study.", 0, 1, recruitment));
5329        children.add(new Property("comparisonGroup", "", "Describes an expected sequence of events for one of the participants of a study.  E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up.", 0, java.lang.Integer.MAX_VALUE, comparisonGroup));
5330        children.add(new Property("objective", "", "A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study.", 0, java.lang.Integer.MAX_VALUE, objective));
5331        children.add(new Property("outcomeMeasure", "", "An outcome or planned variable to measure during the study.", 0, java.lang.Integer.MAX_VALUE, outcomeMeasure));
5332        children.add(new Property("result", "Reference(EvidenceReport|Citation|DiagnosticReport)", "Link to one or more sets of results generated by the study.  Could also link to a research registry holding the results such as ClinicalTrials.gov.", 0, java.lang.Integer.MAX_VALUE, result));
5333        children.add(new Property("webLocation", "", "A general storage or archive location for the study.  This may contain an assortment of content which is not specified in advance.", 0, java.lang.Integer.MAX_VALUE, webLocation));
5334      }
5335
5336      @Override
5337      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5338        switch (_hash) {
5339        case 116079: /*url*/  return new Property("url", "uri", "Canonical identifier for this study resource, represented as a globally unique URI.", 0, 1, url);
5340        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers assigned to this research study by the sponsor or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier);
5341        case 351608024: /*version*/  return new Property("version", "string", "Business identifier for the study record.", 0, 1, version);
5342        case 3373707: /*name*/  return new Property("name", "string", "Name for this study (computer friendly).", 0, 1, name);
5343        case 110371416: /*title*/  return new Property("title", "string", "The human readable name of the research study.", 0, 1, title);
5344        case 102727412: /*label*/  return new Property("label", "", "Additional names for the study.", 0, java.lang.Integer.MAX_VALUE, label);
5345        case -989163880: /*protocol*/  return new Property("protocol", "Reference(PlanDefinition)", "The set of steps expected to be performed as part of the execution of the study.", 0, java.lang.Integer.MAX_VALUE, protocol);
5346        case -995410646: /*partOf*/  return new Property("partOf", "Reference(ResearchStudy)", "A larger research study of which this particular study is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf);
5347        case 666807069: /*relatedArtifact*/  return new Property("relatedArtifact", "RelatedArtifact", "Citations, references and other related documents.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact);
5348        case 3076014: /*date*/  return new Property("date", "dateTime", "The date (and optionally time) when the ResearchStudy Resource was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.", 0, 1, date);
5349        case -892481550: /*status*/  return new Property("status", "code", "The publication state of the resource (not of the study).", 0, 1, status);
5350        case -2132842986: /*primaryPurposeType*/  return new Property("primaryPurposeType", "CodeableConcept", "The type of study based upon the intent of the study activities. A classification of the intent of the study.", 0, 1, primaryPurposeType);
5351        case 106629499: /*phase*/  return new Property("phase", "CodeableConcept", "The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.", 0, 1, phase);
5352        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.", 0, java.lang.Integer.MAX_VALUE, category);
5353        case 97604824: /*focus*/  return new Property("focus", "", "The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.", 0, java.lang.Integer.MAX_VALUE, focus);
5354        case -861311717: /*condition*/  return new Property("condition", "CodeableConcept", "The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion \"healthy volunteer\", but the target condition code would be a Lupus SNOMED code.", 0, java.lang.Integer.MAX_VALUE, condition);
5355        case -814408215: /*keyword*/  return new Property("keyword", "CodeableConcept", "Key terms to aid in searching for or filtering the study.", 0, java.lang.Integer.MAX_VALUE, keyword);
5356        case 1901043637: /*location*/  return new Property("location", "CodeableConcept", "Indicates a country, state or other region where the study is taking place.", 0, java.lang.Integer.MAX_VALUE, location);
5357        case 21530634: /*descriptionSummary*/  return new Property("descriptionSummary", "markdown", "A brief summary of the study description.", 0, 1, descriptionSummary);
5358        case -1724546052: /*description*/  return new Property("description", "markdown", "A full description of how the study is being conducted.  For a description of what the study objectives are see ResearchStudy.objective.description.", 0, 1, description);
5359        case -991726143: /*period*/  return new Property("period", "Period", "Identifies the start date and the expected (or actual, depending on status) end date for the study.", 0, 1, period);
5360        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in learning more about or engaging with the study.", 0, java.lang.Integer.MAX_VALUE, contact);
5361        case -1998892262: /*sponsor*/  return new Property("sponsor", "Reference(Organization)", "An organization that initiates the investigation and is legally responsible for the study.", 0, 1, sponsor);
5362        case 1437117175: /*principalInvestigator*/  return new Property("principalInvestigator", "Reference(Practitioner|PractitionerRole)", "A researcher in a study who oversees multiple aspects of the study, such as concept development, protocol writing, protocol submission for IRB approval, participant recruitment, informed consent, data collection, analysis, interpretation and presentation.", 0, 1, principalInvestigator);
5363        case 3530567: /*site*/  return new Property("site", "Reference(Location|ResearchStudy|Organization)", "A facility in which study activities are conducted.", 0, java.lang.Integer.MAX_VALUE, site);
5364        case 3387378: /*note*/  return new Property("note", "Annotation", "Comments made about the study by the performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note);
5365        case 382350310: /*classification*/  return new Property("classification", "", "Classification for the study.", 0, java.lang.Integer.MAX_VALUE, classification);
5366        case -1841460864: /*associatedParty*/  return new Property("associatedParty", "", "Sponsors, collaborators, and other parties.", 0, java.lang.Integer.MAX_VALUE, associatedParty);
5367        case 1457822360: /*currentState*/  return new Property("currentState", "CodeableConcept", "Current status of the study.", 0, java.lang.Integer.MAX_VALUE, currentState);
5368        case 247524032: /*statusDate*/  return new Property("statusDate", "", "Status of study with time for that status.", 0, java.lang.Integer.MAX_VALUE, statusDate);
5369        case -699986715: /*whyStopped*/  return new Property("whyStopped", "CodeableConcept", "A description and/or code explaining the premature termination of the study.", 0, 1, whyStopped);
5370        case 780783004: /*recruitment*/  return new Property("recruitment", "", "Target or actual group of participants enrolled in study.", 0, 1, recruitment);
5371        case -138266634: /*comparisonGroup*/  return new Property("comparisonGroup", "", "Describes an expected sequence of events for one of the participants of a study.  E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up.", 0, java.lang.Integer.MAX_VALUE, comparisonGroup);
5372        case -1489585863: /*objective*/  return new Property("objective", "", "A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study.", 0, java.lang.Integer.MAX_VALUE, objective);
5373        case -1510689364: /*outcomeMeasure*/  return new Property("outcomeMeasure", "", "An outcome or planned variable to measure during the study.", 0, java.lang.Integer.MAX_VALUE, outcomeMeasure);
5374        case -934426595: /*result*/  return new Property("result", "Reference(EvidenceReport|Citation|DiagnosticReport)", "Link to one or more sets of results generated by the study.  Could also link to a research registry holding the results such as ClinicalTrials.gov.", 0, java.lang.Integer.MAX_VALUE, result);
5375        case -828032215: /*webLocation*/  return new Property("webLocation", "", "A general storage or archive location for the study.  This may contain an assortment of content which is not specified in advance.", 0, java.lang.Integer.MAX_VALUE, webLocation);
5376        default: return super.getNamedProperty(_hash, _name, _checkValid);
5377        }
5378
5379      }
5380
5381      @Override
5382      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5383        switch (hash) {
5384        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
5385        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
5386        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
5387        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
5388        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
5389        case 102727412: /*label*/ return this.label == null ? new Base[0] : this.label.toArray(new Base[this.label.size()]); // ResearchStudyLabelComponent
5390        case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : this.protocol.toArray(new Base[this.protocol.size()]); // Reference
5391        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
5392        case 666807069: /*relatedArtifact*/ return this.relatedArtifact == null ? new Base[0] : this.relatedArtifact.toArray(new Base[this.relatedArtifact.size()]); // RelatedArtifact
5393        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
5394        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
5395        case -2132842986: /*primaryPurposeType*/ return this.primaryPurposeType == null ? new Base[0] : new Base[] {this.primaryPurposeType}; // CodeableConcept
5396        case 106629499: /*phase*/ return this.phase == null ? new Base[0] : new Base[] {this.phase}; // CodeableConcept
5397        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
5398        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // ResearchStudyFocusComponent
5399        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // CodeableConcept
5400        case -814408215: /*keyword*/ return this.keyword == null ? new Base[0] : this.keyword.toArray(new Base[this.keyword.size()]); // CodeableConcept
5401        case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // CodeableConcept
5402        case 21530634: /*descriptionSummary*/ return this.descriptionSummary == null ? new Base[0] : new Base[] {this.descriptionSummary}; // MarkdownType
5403        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
5404        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
5405        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
5406        case -1998892262: /*sponsor*/ return this.sponsor == null ? new Base[0] : new Base[] {this.sponsor}; // Reference
5407        case 1437117175: /*principalInvestigator*/ return this.principalInvestigator == null ? new Base[0] : new Base[] {this.principalInvestigator}; // Reference
5408        case 3530567: /*site*/ return this.site == null ? new Base[0] : this.site.toArray(new Base[this.site.size()]); // Reference
5409        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
5410        case 382350310: /*classification*/ return this.classification == null ? new Base[0] : this.classification.toArray(new Base[this.classification.size()]); // ResearchStudyClassificationComponent
5411        case -1841460864: /*associatedParty*/ return this.associatedParty == null ? new Base[0] : this.associatedParty.toArray(new Base[this.associatedParty.size()]); // ResearchStudyAssociatedPartyComponent
5412        case 1457822360: /*currentState*/ return this.currentState == null ? new Base[0] : this.currentState.toArray(new Base[this.currentState.size()]); // CodeableConcept
5413        case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : this.statusDate.toArray(new Base[this.statusDate.size()]); // ResearchStudyStatusDateComponent
5414        case -699986715: /*whyStopped*/ return this.whyStopped == null ? new Base[0] : new Base[] {this.whyStopped}; // CodeableConcept
5415        case 780783004: /*recruitment*/ return this.recruitment == null ? new Base[0] : new Base[] {this.recruitment}; // ResearchStudyRecruitmentComponent
5416        case -138266634: /*comparisonGroup*/ return this.comparisonGroup == null ? new Base[0] : this.comparisonGroup.toArray(new Base[this.comparisonGroup.size()]); // ResearchStudyComparisonGroupComponent
5417        case -1489585863: /*objective*/ return this.objective == null ? new Base[0] : this.objective.toArray(new Base[this.objective.size()]); // ResearchStudyObjectiveComponent
5418        case -1510689364: /*outcomeMeasure*/ return this.outcomeMeasure == null ? new Base[0] : this.outcomeMeasure.toArray(new Base[this.outcomeMeasure.size()]); // ResearchStudyOutcomeMeasureComponent
5419        case -934426595: /*result*/ return this.result == null ? new Base[0] : this.result.toArray(new Base[this.result.size()]); // Reference
5420        case -828032215: /*webLocation*/ return this.webLocation == null ? new Base[0] : this.webLocation.toArray(new Base[this.webLocation.size()]); // ResearchStudyWebLocationComponent
5421        default: return super.getProperty(hash, name, checkValid);
5422        }
5423
5424      }
5425
5426      @Override
5427      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5428        switch (hash) {
5429        case 116079: // url
5430          this.url = TypeConvertor.castToUri(value); // UriType
5431          return value;
5432        case -1618432855: // identifier
5433          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
5434          return value;
5435        case 351608024: // version
5436          this.version = TypeConvertor.castToString(value); // StringType
5437          return value;
5438        case 3373707: // name
5439          this.name = TypeConvertor.castToString(value); // StringType
5440          return value;
5441        case 110371416: // title
5442          this.title = TypeConvertor.castToString(value); // StringType
5443          return value;
5444        case 102727412: // label
5445          this.getLabel().add((ResearchStudyLabelComponent) value); // ResearchStudyLabelComponent
5446          return value;
5447        case -989163880: // protocol
5448          this.getProtocol().add(TypeConvertor.castToReference(value)); // Reference
5449          return value;
5450        case -995410646: // partOf
5451          this.getPartOf().add(TypeConvertor.castToReference(value)); // Reference
5452          return value;
5453        case 666807069: // relatedArtifact
5454          this.getRelatedArtifact().add(TypeConvertor.castToRelatedArtifact(value)); // RelatedArtifact
5455          return value;
5456        case 3076014: // date
5457          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
5458          return value;
5459        case -892481550: // status
5460          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
5461          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
5462          return value;
5463        case -2132842986: // primaryPurposeType
5464          this.primaryPurposeType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5465          return value;
5466        case 106629499: // phase
5467          this.phase = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5468          return value;
5469        case 50511102: // category
5470          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
5471          return value;
5472        case 97604824: // focus
5473          this.getFocus().add((ResearchStudyFocusComponent) value); // ResearchStudyFocusComponent
5474          return value;
5475        case -861311717: // condition
5476          this.getCondition().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
5477          return value;
5478        case -814408215: // keyword
5479          this.getKeyword().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
5480          return value;
5481        case 1901043637: // location
5482          this.getLocation().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
5483          return value;
5484        case 21530634: // descriptionSummary
5485          this.descriptionSummary = TypeConvertor.castToMarkdown(value); // MarkdownType
5486          return value;
5487        case -1724546052: // description
5488          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
5489          return value;
5490        case -991726143: // period
5491          this.period = TypeConvertor.castToPeriod(value); // Period
5492          return value;
5493        case 951526432: // contact
5494          this.getContact().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
5495          return value;
5496        case -1998892262: // sponsor
5497          this.sponsor = TypeConvertor.castToReference(value); // Reference
5498          return value;
5499        case 1437117175: // principalInvestigator
5500          this.principalInvestigator = TypeConvertor.castToReference(value); // Reference
5501          return value;
5502        case 3530567: // site
5503          this.getSite().add(TypeConvertor.castToReference(value)); // Reference
5504          return value;
5505        case 3387378: // note
5506          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
5507          return value;
5508        case 382350310: // classification
5509          this.getClassification().add((ResearchStudyClassificationComponent) value); // ResearchStudyClassificationComponent
5510          return value;
5511        case -1841460864: // associatedParty
5512          this.getAssociatedParty().add((ResearchStudyAssociatedPartyComponent) value); // ResearchStudyAssociatedPartyComponent
5513          return value;
5514        case 1457822360: // currentState
5515          this.getCurrentState().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
5516          return value;
5517        case 247524032: // statusDate
5518          this.getStatusDate().add((ResearchStudyStatusDateComponent) value); // ResearchStudyStatusDateComponent
5519          return value;
5520        case -699986715: // whyStopped
5521          this.whyStopped = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5522          return value;
5523        case 780783004: // recruitment
5524          this.recruitment = (ResearchStudyRecruitmentComponent) value; // ResearchStudyRecruitmentComponent
5525          return value;
5526        case -138266634: // comparisonGroup
5527          this.getComparisonGroup().add((ResearchStudyComparisonGroupComponent) value); // ResearchStudyComparisonGroupComponent
5528          return value;
5529        case -1489585863: // objective
5530          this.getObjective().add((ResearchStudyObjectiveComponent) value); // ResearchStudyObjectiveComponent
5531          return value;
5532        case -1510689364: // outcomeMeasure
5533          this.getOutcomeMeasure().add((ResearchStudyOutcomeMeasureComponent) value); // ResearchStudyOutcomeMeasureComponent
5534          return value;
5535        case -934426595: // result
5536          this.getResult().add(TypeConvertor.castToReference(value)); // Reference
5537          return value;
5538        case -828032215: // webLocation
5539          this.getWebLocation().add((ResearchStudyWebLocationComponent) value); // ResearchStudyWebLocationComponent
5540          return value;
5541        default: return super.setProperty(hash, name, value);
5542        }
5543
5544      }
5545
5546      @Override
5547      public Base setProperty(String name, Base value) throws FHIRException {
5548        if (name.equals("url")) {
5549          this.url = TypeConvertor.castToUri(value); // UriType
5550        } else if (name.equals("identifier")) {
5551          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
5552        } else if (name.equals("version")) {
5553          this.version = TypeConvertor.castToString(value); // StringType
5554        } else if (name.equals("name")) {
5555          this.name = TypeConvertor.castToString(value); // StringType
5556        } else if (name.equals("title")) {
5557          this.title = TypeConvertor.castToString(value); // StringType
5558        } else if (name.equals("label")) {
5559          this.getLabel().add((ResearchStudyLabelComponent) value);
5560        } else if (name.equals("protocol")) {
5561          this.getProtocol().add(TypeConvertor.castToReference(value));
5562        } else if (name.equals("partOf")) {
5563          this.getPartOf().add(TypeConvertor.castToReference(value));
5564        } else if (name.equals("relatedArtifact")) {
5565          this.getRelatedArtifact().add(TypeConvertor.castToRelatedArtifact(value));
5566        } else if (name.equals("date")) {
5567          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
5568        } else if (name.equals("status")) {
5569          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
5570          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
5571        } else if (name.equals("primaryPurposeType")) {
5572          this.primaryPurposeType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5573        } else if (name.equals("phase")) {
5574          this.phase = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5575        } else if (name.equals("category")) {
5576          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
5577        } else if (name.equals("focus")) {
5578          this.getFocus().add((ResearchStudyFocusComponent) value);
5579        } else if (name.equals("condition")) {
5580          this.getCondition().add(TypeConvertor.castToCodeableConcept(value));
5581        } else if (name.equals("keyword")) {
5582          this.getKeyword().add(TypeConvertor.castToCodeableConcept(value));
5583        } else if (name.equals("location")) {
5584          this.getLocation().add(TypeConvertor.castToCodeableConcept(value));
5585        } else if (name.equals("descriptionSummary")) {
5586          this.descriptionSummary = TypeConvertor.castToMarkdown(value); // MarkdownType
5587        } else if (name.equals("description")) {
5588          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
5589        } else if (name.equals("period")) {
5590          this.period = TypeConvertor.castToPeriod(value); // Period
5591        } else if (name.equals("contact")) {
5592          this.getContact().add(TypeConvertor.castToContactDetail(value));
5593        } else if (name.equals("sponsor")) {
5594          this.sponsor = TypeConvertor.castToReference(value); // Reference
5595        } else if (name.equals("principalInvestigator")) {
5596          this.principalInvestigator = TypeConvertor.castToReference(value); // Reference
5597        } else if (name.equals("site")) {
5598          this.getSite().add(TypeConvertor.castToReference(value));
5599        } else if (name.equals("note")) {
5600          this.getNote().add(TypeConvertor.castToAnnotation(value));
5601        } else if (name.equals("classification")) {
5602          this.getClassification().add((ResearchStudyClassificationComponent) value);
5603        } else if (name.equals("associatedParty")) {
5604          this.getAssociatedParty().add((ResearchStudyAssociatedPartyComponent) value);
5605        } else if (name.equals("currentState")) {
5606          this.getCurrentState().add(TypeConvertor.castToCodeableConcept(value));
5607        } else if (name.equals("statusDate")) {
5608          this.getStatusDate().add((ResearchStudyStatusDateComponent) value);
5609        } else if (name.equals("whyStopped")) {
5610          this.whyStopped = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5611        } else if (name.equals("recruitment")) {
5612          this.recruitment = (ResearchStudyRecruitmentComponent) value; // ResearchStudyRecruitmentComponent
5613        } else if (name.equals("comparisonGroup")) {
5614          this.getComparisonGroup().add((ResearchStudyComparisonGroupComponent) value);
5615        } else if (name.equals("objective")) {
5616          this.getObjective().add((ResearchStudyObjectiveComponent) value);
5617        } else if (name.equals("outcomeMeasure")) {
5618          this.getOutcomeMeasure().add((ResearchStudyOutcomeMeasureComponent) value);
5619        } else if (name.equals("result")) {
5620          this.getResult().add(TypeConvertor.castToReference(value));
5621        } else if (name.equals("webLocation")) {
5622          this.getWebLocation().add((ResearchStudyWebLocationComponent) value);
5623        } else
5624          return super.setProperty(name, value);
5625        return value;
5626      }
5627
5628      @Override
5629      public Base makeProperty(int hash, String name) throws FHIRException {
5630        switch (hash) {
5631        case 116079:  return getUrlElement();
5632        case -1618432855:  return addIdentifier(); 
5633        case 351608024:  return getVersionElement();
5634        case 3373707:  return getNameElement();
5635        case 110371416:  return getTitleElement();
5636        case 102727412:  return addLabel(); 
5637        case -989163880:  return addProtocol(); 
5638        case -995410646:  return addPartOf(); 
5639        case 666807069:  return addRelatedArtifact(); 
5640        case 3076014:  return getDateElement();
5641        case -892481550:  return getStatusElement();
5642        case -2132842986:  return getPrimaryPurposeType();
5643        case 106629499:  return getPhase();
5644        case 50511102:  return addCategory(); 
5645        case 97604824:  return addFocus(); 
5646        case -861311717:  return addCondition(); 
5647        case -814408215:  return addKeyword(); 
5648        case 1901043637:  return addLocation(); 
5649        case 21530634:  return getDescriptionSummaryElement();
5650        case -1724546052:  return getDescriptionElement();
5651        case -991726143:  return getPeriod();
5652        case 951526432:  return addContact(); 
5653        case -1998892262:  return getSponsor();
5654        case 1437117175:  return getPrincipalInvestigator();
5655        case 3530567:  return addSite(); 
5656        case 3387378:  return addNote(); 
5657        case 382350310:  return addClassification(); 
5658        case -1841460864:  return addAssociatedParty(); 
5659        case 1457822360:  return addCurrentState(); 
5660        case 247524032:  return addStatusDate(); 
5661        case -699986715:  return getWhyStopped();
5662        case 780783004:  return getRecruitment();
5663        case -138266634:  return addComparisonGroup(); 
5664        case -1489585863:  return addObjective(); 
5665        case -1510689364:  return addOutcomeMeasure(); 
5666        case -934426595:  return addResult(); 
5667        case -828032215:  return addWebLocation(); 
5668        default: return super.makeProperty(hash, name);
5669        }
5670
5671      }
5672
5673      @Override
5674      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5675        switch (hash) {
5676        case 116079: /*url*/ return new String[] {"uri"};
5677        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
5678        case 351608024: /*version*/ return new String[] {"string"};
5679        case 3373707: /*name*/ return new String[] {"string"};
5680        case 110371416: /*title*/ return new String[] {"string"};
5681        case 102727412: /*label*/ return new String[] {};
5682        case -989163880: /*protocol*/ return new String[] {"Reference"};
5683        case -995410646: /*partOf*/ return new String[] {"Reference"};
5684        case 666807069: /*relatedArtifact*/ return new String[] {"RelatedArtifact"};
5685        case 3076014: /*date*/ return new String[] {"dateTime"};
5686        case -892481550: /*status*/ return new String[] {"code"};
5687        case -2132842986: /*primaryPurposeType*/ return new String[] {"CodeableConcept"};
5688        case 106629499: /*phase*/ return new String[] {"CodeableConcept"};
5689        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
5690        case 97604824: /*focus*/ return new String[] {};
5691        case -861311717: /*condition*/ return new String[] {"CodeableConcept"};
5692        case -814408215: /*keyword*/ return new String[] {"CodeableConcept"};
5693        case 1901043637: /*location*/ return new String[] {"CodeableConcept"};
5694        case 21530634: /*descriptionSummary*/ return new String[] {"markdown"};
5695        case -1724546052: /*description*/ return new String[] {"markdown"};
5696        case -991726143: /*period*/ return new String[] {"Period"};
5697        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
5698        case -1998892262: /*sponsor*/ return new String[] {"Reference"};
5699        case 1437117175: /*principalInvestigator*/ return new String[] {"Reference"};
5700        case 3530567: /*site*/ return new String[] {"Reference"};
5701        case 3387378: /*note*/ return new String[] {"Annotation"};
5702        case 382350310: /*classification*/ return new String[] {};
5703        case -1841460864: /*associatedParty*/ return new String[] {};
5704        case 1457822360: /*currentState*/ return new String[] {"CodeableConcept"};
5705        case 247524032: /*statusDate*/ return new String[] {};
5706        case -699986715: /*whyStopped*/ return new String[] {"CodeableConcept"};
5707        case 780783004: /*recruitment*/ return new String[] {};
5708        case -138266634: /*comparisonGroup*/ return new String[] {};
5709        case -1489585863: /*objective*/ return new String[] {};
5710        case -1510689364: /*outcomeMeasure*/ return new String[] {};
5711        case -934426595: /*result*/ return new String[] {"Reference"};
5712        case -828032215: /*webLocation*/ return new String[] {};
5713        default: return super.getTypesForProperty(hash, name);
5714        }
5715
5716      }
5717
5718      @Override
5719      public Base addChild(String name) throws FHIRException {
5720        if (name.equals("url")) {
5721          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.url");
5722        }
5723        else if (name.equals("identifier")) {
5724          return addIdentifier();
5725        }
5726        else if (name.equals("version")) {
5727          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.version");
5728        }
5729        else if (name.equals("name")) {
5730          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.name");
5731        }
5732        else if (name.equals("title")) {
5733          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.title");
5734        }
5735        else if (name.equals("label")) {
5736          return addLabel();
5737        }
5738        else if (name.equals("protocol")) {
5739          return addProtocol();
5740        }
5741        else if (name.equals("partOf")) {
5742          return addPartOf();
5743        }
5744        else if (name.equals("relatedArtifact")) {
5745          return addRelatedArtifact();
5746        }
5747        else if (name.equals("date")) {
5748          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.date");
5749        }
5750        else if (name.equals("status")) {
5751          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.status");
5752        }
5753        else if (name.equals("primaryPurposeType")) {
5754          this.primaryPurposeType = new CodeableConcept();
5755          return this.primaryPurposeType;
5756        }
5757        else if (name.equals("phase")) {
5758          this.phase = new CodeableConcept();
5759          return this.phase;
5760        }
5761        else if (name.equals("category")) {
5762          return addCategory();
5763        }
5764        else if (name.equals("focus")) {
5765          return addFocus();
5766        }
5767        else if (name.equals("condition")) {
5768          return addCondition();
5769        }
5770        else if (name.equals("keyword")) {
5771          return addKeyword();
5772        }
5773        else if (name.equals("location")) {
5774          return addLocation();
5775        }
5776        else if (name.equals("descriptionSummary")) {
5777          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.descriptionSummary");
5778        }
5779        else if (name.equals("description")) {
5780          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.description");
5781        }
5782        else if (name.equals("period")) {
5783          this.period = new Period();
5784          return this.period;
5785        }
5786        else if (name.equals("contact")) {
5787          return addContact();
5788        }
5789        else if (name.equals("sponsor")) {
5790          this.sponsor = new Reference();
5791          return this.sponsor;
5792        }
5793        else if (name.equals("principalInvestigator")) {
5794          this.principalInvestigator = new Reference();
5795          return this.principalInvestigator;
5796        }
5797        else if (name.equals("site")) {
5798          return addSite();
5799        }
5800        else if (name.equals("note")) {
5801          return addNote();
5802        }
5803        else if (name.equals("classification")) {
5804          return addClassification();
5805        }
5806        else if (name.equals("associatedParty")) {
5807          return addAssociatedParty();
5808        }
5809        else if (name.equals("currentState")) {
5810          return addCurrentState();
5811        }
5812        else if (name.equals("statusDate")) {
5813          return addStatusDate();
5814        }
5815        else if (name.equals("whyStopped")) {
5816          this.whyStopped = new CodeableConcept();
5817          return this.whyStopped;
5818        }
5819        else if (name.equals("recruitment")) {
5820          this.recruitment = new ResearchStudyRecruitmentComponent();
5821          return this.recruitment;
5822        }
5823        else if (name.equals("comparisonGroup")) {
5824          return addComparisonGroup();
5825        }
5826        else if (name.equals("objective")) {
5827          return addObjective();
5828        }
5829        else if (name.equals("outcomeMeasure")) {
5830          return addOutcomeMeasure();
5831        }
5832        else if (name.equals("result")) {
5833          return addResult();
5834        }
5835        else if (name.equals("webLocation")) {
5836          return addWebLocation();
5837        }
5838        else
5839          return super.addChild(name);
5840      }
5841
5842  public String fhirType() {
5843    return "ResearchStudy";
5844
5845  }
5846
5847      public ResearchStudy copy() {
5848        ResearchStudy dst = new ResearchStudy();
5849        copyValues(dst);
5850        return dst;
5851      }
5852
5853      public void copyValues(ResearchStudy dst) {
5854        super.copyValues(dst);
5855        dst.url = url == null ? null : url.copy();
5856        if (identifier != null) {
5857          dst.identifier = new ArrayList<Identifier>();
5858          for (Identifier i : identifier)
5859            dst.identifier.add(i.copy());
5860        };
5861        dst.version = version == null ? null : version.copy();
5862        dst.name = name == null ? null : name.copy();
5863        dst.title = title == null ? null : title.copy();
5864        if (label != null) {
5865          dst.label = new ArrayList<ResearchStudyLabelComponent>();
5866          for (ResearchStudyLabelComponent i : label)
5867            dst.label.add(i.copy());
5868        };
5869        if (protocol != null) {
5870          dst.protocol = new ArrayList<Reference>();
5871          for (Reference i : protocol)
5872            dst.protocol.add(i.copy());
5873        };
5874        if (partOf != null) {
5875          dst.partOf = new ArrayList<Reference>();
5876          for (Reference i : partOf)
5877            dst.partOf.add(i.copy());
5878        };
5879        if (relatedArtifact != null) {
5880          dst.relatedArtifact = new ArrayList<RelatedArtifact>();
5881          for (RelatedArtifact i : relatedArtifact)
5882            dst.relatedArtifact.add(i.copy());
5883        };
5884        dst.date = date == null ? null : date.copy();
5885        dst.status = status == null ? null : status.copy();
5886        dst.primaryPurposeType = primaryPurposeType == null ? null : primaryPurposeType.copy();
5887        dst.phase = phase == null ? null : phase.copy();
5888        if (category != null) {
5889          dst.category = new ArrayList<CodeableConcept>();
5890          for (CodeableConcept i : category)
5891            dst.category.add(i.copy());
5892        };
5893        if (focus != null) {
5894          dst.focus = new ArrayList<ResearchStudyFocusComponent>();
5895          for (ResearchStudyFocusComponent i : focus)
5896            dst.focus.add(i.copy());
5897        };
5898        if (condition != null) {
5899          dst.condition = new ArrayList<CodeableConcept>();
5900          for (CodeableConcept i : condition)
5901            dst.condition.add(i.copy());
5902        };
5903        if (keyword != null) {
5904          dst.keyword = new ArrayList<CodeableConcept>();
5905          for (CodeableConcept i : keyword)
5906            dst.keyword.add(i.copy());
5907        };
5908        if (location != null) {
5909          dst.location = new ArrayList<CodeableConcept>();
5910          for (CodeableConcept i : location)
5911            dst.location.add(i.copy());
5912        };
5913        dst.descriptionSummary = descriptionSummary == null ? null : descriptionSummary.copy();
5914        dst.description = description == null ? null : description.copy();
5915        dst.period = period == null ? null : period.copy();
5916        if (contact != null) {
5917          dst.contact = new ArrayList<ContactDetail>();
5918          for (ContactDetail i : contact)
5919            dst.contact.add(i.copy());
5920        };
5921        dst.sponsor = sponsor == null ? null : sponsor.copy();
5922        dst.principalInvestigator = principalInvestigator == null ? null : principalInvestigator.copy();
5923        if (site != null) {
5924          dst.site = new ArrayList<Reference>();
5925          for (Reference i : site)
5926            dst.site.add(i.copy());
5927        };
5928        if (note != null) {
5929          dst.note = new ArrayList<Annotation>();
5930          for (Annotation i : note)
5931            dst.note.add(i.copy());
5932        };
5933        if (classification != null) {
5934          dst.classification = new ArrayList<ResearchStudyClassificationComponent>();
5935          for (ResearchStudyClassificationComponent i : classification)
5936            dst.classification.add(i.copy());
5937        };
5938        if (associatedParty != null) {
5939          dst.associatedParty = new ArrayList<ResearchStudyAssociatedPartyComponent>();
5940          for (ResearchStudyAssociatedPartyComponent i : associatedParty)
5941            dst.associatedParty.add(i.copy());
5942        };
5943        if (currentState != null) {
5944          dst.currentState = new ArrayList<CodeableConcept>();
5945          for (CodeableConcept i : currentState)
5946            dst.currentState.add(i.copy());
5947        };
5948        if (statusDate != null) {
5949          dst.statusDate = new ArrayList<ResearchStudyStatusDateComponent>();
5950          for (ResearchStudyStatusDateComponent i : statusDate)
5951            dst.statusDate.add(i.copy());
5952        };
5953        dst.whyStopped = whyStopped == null ? null : whyStopped.copy();
5954        dst.recruitment = recruitment == null ? null : recruitment.copy();
5955        if (comparisonGroup != null) {
5956          dst.comparisonGroup = new ArrayList<ResearchStudyComparisonGroupComponent>();
5957          for (ResearchStudyComparisonGroupComponent i : comparisonGroup)
5958            dst.comparisonGroup.add(i.copy());
5959        };
5960        if (objective != null) {
5961          dst.objective = new ArrayList<ResearchStudyObjectiveComponent>();
5962          for (ResearchStudyObjectiveComponent i : objective)
5963            dst.objective.add(i.copy());
5964        };
5965        if (outcomeMeasure != null) {
5966          dst.outcomeMeasure = new ArrayList<ResearchStudyOutcomeMeasureComponent>();
5967          for (ResearchStudyOutcomeMeasureComponent i : outcomeMeasure)
5968            dst.outcomeMeasure.add(i.copy());
5969        };
5970        if (result != null) {
5971          dst.result = new ArrayList<Reference>();
5972          for (Reference i : result)
5973            dst.result.add(i.copy());
5974        };
5975        if (webLocation != null) {
5976          dst.webLocation = new ArrayList<ResearchStudyWebLocationComponent>();
5977          for (ResearchStudyWebLocationComponent i : webLocation)
5978            dst.webLocation.add(i.copy());
5979        };
5980      }
5981
5982      protected ResearchStudy typedCopy() {
5983        return copy();
5984      }
5985
5986      @Override
5987      public boolean equalsDeep(Base other_) {
5988        if (!super.equalsDeep(other_))
5989          return false;
5990        if (!(other_ instanceof ResearchStudy))
5991          return false;
5992        ResearchStudy o = (ResearchStudy) other_;
5993        return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true)
5994           && compareDeep(name, o.name, true) && compareDeep(title, o.title, true) && compareDeep(label, o.label, true)
5995           && compareDeep(protocol, o.protocol, true) && compareDeep(partOf, o.partOf, true) && compareDeep(relatedArtifact, o.relatedArtifact, true)
5996           && compareDeep(date, o.date, true) && compareDeep(status, o.status, true) && compareDeep(primaryPurposeType, o.primaryPurposeType, true)
5997           && compareDeep(phase, o.phase, true) && compareDeep(category, o.category, true) && compareDeep(focus, o.focus, true)
5998           && compareDeep(condition, o.condition, true) && compareDeep(keyword, o.keyword, true) && compareDeep(location, o.location, true)
5999           && compareDeep(descriptionSummary, o.descriptionSummary, true) && compareDeep(description, o.description, true)
6000           && compareDeep(period, o.period, true) && compareDeep(contact, o.contact, true) && compareDeep(sponsor, o.sponsor, true)
6001           && compareDeep(principalInvestigator, o.principalInvestigator, true) && compareDeep(site, o.site, true)
6002           && compareDeep(note, o.note, true) && compareDeep(classification, o.classification, true) && compareDeep(associatedParty, o.associatedParty, true)
6003           && compareDeep(currentState, o.currentState, true) && compareDeep(statusDate, o.statusDate, true)
6004           && compareDeep(whyStopped, o.whyStopped, true) && compareDeep(recruitment, o.recruitment, true)
6005           && compareDeep(comparisonGroup, o.comparisonGroup, true) && compareDeep(objective, o.objective, true)
6006           && compareDeep(outcomeMeasure, o.outcomeMeasure, true) && compareDeep(result, o.result, true) && compareDeep(webLocation, o.webLocation, true)
6007          ;
6008      }
6009
6010      @Override
6011      public boolean equalsShallow(Base other_) {
6012        if (!super.equalsShallow(other_))
6013          return false;
6014        if (!(other_ instanceof ResearchStudy))
6015          return false;
6016        ResearchStudy o = (ResearchStudy) other_;
6017        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true)
6018           && compareValues(title, o.title, true) && compareValues(date, o.date, true) && compareValues(status, o.status, true)
6019           && compareValues(descriptionSummary, o.descriptionSummary, true) && compareValues(description, o.description, true)
6020          ;
6021      }
6022
6023      public boolean isEmpty() {
6024        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, identifier, version
6025          , name, title, label, protocol, partOf, relatedArtifact, date, status, primaryPurposeType
6026          , phase, category, focus, condition, keyword, location, descriptionSummary, description
6027          , period, contact, sponsor, principalInvestigator, site, note, classification
6028          , associatedParty, currentState, statusDate, whyStopped, recruitment, comparisonGroup
6029          , objective, outcomeMeasure, result, webLocation);
6030      }
6031
6032  @Override
6033  public ResourceType getResourceType() {
6034    return ResourceType.ResearchStudy;
6035   }
6036
6037 /**
6038   * Search parameter: <b>category</b>
6039   * <p>
6040   * Description: <b>Classifications for the study</b><br>
6041   * Type: <b>token</b><br>
6042   * Path: <b>ResearchStudy.category</b><br>
6043   * </p>
6044   */
6045  @SearchParamDefinition(name="category", path="ResearchStudy.category", description="Classifications for the study", type="token" )
6046  public static final String SP_CATEGORY = "category";
6047 /**
6048   * <b>Fluent Client</b> search parameter constant for <b>category</b>
6049   * <p>
6050   * Description: <b>Classifications for the study</b><br>
6051   * Type: <b>token</b><br>
6052   * Path: <b>ResearchStudy.category</b><br>
6053   * </p>
6054   */
6055  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
6056
6057 /**
6058   * Search parameter: <b>condition</b>
6059   * <p>
6060   * Description: <b>Condition being studied</b><br>
6061   * Type: <b>token</b><br>
6062   * Path: <b>ResearchStudy.condition</b><br>
6063   * </p>
6064   */
6065  @SearchParamDefinition(name="condition", path="ResearchStudy.condition", description="Condition being studied", type="token" )
6066  public static final String SP_CONDITION = "condition";
6067 /**
6068   * <b>Fluent Client</b> search parameter constant for <b>condition</b>
6069   * <p>
6070   * Description: <b>Condition being studied</b><br>
6071   * Type: <b>token</b><br>
6072   * Path: <b>ResearchStudy.condition</b><br>
6073   * </p>
6074   */
6075  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONDITION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONDITION);
6076
6077 /**
6078   * Search parameter: <b>date</b>
6079   * <p>
6080   * Description: <b>When the study began and ended</b><br>
6081   * Type: <b>date</b><br>
6082   * Path: <b>ResearchStudy.period</b><br>
6083   * </p>
6084   */
6085  @SearchParamDefinition(name="date", path="ResearchStudy.period", description="When the study began and ended", type="date" )
6086  public static final String SP_DATE = "date";
6087 /**
6088   * <b>Fluent Client</b> search parameter constant for <b>date</b>
6089   * <p>
6090   * Description: <b>When the study began and ended</b><br>
6091   * Type: <b>date</b><br>
6092   * Path: <b>ResearchStudy.period</b><br>
6093   * </p>
6094   */
6095  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
6096
6097 /**
6098   * Search parameter: <b>focus</b>
6099   * <p>
6100   * Description: <b>Drugs, devices, etc. under study</b><br>
6101   * Type: <b>token</b><br>
6102   * Path: <b>ResearchStudy.focus</b><br>
6103   * </p>
6104   */
6105  @SearchParamDefinition(name="focus", path="ResearchStudy.focus", description="Drugs, devices, etc. under study", type="token" )
6106  public static final String SP_FOCUS = "focus";
6107 /**
6108   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
6109   * <p>
6110   * Description: <b>Drugs, devices, etc. under study</b><br>
6111   * Type: <b>token</b><br>
6112   * Path: <b>ResearchStudy.focus</b><br>
6113   * </p>
6114   */
6115  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FOCUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FOCUS);
6116
6117 /**
6118   * Search parameter: <b>identifier</b>
6119   * <p>
6120   * Description: <b>Business Identifier for study</b><br>
6121   * Type: <b>token</b><br>
6122   * Path: <b>ResearchStudy.identifier</b><br>
6123   * </p>
6124   */
6125  @SearchParamDefinition(name="identifier", path="ResearchStudy.identifier", description="Business Identifier for study", type="token" )
6126  public static final String SP_IDENTIFIER = "identifier";
6127 /**
6128   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
6129   * <p>
6130   * Description: <b>Business Identifier for study</b><br>
6131   * Type: <b>token</b><br>
6132   * Path: <b>ResearchStudy.identifier</b><br>
6133   * </p>
6134   */
6135  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
6136
6137 /**
6138   * Search parameter: <b>keyword</b>
6139   * <p>
6140   * Description: <b>Used to search for the study</b><br>
6141   * Type: <b>token</b><br>
6142   * Path: <b>ResearchStudy.keyword</b><br>
6143   * </p>
6144   */
6145  @SearchParamDefinition(name="keyword", path="ResearchStudy.keyword", description="Used to search for the study", type="token" )
6146  public static final String SP_KEYWORD = "keyword";
6147 /**
6148   * <b>Fluent Client</b> search parameter constant for <b>keyword</b>
6149   * <p>
6150   * Description: <b>Used to search for the study</b><br>
6151   * Type: <b>token</b><br>
6152   * Path: <b>ResearchStudy.keyword</b><br>
6153   * </p>
6154   */
6155  public static final ca.uhn.fhir.rest.gclient.TokenClientParam KEYWORD = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KEYWORD);
6156
6157 /**
6158   * Search parameter: <b>location</b>
6159   * <p>
6160   * Description: <b>Geographic region(s) for study</b><br>
6161   * Type: <b>token</b><br>
6162   * Path: <b>ResearchStudy.location</b><br>
6163   * </p>
6164   */
6165  @SearchParamDefinition(name="location", path="ResearchStudy.location", description="Geographic region(s) for study", type="token" )
6166  public static final String SP_LOCATION = "location";
6167 /**
6168   * <b>Fluent Client</b> search parameter constant for <b>location</b>
6169   * <p>
6170   * Description: <b>Geographic region(s) for study</b><br>
6171   * Type: <b>token</b><br>
6172   * Path: <b>ResearchStudy.location</b><br>
6173   * </p>
6174   */
6175  public static final ca.uhn.fhir.rest.gclient.TokenClientParam LOCATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LOCATION);
6176
6177 /**
6178   * Search parameter: <b>partof</b>
6179   * <p>
6180   * Description: <b>Part of larger study</b><br>
6181   * Type: <b>reference</b><br>
6182   * Path: <b>ResearchStudy.partOf</b><br>
6183   * </p>
6184   */
6185  @SearchParamDefinition(name="partof", path="ResearchStudy.partOf", description="Part of larger study", type="reference", target={ResearchStudy.class } )
6186  public static final String SP_PARTOF = "partof";
6187 /**
6188   * <b>Fluent Client</b> search parameter constant for <b>partof</b>
6189   * <p>
6190   * Description: <b>Part of larger study</b><br>
6191   * Type: <b>reference</b><br>
6192   * Path: <b>ResearchStudy.partOf</b><br>
6193   * </p>
6194   */
6195  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTOF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTOF);
6196
6197/**
6198   * Constant for fluent queries to be used to add include statements. Specifies
6199   * the path value of "<b>ResearchStudy:partof</b>".
6200   */
6201  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include("ResearchStudy:partof").toLocked();
6202
6203 /**
6204   * Search parameter: <b>principalinvestigator</b>
6205   * <p>
6206   * Description: <b>Researcher who oversees multiple aspects of the study</b><br>
6207   * Type: <b>reference</b><br>
6208   * Path: <b>ResearchStudy.principalInvestigator</b><br>
6209   * </p>
6210   */
6211  @SearchParamDefinition(name="principalinvestigator", path="ResearchStudy.principalInvestigator", description="Researcher who oversees multiple aspects of the study", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Practitioner.class, PractitionerRole.class } )
6212  public static final String SP_PRINCIPALINVESTIGATOR = "principalinvestigator";
6213 /**
6214   * <b>Fluent Client</b> search parameter constant for <b>principalinvestigator</b>
6215   * <p>
6216   * Description: <b>Researcher who oversees multiple aspects of the study</b><br>
6217   * Type: <b>reference</b><br>
6218   * Path: <b>ResearchStudy.principalInvestigator</b><br>
6219   * </p>
6220   */
6221  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRINCIPALINVESTIGATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRINCIPALINVESTIGATOR);
6222
6223/**
6224   * Constant for fluent queries to be used to add include statements. Specifies
6225   * the path value of "<b>ResearchStudy:principalinvestigator</b>".
6226   */
6227  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRINCIPALINVESTIGATOR = new ca.uhn.fhir.model.api.Include("ResearchStudy:principalinvestigator").toLocked();
6228
6229 /**
6230   * Search parameter: <b>protocol</b>
6231   * <p>
6232   * Description: <b>Steps followed in executing study</b><br>
6233   * Type: <b>reference</b><br>
6234   * Path: <b>ResearchStudy.protocol</b><br>
6235   * </p>
6236   */
6237  @SearchParamDefinition(name="protocol", path="ResearchStudy.protocol", description="Steps followed in executing study", type="reference", target={PlanDefinition.class } )
6238  public static final String SP_PROTOCOL = "protocol";
6239 /**
6240   * <b>Fluent Client</b> search parameter constant for <b>protocol</b>
6241   * <p>
6242   * Description: <b>Steps followed in executing study</b><br>
6243   * Type: <b>reference</b><br>
6244   * Path: <b>ResearchStudy.protocol</b><br>
6245   * </p>
6246   */
6247  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROTOCOL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROTOCOL);
6248
6249/**
6250   * Constant for fluent queries to be used to add include statements. Specifies
6251   * the path value of "<b>ResearchStudy:protocol</b>".
6252   */
6253  public static final ca.uhn.fhir.model.api.Include INCLUDE_PROTOCOL = new ca.uhn.fhir.model.api.Include("ResearchStudy:protocol").toLocked();
6254
6255 /**
6256   * Search parameter: <b>recruitment_actual</b>
6257   * <p>
6258   * Description: <b>Actual number of participants enrolled in study across all groups</b><br>
6259   * Type: <b>number</b><br>
6260   * Path: <b>ResearchStudy.recruitment.actualNumber</b><br>
6261   * </p>
6262   */
6263  @SearchParamDefinition(name="recruitment_actual", path="ResearchStudy.recruitment.actualNumber", description="Actual number of participants enrolled in study across all groups", type="number" )
6264  public static final String SP_RECRUITMENTACTUAL = "recruitment_actual";
6265 /**
6266   * <b>Fluent Client</b> search parameter constant for <b>recruitment_actual</b>
6267   * <p>
6268   * Description: <b>Actual number of participants enrolled in study across all groups</b><br>
6269   * Type: <b>number</b><br>
6270   * Path: <b>ResearchStudy.recruitment.actualNumber</b><br>
6271   * </p>
6272   */
6273  public static final ca.uhn.fhir.rest.gclient.NumberClientParam RECRUITMENTACTUAL = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_RECRUITMENTACTUAL);
6274
6275 /**
6276   * Search parameter: <b>recruitment_target</b>
6277   * <p>
6278   * Description: <b>Target number of participants enrolled in study across all groups</b><br>
6279   * Type: <b>number</b><br>
6280   * Path: <b>ResearchStudy.recruitment.targetNumber</b><br>
6281   * </p>
6282   */
6283  @SearchParamDefinition(name="recruitment_target", path="ResearchStudy.recruitment.targetNumber", description="Target number of participants enrolled in study across all groups", type="number" )
6284  public static final String SP_RECRUITMENTTARGET = "recruitment_target";
6285 /**
6286   * <b>Fluent Client</b> search parameter constant for <b>recruitment_target</b>
6287   * <p>
6288   * Description: <b>Target number of participants enrolled in study across all groups</b><br>
6289   * Type: <b>number</b><br>
6290   * Path: <b>ResearchStudy.recruitment.targetNumber</b><br>
6291   * </p>
6292   */
6293  public static final ca.uhn.fhir.rest.gclient.NumberClientParam RECRUITMENTTARGET = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_RECRUITMENTTARGET);
6294
6295 /**
6296   * Search parameter: <b>site</b>
6297   * <p>
6298   * Description: <b>Facility where study activities are conducted</b><br>
6299   * Type: <b>reference</b><br>
6300   * Path: <b>ResearchStudy.site</b><br>
6301   * </p>
6302   */
6303  @SearchParamDefinition(name="site", path="ResearchStudy.site", description="Facility where study activities are conducted", type="reference", target={Location.class, Organization.class, ResearchStudy.class } )
6304  public static final String SP_SITE = "site";
6305 /**
6306   * <b>Fluent Client</b> search parameter constant for <b>site</b>
6307   * <p>
6308   * Description: <b>Facility where study activities are conducted</b><br>
6309   * Type: <b>reference</b><br>
6310   * Path: <b>ResearchStudy.site</b><br>
6311   * </p>
6312   */
6313  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SITE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SITE);
6314
6315/**
6316   * Constant for fluent queries to be used to add include statements. Specifies
6317   * the path value of "<b>ResearchStudy:site</b>".
6318   */
6319  public static final ca.uhn.fhir.model.api.Include INCLUDE_SITE = new ca.uhn.fhir.model.api.Include("ResearchStudy:site").toLocked();
6320
6321 /**
6322   * Search parameter: <b>sponsor</b>
6323   * <p>
6324   * Description: <b>Organization that initiates and is legally responsible for the study</b><br>
6325   * Type: <b>reference</b><br>
6326   * Path: <b>ResearchStudy.sponsor</b><br>
6327   * </p>
6328   */
6329  @SearchParamDefinition(name="sponsor", path="ResearchStudy.sponsor", description="Organization that initiates and is legally responsible for the study", type="reference", target={Organization.class } )
6330  public static final String SP_SPONSOR = "sponsor";
6331 /**
6332   * <b>Fluent Client</b> search parameter constant for <b>sponsor</b>
6333   * <p>
6334   * Description: <b>Organization that initiates and is legally responsible for the study</b><br>
6335   * Type: <b>reference</b><br>
6336   * Path: <b>ResearchStudy.sponsor</b><br>
6337   * </p>
6338   */
6339  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPONSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPONSOR);
6340
6341/**
6342   * Constant for fluent queries to be used to add include statements. Specifies
6343   * the path value of "<b>ResearchStudy:sponsor</b>".
6344   */
6345  public static final ca.uhn.fhir.model.api.Include INCLUDE_SPONSOR = new ca.uhn.fhir.model.api.Include("ResearchStudy:sponsor").toLocked();
6346
6347 /**
6348   * Search parameter: <b>status</b>
6349   * <p>
6350   * Description: <b>active | active-but-not-recruiting | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | enrolling-by-invitation | in-review | not-yet-recruiting | recruiting | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | terminated | withdrawn</b><br>
6351   * Type: <b>token</b><br>
6352   * Path: <b>ResearchStudy.status</b><br>
6353   * </p>
6354   */
6355  @SearchParamDefinition(name="status", path="ResearchStudy.status", description="active | active-but-not-recruiting | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | enrolling-by-invitation | in-review | not-yet-recruiting | recruiting | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | terminated | withdrawn", type="token" )
6356  public static final String SP_STATUS = "status";
6357 /**
6358   * <b>Fluent Client</b> search parameter constant for <b>status</b>
6359   * <p>
6360   * Description: <b>active | active-but-not-recruiting | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | enrolling-by-invitation | in-review | not-yet-recruiting | recruiting | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | terminated | withdrawn</b><br>
6361   * Type: <b>token</b><br>
6362   * Path: <b>ResearchStudy.status</b><br>
6363   * </p>
6364   */
6365  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
6366
6367 /**
6368   * Search parameter: <b>title</b>
6369   * <p>
6370   * Description: <b>Name for this study</b><br>
6371   * Type: <b>string</b><br>
6372   * Path: <b>ResearchStudy.title</b><br>
6373   * </p>
6374   */
6375  @SearchParamDefinition(name="title", path="ResearchStudy.title", description="Name for this study", type="string" )
6376  public static final String SP_TITLE = "title";
6377 /**
6378   * <b>Fluent Client</b> search parameter constant for <b>title</b>
6379   * <p>
6380   * Description: <b>Name for this study</b><br>
6381   * Type: <b>string</b><br>
6382   * Path: <b>ResearchStudy.title</b><br>
6383   * </p>
6384   */
6385  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
6386
6387
6388}
6389