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