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