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