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