001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Thu, Dec 27, 2018 10:06-0500 for FHIR v4.0.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.r4.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046/**
047 * 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.
048 */
049@ResourceDef(name="ResearchStudy", profile="http://hl7.org/fhir/StructureDefinition/ResearchStudy")
050public class ResearchStudy extends DomainResource {
051
052    public enum ResearchStudyStatus {
053        /**
054         * Study is opened for accrual.
055         */
056        ACTIVE, 
057        /**
058         * Study is completed prematurely and will not resume; patients are no longer examined nor treated.
059         */
060        ADMINISTRATIVELYCOMPLETED, 
061        /**
062         * Protocol is approved by the review board.
063         */
064        APPROVED, 
065        /**
066         * Study is closed for accrual; patients can be examined and treated.
067         */
068        CLOSEDTOACCRUAL, 
069        /**
070         * Study is closed to accrual and intervention, i.e. the study is closed to enrollment, all study subjects have completed treatment or intervention but are still being followed according to the primary objective of the study.
071         */
072        CLOSEDTOACCRUALANDINTERVENTION, 
073        /**
074         * Study is closed to accrual and intervention, i.e. the study is closed to enrollment, all study subjects have completed treatment
075or intervention but are still being followed according to the primary objective of the study.
076         */
077        COMPLETED, 
078        /**
079         * Protocol was disapproved by the review board.
080         */
081        DISAPPROVED, 
082        /**
083         * Protocol is submitted to the review board for approval.
084         */
085        INREVIEW, 
086        /**
087         * Study is temporarily closed for accrual; can be potentially resumed in the future; patients can be examined and treated.
088         */
089        TEMPORARILYCLOSEDTOACCRUAL, 
090        /**
091         * Study is temporarily closed for accrual and intervention and potentially can be resumed in the future.
092         */
093        TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION, 
094        /**
095         * Protocol was withdrawn by the lead organization.
096         */
097        WITHDRAWN, 
098        /**
099         * added to help the parsers with the generic types
100         */
101        NULL;
102        public static ResearchStudyStatus fromCode(String codeString) throws FHIRException {
103            if (codeString == null || "".equals(codeString))
104                return null;
105        if ("active".equals(codeString))
106          return ACTIVE;
107        if ("administratively-completed".equals(codeString))
108          return ADMINISTRATIVELYCOMPLETED;
109        if ("approved".equals(codeString))
110          return APPROVED;
111        if ("closed-to-accrual".equals(codeString))
112          return CLOSEDTOACCRUAL;
113        if ("closed-to-accrual-and-intervention".equals(codeString))
114          return CLOSEDTOACCRUALANDINTERVENTION;
115        if ("completed".equals(codeString))
116          return COMPLETED;
117        if ("disapproved".equals(codeString))
118          return DISAPPROVED;
119        if ("in-review".equals(codeString))
120          return INREVIEW;
121        if ("temporarily-closed-to-accrual".equals(codeString))
122          return TEMPORARILYCLOSEDTOACCRUAL;
123        if ("temporarily-closed-to-accrual-and-intervention".equals(codeString))
124          return TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION;
125        if ("withdrawn".equals(codeString))
126          return WITHDRAWN;
127        if (Configuration.isAcceptInvalidEnums())
128          return null;
129        else
130          throw new FHIRException("Unknown ResearchStudyStatus code '"+codeString+"'");
131        }
132        public String toCode() {
133          switch (this) {
134            case ACTIVE: return "active";
135            case ADMINISTRATIVELYCOMPLETED: return "administratively-completed";
136            case APPROVED: return "approved";
137            case CLOSEDTOACCRUAL: return "closed-to-accrual";
138            case CLOSEDTOACCRUALANDINTERVENTION: return "closed-to-accrual-and-intervention";
139            case COMPLETED: return "completed";
140            case DISAPPROVED: return "disapproved";
141            case INREVIEW: return "in-review";
142            case TEMPORARILYCLOSEDTOACCRUAL: return "temporarily-closed-to-accrual";
143            case TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION: return "temporarily-closed-to-accrual-and-intervention";
144            case WITHDRAWN: return "withdrawn";
145            default: return "?";
146          }
147        }
148        public String getSystem() {
149          switch (this) {
150            case ACTIVE: return "http://hl7.org/fhir/research-study-status";
151            case ADMINISTRATIVELYCOMPLETED: return "http://hl7.org/fhir/research-study-status";
152            case APPROVED: return "http://hl7.org/fhir/research-study-status";
153            case CLOSEDTOACCRUAL: return "http://hl7.org/fhir/research-study-status";
154            case CLOSEDTOACCRUALANDINTERVENTION: return "http://hl7.org/fhir/research-study-status";
155            case COMPLETED: return "http://hl7.org/fhir/research-study-status";
156            case DISAPPROVED: return "http://hl7.org/fhir/research-study-status";
157            case INREVIEW: return "http://hl7.org/fhir/research-study-status";
158            case TEMPORARILYCLOSEDTOACCRUAL: return "http://hl7.org/fhir/research-study-status";
159            case TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION: return "http://hl7.org/fhir/research-study-status";
160            case WITHDRAWN: return "http://hl7.org/fhir/research-study-status";
161            default: return "?";
162          }
163        }
164        public String getDefinition() {
165          switch (this) {
166            case ACTIVE: return "Study is opened for accrual.";
167            case ADMINISTRATIVELYCOMPLETED: return "Study is completed prematurely and will not resume; patients are no longer examined nor treated.";
168            case APPROVED: return "Protocol is approved by the review board.";
169            case CLOSEDTOACCRUAL: return "Study is closed for accrual; patients can be examined and treated.";
170            case CLOSEDTOACCRUALANDINTERVENTION: return "Study is closed to accrual and intervention, i.e. the study is closed to enrollment, all study subjects have completed treatment or intervention but are still being followed according to the primary objective of the study.";
171            case COMPLETED: return "Study is closed to accrual and intervention, i.e. the study is closed to enrollment, all study subjects have completed treatment\nor intervention but are still being followed according to the primary objective of the study.";
172            case DISAPPROVED: return "Protocol was disapproved by the review board.";
173            case INREVIEW: return "Protocol is submitted to the review board for approval.";
174            case TEMPORARILYCLOSEDTOACCRUAL: return "Study is temporarily closed for accrual; can be potentially resumed in the future; patients can be examined and treated.";
175            case TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION: return "Study is temporarily closed for accrual and intervention and potentially can be resumed in the future.";
176            case WITHDRAWN: return "Protocol was withdrawn by the lead organization.";
177            default: return "?";
178          }
179        }
180        public String getDisplay() {
181          switch (this) {
182            case ACTIVE: return "Active";
183            case ADMINISTRATIVELYCOMPLETED: return "Administratively Completed";
184            case APPROVED: return "Approved";
185            case CLOSEDTOACCRUAL: return "Closed to Accrual";
186            case CLOSEDTOACCRUALANDINTERVENTION: return "Closed to Accrual and Intervention";
187            case COMPLETED: return "Completed";
188            case DISAPPROVED: return "Disapproved";
189            case INREVIEW: return "In Review";
190            case TEMPORARILYCLOSEDTOACCRUAL: return "Temporarily Closed to Accrual";
191            case TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION: return "Temporarily Closed to Accrual and Intervention";
192            case WITHDRAWN: return "Withdrawn";
193            default: return "?";
194          }
195        }
196    }
197
198  public static class ResearchStudyStatusEnumFactory implements EnumFactory<ResearchStudyStatus> {
199    public ResearchStudyStatus fromCode(String codeString) throws IllegalArgumentException {
200      if (codeString == null || "".equals(codeString))
201            if (codeString == null || "".equals(codeString))
202                return null;
203        if ("active".equals(codeString))
204          return ResearchStudyStatus.ACTIVE;
205        if ("administratively-completed".equals(codeString))
206          return ResearchStudyStatus.ADMINISTRATIVELYCOMPLETED;
207        if ("approved".equals(codeString))
208          return ResearchStudyStatus.APPROVED;
209        if ("closed-to-accrual".equals(codeString))
210          return ResearchStudyStatus.CLOSEDTOACCRUAL;
211        if ("closed-to-accrual-and-intervention".equals(codeString))
212          return ResearchStudyStatus.CLOSEDTOACCRUALANDINTERVENTION;
213        if ("completed".equals(codeString))
214          return ResearchStudyStatus.COMPLETED;
215        if ("disapproved".equals(codeString))
216          return ResearchStudyStatus.DISAPPROVED;
217        if ("in-review".equals(codeString))
218          return ResearchStudyStatus.INREVIEW;
219        if ("temporarily-closed-to-accrual".equals(codeString))
220          return ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUAL;
221        if ("temporarily-closed-to-accrual-and-intervention".equals(codeString))
222          return ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION;
223        if ("withdrawn".equals(codeString))
224          return ResearchStudyStatus.WITHDRAWN;
225        throw new IllegalArgumentException("Unknown ResearchStudyStatus code '"+codeString+"'");
226        }
227        public Enumeration<ResearchStudyStatus> fromType(Base code) throws FHIRException {
228          if (code == null)
229            return null;
230          if (code.isEmpty())
231            return new Enumeration<ResearchStudyStatus>(this);
232          String codeString = ((PrimitiveType) code).asStringValue();
233          if (codeString == null || "".equals(codeString))
234            return null;
235        if ("active".equals(codeString))
236          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.ACTIVE);
237        if ("administratively-completed".equals(codeString))
238          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.ADMINISTRATIVELYCOMPLETED);
239        if ("approved".equals(codeString))
240          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.APPROVED);
241        if ("closed-to-accrual".equals(codeString))
242          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.CLOSEDTOACCRUAL);
243        if ("closed-to-accrual-and-intervention".equals(codeString))
244          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.CLOSEDTOACCRUALANDINTERVENTION);
245        if ("completed".equals(codeString))
246          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.COMPLETED);
247        if ("disapproved".equals(codeString))
248          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.DISAPPROVED);
249        if ("in-review".equals(codeString))
250          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.INREVIEW);
251        if ("temporarily-closed-to-accrual".equals(codeString))
252          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUAL);
253        if ("temporarily-closed-to-accrual-and-intervention".equals(codeString))
254          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION);
255        if ("withdrawn".equals(codeString))
256          return new Enumeration<ResearchStudyStatus>(this, ResearchStudyStatus.WITHDRAWN);
257        throw new FHIRException("Unknown ResearchStudyStatus code '"+codeString+"'");
258        }
259    public String toCode(ResearchStudyStatus code) {
260      if (code == ResearchStudyStatus.ACTIVE)
261        return "active";
262      if (code == ResearchStudyStatus.ADMINISTRATIVELYCOMPLETED)
263        return "administratively-completed";
264      if (code == ResearchStudyStatus.APPROVED)
265        return "approved";
266      if (code == ResearchStudyStatus.CLOSEDTOACCRUAL)
267        return "closed-to-accrual";
268      if (code == ResearchStudyStatus.CLOSEDTOACCRUALANDINTERVENTION)
269        return "closed-to-accrual-and-intervention";
270      if (code == ResearchStudyStatus.COMPLETED)
271        return "completed";
272      if (code == ResearchStudyStatus.DISAPPROVED)
273        return "disapproved";
274      if (code == ResearchStudyStatus.INREVIEW)
275        return "in-review";
276      if (code == ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUAL)
277        return "temporarily-closed-to-accrual";
278      if (code == ResearchStudyStatus.TEMPORARILYCLOSEDTOACCRUALANDINTERVENTION)
279        return "temporarily-closed-to-accrual-and-intervention";
280      if (code == ResearchStudyStatus.WITHDRAWN)
281        return "withdrawn";
282      return "?";
283      }
284    public String toSystem(ResearchStudyStatus code) {
285      return code.getSystem();
286      }
287    }
288
289    @Block()
290    public static class ResearchStudyArmComponent extends BackboneElement implements IBaseBackboneElement {
291        /**
292         * Unique, human-readable label for this arm of the study.
293         */
294        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
295        @Description(shortDefinition="Label for study arm", formalDefinition="Unique, human-readable label for this arm of the study." )
296        protected StringType name;
297
298        /**
299         * Categorization of study arm, e.g. experimental, active comparator, placebo comparater.
300         */
301        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
302        @Description(shortDefinition="Categorization of study arm", formalDefinition="Categorization of study arm, e.g. experimental, active comparator, placebo comparater." )
303        protected CodeableConcept type;
304
305        /**
306         * A succinct description of the path through the study that would be followed by a subject adhering to this arm.
307         */
308        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
309        @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 arm." )
310        protected StringType description;
311
312        private static final long serialVersionUID = 311445244L;
313
314    /**
315     * Constructor
316     */
317      public ResearchStudyArmComponent() {
318        super();
319      }
320
321    /**
322     * Constructor
323     */
324      public ResearchStudyArmComponent(StringType name) {
325        super();
326        this.name = name;
327      }
328
329        /**
330         * @return {@link #name} (Unique, human-readable label for this arm of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
331         */
332        public StringType getNameElement() { 
333          if (this.name == null)
334            if (Configuration.errorOnAutoCreate())
335              throw new Error("Attempt to auto-create ResearchStudyArmComponent.name");
336            else if (Configuration.doAutoCreate())
337              this.name = new StringType(); // bb
338          return this.name;
339        }
340
341        public boolean hasNameElement() { 
342          return this.name != null && !this.name.isEmpty();
343        }
344
345        public boolean hasName() { 
346          return this.name != null && !this.name.isEmpty();
347        }
348
349        /**
350         * @param value {@link #name} (Unique, human-readable label for this arm of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
351         */
352        public ResearchStudyArmComponent setNameElement(StringType value) { 
353          this.name = value;
354          return this;
355        }
356
357        /**
358         * @return Unique, human-readable label for this arm of the study.
359         */
360        public String getName() { 
361          return this.name == null ? null : this.name.getValue();
362        }
363
364        /**
365         * @param value Unique, human-readable label for this arm of the study.
366         */
367        public ResearchStudyArmComponent setName(String value) { 
368            if (this.name == null)
369              this.name = new StringType();
370            this.name.setValue(value);
371          return this;
372        }
373
374        /**
375         * @return {@link #type} (Categorization of study arm, e.g. experimental, active comparator, placebo comparater.)
376         */
377        public CodeableConcept getType() { 
378          if (this.type == null)
379            if (Configuration.errorOnAutoCreate())
380              throw new Error("Attempt to auto-create ResearchStudyArmComponent.type");
381            else if (Configuration.doAutoCreate())
382              this.type = new CodeableConcept(); // cc
383          return this.type;
384        }
385
386        public boolean hasType() { 
387          return this.type != null && !this.type.isEmpty();
388        }
389
390        /**
391         * @param value {@link #type} (Categorization of study arm, e.g. experimental, active comparator, placebo comparater.)
392         */
393        public ResearchStudyArmComponent setType(CodeableConcept value) { 
394          this.type = value;
395          return this;
396        }
397
398        /**
399         * @return {@link #description} (A succinct description of the path through the study that would be followed by a subject adhering to this arm.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
400         */
401        public StringType getDescriptionElement() { 
402          if (this.description == null)
403            if (Configuration.errorOnAutoCreate())
404              throw new Error("Attempt to auto-create ResearchStudyArmComponent.description");
405            else if (Configuration.doAutoCreate())
406              this.description = new StringType(); // bb
407          return this.description;
408        }
409
410        public boolean hasDescriptionElement() { 
411          return this.description != null && !this.description.isEmpty();
412        }
413
414        public boolean hasDescription() { 
415          return this.description != null && !this.description.isEmpty();
416        }
417
418        /**
419         * @param value {@link #description} (A succinct description of the path through the study that would be followed by a subject adhering to this arm.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
420         */
421        public ResearchStudyArmComponent setDescriptionElement(StringType value) { 
422          this.description = value;
423          return this;
424        }
425
426        /**
427         * @return A succinct description of the path through the study that would be followed by a subject adhering to this arm.
428         */
429        public String getDescription() { 
430          return this.description == null ? null : this.description.getValue();
431        }
432
433        /**
434         * @param value A succinct description of the path through the study that would be followed by a subject adhering to this arm.
435         */
436        public ResearchStudyArmComponent setDescription(String value) { 
437          if (Utilities.noString(value))
438            this.description = null;
439          else {
440            if (this.description == null)
441              this.description = new StringType();
442            this.description.setValue(value);
443          }
444          return this;
445        }
446
447        protected void listChildren(List<Property> children) {
448          super.listChildren(children);
449          children.add(new Property("name", "string", "Unique, human-readable label for this arm of the study.", 0, 1, name));
450          children.add(new Property("type", "CodeableConcept", "Categorization of study arm, e.g. experimental, active comparator, placebo comparater.", 0, 1, type));
451          children.add(new Property("description", "string", "A succinct description of the path through the study that would be followed by a subject adhering to this arm.", 0, 1, description));
452        }
453
454        @Override
455        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
456          switch (_hash) {
457          case 3373707: /*name*/  return new Property("name", "string", "Unique, human-readable label for this arm of the study.", 0, 1, name);
458          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Categorization of study arm, e.g. experimental, active comparator, placebo comparater.", 0, 1, type);
459          case -1724546052: /*description*/  return new Property("description", "string", "A succinct description of the path through the study that would be followed by a subject adhering to this arm.", 0, 1, description);
460          default: return super.getNamedProperty(_hash, _name, _checkValid);
461          }
462
463        }
464
465      @Override
466      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
467        switch (hash) {
468        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
469        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
470        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
471        default: return super.getProperty(hash, name, checkValid);
472        }
473
474      }
475
476      @Override
477      public Base setProperty(int hash, String name, Base value) throws FHIRException {
478        switch (hash) {
479        case 3373707: // name
480          this.name = castToString(value); // StringType
481          return value;
482        case 3575610: // type
483          this.type = castToCodeableConcept(value); // CodeableConcept
484          return value;
485        case -1724546052: // description
486          this.description = castToString(value); // StringType
487          return value;
488        default: return super.setProperty(hash, name, value);
489        }
490
491      }
492
493      @Override
494      public Base setProperty(String name, Base value) throws FHIRException {
495        if (name.equals("name")) {
496          this.name = castToString(value); // StringType
497        } else if (name.equals("type")) {
498          this.type = castToCodeableConcept(value); // CodeableConcept
499        } else if (name.equals("description")) {
500          this.description = castToString(value); // StringType
501        } else
502          return super.setProperty(name, value);
503        return value;
504      }
505
506      @Override
507      public Base makeProperty(int hash, String name) throws FHIRException {
508        switch (hash) {
509        case 3373707:  return getNameElement();
510        case 3575610:  return getType(); 
511        case -1724546052:  return getDescriptionElement();
512        default: return super.makeProperty(hash, name);
513        }
514
515      }
516
517      @Override
518      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
519        switch (hash) {
520        case 3373707: /*name*/ return new String[] {"string"};
521        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
522        case -1724546052: /*description*/ return new String[] {"string"};
523        default: return super.getTypesForProperty(hash, name);
524        }
525
526      }
527
528      @Override
529      public Base addChild(String name) throws FHIRException {
530        if (name.equals("name")) {
531          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.name");
532        }
533        else if (name.equals("type")) {
534          this.type = new CodeableConcept();
535          return this.type;
536        }
537        else if (name.equals("description")) {
538          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.description");
539        }
540        else
541          return super.addChild(name);
542      }
543
544      public ResearchStudyArmComponent copy() {
545        ResearchStudyArmComponent dst = new ResearchStudyArmComponent();
546        copyValues(dst);
547        dst.name = name == null ? null : name.copy();
548        dst.type = type == null ? null : type.copy();
549        dst.description = description == null ? null : description.copy();
550        return dst;
551      }
552
553      @Override
554      public boolean equalsDeep(Base other_) {
555        if (!super.equalsDeep(other_))
556          return false;
557        if (!(other_ instanceof ResearchStudyArmComponent))
558          return false;
559        ResearchStudyArmComponent o = (ResearchStudyArmComponent) other_;
560        return compareDeep(name, o.name, true) && compareDeep(type, o.type, true) && compareDeep(description, o.description, true)
561          ;
562      }
563
564      @Override
565      public boolean equalsShallow(Base other_) {
566        if (!super.equalsShallow(other_))
567          return false;
568        if (!(other_ instanceof ResearchStudyArmComponent))
569          return false;
570        ResearchStudyArmComponent o = (ResearchStudyArmComponent) other_;
571        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
572      }
573
574      public boolean isEmpty() {
575        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type, description
576          );
577      }
578
579  public String fhirType() {
580    return "ResearchStudy.arm";
581
582  }
583
584  }
585
586    @Block()
587    public static class ResearchStudyObjectiveComponent extends BackboneElement implements IBaseBackboneElement {
588        /**
589         * Unique, human-readable label for this objective of the study.
590         */
591        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
592        @Description(shortDefinition="Label for the objective", formalDefinition="Unique, human-readable label for this objective of the study." )
593        protected StringType name;
594
595        /**
596         * The kind of study objective.
597         */
598        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
599        @Description(shortDefinition="primary | secondary | exploratory", formalDefinition="The kind of study objective." )
600        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-objective-type")
601        protected CodeableConcept type;
602
603        private static final long serialVersionUID = -1935215997L;
604
605    /**
606     * Constructor
607     */
608      public ResearchStudyObjectiveComponent() {
609        super();
610      }
611
612        /**
613         * @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
614         */
615        public StringType getNameElement() { 
616          if (this.name == null)
617            if (Configuration.errorOnAutoCreate())
618              throw new Error("Attempt to auto-create ResearchStudyObjectiveComponent.name");
619            else if (Configuration.doAutoCreate())
620              this.name = new StringType(); // bb
621          return this.name;
622        }
623
624        public boolean hasNameElement() { 
625          return this.name != null && !this.name.isEmpty();
626        }
627
628        public boolean hasName() { 
629          return this.name != null && !this.name.isEmpty();
630        }
631
632        /**
633         * @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
634         */
635        public ResearchStudyObjectiveComponent setNameElement(StringType value) { 
636          this.name = value;
637          return this;
638        }
639
640        /**
641         * @return Unique, human-readable label for this objective of the study.
642         */
643        public String getName() { 
644          return this.name == null ? null : this.name.getValue();
645        }
646
647        /**
648         * @param value Unique, human-readable label for this objective of the study.
649         */
650        public ResearchStudyObjectiveComponent setName(String value) { 
651          if (Utilities.noString(value))
652            this.name = null;
653          else {
654            if (this.name == null)
655              this.name = new StringType();
656            this.name.setValue(value);
657          }
658          return this;
659        }
660
661        /**
662         * @return {@link #type} (The kind of study objective.)
663         */
664        public CodeableConcept getType() { 
665          if (this.type == null)
666            if (Configuration.errorOnAutoCreate())
667              throw new Error("Attempt to auto-create ResearchStudyObjectiveComponent.type");
668            else if (Configuration.doAutoCreate())
669              this.type = new CodeableConcept(); // cc
670          return this.type;
671        }
672
673        public boolean hasType() { 
674          return this.type != null && !this.type.isEmpty();
675        }
676
677        /**
678         * @param value {@link #type} (The kind of study objective.)
679         */
680        public ResearchStudyObjectiveComponent setType(CodeableConcept value) { 
681          this.type = value;
682          return this;
683        }
684
685        protected void listChildren(List<Property> children) {
686          super.listChildren(children);
687          children.add(new Property("name", "string", "Unique, human-readable label for this objective of the study.", 0, 1, name));
688          children.add(new Property("type", "CodeableConcept", "The kind of study objective.", 0, 1, type));
689        }
690
691        @Override
692        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
693          switch (_hash) {
694          case 3373707: /*name*/  return new Property("name", "string", "Unique, human-readable label for this objective of the study.", 0, 1, name);
695          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of study objective.", 0, 1, type);
696          default: return super.getNamedProperty(_hash, _name, _checkValid);
697          }
698
699        }
700
701      @Override
702      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
703        switch (hash) {
704        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
705        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
706        default: return super.getProperty(hash, name, checkValid);
707        }
708
709      }
710
711      @Override
712      public Base setProperty(int hash, String name, Base value) throws FHIRException {
713        switch (hash) {
714        case 3373707: // name
715          this.name = castToString(value); // StringType
716          return value;
717        case 3575610: // type
718          this.type = castToCodeableConcept(value); // CodeableConcept
719          return value;
720        default: return super.setProperty(hash, name, value);
721        }
722
723      }
724
725      @Override
726      public Base setProperty(String name, Base value) throws FHIRException {
727        if (name.equals("name")) {
728          this.name = castToString(value); // StringType
729        } else if (name.equals("type")) {
730          this.type = castToCodeableConcept(value); // CodeableConcept
731        } else
732          return super.setProperty(name, value);
733        return value;
734      }
735
736      @Override
737      public Base makeProperty(int hash, String name) throws FHIRException {
738        switch (hash) {
739        case 3373707:  return getNameElement();
740        case 3575610:  return getType(); 
741        default: return super.makeProperty(hash, name);
742        }
743
744      }
745
746      @Override
747      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
748        switch (hash) {
749        case 3373707: /*name*/ return new String[] {"string"};
750        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
751        default: return super.getTypesForProperty(hash, name);
752        }
753
754      }
755
756      @Override
757      public Base addChild(String name) throws FHIRException {
758        if (name.equals("name")) {
759          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.name");
760        }
761        else if (name.equals("type")) {
762          this.type = new CodeableConcept();
763          return this.type;
764        }
765        else
766          return super.addChild(name);
767      }
768
769      public ResearchStudyObjectiveComponent copy() {
770        ResearchStudyObjectiveComponent dst = new ResearchStudyObjectiveComponent();
771        copyValues(dst);
772        dst.name = name == null ? null : name.copy();
773        dst.type = type == null ? null : type.copy();
774        return dst;
775      }
776
777      @Override
778      public boolean equalsDeep(Base other_) {
779        if (!super.equalsDeep(other_))
780          return false;
781        if (!(other_ instanceof ResearchStudyObjectiveComponent))
782          return false;
783        ResearchStudyObjectiveComponent o = (ResearchStudyObjectiveComponent) other_;
784        return compareDeep(name, o.name, true) && compareDeep(type, o.type, true);
785      }
786
787      @Override
788      public boolean equalsShallow(Base other_) {
789        if (!super.equalsShallow(other_))
790          return false;
791        if (!(other_ instanceof ResearchStudyObjectiveComponent))
792          return false;
793        ResearchStudyObjectiveComponent o = (ResearchStudyObjectiveComponent) other_;
794        return compareValues(name, o.name, true);
795      }
796
797      public boolean isEmpty() {
798        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type);
799      }
800
801  public String fhirType() {
802    return "ResearchStudy.objective";
803
804  }
805
806  }
807
808    /**
809     * Identifiers assigned to this research study by the sponsor or other systems.
810     */
811    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
812    @Description(shortDefinition="Business Identifier for study", formalDefinition="Identifiers assigned to this research study by the sponsor or other systems." )
813    protected List<Identifier> identifier;
814
815    /**
816     * A short, descriptive user-friendly label for the study.
817     */
818    @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
819    @Description(shortDefinition="Name for this study", formalDefinition="A short, descriptive user-friendly label for the study." )
820    protected StringType title;
821
822    /**
823     * The set of steps expected to be performed as part of the execution of the study.
824     */
825    @Child(name = "protocol", type = {PlanDefinition.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
826    @Description(shortDefinition="Steps followed in executing study", formalDefinition="The set of steps expected to be performed as part of the execution of the study." )
827    protected List<Reference> protocol;
828    /**
829     * The actual objects that are the target of the reference (The set of steps expected to be performed as part of the execution of the study.)
830     */
831    protected List<PlanDefinition> protocolTarget;
832
833
834    /**
835     * A larger research study of which this particular study is a component or step.
836     */
837    @Child(name = "partOf", type = {ResearchStudy.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
838    @Description(shortDefinition="Part of larger study", formalDefinition="A larger research study of which this particular study is a component or step." )
839    protected List<Reference> partOf;
840    /**
841     * The actual objects that are the target of the reference (A larger research study of which this particular study is a component or step.)
842     */
843    protected List<ResearchStudy> partOfTarget;
844
845
846    /**
847     * The current state of the study.
848     */
849    @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true)
850    @Description(shortDefinition="active | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | in-review | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | withdrawn", formalDefinition="The current state of the study." )
851    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-status")
852    protected Enumeration<ResearchStudyStatus> status;
853
854    /**
855     * The type of study based upon the intent of the study's activities. A classification of the intent of the study.
856     */
857    @Child(name = "primaryPurposeType", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true)
858    @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's activities. A classification of the intent of the study." )
859    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-prim-purp-type")
860    protected CodeableConcept primaryPurposeType;
861
862    /**
863     * The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.
864     */
865    @Child(name = "phase", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
866    @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." )
867    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-phase")
868    protected CodeableConcept phase;
869
870    /**
871     * Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.
872     */
873    @Child(name = "category", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
874    @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." )
875    protected List<CodeableConcept> category;
876
877    /**
878     * The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.
879     */
880    @Child(name = "focus", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
881    @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." )
882    protected List<CodeableConcept> focus;
883
884    /**
885     * 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.
886     */
887    @Child(name = "condition", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
888    @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." )
889    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
890    protected List<CodeableConcept> condition;
891
892    /**
893     * Contact details to assist a user in learning more about or engaging with the study.
894     */
895    @Child(name = "contact", type = {ContactDetail.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
896    @Description(shortDefinition="Contact details for the study", formalDefinition="Contact details to assist a user in learning more about or engaging with the study." )
897    protected List<ContactDetail> contact;
898
899    /**
900     * Citations, references and other related documents.
901     */
902    @Child(name = "relatedArtifact", type = {RelatedArtifact.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
903    @Description(shortDefinition="References and dependencies", formalDefinition="Citations, references and other related documents." )
904    protected List<RelatedArtifact> relatedArtifact;
905
906    /**
907     * Key terms to aid in searching for or filtering the study.
908     */
909    @Child(name = "keyword", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
910    @Description(shortDefinition="Used to search for the study", formalDefinition="Key terms to aid in searching for or filtering the study." )
911    protected List<CodeableConcept> keyword;
912
913    /**
914     * Indicates a country, state or other region where the study is taking place.
915     */
916    @Child(name = "location", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
917    @Description(shortDefinition="Geographic region(s) for study", formalDefinition="Indicates a country, state or other region where the study is taking place." )
918    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
919    protected List<CodeableConcept> location;
920
921    /**
922     * A full description of how the study is being conducted.
923     */
924    @Child(name = "description", type = {MarkdownType.class}, order=14, min=0, max=1, modifier=false, summary=false)
925    @Description(shortDefinition="What this is study doing", formalDefinition="A full description of how the study is being conducted." )
926    protected MarkdownType description;
927
928    /**
929     * Reference to a Group that defines the criteria for and quantity of subjects participating in the study.  E.g. " 200 female Europeans between the ages of 20 and 45 with early onset diabetes".
930     */
931    @Child(name = "enrollment", type = {Group.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
932    @Description(shortDefinition="Inclusion & exclusion criteria", formalDefinition="Reference to a Group that defines the criteria for and quantity of subjects participating in the study.  E.g. \" 200 female Europeans between the ages of 20 and 45 with early onset diabetes\"." )
933    protected List<Reference> enrollment;
934    /**
935     * The actual objects that are the target of the reference (Reference to a Group that defines the criteria for and quantity of subjects participating in the study.  E.g. " 200 female Europeans between the ages of 20 and 45 with early onset diabetes".)
936     */
937    protected List<Group> enrollmentTarget;
938
939
940    /**
941     * Identifies the start date and the expected (or actual, depending on status) end date for the study.
942     */
943    @Child(name = "period", type = {Period.class}, order=16, min=0, max=1, modifier=false, summary=true)
944    @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." )
945    protected Period period;
946
947    /**
948     * An organization that initiates the investigation and is legally responsible for the study.
949     */
950    @Child(name = "sponsor", type = {Organization.class}, order=17, min=0, max=1, modifier=false, summary=true)
951    @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." )
952    protected Reference sponsor;
953
954    /**
955     * The actual object that is the target of the reference (An organization that initiates the investigation and is legally responsible for the study.)
956     */
957    protected Organization sponsorTarget;
958
959    /**
960     * 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.
961     */
962    @Child(name = "principalInvestigator", type = {Practitioner.class, PractitionerRole.class}, order=18, min=0, max=1, modifier=false, summary=true)
963    @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." )
964    protected Reference principalInvestigator;
965
966    /**
967     * The actual object that is the target of the reference (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.)
968     */
969    protected Resource principalInvestigatorTarget;
970
971    /**
972     * A facility in which study activities are conducted.
973     */
974    @Child(name = "site", type = {Location.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
975    @Description(shortDefinition="Facility where study activities are conducted", formalDefinition="A facility in which study activities are conducted." )
976    protected List<Reference> site;
977    /**
978     * The actual objects that are the target of the reference (A facility in which study activities are conducted.)
979     */
980    protected List<Location> siteTarget;
981
982
983    /**
984     * A description and/or code explaining the premature termination of the study.
985     */
986    @Child(name = "reasonStopped", type = {CodeableConcept.class}, order=20, min=0, max=1, modifier=false, summary=true)
987    @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." )
988    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-reason-stopped")
989    protected CodeableConcept reasonStopped;
990
991    /**
992     * Comments made about the study by the performer, subject or other participants.
993     */
994    @Child(name = "note", type = {Annotation.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
995    @Description(shortDefinition="Comments made about the study", formalDefinition="Comments made about the study by the performer, subject or other participants." )
996    protected List<Annotation> note;
997
998    /**
999     * 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.
1000     */
1001    @Child(name = "arm", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1002    @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." )
1003    protected List<ResearchStudyArmComponent> arm;
1004
1005    /**
1006     * 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.
1007     */
1008    @Child(name = "objective", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1009    @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." )
1010    protected List<ResearchStudyObjectiveComponent> objective;
1011
1012    private static final long serialVersionUID = -911538323L;
1013
1014  /**
1015   * Constructor
1016   */
1017    public ResearchStudy() {
1018      super();
1019    }
1020
1021  /**
1022   * Constructor
1023   */
1024    public ResearchStudy(Enumeration<ResearchStudyStatus> status) {
1025      super();
1026      this.status = status;
1027    }
1028
1029    /**
1030     * @return {@link #identifier} (Identifiers assigned to this research study by the sponsor or other systems.)
1031     */
1032    public List<Identifier> getIdentifier() { 
1033      if (this.identifier == null)
1034        this.identifier = new ArrayList<Identifier>();
1035      return this.identifier;
1036    }
1037
1038    /**
1039     * @return Returns a reference to <code>this</code> for easy method chaining
1040     */
1041    public ResearchStudy setIdentifier(List<Identifier> theIdentifier) { 
1042      this.identifier = theIdentifier;
1043      return this;
1044    }
1045
1046    public boolean hasIdentifier() { 
1047      if (this.identifier == null)
1048        return false;
1049      for (Identifier item : this.identifier)
1050        if (!item.isEmpty())
1051          return true;
1052      return false;
1053    }
1054
1055    public Identifier addIdentifier() { //3
1056      Identifier t = new Identifier();
1057      if (this.identifier == null)
1058        this.identifier = new ArrayList<Identifier>();
1059      this.identifier.add(t);
1060      return t;
1061    }
1062
1063    public ResearchStudy addIdentifier(Identifier t) { //3
1064      if (t == null)
1065        return this;
1066      if (this.identifier == null)
1067        this.identifier = new ArrayList<Identifier>();
1068      this.identifier.add(t);
1069      return this;
1070    }
1071
1072    /**
1073     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1074     */
1075    public Identifier getIdentifierFirstRep() { 
1076      if (getIdentifier().isEmpty()) {
1077        addIdentifier();
1078      }
1079      return getIdentifier().get(0);
1080    }
1081
1082    /**
1083     * @return {@link #title} (A short, descriptive user-friendly label for the study.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1084     */
1085    public StringType getTitleElement() { 
1086      if (this.title == null)
1087        if (Configuration.errorOnAutoCreate())
1088          throw new Error("Attempt to auto-create ResearchStudy.title");
1089        else if (Configuration.doAutoCreate())
1090          this.title = new StringType(); // bb
1091      return this.title;
1092    }
1093
1094    public boolean hasTitleElement() { 
1095      return this.title != null && !this.title.isEmpty();
1096    }
1097
1098    public boolean hasTitle() { 
1099      return this.title != null && !this.title.isEmpty();
1100    }
1101
1102    /**
1103     * @param value {@link #title} (A short, descriptive user-friendly label for the study.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1104     */
1105    public ResearchStudy setTitleElement(StringType value) { 
1106      this.title = value;
1107      return this;
1108    }
1109
1110    /**
1111     * @return A short, descriptive user-friendly label for the study.
1112     */
1113    public String getTitle() { 
1114      return this.title == null ? null : this.title.getValue();
1115    }
1116
1117    /**
1118     * @param value A short, descriptive user-friendly label for the study.
1119     */
1120    public ResearchStudy setTitle(String value) { 
1121      if (Utilities.noString(value))
1122        this.title = null;
1123      else {
1124        if (this.title == null)
1125          this.title = new StringType();
1126        this.title.setValue(value);
1127      }
1128      return this;
1129    }
1130
1131    /**
1132     * @return {@link #protocol} (The set of steps expected to be performed as part of the execution of the study.)
1133     */
1134    public List<Reference> getProtocol() { 
1135      if (this.protocol == null)
1136        this.protocol = new ArrayList<Reference>();
1137      return this.protocol;
1138    }
1139
1140    /**
1141     * @return Returns a reference to <code>this</code> for easy method chaining
1142     */
1143    public ResearchStudy setProtocol(List<Reference> theProtocol) { 
1144      this.protocol = theProtocol;
1145      return this;
1146    }
1147
1148    public boolean hasProtocol() { 
1149      if (this.protocol == null)
1150        return false;
1151      for (Reference item : this.protocol)
1152        if (!item.isEmpty())
1153          return true;
1154      return false;
1155    }
1156
1157    public Reference addProtocol() { //3
1158      Reference t = new Reference();
1159      if (this.protocol == null)
1160        this.protocol = new ArrayList<Reference>();
1161      this.protocol.add(t);
1162      return t;
1163    }
1164
1165    public ResearchStudy addProtocol(Reference t) { //3
1166      if (t == null)
1167        return this;
1168      if (this.protocol == null)
1169        this.protocol = new ArrayList<Reference>();
1170      this.protocol.add(t);
1171      return this;
1172    }
1173
1174    /**
1175     * @return The first repetition of repeating field {@link #protocol}, creating it if it does not already exist
1176     */
1177    public Reference getProtocolFirstRep() { 
1178      if (getProtocol().isEmpty()) {
1179        addProtocol();
1180      }
1181      return getProtocol().get(0);
1182    }
1183
1184    /**
1185     * @deprecated Use Reference#setResource(IBaseResource) instead
1186     */
1187    @Deprecated
1188    public List<PlanDefinition> getProtocolTarget() { 
1189      if (this.protocolTarget == null)
1190        this.protocolTarget = new ArrayList<PlanDefinition>();
1191      return this.protocolTarget;
1192    }
1193
1194    /**
1195     * @deprecated Use Reference#setResource(IBaseResource) instead
1196     */
1197    @Deprecated
1198    public PlanDefinition addProtocolTarget() { 
1199      PlanDefinition r = new PlanDefinition();
1200      if (this.protocolTarget == null)
1201        this.protocolTarget = new ArrayList<PlanDefinition>();
1202      this.protocolTarget.add(r);
1203      return r;
1204    }
1205
1206    /**
1207     * @return {@link #partOf} (A larger research study of which this particular study is a component or step.)
1208     */
1209    public List<Reference> getPartOf() { 
1210      if (this.partOf == null)
1211        this.partOf = new ArrayList<Reference>();
1212      return this.partOf;
1213    }
1214
1215    /**
1216     * @return Returns a reference to <code>this</code> for easy method chaining
1217     */
1218    public ResearchStudy setPartOf(List<Reference> thePartOf) { 
1219      this.partOf = thePartOf;
1220      return this;
1221    }
1222
1223    public boolean hasPartOf() { 
1224      if (this.partOf == null)
1225        return false;
1226      for (Reference item : this.partOf)
1227        if (!item.isEmpty())
1228          return true;
1229      return false;
1230    }
1231
1232    public Reference addPartOf() { //3
1233      Reference t = new Reference();
1234      if (this.partOf == null)
1235        this.partOf = new ArrayList<Reference>();
1236      this.partOf.add(t);
1237      return t;
1238    }
1239
1240    public ResearchStudy addPartOf(Reference t) { //3
1241      if (t == null)
1242        return this;
1243      if (this.partOf == null)
1244        this.partOf = new ArrayList<Reference>();
1245      this.partOf.add(t);
1246      return this;
1247    }
1248
1249    /**
1250     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist
1251     */
1252    public Reference getPartOfFirstRep() { 
1253      if (getPartOf().isEmpty()) {
1254        addPartOf();
1255      }
1256      return getPartOf().get(0);
1257    }
1258
1259    /**
1260     * @deprecated Use Reference#setResource(IBaseResource) instead
1261     */
1262    @Deprecated
1263    public List<ResearchStudy> getPartOfTarget() { 
1264      if (this.partOfTarget == null)
1265        this.partOfTarget = new ArrayList<ResearchStudy>();
1266      return this.partOfTarget;
1267    }
1268
1269    /**
1270     * @deprecated Use Reference#setResource(IBaseResource) instead
1271     */
1272    @Deprecated
1273    public ResearchStudy addPartOfTarget() { 
1274      ResearchStudy r = new ResearchStudy();
1275      if (this.partOfTarget == null)
1276        this.partOfTarget = new ArrayList<ResearchStudy>();
1277      this.partOfTarget.add(r);
1278      return r;
1279    }
1280
1281    /**
1282     * @return {@link #status} (The current state of the study.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1283     */
1284    public Enumeration<ResearchStudyStatus> getStatusElement() { 
1285      if (this.status == null)
1286        if (Configuration.errorOnAutoCreate())
1287          throw new Error("Attempt to auto-create ResearchStudy.status");
1288        else if (Configuration.doAutoCreate())
1289          this.status = new Enumeration<ResearchStudyStatus>(new ResearchStudyStatusEnumFactory()); // bb
1290      return this.status;
1291    }
1292
1293    public boolean hasStatusElement() { 
1294      return this.status != null && !this.status.isEmpty();
1295    }
1296
1297    public boolean hasStatus() { 
1298      return this.status != null && !this.status.isEmpty();
1299    }
1300
1301    /**
1302     * @param value {@link #status} (The current state of the study.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1303     */
1304    public ResearchStudy setStatusElement(Enumeration<ResearchStudyStatus> value) { 
1305      this.status = value;
1306      return this;
1307    }
1308
1309    /**
1310     * @return The current state of the study.
1311     */
1312    public ResearchStudyStatus getStatus() { 
1313      return this.status == null ? null : this.status.getValue();
1314    }
1315
1316    /**
1317     * @param value The current state of the study.
1318     */
1319    public ResearchStudy setStatus(ResearchStudyStatus value) { 
1320        if (this.status == null)
1321          this.status = new Enumeration<ResearchStudyStatus>(new ResearchStudyStatusEnumFactory());
1322        this.status.setValue(value);
1323      return this;
1324    }
1325
1326    /**
1327     * @return {@link #primaryPurposeType} (The type of study based upon the intent of the study's activities. A classification of the intent of the study.)
1328     */
1329    public CodeableConcept getPrimaryPurposeType() { 
1330      if (this.primaryPurposeType == null)
1331        if (Configuration.errorOnAutoCreate())
1332          throw new Error("Attempt to auto-create ResearchStudy.primaryPurposeType");
1333        else if (Configuration.doAutoCreate())
1334          this.primaryPurposeType = new CodeableConcept(); // cc
1335      return this.primaryPurposeType;
1336    }
1337
1338    public boolean hasPrimaryPurposeType() { 
1339      return this.primaryPurposeType != null && !this.primaryPurposeType.isEmpty();
1340    }
1341
1342    /**
1343     * @param value {@link #primaryPurposeType} (The type of study based upon the intent of the study's activities. A classification of the intent of the study.)
1344     */
1345    public ResearchStudy setPrimaryPurposeType(CodeableConcept value) { 
1346      this.primaryPurposeType = value;
1347      return this;
1348    }
1349
1350    /**
1351     * @return {@link #phase} (The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.)
1352     */
1353    public CodeableConcept getPhase() { 
1354      if (this.phase == null)
1355        if (Configuration.errorOnAutoCreate())
1356          throw new Error("Attempt to auto-create ResearchStudy.phase");
1357        else if (Configuration.doAutoCreate())
1358          this.phase = new CodeableConcept(); // cc
1359      return this.phase;
1360    }
1361
1362    public boolean hasPhase() { 
1363      return this.phase != null && !this.phase.isEmpty();
1364    }
1365
1366    /**
1367     * @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.)
1368     */
1369    public ResearchStudy setPhase(CodeableConcept value) { 
1370      this.phase = value;
1371      return this;
1372    }
1373
1374    /**
1375     * @return {@link #category} (Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.)
1376     */
1377    public List<CodeableConcept> getCategory() { 
1378      if (this.category == null)
1379        this.category = new ArrayList<CodeableConcept>();
1380      return this.category;
1381    }
1382
1383    /**
1384     * @return Returns a reference to <code>this</code> for easy method chaining
1385     */
1386    public ResearchStudy setCategory(List<CodeableConcept> theCategory) { 
1387      this.category = theCategory;
1388      return this;
1389    }
1390
1391    public boolean hasCategory() { 
1392      if (this.category == null)
1393        return false;
1394      for (CodeableConcept item : this.category)
1395        if (!item.isEmpty())
1396          return true;
1397      return false;
1398    }
1399
1400    public CodeableConcept addCategory() { //3
1401      CodeableConcept t = new CodeableConcept();
1402      if (this.category == null)
1403        this.category = new ArrayList<CodeableConcept>();
1404      this.category.add(t);
1405      return t;
1406    }
1407
1408    public ResearchStudy addCategory(CodeableConcept t) { //3
1409      if (t == null)
1410        return this;
1411      if (this.category == null)
1412        this.category = new ArrayList<CodeableConcept>();
1413      this.category.add(t);
1414      return this;
1415    }
1416
1417    /**
1418     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist
1419     */
1420    public CodeableConcept getCategoryFirstRep() { 
1421      if (getCategory().isEmpty()) {
1422        addCategory();
1423      }
1424      return getCategory().get(0);
1425    }
1426
1427    /**
1428     * @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.)
1429     */
1430    public List<CodeableConcept> getFocus() { 
1431      if (this.focus == null)
1432        this.focus = new ArrayList<CodeableConcept>();
1433      return this.focus;
1434    }
1435
1436    /**
1437     * @return Returns a reference to <code>this</code> for easy method chaining
1438     */
1439    public ResearchStudy setFocus(List<CodeableConcept> theFocus) { 
1440      this.focus = theFocus;
1441      return this;
1442    }
1443
1444    public boolean hasFocus() { 
1445      if (this.focus == null)
1446        return false;
1447      for (CodeableConcept item : this.focus)
1448        if (!item.isEmpty())
1449          return true;
1450      return false;
1451    }
1452
1453    public CodeableConcept addFocus() { //3
1454      CodeableConcept t = new CodeableConcept();
1455      if (this.focus == null)
1456        this.focus = new ArrayList<CodeableConcept>();
1457      this.focus.add(t);
1458      return t;
1459    }
1460
1461    public ResearchStudy addFocus(CodeableConcept t) { //3
1462      if (t == null)
1463        return this;
1464      if (this.focus == null)
1465        this.focus = new ArrayList<CodeableConcept>();
1466      this.focus.add(t);
1467      return this;
1468    }
1469
1470    /**
1471     * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist
1472     */
1473    public CodeableConcept getFocusFirstRep() { 
1474      if (getFocus().isEmpty()) {
1475        addFocus();
1476      }
1477      return getFocus().get(0);
1478    }
1479
1480    /**
1481     * @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.)
1482     */
1483    public List<CodeableConcept> getCondition() { 
1484      if (this.condition == null)
1485        this.condition = new ArrayList<CodeableConcept>();
1486      return this.condition;
1487    }
1488
1489    /**
1490     * @return Returns a reference to <code>this</code> for easy method chaining
1491     */
1492    public ResearchStudy setCondition(List<CodeableConcept> theCondition) { 
1493      this.condition = theCondition;
1494      return this;
1495    }
1496
1497    public boolean hasCondition() { 
1498      if (this.condition == null)
1499        return false;
1500      for (CodeableConcept item : this.condition)
1501        if (!item.isEmpty())
1502          return true;
1503      return false;
1504    }
1505
1506    public CodeableConcept addCondition() { //3
1507      CodeableConcept t = new CodeableConcept();
1508      if (this.condition == null)
1509        this.condition = new ArrayList<CodeableConcept>();
1510      this.condition.add(t);
1511      return t;
1512    }
1513
1514    public ResearchStudy addCondition(CodeableConcept t) { //3
1515      if (t == null)
1516        return this;
1517      if (this.condition == null)
1518        this.condition = new ArrayList<CodeableConcept>();
1519      this.condition.add(t);
1520      return this;
1521    }
1522
1523    /**
1524     * @return The first repetition of repeating field {@link #condition}, creating it if it does not already exist
1525     */
1526    public CodeableConcept getConditionFirstRep() { 
1527      if (getCondition().isEmpty()) {
1528        addCondition();
1529      }
1530      return getCondition().get(0);
1531    }
1532
1533    /**
1534     * @return {@link #contact} (Contact details to assist a user in learning more about or engaging with the study.)
1535     */
1536    public List<ContactDetail> getContact() { 
1537      if (this.contact == null)
1538        this.contact = new ArrayList<ContactDetail>();
1539      return this.contact;
1540    }
1541
1542    /**
1543     * @return Returns a reference to <code>this</code> for easy method chaining
1544     */
1545    public ResearchStudy setContact(List<ContactDetail> theContact) { 
1546      this.contact = theContact;
1547      return this;
1548    }
1549
1550    public boolean hasContact() { 
1551      if (this.contact == null)
1552        return false;
1553      for (ContactDetail item : this.contact)
1554        if (!item.isEmpty())
1555          return true;
1556      return false;
1557    }
1558
1559    public ContactDetail addContact() { //3
1560      ContactDetail t = new ContactDetail();
1561      if (this.contact == null)
1562        this.contact = new ArrayList<ContactDetail>();
1563      this.contact.add(t);
1564      return t;
1565    }
1566
1567    public ResearchStudy addContact(ContactDetail t) { //3
1568      if (t == null)
1569        return this;
1570      if (this.contact == null)
1571        this.contact = new ArrayList<ContactDetail>();
1572      this.contact.add(t);
1573      return this;
1574    }
1575
1576    /**
1577     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
1578     */
1579    public ContactDetail getContactFirstRep() { 
1580      if (getContact().isEmpty()) {
1581        addContact();
1582      }
1583      return getContact().get(0);
1584    }
1585
1586    /**
1587     * @return {@link #relatedArtifact} (Citations, references and other related documents.)
1588     */
1589    public List<RelatedArtifact> getRelatedArtifact() { 
1590      if (this.relatedArtifact == null)
1591        this.relatedArtifact = new ArrayList<RelatedArtifact>();
1592      return this.relatedArtifact;
1593    }
1594
1595    /**
1596     * @return Returns a reference to <code>this</code> for easy method chaining
1597     */
1598    public ResearchStudy setRelatedArtifact(List<RelatedArtifact> theRelatedArtifact) { 
1599      this.relatedArtifact = theRelatedArtifact;
1600      return this;
1601    }
1602
1603    public boolean hasRelatedArtifact() { 
1604      if (this.relatedArtifact == null)
1605        return false;
1606      for (RelatedArtifact item : this.relatedArtifact)
1607        if (!item.isEmpty())
1608          return true;
1609      return false;
1610    }
1611
1612    public RelatedArtifact addRelatedArtifact() { //3
1613      RelatedArtifact t = new RelatedArtifact();
1614      if (this.relatedArtifact == null)
1615        this.relatedArtifact = new ArrayList<RelatedArtifact>();
1616      this.relatedArtifact.add(t);
1617      return t;
1618    }
1619
1620    public ResearchStudy addRelatedArtifact(RelatedArtifact t) { //3
1621      if (t == null)
1622        return this;
1623      if (this.relatedArtifact == null)
1624        this.relatedArtifact = new ArrayList<RelatedArtifact>();
1625      this.relatedArtifact.add(t);
1626      return this;
1627    }
1628
1629    /**
1630     * @return The first repetition of repeating field {@link #relatedArtifact}, creating it if it does not already exist
1631     */
1632    public RelatedArtifact getRelatedArtifactFirstRep() { 
1633      if (getRelatedArtifact().isEmpty()) {
1634        addRelatedArtifact();
1635      }
1636      return getRelatedArtifact().get(0);
1637    }
1638
1639    /**
1640     * @return {@link #keyword} (Key terms to aid in searching for or filtering the study.)
1641     */
1642    public List<CodeableConcept> getKeyword() { 
1643      if (this.keyword == null)
1644        this.keyword = new ArrayList<CodeableConcept>();
1645      return this.keyword;
1646    }
1647
1648    /**
1649     * @return Returns a reference to <code>this</code> for easy method chaining
1650     */
1651    public ResearchStudy setKeyword(List<CodeableConcept> theKeyword) { 
1652      this.keyword = theKeyword;
1653      return this;
1654    }
1655
1656    public boolean hasKeyword() { 
1657      if (this.keyword == null)
1658        return false;
1659      for (CodeableConcept item : this.keyword)
1660        if (!item.isEmpty())
1661          return true;
1662      return false;
1663    }
1664
1665    public CodeableConcept addKeyword() { //3
1666      CodeableConcept t = new CodeableConcept();
1667      if (this.keyword == null)
1668        this.keyword = new ArrayList<CodeableConcept>();
1669      this.keyword.add(t);
1670      return t;
1671    }
1672
1673    public ResearchStudy addKeyword(CodeableConcept t) { //3
1674      if (t == null)
1675        return this;
1676      if (this.keyword == null)
1677        this.keyword = new ArrayList<CodeableConcept>();
1678      this.keyword.add(t);
1679      return this;
1680    }
1681
1682    /**
1683     * @return The first repetition of repeating field {@link #keyword}, creating it if it does not already exist
1684     */
1685    public CodeableConcept getKeywordFirstRep() { 
1686      if (getKeyword().isEmpty()) {
1687        addKeyword();
1688      }
1689      return getKeyword().get(0);
1690    }
1691
1692    /**
1693     * @return {@link #location} (Indicates a country, state or other region where the study is taking place.)
1694     */
1695    public List<CodeableConcept> getLocation() { 
1696      if (this.location == null)
1697        this.location = new ArrayList<CodeableConcept>();
1698      return this.location;
1699    }
1700
1701    /**
1702     * @return Returns a reference to <code>this</code> for easy method chaining
1703     */
1704    public ResearchStudy setLocation(List<CodeableConcept> theLocation) { 
1705      this.location = theLocation;
1706      return this;
1707    }
1708
1709    public boolean hasLocation() { 
1710      if (this.location == null)
1711        return false;
1712      for (CodeableConcept item : this.location)
1713        if (!item.isEmpty())
1714          return true;
1715      return false;
1716    }
1717
1718    public CodeableConcept addLocation() { //3
1719      CodeableConcept t = new CodeableConcept();
1720      if (this.location == null)
1721        this.location = new ArrayList<CodeableConcept>();
1722      this.location.add(t);
1723      return t;
1724    }
1725
1726    public ResearchStudy addLocation(CodeableConcept t) { //3
1727      if (t == null)
1728        return this;
1729      if (this.location == null)
1730        this.location = new ArrayList<CodeableConcept>();
1731      this.location.add(t);
1732      return this;
1733    }
1734
1735    /**
1736     * @return The first repetition of repeating field {@link #location}, creating it if it does not already exist
1737     */
1738    public CodeableConcept getLocationFirstRep() { 
1739      if (getLocation().isEmpty()) {
1740        addLocation();
1741      }
1742      return getLocation().get(0);
1743    }
1744
1745    /**
1746     * @return {@link #description} (A full description of how the study is being conducted.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1747     */
1748    public MarkdownType getDescriptionElement() { 
1749      if (this.description == null)
1750        if (Configuration.errorOnAutoCreate())
1751          throw new Error("Attempt to auto-create ResearchStudy.description");
1752        else if (Configuration.doAutoCreate())
1753          this.description = new MarkdownType(); // bb
1754      return this.description;
1755    }
1756
1757    public boolean hasDescriptionElement() { 
1758      return this.description != null && !this.description.isEmpty();
1759    }
1760
1761    public boolean hasDescription() { 
1762      return this.description != null && !this.description.isEmpty();
1763    }
1764
1765    /**
1766     * @param value {@link #description} (A full description of how the study is being conducted.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1767     */
1768    public ResearchStudy setDescriptionElement(MarkdownType value) { 
1769      this.description = value;
1770      return this;
1771    }
1772
1773    /**
1774     * @return A full description of how the study is being conducted.
1775     */
1776    public String getDescription() { 
1777      return this.description == null ? null : this.description.getValue();
1778    }
1779
1780    /**
1781     * @param value A full description of how the study is being conducted.
1782     */
1783    public ResearchStudy setDescription(String value) { 
1784      if (value == null)
1785        this.description = null;
1786      else {
1787        if (this.description == null)
1788          this.description = new MarkdownType();
1789        this.description.setValue(value);
1790      }
1791      return this;
1792    }
1793
1794    /**
1795     * @return {@link #enrollment} (Reference to a Group that defines the criteria for and quantity of subjects participating in the study.  E.g. " 200 female Europeans between the ages of 20 and 45 with early onset diabetes".)
1796     */
1797    public List<Reference> getEnrollment() { 
1798      if (this.enrollment == null)
1799        this.enrollment = new ArrayList<Reference>();
1800      return this.enrollment;
1801    }
1802
1803    /**
1804     * @return Returns a reference to <code>this</code> for easy method chaining
1805     */
1806    public ResearchStudy setEnrollment(List<Reference> theEnrollment) { 
1807      this.enrollment = theEnrollment;
1808      return this;
1809    }
1810
1811    public boolean hasEnrollment() { 
1812      if (this.enrollment == null)
1813        return false;
1814      for (Reference item : this.enrollment)
1815        if (!item.isEmpty())
1816          return true;
1817      return false;
1818    }
1819
1820    public Reference addEnrollment() { //3
1821      Reference t = new Reference();
1822      if (this.enrollment == null)
1823        this.enrollment = new ArrayList<Reference>();
1824      this.enrollment.add(t);
1825      return t;
1826    }
1827
1828    public ResearchStudy addEnrollment(Reference t) { //3
1829      if (t == null)
1830        return this;
1831      if (this.enrollment == null)
1832        this.enrollment = new ArrayList<Reference>();
1833      this.enrollment.add(t);
1834      return this;
1835    }
1836
1837    /**
1838     * @return The first repetition of repeating field {@link #enrollment}, creating it if it does not already exist
1839     */
1840    public Reference getEnrollmentFirstRep() { 
1841      if (getEnrollment().isEmpty()) {
1842        addEnrollment();
1843      }
1844      return getEnrollment().get(0);
1845    }
1846
1847    /**
1848     * @deprecated Use Reference#setResource(IBaseResource) instead
1849     */
1850    @Deprecated
1851    public List<Group> getEnrollmentTarget() { 
1852      if (this.enrollmentTarget == null)
1853        this.enrollmentTarget = new ArrayList<Group>();
1854      return this.enrollmentTarget;
1855    }
1856
1857    /**
1858     * @deprecated Use Reference#setResource(IBaseResource) instead
1859     */
1860    @Deprecated
1861    public Group addEnrollmentTarget() { 
1862      Group r = new Group();
1863      if (this.enrollmentTarget == null)
1864        this.enrollmentTarget = new ArrayList<Group>();
1865      this.enrollmentTarget.add(r);
1866      return r;
1867    }
1868
1869    /**
1870     * @return {@link #period} (Identifies the start date and the expected (or actual, depending on status) end date for the study.)
1871     */
1872    public Period getPeriod() { 
1873      if (this.period == null)
1874        if (Configuration.errorOnAutoCreate())
1875          throw new Error("Attempt to auto-create ResearchStudy.period");
1876        else if (Configuration.doAutoCreate())
1877          this.period = new Period(); // cc
1878      return this.period;
1879    }
1880
1881    public boolean hasPeriod() { 
1882      return this.period != null && !this.period.isEmpty();
1883    }
1884
1885    /**
1886     * @param value {@link #period} (Identifies the start date and the expected (or actual, depending on status) end date for the study.)
1887     */
1888    public ResearchStudy setPeriod(Period value) { 
1889      this.period = value;
1890      return this;
1891    }
1892
1893    /**
1894     * @return {@link #sponsor} (An organization that initiates the investigation and is legally responsible for the study.)
1895     */
1896    public Reference getSponsor() { 
1897      if (this.sponsor == null)
1898        if (Configuration.errorOnAutoCreate())
1899          throw new Error("Attempt to auto-create ResearchStudy.sponsor");
1900        else if (Configuration.doAutoCreate())
1901          this.sponsor = new Reference(); // cc
1902      return this.sponsor;
1903    }
1904
1905    public boolean hasSponsor() { 
1906      return this.sponsor != null && !this.sponsor.isEmpty();
1907    }
1908
1909    /**
1910     * @param value {@link #sponsor} (An organization that initiates the investigation and is legally responsible for the study.)
1911     */
1912    public ResearchStudy setSponsor(Reference value) { 
1913      this.sponsor = value;
1914      return this;
1915    }
1916
1917    /**
1918     * @return {@link #sponsor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An organization that initiates the investigation and is legally responsible for the study.)
1919     */
1920    public Organization getSponsorTarget() { 
1921      if (this.sponsorTarget == null)
1922        if (Configuration.errorOnAutoCreate())
1923          throw new Error("Attempt to auto-create ResearchStudy.sponsor");
1924        else if (Configuration.doAutoCreate())
1925          this.sponsorTarget = new Organization(); // aa
1926      return this.sponsorTarget;
1927    }
1928
1929    /**
1930     * @param value {@link #sponsor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An organization that initiates the investigation and is legally responsible for the study.)
1931     */
1932    public ResearchStudy setSponsorTarget(Organization value) { 
1933      this.sponsorTarget = value;
1934      return this;
1935    }
1936
1937    /**
1938     * @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.)
1939     */
1940    public Reference getPrincipalInvestigator() { 
1941      if (this.principalInvestigator == null)
1942        if (Configuration.errorOnAutoCreate())
1943          throw new Error("Attempt to auto-create ResearchStudy.principalInvestigator");
1944        else if (Configuration.doAutoCreate())
1945          this.principalInvestigator = new Reference(); // cc
1946      return this.principalInvestigator;
1947    }
1948
1949    public boolean hasPrincipalInvestigator() { 
1950      return this.principalInvestigator != null && !this.principalInvestigator.isEmpty();
1951    }
1952
1953    /**
1954     * @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.)
1955     */
1956    public ResearchStudy setPrincipalInvestigator(Reference value) { 
1957      this.principalInvestigator = value;
1958      return this;
1959    }
1960
1961    /**
1962     * @return {@link #principalInvestigator} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A 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.)
1963     */
1964    public Resource getPrincipalInvestigatorTarget() { 
1965      return this.principalInvestigatorTarget;
1966    }
1967
1968    /**
1969     * @param value {@link #principalInvestigator} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A 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.)
1970     */
1971    public ResearchStudy setPrincipalInvestigatorTarget(Resource value) { 
1972      this.principalInvestigatorTarget = value;
1973      return this;
1974    }
1975
1976    /**
1977     * @return {@link #site} (A facility in which study activities are conducted.)
1978     */
1979    public List<Reference> getSite() { 
1980      if (this.site == null)
1981        this.site = new ArrayList<Reference>();
1982      return this.site;
1983    }
1984
1985    /**
1986     * @return Returns a reference to <code>this</code> for easy method chaining
1987     */
1988    public ResearchStudy setSite(List<Reference> theSite) { 
1989      this.site = theSite;
1990      return this;
1991    }
1992
1993    public boolean hasSite() { 
1994      if (this.site == null)
1995        return false;
1996      for (Reference item : this.site)
1997        if (!item.isEmpty())
1998          return true;
1999      return false;
2000    }
2001
2002    public Reference addSite() { //3
2003      Reference t = new Reference();
2004      if (this.site == null)
2005        this.site = new ArrayList<Reference>();
2006      this.site.add(t);
2007      return t;
2008    }
2009
2010    public ResearchStudy addSite(Reference t) { //3
2011      if (t == null)
2012        return this;
2013      if (this.site == null)
2014        this.site = new ArrayList<Reference>();
2015      this.site.add(t);
2016      return this;
2017    }
2018
2019    /**
2020     * @return The first repetition of repeating field {@link #site}, creating it if it does not already exist
2021     */
2022    public Reference getSiteFirstRep() { 
2023      if (getSite().isEmpty()) {
2024        addSite();
2025      }
2026      return getSite().get(0);
2027    }
2028
2029    /**
2030     * @deprecated Use Reference#setResource(IBaseResource) instead
2031     */
2032    @Deprecated
2033    public List<Location> getSiteTarget() { 
2034      if (this.siteTarget == null)
2035        this.siteTarget = new ArrayList<Location>();
2036      return this.siteTarget;
2037    }
2038
2039    /**
2040     * @deprecated Use Reference#setResource(IBaseResource) instead
2041     */
2042    @Deprecated
2043    public Location addSiteTarget() { 
2044      Location r = new Location();
2045      if (this.siteTarget == null)
2046        this.siteTarget = new ArrayList<Location>();
2047      this.siteTarget.add(r);
2048      return r;
2049    }
2050
2051    /**
2052     * @return {@link #reasonStopped} (A description and/or code explaining the premature termination of the study.)
2053     */
2054    public CodeableConcept getReasonStopped() { 
2055      if (this.reasonStopped == null)
2056        if (Configuration.errorOnAutoCreate())
2057          throw new Error("Attempt to auto-create ResearchStudy.reasonStopped");
2058        else if (Configuration.doAutoCreate())
2059          this.reasonStopped = new CodeableConcept(); // cc
2060      return this.reasonStopped;
2061    }
2062
2063    public boolean hasReasonStopped() { 
2064      return this.reasonStopped != null && !this.reasonStopped.isEmpty();
2065    }
2066
2067    /**
2068     * @param value {@link #reasonStopped} (A description and/or code explaining the premature termination of the study.)
2069     */
2070    public ResearchStudy setReasonStopped(CodeableConcept value) { 
2071      this.reasonStopped = value;
2072      return this;
2073    }
2074
2075    /**
2076     * @return {@link #note} (Comments made about the study by the performer, subject or other participants.)
2077     */
2078    public List<Annotation> getNote() { 
2079      if (this.note == null)
2080        this.note = new ArrayList<Annotation>();
2081      return this.note;
2082    }
2083
2084    /**
2085     * @return Returns a reference to <code>this</code> for easy method chaining
2086     */
2087    public ResearchStudy setNote(List<Annotation> theNote) { 
2088      this.note = theNote;
2089      return this;
2090    }
2091
2092    public boolean hasNote() { 
2093      if (this.note == null)
2094        return false;
2095      for (Annotation item : this.note)
2096        if (!item.isEmpty())
2097          return true;
2098      return false;
2099    }
2100
2101    public Annotation addNote() { //3
2102      Annotation t = new Annotation();
2103      if (this.note == null)
2104        this.note = new ArrayList<Annotation>();
2105      this.note.add(t);
2106      return t;
2107    }
2108
2109    public ResearchStudy addNote(Annotation t) { //3
2110      if (t == null)
2111        return this;
2112      if (this.note == null)
2113        this.note = new ArrayList<Annotation>();
2114      this.note.add(t);
2115      return this;
2116    }
2117
2118    /**
2119     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
2120     */
2121    public Annotation getNoteFirstRep() { 
2122      if (getNote().isEmpty()) {
2123        addNote();
2124      }
2125      return getNote().get(0);
2126    }
2127
2128    /**
2129     * @return {@link #arm} (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.)
2130     */
2131    public List<ResearchStudyArmComponent> getArm() { 
2132      if (this.arm == null)
2133        this.arm = new ArrayList<ResearchStudyArmComponent>();
2134      return this.arm;
2135    }
2136
2137    /**
2138     * @return Returns a reference to <code>this</code> for easy method chaining
2139     */
2140    public ResearchStudy setArm(List<ResearchStudyArmComponent> theArm) { 
2141      this.arm = theArm;
2142      return this;
2143    }
2144
2145    public boolean hasArm() { 
2146      if (this.arm == null)
2147        return false;
2148      for (ResearchStudyArmComponent item : this.arm)
2149        if (!item.isEmpty())
2150          return true;
2151      return false;
2152    }
2153
2154    public ResearchStudyArmComponent addArm() { //3
2155      ResearchStudyArmComponent t = new ResearchStudyArmComponent();
2156      if (this.arm == null)
2157        this.arm = new ArrayList<ResearchStudyArmComponent>();
2158      this.arm.add(t);
2159      return t;
2160    }
2161
2162    public ResearchStudy addArm(ResearchStudyArmComponent t) { //3
2163      if (t == null)
2164        return this;
2165      if (this.arm == null)
2166        this.arm = new ArrayList<ResearchStudyArmComponent>();
2167      this.arm.add(t);
2168      return this;
2169    }
2170
2171    /**
2172     * @return The first repetition of repeating field {@link #arm}, creating it if it does not already exist
2173     */
2174    public ResearchStudyArmComponent getArmFirstRep() { 
2175      if (getArm().isEmpty()) {
2176        addArm();
2177      }
2178      return getArm().get(0);
2179    }
2180
2181    /**
2182     * @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.)
2183     */
2184    public List<ResearchStudyObjectiveComponent> getObjective() { 
2185      if (this.objective == null)
2186        this.objective = new ArrayList<ResearchStudyObjectiveComponent>();
2187      return this.objective;
2188    }
2189
2190    /**
2191     * @return Returns a reference to <code>this</code> for easy method chaining
2192     */
2193    public ResearchStudy setObjective(List<ResearchStudyObjectiveComponent> theObjective) { 
2194      this.objective = theObjective;
2195      return this;
2196    }
2197
2198    public boolean hasObjective() { 
2199      if (this.objective == null)
2200        return false;
2201      for (ResearchStudyObjectiveComponent item : this.objective)
2202        if (!item.isEmpty())
2203          return true;
2204      return false;
2205    }
2206
2207    public ResearchStudyObjectiveComponent addObjective() { //3
2208      ResearchStudyObjectiveComponent t = new ResearchStudyObjectiveComponent();
2209      if (this.objective == null)
2210        this.objective = new ArrayList<ResearchStudyObjectiveComponent>();
2211      this.objective.add(t);
2212      return t;
2213    }
2214
2215    public ResearchStudy addObjective(ResearchStudyObjectiveComponent t) { //3
2216      if (t == null)
2217        return this;
2218      if (this.objective == null)
2219        this.objective = new ArrayList<ResearchStudyObjectiveComponent>();
2220      this.objective.add(t);
2221      return this;
2222    }
2223
2224    /**
2225     * @return The first repetition of repeating field {@link #objective}, creating it if it does not already exist
2226     */
2227    public ResearchStudyObjectiveComponent getObjectiveFirstRep() { 
2228      if (getObjective().isEmpty()) {
2229        addObjective();
2230      }
2231      return getObjective().get(0);
2232    }
2233
2234      protected void listChildren(List<Property> children) {
2235        super.listChildren(children);
2236        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));
2237        children.add(new Property("title", "string", "A short, descriptive user-friendly label for the study.", 0, 1, title));
2238        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));
2239        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));
2240        children.add(new Property("status", "code", "The current state of the study.", 0, 1, status));
2241        children.add(new Property("primaryPurposeType", "CodeableConcept", "The type of study based upon the intent of the study's activities. A classification of the intent of the study.", 0, 1, primaryPurposeType));
2242        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));
2243        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));
2244        children.add(new Property("focus", "CodeableConcept", "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));
2245        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));
2246        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));
2247        children.add(new Property("relatedArtifact", "RelatedArtifact", "Citations, references and other related documents.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact));
2248        children.add(new Property("keyword", "CodeableConcept", "Key terms to aid in searching for or filtering the study.", 0, java.lang.Integer.MAX_VALUE, keyword));
2249        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));
2250        children.add(new Property("description", "markdown", "A full description of how the study is being conducted.", 0, 1, description));
2251        children.add(new Property("enrollment", "Reference(Group)", "Reference to a Group that defines the criteria for and quantity of subjects participating in the study.  E.g. \" 200 female Europeans between the ages of 20 and 45 with early onset diabetes\".", 0, java.lang.Integer.MAX_VALUE, enrollment));
2252        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));
2253        children.add(new Property("sponsor", "Reference(Organization)", "An organization that initiates the investigation and is legally responsible for the study.", 0, 1, sponsor));
2254        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));
2255        children.add(new Property("site", "Reference(Location)", "A facility in which study activities are conducted.", 0, java.lang.Integer.MAX_VALUE, site));
2256        children.add(new Property("reasonStopped", "CodeableConcept", "A description and/or code explaining the premature termination of the study.", 0, 1, reasonStopped));
2257        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));
2258        children.add(new Property("arm", "", "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, arm));
2259        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));
2260      }
2261
2262      @Override
2263      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2264        switch (_hash) {
2265        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);
2266        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive user-friendly label for the study.", 0, 1, title);
2267        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);
2268        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);
2269        case -892481550: /*status*/  return new Property("status", "code", "The current state of the study.", 0, 1, status);
2270        case -2132842986: /*primaryPurposeType*/  return new Property("primaryPurposeType", "CodeableConcept", "The type of study based upon the intent of the study's activities. A classification of the intent of the study.", 0, 1, primaryPurposeType);
2271        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);
2272        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);
2273        case 97604824: /*focus*/  return new Property("focus", "CodeableConcept", "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);
2274        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);
2275        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);
2276        case 666807069: /*relatedArtifact*/  return new Property("relatedArtifact", "RelatedArtifact", "Citations, references and other related documents.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact);
2277        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);
2278        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);
2279        case -1724546052: /*description*/  return new Property("description", "markdown", "A full description of how the study is being conducted.", 0, 1, description);
2280        case 116089604: /*enrollment*/  return new Property("enrollment", "Reference(Group)", "Reference to a Group that defines the criteria for and quantity of subjects participating in the study.  E.g. \" 200 female Europeans between the ages of 20 and 45 with early onset diabetes\".", 0, java.lang.Integer.MAX_VALUE, enrollment);
2281        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);
2282        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);
2283        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);
2284        case 3530567: /*site*/  return new Property("site", "Reference(Location)", "A facility in which study activities are conducted.", 0, java.lang.Integer.MAX_VALUE, site);
2285        case 1181369065: /*reasonStopped*/  return new Property("reasonStopped", "CodeableConcept", "A description and/or code explaining the premature termination of the study.", 0, 1, reasonStopped);
2286        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);
2287        case 96860: /*arm*/  return new Property("arm", "", "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, arm);
2288        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);
2289        default: return super.getNamedProperty(_hash, _name, _checkValid);
2290        }
2291
2292      }
2293
2294      @Override
2295      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2296        switch (hash) {
2297        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2298        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
2299        case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : this.protocol.toArray(new Base[this.protocol.size()]); // Reference
2300        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
2301        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ResearchStudyStatus>
2302        case -2132842986: /*primaryPurposeType*/ return this.primaryPurposeType == null ? new Base[0] : new Base[] {this.primaryPurposeType}; // CodeableConcept
2303        case 106629499: /*phase*/ return this.phase == null ? new Base[0] : new Base[] {this.phase}; // CodeableConcept
2304        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2305        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // CodeableConcept
2306        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // CodeableConcept
2307        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
2308        case 666807069: /*relatedArtifact*/ return this.relatedArtifact == null ? new Base[0] : this.relatedArtifact.toArray(new Base[this.relatedArtifact.size()]); // RelatedArtifact
2309        case -814408215: /*keyword*/ return this.keyword == null ? new Base[0] : this.keyword.toArray(new Base[this.keyword.size()]); // CodeableConcept
2310        case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // CodeableConcept
2311        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2312        case 116089604: /*enrollment*/ return this.enrollment == null ? new Base[0] : this.enrollment.toArray(new Base[this.enrollment.size()]); // Reference
2313        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
2314        case -1998892262: /*sponsor*/ return this.sponsor == null ? new Base[0] : new Base[] {this.sponsor}; // Reference
2315        case 1437117175: /*principalInvestigator*/ return this.principalInvestigator == null ? new Base[0] : new Base[] {this.principalInvestigator}; // Reference
2316        case 3530567: /*site*/ return this.site == null ? new Base[0] : this.site.toArray(new Base[this.site.size()]); // Reference
2317        case 1181369065: /*reasonStopped*/ return this.reasonStopped == null ? new Base[0] : new Base[] {this.reasonStopped}; // CodeableConcept
2318        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2319        case 96860: /*arm*/ return this.arm == null ? new Base[0] : this.arm.toArray(new Base[this.arm.size()]); // ResearchStudyArmComponent
2320        case -1489585863: /*objective*/ return this.objective == null ? new Base[0] : this.objective.toArray(new Base[this.objective.size()]); // ResearchStudyObjectiveComponent
2321        default: return super.getProperty(hash, name, checkValid);
2322        }
2323
2324      }
2325
2326      @Override
2327      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2328        switch (hash) {
2329        case -1618432855: // identifier
2330          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2331          return value;
2332        case 110371416: // title
2333          this.title = castToString(value); // StringType
2334          return value;
2335        case -989163880: // protocol
2336          this.getProtocol().add(castToReference(value)); // Reference
2337          return value;
2338        case -995410646: // partOf
2339          this.getPartOf().add(castToReference(value)); // Reference
2340          return value;
2341        case -892481550: // status
2342          value = new ResearchStudyStatusEnumFactory().fromType(castToCode(value));
2343          this.status = (Enumeration) value; // Enumeration<ResearchStudyStatus>
2344          return value;
2345        case -2132842986: // primaryPurposeType
2346          this.primaryPurposeType = castToCodeableConcept(value); // CodeableConcept
2347          return value;
2348        case 106629499: // phase
2349          this.phase = castToCodeableConcept(value); // CodeableConcept
2350          return value;
2351        case 50511102: // category
2352          this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
2353          return value;
2354        case 97604824: // focus
2355          this.getFocus().add(castToCodeableConcept(value)); // CodeableConcept
2356          return value;
2357        case -861311717: // condition
2358          this.getCondition().add(castToCodeableConcept(value)); // CodeableConcept
2359          return value;
2360        case 951526432: // contact
2361          this.getContact().add(castToContactDetail(value)); // ContactDetail
2362          return value;
2363        case 666807069: // relatedArtifact
2364          this.getRelatedArtifact().add(castToRelatedArtifact(value)); // RelatedArtifact
2365          return value;
2366        case -814408215: // keyword
2367          this.getKeyword().add(castToCodeableConcept(value)); // CodeableConcept
2368          return value;
2369        case 1901043637: // location
2370          this.getLocation().add(castToCodeableConcept(value)); // CodeableConcept
2371          return value;
2372        case -1724546052: // description
2373          this.description = castToMarkdown(value); // MarkdownType
2374          return value;
2375        case 116089604: // enrollment
2376          this.getEnrollment().add(castToReference(value)); // Reference
2377          return value;
2378        case -991726143: // period
2379          this.period = castToPeriod(value); // Period
2380          return value;
2381        case -1998892262: // sponsor
2382          this.sponsor = castToReference(value); // Reference
2383          return value;
2384        case 1437117175: // principalInvestigator
2385          this.principalInvestigator = castToReference(value); // Reference
2386          return value;
2387        case 3530567: // site
2388          this.getSite().add(castToReference(value)); // Reference
2389          return value;
2390        case 1181369065: // reasonStopped
2391          this.reasonStopped = castToCodeableConcept(value); // CodeableConcept
2392          return value;
2393        case 3387378: // note
2394          this.getNote().add(castToAnnotation(value)); // Annotation
2395          return value;
2396        case 96860: // arm
2397          this.getArm().add((ResearchStudyArmComponent) value); // ResearchStudyArmComponent
2398          return value;
2399        case -1489585863: // objective
2400          this.getObjective().add((ResearchStudyObjectiveComponent) value); // ResearchStudyObjectiveComponent
2401          return value;
2402        default: return super.setProperty(hash, name, value);
2403        }
2404
2405      }
2406
2407      @Override
2408      public Base setProperty(String name, Base value) throws FHIRException {
2409        if (name.equals("identifier")) {
2410          this.getIdentifier().add(castToIdentifier(value));
2411        } else if (name.equals("title")) {
2412          this.title = castToString(value); // StringType
2413        } else if (name.equals("protocol")) {
2414          this.getProtocol().add(castToReference(value));
2415        } else if (name.equals("partOf")) {
2416          this.getPartOf().add(castToReference(value));
2417        } else if (name.equals("status")) {
2418          value = new ResearchStudyStatusEnumFactory().fromType(castToCode(value));
2419          this.status = (Enumeration) value; // Enumeration<ResearchStudyStatus>
2420        } else if (name.equals("primaryPurposeType")) {
2421          this.primaryPurposeType = castToCodeableConcept(value); // CodeableConcept
2422        } else if (name.equals("phase")) {
2423          this.phase = castToCodeableConcept(value); // CodeableConcept
2424        } else if (name.equals("category")) {
2425          this.getCategory().add(castToCodeableConcept(value));
2426        } else if (name.equals("focus")) {
2427          this.getFocus().add(castToCodeableConcept(value));
2428        } else if (name.equals("condition")) {
2429          this.getCondition().add(castToCodeableConcept(value));
2430        } else if (name.equals("contact")) {
2431          this.getContact().add(castToContactDetail(value));
2432        } else if (name.equals("relatedArtifact")) {
2433          this.getRelatedArtifact().add(castToRelatedArtifact(value));
2434        } else if (name.equals("keyword")) {
2435          this.getKeyword().add(castToCodeableConcept(value));
2436        } else if (name.equals("location")) {
2437          this.getLocation().add(castToCodeableConcept(value));
2438        } else if (name.equals("description")) {
2439          this.description = castToMarkdown(value); // MarkdownType
2440        } else if (name.equals("enrollment")) {
2441          this.getEnrollment().add(castToReference(value));
2442        } else if (name.equals("period")) {
2443          this.period = castToPeriod(value); // Period
2444        } else if (name.equals("sponsor")) {
2445          this.sponsor = castToReference(value); // Reference
2446        } else if (name.equals("principalInvestigator")) {
2447          this.principalInvestigator = castToReference(value); // Reference
2448        } else if (name.equals("site")) {
2449          this.getSite().add(castToReference(value));
2450        } else if (name.equals("reasonStopped")) {
2451          this.reasonStopped = castToCodeableConcept(value); // CodeableConcept
2452        } else if (name.equals("note")) {
2453          this.getNote().add(castToAnnotation(value));
2454        } else if (name.equals("arm")) {
2455          this.getArm().add((ResearchStudyArmComponent) value);
2456        } else if (name.equals("objective")) {
2457          this.getObjective().add((ResearchStudyObjectiveComponent) value);
2458        } else
2459          return super.setProperty(name, value);
2460        return value;
2461      }
2462
2463      @Override
2464      public Base makeProperty(int hash, String name) throws FHIRException {
2465        switch (hash) {
2466        case -1618432855:  return addIdentifier(); 
2467        case 110371416:  return getTitleElement();
2468        case -989163880:  return addProtocol(); 
2469        case -995410646:  return addPartOf(); 
2470        case -892481550:  return getStatusElement();
2471        case -2132842986:  return getPrimaryPurposeType(); 
2472        case 106629499:  return getPhase(); 
2473        case 50511102:  return addCategory(); 
2474        case 97604824:  return addFocus(); 
2475        case -861311717:  return addCondition(); 
2476        case 951526432:  return addContact(); 
2477        case 666807069:  return addRelatedArtifact(); 
2478        case -814408215:  return addKeyword(); 
2479        case 1901043637:  return addLocation(); 
2480        case -1724546052:  return getDescriptionElement();
2481        case 116089604:  return addEnrollment(); 
2482        case -991726143:  return getPeriod(); 
2483        case -1998892262:  return getSponsor(); 
2484        case 1437117175:  return getPrincipalInvestigator(); 
2485        case 3530567:  return addSite(); 
2486        case 1181369065:  return getReasonStopped(); 
2487        case 3387378:  return addNote(); 
2488        case 96860:  return addArm(); 
2489        case -1489585863:  return addObjective(); 
2490        default: return super.makeProperty(hash, name);
2491        }
2492
2493      }
2494
2495      @Override
2496      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2497        switch (hash) {
2498        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2499        case 110371416: /*title*/ return new String[] {"string"};
2500        case -989163880: /*protocol*/ return new String[] {"Reference"};
2501        case -995410646: /*partOf*/ return new String[] {"Reference"};
2502        case -892481550: /*status*/ return new String[] {"code"};
2503        case -2132842986: /*primaryPurposeType*/ return new String[] {"CodeableConcept"};
2504        case 106629499: /*phase*/ return new String[] {"CodeableConcept"};
2505        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2506        case 97604824: /*focus*/ return new String[] {"CodeableConcept"};
2507        case -861311717: /*condition*/ return new String[] {"CodeableConcept"};
2508        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
2509        case 666807069: /*relatedArtifact*/ return new String[] {"RelatedArtifact"};
2510        case -814408215: /*keyword*/ return new String[] {"CodeableConcept"};
2511        case 1901043637: /*location*/ return new String[] {"CodeableConcept"};
2512        case -1724546052: /*description*/ return new String[] {"markdown"};
2513        case 116089604: /*enrollment*/ return new String[] {"Reference"};
2514        case -991726143: /*period*/ return new String[] {"Period"};
2515        case -1998892262: /*sponsor*/ return new String[] {"Reference"};
2516        case 1437117175: /*principalInvestigator*/ return new String[] {"Reference"};
2517        case 3530567: /*site*/ return new String[] {"Reference"};
2518        case 1181369065: /*reasonStopped*/ return new String[] {"CodeableConcept"};
2519        case 3387378: /*note*/ return new String[] {"Annotation"};
2520        case 96860: /*arm*/ return new String[] {};
2521        case -1489585863: /*objective*/ return new String[] {};
2522        default: return super.getTypesForProperty(hash, name);
2523        }
2524
2525      }
2526
2527      @Override
2528      public Base addChild(String name) throws FHIRException {
2529        if (name.equals("identifier")) {
2530          return addIdentifier();
2531        }
2532        else if (name.equals("title")) {
2533          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.title");
2534        }
2535        else if (name.equals("protocol")) {
2536          return addProtocol();
2537        }
2538        else if (name.equals("partOf")) {
2539          return addPartOf();
2540        }
2541        else if (name.equals("status")) {
2542          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.status");
2543        }
2544        else if (name.equals("primaryPurposeType")) {
2545          this.primaryPurposeType = new CodeableConcept();
2546          return this.primaryPurposeType;
2547        }
2548        else if (name.equals("phase")) {
2549          this.phase = new CodeableConcept();
2550          return this.phase;
2551        }
2552        else if (name.equals("category")) {
2553          return addCategory();
2554        }
2555        else if (name.equals("focus")) {
2556          return addFocus();
2557        }
2558        else if (name.equals("condition")) {
2559          return addCondition();
2560        }
2561        else if (name.equals("contact")) {
2562          return addContact();
2563        }
2564        else if (name.equals("relatedArtifact")) {
2565          return addRelatedArtifact();
2566        }
2567        else if (name.equals("keyword")) {
2568          return addKeyword();
2569        }
2570        else if (name.equals("location")) {
2571          return addLocation();
2572        }
2573        else if (name.equals("description")) {
2574          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.description");
2575        }
2576        else if (name.equals("enrollment")) {
2577          return addEnrollment();
2578        }
2579        else if (name.equals("period")) {
2580          this.period = new Period();
2581          return this.period;
2582        }
2583        else if (name.equals("sponsor")) {
2584          this.sponsor = new Reference();
2585          return this.sponsor;
2586        }
2587        else if (name.equals("principalInvestigator")) {
2588          this.principalInvestigator = new Reference();
2589          return this.principalInvestigator;
2590        }
2591        else if (name.equals("site")) {
2592          return addSite();
2593        }
2594        else if (name.equals("reasonStopped")) {
2595          this.reasonStopped = new CodeableConcept();
2596          return this.reasonStopped;
2597        }
2598        else if (name.equals("note")) {
2599          return addNote();
2600        }
2601        else if (name.equals("arm")) {
2602          return addArm();
2603        }
2604        else if (name.equals("objective")) {
2605          return addObjective();
2606        }
2607        else
2608          return super.addChild(name);
2609      }
2610
2611  public String fhirType() {
2612    return "ResearchStudy";
2613
2614  }
2615
2616      public ResearchStudy copy() {
2617        ResearchStudy dst = new ResearchStudy();
2618        copyValues(dst);
2619        if (identifier != null) {
2620          dst.identifier = new ArrayList<Identifier>();
2621          for (Identifier i : identifier)
2622            dst.identifier.add(i.copy());
2623        };
2624        dst.title = title == null ? null : title.copy();
2625        if (protocol != null) {
2626          dst.protocol = new ArrayList<Reference>();
2627          for (Reference i : protocol)
2628            dst.protocol.add(i.copy());
2629        };
2630        if (partOf != null) {
2631          dst.partOf = new ArrayList<Reference>();
2632          for (Reference i : partOf)
2633            dst.partOf.add(i.copy());
2634        };
2635        dst.status = status == null ? null : status.copy();
2636        dst.primaryPurposeType = primaryPurposeType == null ? null : primaryPurposeType.copy();
2637        dst.phase = phase == null ? null : phase.copy();
2638        if (category != null) {
2639          dst.category = new ArrayList<CodeableConcept>();
2640          for (CodeableConcept i : category)
2641            dst.category.add(i.copy());
2642        };
2643        if (focus != null) {
2644          dst.focus = new ArrayList<CodeableConcept>();
2645          for (CodeableConcept i : focus)
2646            dst.focus.add(i.copy());
2647        };
2648        if (condition != null) {
2649          dst.condition = new ArrayList<CodeableConcept>();
2650          for (CodeableConcept i : condition)
2651            dst.condition.add(i.copy());
2652        };
2653        if (contact != null) {
2654          dst.contact = new ArrayList<ContactDetail>();
2655          for (ContactDetail i : contact)
2656            dst.contact.add(i.copy());
2657        };
2658        if (relatedArtifact != null) {
2659          dst.relatedArtifact = new ArrayList<RelatedArtifact>();
2660          for (RelatedArtifact i : relatedArtifact)
2661            dst.relatedArtifact.add(i.copy());
2662        };
2663        if (keyword != null) {
2664          dst.keyword = new ArrayList<CodeableConcept>();
2665          for (CodeableConcept i : keyword)
2666            dst.keyword.add(i.copy());
2667        };
2668        if (location != null) {
2669          dst.location = new ArrayList<CodeableConcept>();
2670          for (CodeableConcept i : location)
2671            dst.location.add(i.copy());
2672        };
2673        dst.description = description == null ? null : description.copy();
2674        if (enrollment != null) {
2675          dst.enrollment = new ArrayList<Reference>();
2676          for (Reference i : enrollment)
2677            dst.enrollment.add(i.copy());
2678        };
2679        dst.period = period == null ? null : period.copy();
2680        dst.sponsor = sponsor == null ? null : sponsor.copy();
2681        dst.principalInvestigator = principalInvestigator == null ? null : principalInvestigator.copy();
2682        if (site != null) {
2683          dst.site = new ArrayList<Reference>();
2684          for (Reference i : site)
2685            dst.site.add(i.copy());
2686        };
2687        dst.reasonStopped = reasonStopped == null ? null : reasonStopped.copy();
2688        if (note != null) {
2689          dst.note = new ArrayList<Annotation>();
2690          for (Annotation i : note)
2691            dst.note.add(i.copy());
2692        };
2693        if (arm != null) {
2694          dst.arm = new ArrayList<ResearchStudyArmComponent>();
2695          for (ResearchStudyArmComponent i : arm)
2696            dst.arm.add(i.copy());
2697        };
2698        if (objective != null) {
2699          dst.objective = new ArrayList<ResearchStudyObjectiveComponent>();
2700          for (ResearchStudyObjectiveComponent i : objective)
2701            dst.objective.add(i.copy());
2702        };
2703        return dst;
2704      }
2705
2706      protected ResearchStudy typedCopy() {
2707        return copy();
2708      }
2709
2710      @Override
2711      public boolean equalsDeep(Base other_) {
2712        if (!super.equalsDeep(other_))
2713          return false;
2714        if (!(other_ instanceof ResearchStudy))
2715          return false;
2716        ResearchStudy o = (ResearchStudy) other_;
2717        return compareDeep(identifier, o.identifier, true) && compareDeep(title, o.title, true) && compareDeep(protocol, o.protocol, true)
2718           && compareDeep(partOf, o.partOf, true) && compareDeep(status, o.status, true) && compareDeep(primaryPurposeType, o.primaryPurposeType, true)
2719           && compareDeep(phase, o.phase, true) && compareDeep(category, o.category, true) && compareDeep(focus, o.focus, true)
2720           && compareDeep(condition, o.condition, true) && compareDeep(contact, o.contact, true) && compareDeep(relatedArtifact, o.relatedArtifact, true)
2721           && compareDeep(keyword, o.keyword, true) && compareDeep(location, o.location, true) && compareDeep(description, o.description, true)
2722           && compareDeep(enrollment, o.enrollment, true) && compareDeep(period, o.period, true) && compareDeep(sponsor, o.sponsor, true)
2723           && compareDeep(principalInvestigator, o.principalInvestigator, true) && compareDeep(site, o.site, true)
2724           && compareDeep(reasonStopped, o.reasonStopped, true) && compareDeep(note, o.note, true) && compareDeep(arm, o.arm, true)
2725           && compareDeep(objective, o.objective, true);
2726      }
2727
2728      @Override
2729      public boolean equalsShallow(Base other_) {
2730        if (!super.equalsShallow(other_))
2731          return false;
2732        if (!(other_ instanceof ResearchStudy))
2733          return false;
2734        ResearchStudy o = (ResearchStudy) other_;
2735        return compareValues(title, o.title, true) && compareValues(status, o.status, true) && compareValues(description, o.description, true)
2736          ;
2737      }
2738
2739      public boolean isEmpty() {
2740        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, title, protocol
2741          , partOf, status, primaryPurposeType, phase, category, focus, condition, contact
2742          , relatedArtifact, keyword, location, description, enrollment, period, sponsor
2743          , principalInvestigator, site, reasonStopped, note, arm, objective);
2744      }
2745
2746  @Override
2747  public ResourceType getResourceType() {
2748    return ResourceType.ResearchStudy;
2749   }
2750
2751 /**
2752   * Search parameter: <b>date</b>
2753   * <p>
2754   * Description: <b>When the study began and ended</b><br>
2755   * Type: <b>date</b><br>
2756   * Path: <b>ResearchStudy.period</b><br>
2757   * </p>
2758   */
2759  @SearchParamDefinition(name="date", path="ResearchStudy.period", description="When the study began and ended", type="date" )
2760  public static final String SP_DATE = "date";
2761 /**
2762   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2763   * <p>
2764   * Description: <b>When the study began and ended</b><br>
2765   * Type: <b>date</b><br>
2766   * Path: <b>ResearchStudy.period</b><br>
2767   * </p>
2768   */
2769  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2770
2771 /**
2772   * Search parameter: <b>identifier</b>
2773   * <p>
2774   * Description: <b>Business Identifier for study</b><br>
2775   * Type: <b>token</b><br>
2776   * Path: <b>ResearchStudy.identifier</b><br>
2777   * </p>
2778   */
2779  @SearchParamDefinition(name="identifier", path="ResearchStudy.identifier", description="Business Identifier for study", type="token" )
2780  public static final String SP_IDENTIFIER = "identifier";
2781 /**
2782   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2783   * <p>
2784   * Description: <b>Business Identifier for study</b><br>
2785   * Type: <b>token</b><br>
2786   * Path: <b>ResearchStudy.identifier</b><br>
2787   * </p>
2788   */
2789  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2790
2791 /**
2792   * Search parameter: <b>partof</b>
2793   * <p>
2794   * Description: <b>Part of larger study</b><br>
2795   * Type: <b>reference</b><br>
2796   * Path: <b>ResearchStudy.partOf</b><br>
2797   * </p>
2798   */
2799  @SearchParamDefinition(name="partof", path="ResearchStudy.partOf", description="Part of larger study", type="reference", target={ResearchStudy.class } )
2800  public static final String SP_PARTOF = "partof";
2801 /**
2802   * <b>Fluent Client</b> search parameter constant for <b>partof</b>
2803   * <p>
2804   * Description: <b>Part of larger study</b><br>
2805   * Type: <b>reference</b><br>
2806   * Path: <b>ResearchStudy.partOf</b><br>
2807   * </p>
2808   */
2809  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTOF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTOF);
2810
2811/**
2812   * Constant for fluent queries to be used to add include statements. Specifies
2813   * the path value of "<b>ResearchStudy:partof</b>".
2814   */
2815  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include("ResearchStudy:partof").toLocked();
2816
2817 /**
2818   * Search parameter: <b>sponsor</b>
2819   * <p>
2820   * Description: <b>Organization that initiates and is legally responsible for the study</b><br>
2821   * Type: <b>reference</b><br>
2822   * Path: <b>ResearchStudy.sponsor</b><br>
2823   * </p>
2824   */
2825  @SearchParamDefinition(name="sponsor", path="ResearchStudy.sponsor", description="Organization that initiates and is legally responsible for the study", type="reference", target={Organization.class } )
2826  public static final String SP_SPONSOR = "sponsor";
2827 /**
2828   * <b>Fluent Client</b> search parameter constant for <b>sponsor</b>
2829   * <p>
2830   * Description: <b>Organization that initiates and is legally responsible for the study</b><br>
2831   * Type: <b>reference</b><br>
2832   * Path: <b>ResearchStudy.sponsor</b><br>
2833   * </p>
2834   */
2835  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPONSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPONSOR);
2836
2837/**
2838   * Constant for fluent queries to be used to add include statements. Specifies
2839   * the path value of "<b>ResearchStudy:sponsor</b>".
2840   */
2841  public static final ca.uhn.fhir.model.api.Include INCLUDE_SPONSOR = new ca.uhn.fhir.model.api.Include("ResearchStudy:sponsor").toLocked();
2842
2843 /**
2844   * Search parameter: <b>focus</b>
2845   * <p>
2846   * Description: <b>Drugs, devices, etc. under study</b><br>
2847   * Type: <b>token</b><br>
2848   * Path: <b>ResearchStudy.focus</b><br>
2849   * </p>
2850   */
2851  @SearchParamDefinition(name="focus", path="ResearchStudy.focus", description="Drugs, devices, etc. under study", type="token" )
2852  public static final String SP_FOCUS = "focus";
2853 /**
2854   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
2855   * <p>
2856   * Description: <b>Drugs, devices, etc. under study</b><br>
2857   * Type: <b>token</b><br>
2858   * Path: <b>ResearchStudy.focus</b><br>
2859   * </p>
2860   */
2861  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FOCUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FOCUS);
2862
2863 /**
2864   * Search parameter: <b>principalinvestigator</b>
2865   * <p>
2866   * Description: <b>Researcher who oversees multiple aspects of the study</b><br>
2867   * Type: <b>reference</b><br>
2868   * Path: <b>ResearchStudy.principalInvestigator</b><br>
2869   * </p>
2870   */
2871  @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="Practitioner") }, target={Practitioner.class, PractitionerRole.class } )
2872  public static final String SP_PRINCIPALINVESTIGATOR = "principalinvestigator";
2873 /**
2874   * <b>Fluent Client</b> search parameter constant for <b>principalinvestigator</b>
2875   * <p>
2876   * Description: <b>Researcher who oversees multiple aspects of the study</b><br>
2877   * Type: <b>reference</b><br>
2878   * Path: <b>ResearchStudy.principalInvestigator</b><br>
2879   * </p>
2880   */
2881  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRINCIPALINVESTIGATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRINCIPALINVESTIGATOR);
2882
2883/**
2884   * Constant for fluent queries to be used to add include statements. Specifies
2885   * the path value of "<b>ResearchStudy:principalinvestigator</b>".
2886   */
2887  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRINCIPALINVESTIGATOR = new ca.uhn.fhir.model.api.Include("ResearchStudy:principalinvestigator").toLocked();
2888
2889 /**
2890   * Search parameter: <b>title</b>
2891   * <p>
2892   * Description: <b>Name for this study</b><br>
2893   * Type: <b>string</b><br>
2894   * Path: <b>ResearchStudy.title</b><br>
2895   * </p>
2896   */
2897  @SearchParamDefinition(name="title", path="ResearchStudy.title", description="Name for this study", type="string" )
2898  public static final String SP_TITLE = "title";
2899 /**
2900   * <b>Fluent Client</b> search parameter constant for <b>title</b>
2901   * <p>
2902   * Description: <b>Name for this study</b><br>
2903   * Type: <b>string</b><br>
2904   * Path: <b>ResearchStudy.title</b><br>
2905   * </p>
2906   */
2907  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
2908
2909 /**
2910   * Search parameter: <b>protocol</b>
2911   * <p>
2912   * Description: <b>Steps followed in executing study</b><br>
2913   * Type: <b>reference</b><br>
2914   * Path: <b>ResearchStudy.protocol</b><br>
2915   * </p>
2916   */
2917  @SearchParamDefinition(name="protocol", path="ResearchStudy.protocol", description="Steps followed in executing study", type="reference", target={PlanDefinition.class } )
2918  public static final String SP_PROTOCOL = "protocol";
2919 /**
2920   * <b>Fluent Client</b> search parameter constant for <b>protocol</b>
2921   * <p>
2922   * Description: <b>Steps followed in executing study</b><br>
2923   * Type: <b>reference</b><br>
2924   * Path: <b>ResearchStudy.protocol</b><br>
2925   * </p>
2926   */
2927  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROTOCOL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROTOCOL);
2928
2929/**
2930   * Constant for fluent queries to be used to add include statements. Specifies
2931   * the path value of "<b>ResearchStudy:protocol</b>".
2932   */
2933  public static final ca.uhn.fhir.model.api.Include INCLUDE_PROTOCOL = new ca.uhn.fhir.model.api.Include("ResearchStudy:protocol").toLocked();
2934
2935 /**
2936   * Search parameter: <b>site</b>
2937   * <p>
2938   * Description: <b>Facility where study activities are conducted</b><br>
2939   * Type: <b>reference</b><br>
2940   * Path: <b>ResearchStudy.site</b><br>
2941   * </p>
2942   */
2943  @SearchParamDefinition(name="site", path="ResearchStudy.site", description="Facility where study activities are conducted", type="reference", target={Location.class } )
2944  public static final String SP_SITE = "site";
2945 /**
2946   * <b>Fluent Client</b> search parameter constant for <b>site</b>
2947   * <p>
2948   * Description: <b>Facility where study activities are conducted</b><br>
2949   * Type: <b>reference</b><br>
2950   * Path: <b>ResearchStudy.site</b><br>
2951   * </p>
2952   */
2953  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SITE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SITE);
2954
2955/**
2956   * Constant for fluent queries to be used to add include statements. Specifies
2957   * the path value of "<b>ResearchStudy:site</b>".
2958   */
2959  public static final ca.uhn.fhir.model.api.Include INCLUDE_SITE = new ca.uhn.fhir.model.api.Include("ResearchStudy:site").toLocked();
2960
2961 /**
2962   * Search parameter: <b>location</b>
2963   * <p>
2964   * Description: <b>Geographic region(s) for study</b><br>
2965   * Type: <b>token</b><br>
2966   * Path: <b>ResearchStudy.location</b><br>
2967   * </p>
2968   */
2969  @SearchParamDefinition(name="location", path="ResearchStudy.location", description="Geographic region(s) for study", type="token" )
2970  public static final String SP_LOCATION = "location";
2971 /**
2972   * <b>Fluent Client</b> search parameter constant for <b>location</b>
2973   * <p>
2974   * Description: <b>Geographic region(s) for study</b><br>
2975   * Type: <b>token</b><br>
2976   * Path: <b>ResearchStudy.location</b><br>
2977   * </p>
2978   */
2979  public static final ca.uhn.fhir.rest.gclient.TokenClientParam LOCATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LOCATION);
2980
2981 /**
2982   * Search parameter: <b>category</b>
2983   * <p>
2984   * Description: <b>Classifications for the study</b><br>
2985   * Type: <b>token</b><br>
2986   * Path: <b>ResearchStudy.category</b><br>
2987   * </p>
2988   */
2989  @SearchParamDefinition(name="category", path="ResearchStudy.category", description="Classifications for the study", type="token" )
2990  public static final String SP_CATEGORY = "category";
2991 /**
2992   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2993   * <p>
2994   * Description: <b>Classifications for the study</b><br>
2995   * Type: <b>token</b><br>
2996   * Path: <b>ResearchStudy.category</b><br>
2997   * </p>
2998   */
2999  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
3000
3001 /**
3002   * Search parameter: <b>keyword</b>
3003   * <p>
3004   * Description: <b>Used to search for the study</b><br>
3005   * Type: <b>token</b><br>
3006   * Path: <b>ResearchStudy.keyword</b><br>
3007   * </p>
3008   */
3009  @SearchParamDefinition(name="keyword", path="ResearchStudy.keyword", description="Used to search for the study", type="token" )
3010  public static final String SP_KEYWORD = "keyword";
3011 /**
3012   * <b>Fluent Client</b> search parameter constant for <b>keyword</b>
3013   * <p>
3014   * Description: <b>Used to search for the study</b><br>
3015   * Type: <b>token</b><br>
3016   * Path: <b>ResearchStudy.keyword</b><br>
3017   * </p>
3018   */
3019  public static final ca.uhn.fhir.rest.gclient.TokenClientParam KEYWORD = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KEYWORD);
3020
3021 /**
3022   * Search parameter: <b>status</b>
3023   * <p>
3024   * Description: <b>active | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | in-review | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | withdrawn</b><br>
3025   * Type: <b>token</b><br>
3026   * Path: <b>ResearchStudy.status</b><br>
3027   * </p>
3028   */
3029  @SearchParamDefinition(name="status", path="ResearchStudy.status", description="active | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | in-review | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | withdrawn", type="token" )
3030  public static final String SP_STATUS = "status";
3031 /**
3032   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3033   * <p>
3034   * Description: <b>active | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | in-review | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | withdrawn</b><br>
3035   * Type: <b>token</b><br>
3036   * Path: <b>ResearchStudy.status</b><br>
3037   * </p>
3038   */
3039  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3040
3041
3042}
3043