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