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