001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 13, 2022 17:53+1100 for FHIR vcurrent
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A scientific study of nature that sometimes includes processes involved in health and disease. For example, clinical trials are research studies that involve people. These studies may be related to new ways to screen, prevent, diagnose, and treat disease. They may also study certain outcomes and certain groups of people by looking at data collected in the past or future.
052 */
053@ResourceDef(name="ResearchStudy", profile="http://hl7.org/fhir/StructureDefinition/ResearchStudy")
054public class ResearchStudy extends DomainResource {
055
056    @Block()
057    public static class ResearchStudyLabelComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * Kind of name.
060         */
061        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
062        @Description(shortDefinition="primary | official | scientific | plain-language | subtitle | short-title | acronym | earlier-title | language | auto-translated | human-use | machine-use | duplicate-uid", formalDefinition="Kind of name." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/title-type")
064        protected CodeableConcept type;
065
066        /**
067         * The name.
068         */
069        @Child(name = "value", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
070        @Description(shortDefinition="The name", formalDefinition="The name." )
071        protected StringType value;
072
073        private static final long serialVersionUID = 944223389L;
074
075    /**
076     * Constructor
077     */
078      public ResearchStudyLabelComponent() {
079        super();
080      }
081
082        /**
083         * @return {@link #type} (Kind of name.)
084         */
085        public CodeableConcept getType() { 
086          if (this.type == null)
087            if (Configuration.errorOnAutoCreate())
088              throw new Error("Attempt to auto-create ResearchStudyLabelComponent.type");
089            else if (Configuration.doAutoCreate())
090              this.type = new CodeableConcept(); // cc
091          return this.type;
092        }
093
094        public boolean hasType() { 
095          return this.type != null && !this.type.isEmpty();
096        }
097
098        /**
099         * @param value {@link #type} (Kind of name.)
100         */
101        public ResearchStudyLabelComponent setType(CodeableConcept value) { 
102          this.type = value;
103          return this;
104        }
105
106        /**
107         * @return {@link #value} (The name.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
108         */
109        public StringType getValueElement() { 
110          if (this.value == null)
111            if (Configuration.errorOnAutoCreate())
112              throw new Error("Attempt to auto-create ResearchStudyLabelComponent.value");
113            else if (Configuration.doAutoCreate())
114              this.value = new StringType(); // bb
115          return this.value;
116        }
117
118        public boolean hasValueElement() { 
119          return this.value != null && !this.value.isEmpty();
120        }
121
122        public boolean hasValue() { 
123          return this.value != null && !this.value.isEmpty();
124        }
125
126        /**
127         * @param value {@link #value} (The name.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
128         */
129        public ResearchStudyLabelComponent setValueElement(StringType value) { 
130          this.value = value;
131          return this;
132        }
133
134        /**
135         * @return The name.
136         */
137        public String getValue() { 
138          return this.value == null ? null : this.value.getValue();
139        }
140
141        /**
142         * @param value The name.
143         */
144        public ResearchStudyLabelComponent setValue(String value) { 
145          if (Utilities.noString(value))
146            this.value = null;
147          else {
148            if (this.value == null)
149              this.value = new StringType();
150            this.value.setValue(value);
151          }
152          return this;
153        }
154
155        protected void listChildren(List<Property> children) {
156          super.listChildren(children);
157          children.add(new Property("type", "CodeableConcept", "Kind of name.", 0, 1, type));
158          children.add(new Property("value", "string", "The name.", 0, 1, value));
159        }
160
161        @Override
162        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
163          switch (_hash) {
164          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Kind of name.", 0, 1, type);
165          case 111972721: /*value*/  return new Property("value", "string", "The name.", 0, 1, value);
166          default: return super.getNamedProperty(_hash, _name, _checkValid);
167          }
168
169        }
170
171      @Override
172      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
173        switch (hash) {
174        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
175        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
176        default: return super.getProperty(hash, name, checkValid);
177        }
178
179      }
180
181      @Override
182      public Base setProperty(int hash, String name, Base value) throws FHIRException {
183        switch (hash) {
184        case 3575610: // type
185          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
186          return value;
187        case 111972721: // value
188          this.value = TypeConvertor.castToString(value); // StringType
189          return value;
190        default: return super.setProperty(hash, name, value);
191        }
192
193      }
194
195      @Override
196      public Base setProperty(String name, Base value) throws FHIRException {
197        if (name.equals("type")) {
198          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
199        } else if (name.equals("value")) {
200          this.value = TypeConvertor.castToString(value); // StringType
201        } else
202          return super.setProperty(name, value);
203        return value;
204      }
205
206      @Override
207      public Base makeProperty(int hash, String name) throws FHIRException {
208        switch (hash) {
209        case 3575610:  return getType();
210        case 111972721:  return getValueElement();
211        default: return super.makeProperty(hash, name);
212        }
213
214      }
215
216      @Override
217      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
218        switch (hash) {
219        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
220        case 111972721: /*value*/ return new String[] {"string"};
221        default: return super.getTypesForProperty(hash, name);
222        }
223
224      }
225
226      @Override
227      public Base addChild(String name) throws FHIRException {
228        if (name.equals("type")) {
229          this.type = new CodeableConcept();
230          return this.type;
231        }
232        else if (name.equals("value")) {
233          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.label.value");
234        }
235        else
236          return super.addChild(name);
237      }
238
239      public ResearchStudyLabelComponent copy() {
240        ResearchStudyLabelComponent dst = new ResearchStudyLabelComponent();
241        copyValues(dst);
242        return dst;
243      }
244
245      public void copyValues(ResearchStudyLabelComponent dst) {
246        super.copyValues(dst);
247        dst.type = type == null ? null : type.copy();
248        dst.value = value == null ? null : value.copy();
249      }
250
251      @Override
252      public boolean equalsDeep(Base other_) {
253        if (!super.equalsDeep(other_))
254          return false;
255        if (!(other_ instanceof ResearchStudyLabelComponent))
256          return false;
257        ResearchStudyLabelComponent o = (ResearchStudyLabelComponent) other_;
258        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
259      }
260
261      @Override
262      public boolean equalsShallow(Base other_) {
263        if (!super.equalsShallow(other_))
264          return false;
265        if (!(other_ instanceof ResearchStudyLabelComponent))
266          return false;
267        ResearchStudyLabelComponent o = (ResearchStudyLabelComponent) other_;
268        return compareValues(value, o.value, true);
269      }
270
271      public boolean isEmpty() {
272        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value);
273      }
274
275  public String fhirType() {
276    return "ResearchStudy.label";
277
278  }
279
280  }
281
282    @Block()
283    public static class ResearchStudyAssociatedPartyComponent extends BackboneElement implements IBaseBackboneElement {
284        /**
285         * Name of associated party.
286         */
287        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
288        @Description(shortDefinition="Name of associated party", formalDefinition="Name of associated party." )
289        protected StringType name;
290
291        /**
292         * Type of association.
293         */
294        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false)
295        @Description(shortDefinition="sponsor | lead-sponsor | sponsor-investigator | primary-investigator | collaborator | funding-source | general-contact | recruitment-contact | sub-investigator | study-director | study-chair", formalDefinition="Type of association." )
296        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-party-role")
297        protected CodeableConcept role;
298
299        /**
300         * Identifies the start date and the end date of the associated party in the role.
301         */
302        @Child(name = "period", type = {Period.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
303        @Description(shortDefinition="When active in the role", formalDefinition="Identifies the start date and the end date of the associated party in the role." )
304        protected List<Period> period;
305
306        /**
307         * A categorization other than role for the associated party.
308         */
309        @Child(name = "classifier", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
310        @Description(shortDefinition="nih | fda | government | nonprofit | academic | industry", formalDefinition="A categorization other than role for the associated party." )
311        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-party-org-type")
312        protected List<CodeableConcept> classifier;
313
314        /**
315         * Individual or organization associated with study (use practitionerRole to specify their organisation).
316         */
317        @Child(name = "party", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=false)
318        @Description(shortDefinition="Individual or organization associated with study (use practitionerRole to specify their organisation)", formalDefinition="Individual or organization associated with study (use practitionerRole to specify their organisation)." )
319        protected Reference party;
320
321        private static final long serialVersionUID = -1418550998L;
322
323    /**
324     * Constructor
325     */
326      public ResearchStudyAssociatedPartyComponent() {
327        super();
328      }
329
330    /**
331     * Constructor
332     */
333      public ResearchStudyAssociatedPartyComponent(CodeableConcept role) {
334        super();
335        this.setRole(role);
336      }
337
338        /**
339         * @return {@link #name} (Name of associated party.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
340         */
341        public StringType getNameElement() { 
342          if (this.name == null)
343            if (Configuration.errorOnAutoCreate())
344              throw new Error("Attempt to auto-create ResearchStudyAssociatedPartyComponent.name");
345            else if (Configuration.doAutoCreate())
346              this.name = new StringType(); // bb
347          return this.name;
348        }
349
350        public boolean hasNameElement() { 
351          return this.name != null && !this.name.isEmpty();
352        }
353
354        public boolean hasName() { 
355          return this.name != null && !this.name.isEmpty();
356        }
357
358        /**
359         * @param value {@link #name} (Name of associated party.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
360         */
361        public ResearchStudyAssociatedPartyComponent setNameElement(StringType value) { 
362          this.name = value;
363          return this;
364        }
365
366        /**
367         * @return Name of associated party.
368         */
369        public String getName() { 
370          return this.name == null ? null : this.name.getValue();
371        }
372
373        /**
374         * @param value Name of associated party.
375         */
376        public ResearchStudyAssociatedPartyComponent setName(String value) { 
377          if (Utilities.noString(value))
378            this.name = null;
379          else {
380            if (this.name == null)
381              this.name = new StringType();
382            this.name.setValue(value);
383          }
384          return this;
385        }
386
387        /**
388         * @return {@link #role} (Type of association.)
389         */
390        public CodeableConcept getRole() { 
391          if (this.role == null)
392            if (Configuration.errorOnAutoCreate())
393              throw new Error("Attempt to auto-create ResearchStudyAssociatedPartyComponent.role");
394            else if (Configuration.doAutoCreate())
395              this.role = new CodeableConcept(); // cc
396          return this.role;
397        }
398
399        public boolean hasRole() { 
400          return this.role != null && !this.role.isEmpty();
401        }
402
403        /**
404         * @param value {@link #role} (Type of association.)
405         */
406        public ResearchStudyAssociatedPartyComponent setRole(CodeableConcept value) { 
407          this.role = value;
408          return this;
409        }
410
411        /**
412         * @return {@link #period} (Identifies the start date and the end date of the associated party in the role.)
413         */
414        public List<Period> getPeriod() { 
415          if (this.period == null)
416            this.period = new ArrayList<Period>();
417          return this.period;
418        }
419
420        /**
421         * @return Returns a reference to <code>this</code> for easy method chaining
422         */
423        public ResearchStudyAssociatedPartyComponent setPeriod(List<Period> thePeriod) { 
424          this.period = thePeriod;
425          return this;
426        }
427
428        public boolean hasPeriod() { 
429          if (this.period == null)
430            return false;
431          for (Period item : this.period)
432            if (!item.isEmpty())
433              return true;
434          return false;
435        }
436
437        public Period addPeriod() { //3
438          Period t = new Period();
439          if (this.period == null)
440            this.period = new ArrayList<Period>();
441          this.period.add(t);
442          return t;
443        }
444
445        public ResearchStudyAssociatedPartyComponent addPeriod(Period t) { //3
446          if (t == null)
447            return this;
448          if (this.period == null)
449            this.period = new ArrayList<Period>();
450          this.period.add(t);
451          return this;
452        }
453
454        /**
455         * @return The first repetition of repeating field {@link #period}, creating it if it does not already exist {3}
456         */
457        public Period getPeriodFirstRep() { 
458          if (getPeriod().isEmpty()) {
459            addPeriod();
460          }
461          return getPeriod().get(0);
462        }
463
464        /**
465         * @return {@link #classifier} (A categorization other than role for the associated party.)
466         */
467        public List<CodeableConcept> getClassifier() { 
468          if (this.classifier == null)
469            this.classifier = new ArrayList<CodeableConcept>();
470          return this.classifier;
471        }
472
473        /**
474         * @return Returns a reference to <code>this</code> for easy method chaining
475         */
476        public ResearchStudyAssociatedPartyComponent setClassifier(List<CodeableConcept> theClassifier) { 
477          this.classifier = theClassifier;
478          return this;
479        }
480
481        public boolean hasClassifier() { 
482          if (this.classifier == null)
483            return false;
484          for (CodeableConcept item : this.classifier)
485            if (!item.isEmpty())
486              return true;
487          return false;
488        }
489
490        public CodeableConcept addClassifier() { //3
491          CodeableConcept t = new CodeableConcept();
492          if (this.classifier == null)
493            this.classifier = new ArrayList<CodeableConcept>();
494          this.classifier.add(t);
495          return t;
496        }
497
498        public ResearchStudyAssociatedPartyComponent addClassifier(CodeableConcept t) { //3
499          if (t == null)
500            return this;
501          if (this.classifier == null)
502            this.classifier = new ArrayList<CodeableConcept>();
503          this.classifier.add(t);
504          return this;
505        }
506
507        /**
508         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
509         */
510        public CodeableConcept getClassifierFirstRep() { 
511          if (getClassifier().isEmpty()) {
512            addClassifier();
513          }
514          return getClassifier().get(0);
515        }
516
517        /**
518         * @return {@link #party} (Individual or organization associated with study (use practitionerRole to specify their organisation).)
519         */
520        public Reference getParty() { 
521          if (this.party == null)
522            if (Configuration.errorOnAutoCreate())
523              throw new Error("Attempt to auto-create ResearchStudyAssociatedPartyComponent.party");
524            else if (Configuration.doAutoCreate())
525              this.party = new Reference(); // cc
526          return this.party;
527        }
528
529        public boolean hasParty() { 
530          return this.party != null && !this.party.isEmpty();
531        }
532
533        /**
534         * @param value {@link #party} (Individual or organization associated with study (use practitionerRole to specify their organisation).)
535         */
536        public ResearchStudyAssociatedPartyComponent setParty(Reference value) { 
537          this.party = value;
538          return this;
539        }
540
541        protected void listChildren(List<Property> children) {
542          super.listChildren(children);
543          children.add(new Property("name", "string", "Name of associated party.", 0, 1, name));
544          children.add(new Property("role", "CodeableConcept", "Type of association.", 0, 1, role));
545          children.add(new Property("period", "Period", "Identifies the start date and the end date of the associated party in the role.", 0, java.lang.Integer.MAX_VALUE, period));
546          children.add(new Property("classifier", "CodeableConcept", "A categorization other than role for the associated party.", 0, java.lang.Integer.MAX_VALUE, classifier));
547          children.add(new Property("party", "Reference(Practitioner|PractitionerRole|Organization)", "Individual or organization associated with study (use practitionerRole to specify their organisation).", 0, 1, party));
548        }
549
550        @Override
551        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
552          switch (_hash) {
553          case 3373707: /*name*/  return new Property("name", "string", "Name of associated party.", 0, 1, name);
554          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Type of association.", 0, 1, role);
555          case -991726143: /*period*/  return new Property("period", "Period", "Identifies the start date and the end date of the associated party in the role.", 0, java.lang.Integer.MAX_VALUE, period);
556          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "A categorization other than role for the associated party.", 0, java.lang.Integer.MAX_VALUE, classifier);
557          case 106437350: /*party*/  return new Property("party", "Reference(Practitioner|PractitionerRole|Organization)", "Individual or organization associated with study (use practitionerRole to specify their organisation).", 0, 1, party);
558          default: return super.getNamedProperty(_hash, _name, _checkValid);
559          }
560
561        }
562
563      @Override
564      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
565        switch (hash) {
566        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
567        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
568        case -991726143: /*period*/ return this.period == null ? new Base[0] : this.period.toArray(new Base[this.period.size()]); // Period
569        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
570        case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference
571        default: return super.getProperty(hash, name, checkValid);
572        }
573
574      }
575
576      @Override
577      public Base setProperty(int hash, String name, Base value) throws FHIRException {
578        switch (hash) {
579        case 3373707: // name
580          this.name = TypeConvertor.castToString(value); // StringType
581          return value;
582        case 3506294: // role
583          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
584          return value;
585        case -991726143: // period
586          this.getPeriod().add(TypeConvertor.castToPeriod(value)); // Period
587          return value;
588        case -281470431: // classifier
589          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
590          return value;
591        case 106437350: // party
592          this.party = TypeConvertor.castToReference(value); // Reference
593          return value;
594        default: return super.setProperty(hash, name, value);
595        }
596
597      }
598
599      @Override
600      public Base setProperty(String name, Base value) throws FHIRException {
601        if (name.equals("name")) {
602          this.name = TypeConvertor.castToString(value); // StringType
603        } else if (name.equals("role")) {
604          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
605        } else if (name.equals("period")) {
606          this.getPeriod().add(TypeConvertor.castToPeriod(value));
607        } else if (name.equals("classifier")) {
608          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
609        } else if (name.equals("party")) {
610          this.party = TypeConvertor.castToReference(value); // Reference
611        } else
612          return super.setProperty(name, value);
613        return value;
614      }
615
616      @Override
617      public Base makeProperty(int hash, String name) throws FHIRException {
618        switch (hash) {
619        case 3373707:  return getNameElement();
620        case 3506294:  return getRole();
621        case -991726143:  return addPeriod(); 
622        case -281470431:  return addClassifier(); 
623        case 106437350:  return getParty();
624        default: return super.makeProperty(hash, name);
625        }
626
627      }
628
629      @Override
630      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
631        switch (hash) {
632        case 3373707: /*name*/ return new String[] {"string"};
633        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
634        case -991726143: /*period*/ return new String[] {"Period"};
635        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
636        case 106437350: /*party*/ return new String[] {"Reference"};
637        default: return super.getTypesForProperty(hash, name);
638        }
639
640      }
641
642      @Override
643      public Base addChild(String name) throws FHIRException {
644        if (name.equals("name")) {
645          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.associatedParty.name");
646        }
647        else if (name.equals("role")) {
648          this.role = new CodeableConcept();
649          return this.role;
650        }
651        else if (name.equals("period")) {
652          return addPeriod();
653        }
654        else if (name.equals("classifier")) {
655          return addClassifier();
656        }
657        else if (name.equals("party")) {
658          this.party = new Reference();
659          return this.party;
660        }
661        else
662          return super.addChild(name);
663      }
664
665      public ResearchStudyAssociatedPartyComponent copy() {
666        ResearchStudyAssociatedPartyComponent dst = new ResearchStudyAssociatedPartyComponent();
667        copyValues(dst);
668        return dst;
669      }
670
671      public void copyValues(ResearchStudyAssociatedPartyComponent dst) {
672        super.copyValues(dst);
673        dst.name = name == null ? null : name.copy();
674        dst.role = role == null ? null : role.copy();
675        if (period != null) {
676          dst.period = new ArrayList<Period>();
677          for (Period i : period)
678            dst.period.add(i.copy());
679        };
680        if (classifier != null) {
681          dst.classifier = new ArrayList<CodeableConcept>();
682          for (CodeableConcept i : classifier)
683            dst.classifier.add(i.copy());
684        };
685        dst.party = party == null ? null : party.copy();
686      }
687
688      @Override
689      public boolean equalsDeep(Base other_) {
690        if (!super.equalsDeep(other_))
691          return false;
692        if (!(other_ instanceof ResearchStudyAssociatedPartyComponent))
693          return false;
694        ResearchStudyAssociatedPartyComponent o = (ResearchStudyAssociatedPartyComponent) other_;
695        return compareDeep(name, o.name, true) && compareDeep(role, o.role, true) && compareDeep(period, o.period, true)
696           && compareDeep(classifier, o.classifier, true) && compareDeep(party, o.party, true);
697      }
698
699      @Override
700      public boolean equalsShallow(Base other_) {
701        if (!super.equalsShallow(other_))
702          return false;
703        if (!(other_ instanceof ResearchStudyAssociatedPartyComponent))
704          return false;
705        ResearchStudyAssociatedPartyComponent o = (ResearchStudyAssociatedPartyComponent) other_;
706        return compareValues(name, o.name, true);
707      }
708
709      public boolean isEmpty() {
710        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, role, period, classifier
711          , party);
712      }
713
714  public String fhirType() {
715    return "ResearchStudy.associatedParty";
716
717  }
718
719  }
720
721    @Block()
722    public static class ResearchStudyProgressStatusComponent extends BackboneElement implements IBaseBackboneElement {
723        /**
724         * Label for status or state (e.g. recruitment status).
725         */
726        @Child(name = "state", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
727        @Description(shortDefinition="Label for status or state (e.g. recruitment status)", formalDefinition="Label for status or state (e.g. recruitment status)." )
728        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-status")
729        protected CodeableConcept state;
730
731        /**
732         * An indication of whether or not the date is a known date when the state changed or will change. A value of true indicates a known date. A value of false indicates an estimated date.
733         */
734        @Child(name = "actual", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
735        @Description(shortDefinition="Actual if true else anticipated", formalDefinition="An indication of whether or not the date is a known date when the state changed or will change. A value of true indicates a known date. A value of false indicates an estimated date." )
736        protected BooleanType actual;
737
738        /**
739         * Date range.
740         */
741        @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false)
742        @Description(shortDefinition="Date range", formalDefinition="Date range." )
743        protected Period period;
744
745        private static final long serialVersionUID = 1232680620L;
746
747    /**
748     * Constructor
749     */
750      public ResearchStudyProgressStatusComponent() {
751        super();
752      }
753
754    /**
755     * Constructor
756     */
757      public ResearchStudyProgressStatusComponent(CodeableConcept state) {
758        super();
759        this.setState(state);
760      }
761
762        /**
763         * @return {@link #state} (Label for status or state (e.g. recruitment status).)
764         */
765        public CodeableConcept getState() { 
766          if (this.state == null)
767            if (Configuration.errorOnAutoCreate())
768              throw new Error("Attempt to auto-create ResearchStudyProgressStatusComponent.state");
769            else if (Configuration.doAutoCreate())
770              this.state = new CodeableConcept(); // cc
771          return this.state;
772        }
773
774        public boolean hasState() { 
775          return this.state != null && !this.state.isEmpty();
776        }
777
778        /**
779         * @param value {@link #state} (Label for status or state (e.g. recruitment status).)
780         */
781        public ResearchStudyProgressStatusComponent setState(CodeableConcept value) { 
782          this.state = value;
783          return this;
784        }
785
786        /**
787         * @return {@link #actual} (An indication of whether or not the date is a known date when the state changed or will change. A value of true indicates a known date. A value of false indicates an estimated date.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
788         */
789        public BooleanType getActualElement() { 
790          if (this.actual == null)
791            if (Configuration.errorOnAutoCreate())
792              throw new Error("Attempt to auto-create ResearchStudyProgressStatusComponent.actual");
793            else if (Configuration.doAutoCreate())
794              this.actual = new BooleanType(); // bb
795          return this.actual;
796        }
797
798        public boolean hasActualElement() { 
799          return this.actual != null && !this.actual.isEmpty();
800        }
801
802        public boolean hasActual() { 
803          return this.actual != null && !this.actual.isEmpty();
804        }
805
806        /**
807         * @param value {@link #actual} (An indication of whether or not the date is a known date when the state changed or will change. A value of true indicates a known date. A value of false indicates an estimated date.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
808         */
809        public ResearchStudyProgressStatusComponent setActualElement(BooleanType value) { 
810          this.actual = value;
811          return this;
812        }
813
814        /**
815         * @return An indication of whether or not the date is a known date when the state changed or will change. A value of true indicates a known date. A value of false indicates an estimated date.
816         */
817        public boolean getActual() { 
818          return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue();
819        }
820
821        /**
822         * @param value An indication of whether or not the date is a known date when the state changed or will change. A value of true indicates a known date. A value of false indicates an estimated date.
823         */
824        public ResearchStudyProgressStatusComponent setActual(boolean value) { 
825            if (this.actual == null)
826              this.actual = new BooleanType();
827            this.actual.setValue(value);
828          return this;
829        }
830
831        /**
832         * @return {@link #period} (Date range.)
833         */
834        public Period getPeriod() { 
835          if (this.period == null)
836            if (Configuration.errorOnAutoCreate())
837              throw new Error("Attempt to auto-create ResearchStudyProgressStatusComponent.period");
838            else if (Configuration.doAutoCreate())
839              this.period = new Period(); // cc
840          return this.period;
841        }
842
843        public boolean hasPeriod() { 
844          return this.period != null && !this.period.isEmpty();
845        }
846
847        /**
848         * @param value {@link #period} (Date range.)
849         */
850        public ResearchStudyProgressStatusComponent setPeriod(Period value) { 
851          this.period = value;
852          return this;
853        }
854
855        protected void listChildren(List<Property> children) {
856          super.listChildren(children);
857          children.add(new Property("state", "CodeableConcept", "Label for status or state (e.g. recruitment status).", 0, 1, state));
858          children.add(new Property("actual", "boolean", "An indication of whether or not the date is a known date when the state changed or will change. A value of true indicates a known date. A value of false indicates an estimated date.", 0, 1, actual));
859          children.add(new Property("period", "Period", "Date range.", 0, 1, period));
860        }
861
862        @Override
863        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
864          switch (_hash) {
865          case 109757585: /*state*/  return new Property("state", "CodeableConcept", "Label for status or state (e.g. recruitment status).", 0, 1, state);
866          case -1422939762: /*actual*/  return new Property("actual", "boolean", "An indication of whether or not the date is a known date when the state changed or will change. A value of true indicates a known date. A value of false indicates an estimated date.", 0, 1, actual);
867          case -991726143: /*period*/  return new Property("period", "Period", "Date range.", 0, 1, period);
868          default: return super.getNamedProperty(_hash, _name, _checkValid);
869          }
870
871        }
872
873      @Override
874      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
875        switch (hash) {
876        case 109757585: /*state*/ return this.state == null ? new Base[0] : new Base[] {this.state}; // CodeableConcept
877        case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType
878        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
879        default: return super.getProperty(hash, name, checkValid);
880        }
881
882      }
883
884      @Override
885      public Base setProperty(int hash, String name, Base value) throws FHIRException {
886        switch (hash) {
887        case 109757585: // state
888          this.state = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
889          return value;
890        case -1422939762: // actual
891          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
892          return value;
893        case -991726143: // period
894          this.period = TypeConvertor.castToPeriod(value); // Period
895          return value;
896        default: return super.setProperty(hash, name, value);
897        }
898
899      }
900
901      @Override
902      public Base setProperty(String name, Base value) throws FHIRException {
903        if (name.equals("state")) {
904          this.state = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
905        } else if (name.equals("actual")) {
906          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
907        } else if (name.equals("period")) {
908          this.period = TypeConvertor.castToPeriod(value); // Period
909        } else
910          return super.setProperty(name, value);
911        return value;
912      }
913
914      @Override
915      public Base makeProperty(int hash, String name) throws FHIRException {
916        switch (hash) {
917        case 109757585:  return getState();
918        case -1422939762:  return getActualElement();
919        case -991726143:  return getPeriod();
920        default: return super.makeProperty(hash, name);
921        }
922
923      }
924
925      @Override
926      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
927        switch (hash) {
928        case 109757585: /*state*/ return new String[] {"CodeableConcept"};
929        case -1422939762: /*actual*/ return new String[] {"boolean"};
930        case -991726143: /*period*/ return new String[] {"Period"};
931        default: return super.getTypesForProperty(hash, name);
932        }
933
934      }
935
936      @Override
937      public Base addChild(String name) throws FHIRException {
938        if (name.equals("state")) {
939          this.state = new CodeableConcept();
940          return this.state;
941        }
942        else if (name.equals("actual")) {
943          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.progressStatus.actual");
944        }
945        else if (name.equals("period")) {
946          this.period = new Period();
947          return this.period;
948        }
949        else
950          return super.addChild(name);
951      }
952
953      public ResearchStudyProgressStatusComponent copy() {
954        ResearchStudyProgressStatusComponent dst = new ResearchStudyProgressStatusComponent();
955        copyValues(dst);
956        return dst;
957      }
958
959      public void copyValues(ResearchStudyProgressStatusComponent dst) {
960        super.copyValues(dst);
961        dst.state = state == null ? null : state.copy();
962        dst.actual = actual == null ? null : actual.copy();
963        dst.period = period == null ? null : period.copy();
964      }
965
966      @Override
967      public boolean equalsDeep(Base other_) {
968        if (!super.equalsDeep(other_))
969          return false;
970        if (!(other_ instanceof ResearchStudyProgressStatusComponent))
971          return false;
972        ResearchStudyProgressStatusComponent o = (ResearchStudyProgressStatusComponent) other_;
973        return compareDeep(state, o.state, true) && compareDeep(actual, o.actual, true) && compareDeep(period, o.period, true)
974          ;
975      }
976
977      @Override
978      public boolean equalsShallow(Base other_) {
979        if (!super.equalsShallow(other_))
980          return false;
981        if (!(other_ instanceof ResearchStudyProgressStatusComponent))
982          return false;
983        ResearchStudyProgressStatusComponent o = (ResearchStudyProgressStatusComponent) other_;
984        return compareValues(actual, o.actual, true);
985      }
986
987      public boolean isEmpty() {
988        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(state, actual, period);
989      }
990
991  public String fhirType() {
992    return "ResearchStudy.progressStatus";
993
994  }
995
996  }
997
998    @Block()
999    public static class ResearchStudyRecruitmentComponent extends BackboneElement implements IBaseBackboneElement {
1000        /**
1001         * Estimated total number of participants to be enrolled.
1002         */
1003        @Child(name = "targetNumber", type = {UnsignedIntType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1004        @Description(shortDefinition="Estimated total number of participants to be enrolled", formalDefinition="Estimated total number of participants to be enrolled." )
1005        protected UnsignedIntType targetNumber;
1006
1007        /**
1008         * Actual total number of participants enrolled in study.
1009         */
1010        @Child(name = "actualNumber", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1011        @Description(shortDefinition="Actual total number of participants enrolled in study", formalDefinition="Actual total number of participants enrolled in study." )
1012        protected UnsignedIntType actualNumber;
1013
1014        /**
1015         * Inclusion and exclusion criteria.
1016         */
1017        @Child(name = "eligibility", type = {Group.class, EvidenceVariable.class}, order=3, min=0, max=1, modifier=false, summary=false)
1018        @Description(shortDefinition="Inclusion and exclusion criteria", formalDefinition="Inclusion and exclusion criteria." )
1019        protected Reference eligibility;
1020
1021        /**
1022         * Group of participants who were enrolled in study.
1023         */
1024        @Child(name = "actualGroup", type = {Group.class}, order=4, min=0, max=1, modifier=false, summary=true)
1025        @Description(shortDefinition="Group of participants who were enrolled in study", formalDefinition="Group of participants who were enrolled in study." )
1026        protected Reference actualGroup;
1027
1028        private static final long serialVersionUID = 1483229827L;
1029
1030    /**
1031     * Constructor
1032     */
1033      public ResearchStudyRecruitmentComponent() {
1034        super();
1035      }
1036
1037        /**
1038         * @return {@link #targetNumber} (Estimated total number of participants to be enrolled.). This is the underlying object with id, value and extensions. The accessor "getTargetNumber" gives direct access to the value
1039         */
1040        public UnsignedIntType getTargetNumberElement() { 
1041          if (this.targetNumber == null)
1042            if (Configuration.errorOnAutoCreate())
1043              throw new Error("Attempt to auto-create ResearchStudyRecruitmentComponent.targetNumber");
1044            else if (Configuration.doAutoCreate())
1045              this.targetNumber = new UnsignedIntType(); // bb
1046          return this.targetNumber;
1047        }
1048
1049        public boolean hasTargetNumberElement() { 
1050          return this.targetNumber != null && !this.targetNumber.isEmpty();
1051        }
1052
1053        public boolean hasTargetNumber() { 
1054          return this.targetNumber != null && !this.targetNumber.isEmpty();
1055        }
1056
1057        /**
1058         * @param value {@link #targetNumber} (Estimated total number of participants to be enrolled.). This is the underlying object with id, value and extensions. The accessor "getTargetNumber" gives direct access to the value
1059         */
1060        public ResearchStudyRecruitmentComponent setTargetNumberElement(UnsignedIntType value) { 
1061          this.targetNumber = value;
1062          return this;
1063        }
1064
1065        /**
1066         * @return Estimated total number of participants to be enrolled.
1067         */
1068        public int getTargetNumber() { 
1069          return this.targetNumber == null || this.targetNumber.isEmpty() ? 0 : this.targetNumber.getValue();
1070        }
1071
1072        /**
1073         * @param value Estimated total number of participants to be enrolled.
1074         */
1075        public ResearchStudyRecruitmentComponent setTargetNumber(int value) { 
1076            if (this.targetNumber == null)
1077              this.targetNumber = new UnsignedIntType();
1078            this.targetNumber.setValue(value);
1079          return this;
1080        }
1081
1082        /**
1083         * @return {@link #actualNumber} (Actual total number of participants enrolled in study.). This is the underlying object with id, value and extensions. The accessor "getActualNumber" gives direct access to the value
1084         */
1085        public UnsignedIntType getActualNumberElement() { 
1086          if (this.actualNumber == null)
1087            if (Configuration.errorOnAutoCreate())
1088              throw new Error("Attempt to auto-create ResearchStudyRecruitmentComponent.actualNumber");
1089            else if (Configuration.doAutoCreate())
1090              this.actualNumber = new UnsignedIntType(); // bb
1091          return this.actualNumber;
1092        }
1093
1094        public boolean hasActualNumberElement() { 
1095          return this.actualNumber != null && !this.actualNumber.isEmpty();
1096        }
1097
1098        public boolean hasActualNumber() { 
1099          return this.actualNumber != null && !this.actualNumber.isEmpty();
1100        }
1101
1102        /**
1103         * @param value {@link #actualNumber} (Actual total number of participants enrolled in study.). This is the underlying object with id, value and extensions. The accessor "getActualNumber" gives direct access to the value
1104         */
1105        public ResearchStudyRecruitmentComponent setActualNumberElement(UnsignedIntType value) { 
1106          this.actualNumber = value;
1107          return this;
1108        }
1109
1110        /**
1111         * @return Actual total number of participants enrolled in study.
1112         */
1113        public int getActualNumber() { 
1114          return this.actualNumber == null || this.actualNumber.isEmpty() ? 0 : this.actualNumber.getValue();
1115        }
1116
1117        /**
1118         * @param value Actual total number of participants enrolled in study.
1119         */
1120        public ResearchStudyRecruitmentComponent setActualNumber(int value) { 
1121            if (this.actualNumber == null)
1122              this.actualNumber = new UnsignedIntType();
1123            this.actualNumber.setValue(value);
1124          return this;
1125        }
1126
1127        /**
1128         * @return {@link #eligibility} (Inclusion and exclusion criteria.)
1129         */
1130        public Reference getEligibility() { 
1131          if (this.eligibility == null)
1132            if (Configuration.errorOnAutoCreate())
1133              throw new Error("Attempt to auto-create ResearchStudyRecruitmentComponent.eligibility");
1134            else if (Configuration.doAutoCreate())
1135              this.eligibility = new Reference(); // cc
1136          return this.eligibility;
1137        }
1138
1139        public boolean hasEligibility() { 
1140          return this.eligibility != null && !this.eligibility.isEmpty();
1141        }
1142
1143        /**
1144         * @param value {@link #eligibility} (Inclusion and exclusion criteria.)
1145         */
1146        public ResearchStudyRecruitmentComponent setEligibility(Reference value) { 
1147          this.eligibility = value;
1148          return this;
1149        }
1150
1151        /**
1152         * @return {@link #actualGroup} (Group of participants who were enrolled in study.)
1153         */
1154        public Reference getActualGroup() { 
1155          if (this.actualGroup == null)
1156            if (Configuration.errorOnAutoCreate())
1157              throw new Error("Attempt to auto-create ResearchStudyRecruitmentComponent.actualGroup");
1158            else if (Configuration.doAutoCreate())
1159              this.actualGroup = new Reference(); // cc
1160          return this.actualGroup;
1161        }
1162
1163        public boolean hasActualGroup() { 
1164          return this.actualGroup != null && !this.actualGroup.isEmpty();
1165        }
1166
1167        /**
1168         * @param value {@link #actualGroup} (Group of participants who were enrolled in study.)
1169         */
1170        public ResearchStudyRecruitmentComponent setActualGroup(Reference value) { 
1171          this.actualGroup = value;
1172          return this;
1173        }
1174
1175        protected void listChildren(List<Property> children) {
1176          super.listChildren(children);
1177          children.add(new Property("targetNumber", "unsignedInt", "Estimated total number of participants to be enrolled.", 0, 1, targetNumber));
1178          children.add(new Property("actualNumber", "unsignedInt", "Actual total number of participants enrolled in study.", 0, 1, actualNumber));
1179          children.add(new Property("eligibility", "Reference(Group|EvidenceVariable)", "Inclusion and exclusion criteria.", 0, 1, eligibility));
1180          children.add(new Property("actualGroup", "Reference(Group)", "Group of participants who were enrolled in study.", 0, 1, actualGroup));
1181        }
1182
1183        @Override
1184        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1185          switch (_hash) {
1186          case -682948550: /*targetNumber*/  return new Property("targetNumber", "unsignedInt", "Estimated total number of participants to be enrolled.", 0, 1, targetNumber);
1187          case 746557047: /*actualNumber*/  return new Property("actualNumber", "unsignedInt", "Actual total number of participants enrolled in study.", 0, 1, actualNumber);
1188          case -930847859: /*eligibility*/  return new Property("eligibility", "Reference(Group|EvidenceVariable)", "Inclusion and exclusion criteria.", 0, 1, eligibility);
1189          case 1403004305: /*actualGroup*/  return new Property("actualGroup", "Reference(Group)", "Group of participants who were enrolled in study.", 0, 1, actualGroup);
1190          default: return super.getNamedProperty(_hash, _name, _checkValid);
1191          }
1192
1193        }
1194
1195      @Override
1196      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1197        switch (hash) {
1198        case -682948550: /*targetNumber*/ return this.targetNumber == null ? new Base[0] : new Base[] {this.targetNumber}; // UnsignedIntType
1199        case 746557047: /*actualNumber*/ return this.actualNumber == null ? new Base[0] : new Base[] {this.actualNumber}; // UnsignedIntType
1200        case -930847859: /*eligibility*/ return this.eligibility == null ? new Base[0] : new Base[] {this.eligibility}; // Reference
1201        case 1403004305: /*actualGroup*/ return this.actualGroup == null ? new Base[0] : new Base[] {this.actualGroup}; // Reference
1202        default: return super.getProperty(hash, name, checkValid);
1203        }
1204
1205      }
1206
1207      @Override
1208      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1209        switch (hash) {
1210        case -682948550: // targetNumber
1211          this.targetNumber = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1212          return value;
1213        case 746557047: // actualNumber
1214          this.actualNumber = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1215          return value;
1216        case -930847859: // eligibility
1217          this.eligibility = TypeConvertor.castToReference(value); // Reference
1218          return value;
1219        case 1403004305: // actualGroup
1220          this.actualGroup = TypeConvertor.castToReference(value); // Reference
1221          return value;
1222        default: return super.setProperty(hash, name, value);
1223        }
1224
1225      }
1226
1227      @Override
1228      public Base setProperty(String name, Base value) throws FHIRException {
1229        if (name.equals("targetNumber")) {
1230          this.targetNumber = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1231        } else if (name.equals("actualNumber")) {
1232          this.actualNumber = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1233        } else if (name.equals("eligibility")) {
1234          this.eligibility = TypeConvertor.castToReference(value); // Reference
1235        } else if (name.equals("actualGroup")) {
1236          this.actualGroup = TypeConvertor.castToReference(value); // Reference
1237        } else
1238          return super.setProperty(name, value);
1239        return value;
1240      }
1241
1242      @Override
1243      public Base makeProperty(int hash, String name) throws FHIRException {
1244        switch (hash) {
1245        case -682948550:  return getTargetNumberElement();
1246        case 746557047:  return getActualNumberElement();
1247        case -930847859:  return getEligibility();
1248        case 1403004305:  return getActualGroup();
1249        default: return super.makeProperty(hash, name);
1250        }
1251
1252      }
1253
1254      @Override
1255      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1256        switch (hash) {
1257        case -682948550: /*targetNumber*/ return new String[] {"unsignedInt"};
1258        case 746557047: /*actualNumber*/ return new String[] {"unsignedInt"};
1259        case -930847859: /*eligibility*/ return new String[] {"Reference"};
1260        case 1403004305: /*actualGroup*/ return new String[] {"Reference"};
1261        default: return super.getTypesForProperty(hash, name);
1262        }
1263
1264      }
1265
1266      @Override
1267      public Base addChild(String name) throws FHIRException {
1268        if (name.equals("targetNumber")) {
1269          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.recruitment.targetNumber");
1270        }
1271        else if (name.equals("actualNumber")) {
1272          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.recruitment.actualNumber");
1273        }
1274        else if (name.equals("eligibility")) {
1275          this.eligibility = new Reference();
1276          return this.eligibility;
1277        }
1278        else if (name.equals("actualGroup")) {
1279          this.actualGroup = new Reference();
1280          return this.actualGroup;
1281        }
1282        else
1283          return super.addChild(name);
1284      }
1285
1286      public ResearchStudyRecruitmentComponent copy() {
1287        ResearchStudyRecruitmentComponent dst = new ResearchStudyRecruitmentComponent();
1288        copyValues(dst);
1289        return dst;
1290      }
1291
1292      public void copyValues(ResearchStudyRecruitmentComponent dst) {
1293        super.copyValues(dst);
1294        dst.targetNumber = targetNumber == null ? null : targetNumber.copy();
1295        dst.actualNumber = actualNumber == null ? null : actualNumber.copy();
1296        dst.eligibility = eligibility == null ? null : eligibility.copy();
1297        dst.actualGroup = actualGroup == null ? null : actualGroup.copy();
1298      }
1299
1300      @Override
1301      public boolean equalsDeep(Base other_) {
1302        if (!super.equalsDeep(other_))
1303          return false;
1304        if (!(other_ instanceof ResearchStudyRecruitmentComponent))
1305          return false;
1306        ResearchStudyRecruitmentComponent o = (ResearchStudyRecruitmentComponent) other_;
1307        return compareDeep(targetNumber, o.targetNumber, true) && compareDeep(actualNumber, o.actualNumber, true)
1308           && compareDeep(eligibility, o.eligibility, true) && compareDeep(actualGroup, o.actualGroup, true)
1309          ;
1310      }
1311
1312      @Override
1313      public boolean equalsShallow(Base other_) {
1314        if (!super.equalsShallow(other_))
1315          return false;
1316        if (!(other_ instanceof ResearchStudyRecruitmentComponent))
1317          return false;
1318        ResearchStudyRecruitmentComponent o = (ResearchStudyRecruitmentComponent) other_;
1319        return compareValues(targetNumber, o.targetNumber, true) && compareValues(actualNumber, o.actualNumber, true)
1320          ;
1321      }
1322
1323      public boolean isEmpty() {
1324        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(targetNumber, actualNumber
1325          , eligibility, actualGroup);
1326      }
1327
1328  public String fhirType() {
1329    return "ResearchStudy.recruitment";
1330
1331  }
1332
1333  }
1334
1335    @Block()
1336    public static class ResearchStudyComparisonGroupComponent extends BackboneElement implements IBaseBackboneElement {
1337        /**
1338         * Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.
1339         */
1340        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1341        @Description(shortDefinition="Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily", formalDefinition="Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily." )
1342        protected List<Identifier> identifier;
1343
1344        /**
1345         * Unique, human-readable label for this comparisonGroup of the study.
1346         */
1347        @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
1348        @Description(shortDefinition="Label for study comparisonGroup", formalDefinition="Unique, human-readable label for this comparisonGroup of the study." )
1349        protected StringType name;
1350
1351        /**
1352         * Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater.
1353         */
1354        @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1355        @Description(shortDefinition="Categorization of study comparisonGroup", formalDefinition="Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater." )
1356        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-arm-type")
1357        protected CodeableConcept type;
1358
1359        /**
1360         * A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.
1361         */
1362        @Child(name = "description", type = {MarkdownType.class}, order=4, min=0, max=1, modifier=false, summary=false)
1363        @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 comparisonGroup." )
1364        protected MarkdownType description;
1365
1366        /**
1367         * Interventions or exposures in this comparisonGroup or cohort.
1368         */
1369        @Child(name = "intendedExposure", type = {EvidenceVariable.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1370        @Description(shortDefinition="Interventions or exposures in this comparisonGroup or cohort", formalDefinition="Interventions or exposures in this comparisonGroup or cohort." )
1371        protected List<Reference> intendedExposure;
1372
1373        /**
1374         * Group of participants who were enrolled in study comparisonGroup.
1375         */
1376        @Child(name = "observedGroup", type = {Group.class}, order=6, min=0, max=1, modifier=false, summary=false)
1377        @Description(shortDefinition="Group of participants who were enrolled in study comparisonGroup", formalDefinition="Group of participants who were enrolled in study comparisonGroup." )
1378        protected Reference observedGroup;
1379
1380        private static final long serialVersionUID = -1154017097L;
1381
1382    /**
1383     * Constructor
1384     */
1385      public ResearchStudyComparisonGroupComponent() {
1386        super();
1387      }
1388
1389    /**
1390     * Constructor
1391     */
1392      public ResearchStudyComparisonGroupComponent(String name) {
1393        super();
1394        this.setName(name);
1395      }
1396
1397        /**
1398         * @return {@link #identifier} (Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.)
1399         */
1400        public List<Identifier> getIdentifier() { 
1401          if (this.identifier == null)
1402            this.identifier = new ArrayList<Identifier>();
1403          return this.identifier;
1404        }
1405
1406        /**
1407         * @return Returns a reference to <code>this</code> for easy method chaining
1408         */
1409        public ResearchStudyComparisonGroupComponent setIdentifier(List<Identifier> theIdentifier) { 
1410          this.identifier = theIdentifier;
1411          return this;
1412        }
1413
1414        public boolean hasIdentifier() { 
1415          if (this.identifier == null)
1416            return false;
1417          for (Identifier item : this.identifier)
1418            if (!item.isEmpty())
1419              return true;
1420          return false;
1421        }
1422
1423        public Identifier addIdentifier() { //3
1424          Identifier t = new Identifier();
1425          if (this.identifier == null)
1426            this.identifier = new ArrayList<Identifier>();
1427          this.identifier.add(t);
1428          return t;
1429        }
1430
1431        public ResearchStudyComparisonGroupComponent addIdentifier(Identifier t) { //3
1432          if (t == null)
1433            return this;
1434          if (this.identifier == null)
1435            this.identifier = new ArrayList<Identifier>();
1436          this.identifier.add(t);
1437          return this;
1438        }
1439
1440        /**
1441         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1442         */
1443        public Identifier getIdentifierFirstRep() { 
1444          if (getIdentifier().isEmpty()) {
1445            addIdentifier();
1446          }
1447          return getIdentifier().get(0);
1448        }
1449
1450        /**
1451         * @return {@link #name} (Unique, human-readable label for this comparisonGroup of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1452         */
1453        public StringType getNameElement() { 
1454          if (this.name == null)
1455            if (Configuration.errorOnAutoCreate())
1456              throw new Error("Attempt to auto-create ResearchStudyComparisonGroupComponent.name");
1457            else if (Configuration.doAutoCreate())
1458              this.name = new StringType(); // bb
1459          return this.name;
1460        }
1461
1462        public boolean hasNameElement() { 
1463          return this.name != null && !this.name.isEmpty();
1464        }
1465
1466        public boolean hasName() { 
1467          return this.name != null && !this.name.isEmpty();
1468        }
1469
1470        /**
1471         * @param value {@link #name} (Unique, human-readable label for this comparisonGroup of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1472         */
1473        public ResearchStudyComparisonGroupComponent setNameElement(StringType value) { 
1474          this.name = value;
1475          return this;
1476        }
1477
1478        /**
1479         * @return Unique, human-readable label for this comparisonGroup of the study.
1480         */
1481        public String getName() { 
1482          return this.name == null ? null : this.name.getValue();
1483        }
1484
1485        /**
1486         * @param value Unique, human-readable label for this comparisonGroup of the study.
1487         */
1488        public ResearchStudyComparisonGroupComponent setName(String value) { 
1489            if (this.name == null)
1490              this.name = new StringType();
1491            this.name.setValue(value);
1492          return this;
1493        }
1494
1495        /**
1496         * @return {@link #type} (Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater.)
1497         */
1498        public CodeableConcept getType() { 
1499          if (this.type == null)
1500            if (Configuration.errorOnAutoCreate())
1501              throw new Error("Attempt to auto-create ResearchStudyComparisonGroupComponent.type");
1502            else if (Configuration.doAutoCreate())
1503              this.type = new CodeableConcept(); // cc
1504          return this.type;
1505        }
1506
1507        public boolean hasType() { 
1508          return this.type != null && !this.type.isEmpty();
1509        }
1510
1511        /**
1512         * @param value {@link #type} (Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater.)
1513         */
1514        public ResearchStudyComparisonGroupComponent setType(CodeableConcept value) { 
1515          this.type = value;
1516          return this;
1517        }
1518
1519        /**
1520         * @return {@link #description} (A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1521         */
1522        public MarkdownType getDescriptionElement() { 
1523          if (this.description == null)
1524            if (Configuration.errorOnAutoCreate())
1525              throw new Error("Attempt to auto-create ResearchStudyComparisonGroupComponent.description");
1526            else if (Configuration.doAutoCreate())
1527              this.description = new MarkdownType(); // bb
1528          return this.description;
1529        }
1530
1531        public boolean hasDescriptionElement() { 
1532          return this.description != null && !this.description.isEmpty();
1533        }
1534
1535        public boolean hasDescription() { 
1536          return this.description != null && !this.description.isEmpty();
1537        }
1538
1539        /**
1540         * @param value {@link #description} (A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1541         */
1542        public ResearchStudyComparisonGroupComponent setDescriptionElement(MarkdownType value) { 
1543          this.description = value;
1544          return this;
1545        }
1546
1547        /**
1548         * @return A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.
1549         */
1550        public String getDescription() { 
1551          return this.description == null ? null : this.description.getValue();
1552        }
1553
1554        /**
1555         * @param value A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.
1556         */
1557        public ResearchStudyComparisonGroupComponent setDescription(String value) { 
1558          if (value == null)
1559            this.description = null;
1560          else {
1561            if (this.description == null)
1562              this.description = new MarkdownType();
1563            this.description.setValue(value);
1564          }
1565          return this;
1566        }
1567
1568        /**
1569         * @return {@link #intendedExposure} (Interventions or exposures in this comparisonGroup or cohort.)
1570         */
1571        public List<Reference> getIntendedExposure() { 
1572          if (this.intendedExposure == null)
1573            this.intendedExposure = new ArrayList<Reference>();
1574          return this.intendedExposure;
1575        }
1576
1577        /**
1578         * @return Returns a reference to <code>this</code> for easy method chaining
1579         */
1580        public ResearchStudyComparisonGroupComponent setIntendedExposure(List<Reference> theIntendedExposure) { 
1581          this.intendedExposure = theIntendedExposure;
1582          return this;
1583        }
1584
1585        public boolean hasIntendedExposure() { 
1586          if (this.intendedExposure == null)
1587            return false;
1588          for (Reference item : this.intendedExposure)
1589            if (!item.isEmpty())
1590              return true;
1591          return false;
1592        }
1593
1594        public Reference addIntendedExposure() { //3
1595          Reference t = new Reference();
1596          if (this.intendedExposure == null)
1597            this.intendedExposure = new ArrayList<Reference>();
1598          this.intendedExposure.add(t);
1599          return t;
1600        }
1601
1602        public ResearchStudyComparisonGroupComponent addIntendedExposure(Reference t) { //3
1603          if (t == null)
1604            return this;
1605          if (this.intendedExposure == null)
1606            this.intendedExposure = new ArrayList<Reference>();
1607          this.intendedExposure.add(t);
1608          return this;
1609        }
1610
1611        /**
1612         * @return The first repetition of repeating field {@link #intendedExposure}, creating it if it does not already exist {3}
1613         */
1614        public Reference getIntendedExposureFirstRep() { 
1615          if (getIntendedExposure().isEmpty()) {
1616            addIntendedExposure();
1617          }
1618          return getIntendedExposure().get(0);
1619        }
1620
1621        /**
1622         * @return {@link #observedGroup} (Group of participants who were enrolled in study comparisonGroup.)
1623         */
1624        public Reference getObservedGroup() { 
1625          if (this.observedGroup == null)
1626            if (Configuration.errorOnAutoCreate())
1627              throw new Error("Attempt to auto-create ResearchStudyComparisonGroupComponent.observedGroup");
1628            else if (Configuration.doAutoCreate())
1629              this.observedGroup = new Reference(); // cc
1630          return this.observedGroup;
1631        }
1632
1633        public boolean hasObservedGroup() { 
1634          return this.observedGroup != null && !this.observedGroup.isEmpty();
1635        }
1636
1637        /**
1638         * @param value {@link #observedGroup} (Group of participants who were enrolled in study comparisonGroup.)
1639         */
1640        public ResearchStudyComparisonGroupComponent setObservedGroup(Reference value) { 
1641          this.observedGroup = value;
1642          return this;
1643        }
1644
1645        protected void listChildren(List<Property> children) {
1646          super.listChildren(children);
1647          children.add(new Property("identifier", "Identifier", "Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.", 0, java.lang.Integer.MAX_VALUE, identifier));
1648          children.add(new Property("name", "string", "Unique, human-readable label for this comparisonGroup of the study.", 0, 1, name));
1649          children.add(new Property("type", "CodeableConcept", "Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater.", 0, 1, type));
1650          children.add(new Property("description", "markdown", "A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.", 0, 1, description));
1651          children.add(new Property("intendedExposure", "Reference(EvidenceVariable)", "Interventions or exposures in this comparisonGroup or cohort.", 0, java.lang.Integer.MAX_VALUE, intendedExposure));
1652          children.add(new Property("observedGroup", "Reference(Group)", "Group of participants who were enrolled in study comparisonGroup.", 0, 1, observedGroup));
1653        }
1654
1655        @Override
1656        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1657          switch (_hash) {
1658          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Allows the comparisonGroup for the study and the comparisonGroup for the subject to be linked easily.", 0, java.lang.Integer.MAX_VALUE, identifier);
1659          case 3373707: /*name*/  return new Property("name", "string", "Unique, human-readable label for this comparisonGroup of the study.", 0, 1, name);
1660          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Categorization of study comparisonGroup, e.g. experimental, active comparator, placebo comparater.", 0, 1, type);
1661          case -1724546052: /*description*/  return new Property("description", "markdown", "A succinct description of the path through the study that would be followed by a subject adhering to this comparisonGroup.", 0, 1, description);
1662          case -407218606: /*intendedExposure*/  return new Property("intendedExposure", "Reference(EvidenceVariable)", "Interventions or exposures in this comparisonGroup or cohort.", 0, java.lang.Integer.MAX_VALUE, intendedExposure);
1663          case 375599255: /*observedGroup*/  return new Property("observedGroup", "Reference(Group)", "Group of participants who were enrolled in study comparisonGroup.", 0, 1, observedGroup);
1664          default: return super.getNamedProperty(_hash, _name, _checkValid);
1665          }
1666
1667        }
1668
1669      @Override
1670      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1671        switch (hash) {
1672        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1673        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1674        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1675        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
1676        case -407218606: /*intendedExposure*/ return this.intendedExposure == null ? new Base[0] : this.intendedExposure.toArray(new Base[this.intendedExposure.size()]); // Reference
1677        case 375599255: /*observedGroup*/ return this.observedGroup == null ? new Base[0] : new Base[] {this.observedGroup}; // Reference
1678        default: return super.getProperty(hash, name, checkValid);
1679        }
1680
1681      }
1682
1683      @Override
1684      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1685        switch (hash) {
1686        case -1618432855: // identifier
1687          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1688          return value;
1689        case 3373707: // name
1690          this.name = TypeConvertor.castToString(value); // StringType
1691          return value;
1692        case 3575610: // type
1693          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1694          return value;
1695        case -1724546052: // description
1696          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
1697          return value;
1698        case -407218606: // intendedExposure
1699          this.getIntendedExposure().add(TypeConvertor.castToReference(value)); // Reference
1700          return value;
1701        case 375599255: // observedGroup
1702          this.observedGroup = TypeConvertor.castToReference(value); // Reference
1703          return value;
1704        default: return super.setProperty(hash, name, value);
1705        }
1706
1707      }
1708
1709      @Override
1710      public Base setProperty(String name, Base value) throws FHIRException {
1711        if (name.equals("identifier")) {
1712          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1713        } else if (name.equals("name")) {
1714          this.name = TypeConvertor.castToString(value); // StringType
1715        } else if (name.equals("type")) {
1716          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1717        } else if (name.equals("description")) {
1718          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
1719        } else if (name.equals("intendedExposure")) {
1720          this.getIntendedExposure().add(TypeConvertor.castToReference(value));
1721        } else if (name.equals("observedGroup")) {
1722          this.observedGroup = TypeConvertor.castToReference(value); // Reference
1723        } else
1724          return super.setProperty(name, value);
1725        return value;
1726      }
1727
1728      @Override
1729      public Base makeProperty(int hash, String name) throws FHIRException {
1730        switch (hash) {
1731        case -1618432855:  return addIdentifier(); 
1732        case 3373707:  return getNameElement();
1733        case 3575610:  return getType();
1734        case -1724546052:  return getDescriptionElement();
1735        case -407218606:  return addIntendedExposure(); 
1736        case 375599255:  return getObservedGroup();
1737        default: return super.makeProperty(hash, name);
1738        }
1739
1740      }
1741
1742      @Override
1743      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1744        switch (hash) {
1745        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1746        case 3373707: /*name*/ return new String[] {"string"};
1747        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1748        case -1724546052: /*description*/ return new String[] {"markdown"};
1749        case -407218606: /*intendedExposure*/ return new String[] {"Reference"};
1750        case 375599255: /*observedGroup*/ return new String[] {"Reference"};
1751        default: return super.getTypesForProperty(hash, name);
1752        }
1753
1754      }
1755
1756      @Override
1757      public Base addChild(String name) throws FHIRException {
1758        if (name.equals("identifier")) {
1759          return addIdentifier();
1760        }
1761        else if (name.equals("name")) {
1762          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.comparisonGroup.name");
1763        }
1764        else if (name.equals("type")) {
1765          this.type = new CodeableConcept();
1766          return this.type;
1767        }
1768        else if (name.equals("description")) {
1769          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.comparisonGroup.description");
1770        }
1771        else if (name.equals("intendedExposure")) {
1772          return addIntendedExposure();
1773        }
1774        else if (name.equals("observedGroup")) {
1775          this.observedGroup = new Reference();
1776          return this.observedGroup;
1777        }
1778        else
1779          return super.addChild(name);
1780      }
1781
1782      public ResearchStudyComparisonGroupComponent copy() {
1783        ResearchStudyComparisonGroupComponent dst = new ResearchStudyComparisonGroupComponent();
1784        copyValues(dst);
1785        return dst;
1786      }
1787
1788      public void copyValues(ResearchStudyComparisonGroupComponent dst) {
1789        super.copyValues(dst);
1790        if (identifier != null) {
1791          dst.identifier = new ArrayList<Identifier>();
1792          for (Identifier i : identifier)
1793            dst.identifier.add(i.copy());
1794        };
1795        dst.name = name == null ? null : name.copy();
1796        dst.type = type == null ? null : type.copy();
1797        dst.description = description == null ? null : description.copy();
1798        if (intendedExposure != null) {
1799          dst.intendedExposure = new ArrayList<Reference>();
1800          for (Reference i : intendedExposure)
1801            dst.intendedExposure.add(i.copy());
1802        };
1803        dst.observedGroup = observedGroup == null ? null : observedGroup.copy();
1804      }
1805
1806      @Override
1807      public boolean equalsDeep(Base other_) {
1808        if (!super.equalsDeep(other_))
1809          return false;
1810        if (!(other_ instanceof ResearchStudyComparisonGroupComponent))
1811          return false;
1812        ResearchStudyComparisonGroupComponent o = (ResearchStudyComparisonGroupComponent) other_;
1813        return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(type, o.type, true)
1814           && compareDeep(description, o.description, true) && compareDeep(intendedExposure, o.intendedExposure, true)
1815           && compareDeep(observedGroup, o.observedGroup, true);
1816      }
1817
1818      @Override
1819      public boolean equalsShallow(Base other_) {
1820        if (!super.equalsShallow(other_))
1821          return false;
1822        if (!(other_ instanceof ResearchStudyComparisonGroupComponent))
1823          return false;
1824        ResearchStudyComparisonGroupComponent o = (ResearchStudyComparisonGroupComponent) other_;
1825        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
1826      }
1827
1828      public boolean isEmpty() {
1829        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, name, type, description
1830          , intendedExposure, observedGroup);
1831      }
1832
1833  public String fhirType() {
1834    return "ResearchStudy.comparisonGroup";
1835
1836  }
1837
1838  }
1839
1840    @Block()
1841    public static class ResearchStudyObjectiveComponent extends BackboneElement implements IBaseBackboneElement {
1842        /**
1843         * Unique, human-readable label for this objective of the study.
1844         */
1845        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1846        @Description(shortDefinition="Label for the objective", formalDefinition="Unique, human-readable label for this objective of the study." )
1847        protected StringType name;
1848
1849        /**
1850         * The kind of study objective.
1851         */
1852        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1853        @Description(shortDefinition="primary | secondary | exploratory", formalDefinition="The kind of study objective." )
1854        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-objective-type")
1855        protected CodeableConcept type;
1856
1857        /**
1858         * Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).
1859         */
1860        @Child(name = "description", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1861        @Description(shortDefinition="Description of the objective", formalDefinition="Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description)." )
1862        protected MarkdownType description;
1863
1864        private static final long serialVersionUID = -1976083810L;
1865
1866    /**
1867     * Constructor
1868     */
1869      public ResearchStudyObjectiveComponent() {
1870        super();
1871      }
1872
1873        /**
1874         * @return {@link #name} (Unique, human-readable label for this objective of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1875         */
1876        public StringType getNameElement() { 
1877          if (this.name == null)
1878            if (Configuration.errorOnAutoCreate())
1879              throw new Error("Attempt to auto-create ResearchStudyObjectiveComponent.name");
1880            else if (Configuration.doAutoCreate())
1881              this.name = new StringType(); // bb
1882          return this.name;
1883        }
1884
1885        public boolean hasNameElement() { 
1886          return this.name != null && !this.name.isEmpty();
1887        }
1888
1889        public boolean hasName() { 
1890          return this.name != null && !this.name.isEmpty();
1891        }
1892
1893        /**
1894         * @param value {@link #name} (Unique, human-readable label for this objective of the study.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1895         */
1896        public ResearchStudyObjectiveComponent setNameElement(StringType value) { 
1897          this.name = value;
1898          return this;
1899        }
1900
1901        /**
1902         * @return Unique, human-readable label for this objective of the study.
1903         */
1904        public String getName() { 
1905          return this.name == null ? null : this.name.getValue();
1906        }
1907
1908        /**
1909         * @param value Unique, human-readable label for this objective of the study.
1910         */
1911        public ResearchStudyObjectiveComponent setName(String value) { 
1912          if (Utilities.noString(value))
1913            this.name = null;
1914          else {
1915            if (this.name == null)
1916              this.name = new StringType();
1917            this.name.setValue(value);
1918          }
1919          return this;
1920        }
1921
1922        /**
1923         * @return {@link #type} (The kind of study objective.)
1924         */
1925        public CodeableConcept getType() { 
1926          if (this.type == null)
1927            if (Configuration.errorOnAutoCreate())
1928              throw new Error("Attempt to auto-create ResearchStudyObjectiveComponent.type");
1929            else if (Configuration.doAutoCreate())
1930              this.type = new CodeableConcept(); // cc
1931          return this.type;
1932        }
1933
1934        public boolean hasType() { 
1935          return this.type != null && !this.type.isEmpty();
1936        }
1937
1938        /**
1939         * @param value {@link #type} (The kind of study objective.)
1940         */
1941        public ResearchStudyObjectiveComponent setType(CodeableConcept value) { 
1942          this.type = value;
1943          return this;
1944        }
1945
1946        /**
1947         * @return {@link #description} (Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1948         */
1949        public MarkdownType getDescriptionElement() { 
1950          if (this.description == null)
1951            if (Configuration.errorOnAutoCreate())
1952              throw new Error("Attempt to auto-create ResearchStudyObjectiveComponent.description");
1953            else if (Configuration.doAutoCreate())
1954              this.description = new MarkdownType(); // bb
1955          return this.description;
1956        }
1957
1958        public boolean hasDescriptionElement() { 
1959          return this.description != null && !this.description.isEmpty();
1960        }
1961
1962        public boolean hasDescription() { 
1963          return this.description != null && !this.description.isEmpty();
1964        }
1965
1966        /**
1967         * @param value {@link #description} (Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1968         */
1969        public ResearchStudyObjectiveComponent setDescriptionElement(MarkdownType value) { 
1970          this.description = value;
1971          return this;
1972        }
1973
1974        /**
1975         * @return Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).
1976         */
1977        public String getDescription() { 
1978          return this.description == null ? null : this.description.getValue();
1979        }
1980
1981        /**
1982         * @param value Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).
1983         */
1984        public ResearchStudyObjectiveComponent setDescription(String value) { 
1985          if (value == null)
1986            this.description = null;
1987          else {
1988            if (this.description == null)
1989              this.description = new MarkdownType();
1990            this.description.setValue(value);
1991          }
1992          return this;
1993        }
1994
1995        protected void listChildren(List<Property> children) {
1996          super.listChildren(children);
1997          children.add(new Property("name", "string", "Unique, human-readable label for this objective of the study.", 0, 1, name));
1998          children.add(new Property("type", "CodeableConcept", "The kind of study objective.", 0, 1, type));
1999          children.add(new Property("description", "markdown", "Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).", 0, 1, description));
2000        }
2001
2002        @Override
2003        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2004          switch (_hash) {
2005          case 3373707: /*name*/  return new Property("name", "string", "Unique, human-readable label for this objective of the study.", 0, 1, name);
2006          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of study objective.", 0, 1, type);
2007          case -1724546052: /*description*/  return new Property("description", "markdown", "Free text description of the objective of the study.  This is what the study is trying to achieve rather than how it is going to achieve it (see ResearchStudy.description).", 0, 1, description);
2008          default: return super.getNamedProperty(_hash, _name, _checkValid);
2009          }
2010
2011        }
2012
2013      @Override
2014      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2015        switch (hash) {
2016        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2017        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2018        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2019        default: return super.getProperty(hash, name, checkValid);
2020        }
2021
2022      }
2023
2024      @Override
2025      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2026        switch (hash) {
2027        case 3373707: // name
2028          this.name = TypeConvertor.castToString(value); // StringType
2029          return value;
2030        case 3575610: // type
2031          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2032          return value;
2033        case -1724546052: // description
2034          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2035          return value;
2036        default: return super.setProperty(hash, name, value);
2037        }
2038
2039      }
2040
2041      @Override
2042      public Base setProperty(String name, Base value) throws FHIRException {
2043        if (name.equals("name")) {
2044          this.name = TypeConvertor.castToString(value); // StringType
2045        } else if (name.equals("type")) {
2046          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2047        } else if (name.equals("description")) {
2048          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2049        } else
2050          return super.setProperty(name, value);
2051        return value;
2052      }
2053
2054      @Override
2055      public Base makeProperty(int hash, String name) throws FHIRException {
2056        switch (hash) {
2057        case 3373707:  return getNameElement();
2058        case 3575610:  return getType();
2059        case -1724546052:  return getDescriptionElement();
2060        default: return super.makeProperty(hash, name);
2061        }
2062
2063      }
2064
2065      @Override
2066      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2067        switch (hash) {
2068        case 3373707: /*name*/ return new String[] {"string"};
2069        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2070        case -1724546052: /*description*/ return new String[] {"markdown"};
2071        default: return super.getTypesForProperty(hash, name);
2072        }
2073
2074      }
2075
2076      @Override
2077      public Base addChild(String name) throws FHIRException {
2078        if (name.equals("name")) {
2079          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.objective.name");
2080        }
2081        else if (name.equals("type")) {
2082          this.type = new CodeableConcept();
2083          return this.type;
2084        }
2085        else if (name.equals("description")) {
2086          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.objective.description");
2087        }
2088        else
2089          return super.addChild(name);
2090      }
2091
2092      public ResearchStudyObjectiveComponent copy() {
2093        ResearchStudyObjectiveComponent dst = new ResearchStudyObjectiveComponent();
2094        copyValues(dst);
2095        return dst;
2096      }
2097
2098      public void copyValues(ResearchStudyObjectiveComponent dst) {
2099        super.copyValues(dst);
2100        dst.name = name == null ? null : name.copy();
2101        dst.type = type == null ? null : type.copy();
2102        dst.description = description == null ? null : description.copy();
2103      }
2104
2105      @Override
2106      public boolean equalsDeep(Base other_) {
2107        if (!super.equalsDeep(other_))
2108          return false;
2109        if (!(other_ instanceof ResearchStudyObjectiveComponent))
2110          return false;
2111        ResearchStudyObjectiveComponent o = (ResearchStudyObjectiveComponent) other_;
2112        return compareDeep(name, o.name, true) && compareDeep(type, o.type, true) && compareDeep(description, o.description, true)
2113          ;
2114      }
2115
2116      @Override
2117      public boolean equalsShallow(Base other_) {
2118        if (!super.equalsShallow(other_))
2119          return false;
2120        if (!(other_ instanceof ResearchStudyObjectiveComponent))
2121          return false;
2122        ResearchStudyObjectiveComponent o = (ResearchStudyObjectiveComponent) other_;
2123        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
2124      }
2125
2126      public boolean isEmpty() {
2127        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type, description
2128          );
2129      }
2130
2131  public String fhirType() {
2132    return "ResearchStudy.objective";
2133
2134  }
2135
2136  }
2137
2138    @Block()
2139    public static class ResearchStudyOutcomeMeasureComponent extends BackboneElement implements IBaseBackboneElement {
2140        /**
2141         * Label for the outcome.
2142         */
2143        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2144        @Description(shortDefinition="Label for the outcome", formalDefinition="Label for the outcome." )
2145        protected StringType name;
2146
2147        /**
2148         * The parameter or characteristic being assessed as one of the values by which the study is assessed.
2149         */
2150        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2151        @Description(shortDefinition="primary | secondary | exploratory", formalDefinition="The parameter or characteristic being assessed as one of the values by which the study is assessed." )
2152        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-objective-type")
2153        protected List<CodeableConcept> type;
2154
2155        /**
2156         * Description of the outcome.
2157         */
2158        @Child(name = "description", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2159        @Description(shortDefinition="Description of the outcome", formalDefinition="Description of the outcome." )
2160        protected MarkdownType description;
2161
2162        /**
2163         * Structured outcome definition.
2164         */
2165        @Child(name = "reference", type = {EvidenceVariable.class}, order=4, min=0, max=1, modifier=false, summary=false)
2166        @Description(shortDefinition="Structured outcome definition", formalDefinition="Structured outcome definition." )
2167        protected Reference reference;
2168
2169        private static final long serialVersionUID = 1786559672L;
2170
2171    /**
2172     * Constructor
2173     */
2174      public ResearchStudyOutcomeMeasureComponent() {
2175        super();
2176      }
2177
2178        /**
2179         * @return {@link #name} (Label for the outcome.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2180         */
2181        public StringType getNameElement() { 
2182          if (this.name == null)
2183            if (Configuration.errorOnAutoCreate())
2184              throw new Error("Attempt to auto-create ResearchStudyOutcomeMeasureComponent.name");
2185            else if (Configuration.doAutoCreate())
2186              this.name = new StringType(); // bb
2187          return this.name;
2188        }
2189
2190        public boolean hasNameElement() { 
2191          return this.name != null && !this.name.isEmpty();
2192        }
2193
2194        public boolean hasName() { 
2195          return this.name != null && !this.name.isEmpty();
2196        }
2197
2198        /**
2199         * @param value {@link #name} (Label for the outcome.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2200         */
2201        public ResearchStudyOutcomeMeasureComponent setNameElement(StringType value) { 
2202          this.name = value;
2203          return this;
2204        }
2205
2206        /**
2207         * @return Label for the outcome.
2208         */
2209        public String getName() { 
2210          return this.name == null ? null : this.name.getValue();
2211        }
2212
2213        /**
2214         * @param value Label for the outcome.
2215         */
2216        public ResearchStudyOutcomeMeasureComponent setName(String value) { 
2217          if (Utilities.noString(value))
2218            this.name = null;
2219          else {
2220            if (this.name == null)
2221              this.name = new StringType();
2222            this.name.setValue(value);
2223          }
2224          return this;
2225        }
2226
2227        /**
2228         * @return {@link #type} (The parameter or characteristic being assessed as one of the values by which the study is assessed.)
2229         */
2230        public List<CodeableConcept> getType() { 
2231          if (this.type == null)
2232            this.type = new ArrayList<CodeableConcept>();
2233          return this.type;
2234        }
2235
2236        /**
2237         * @return Returns a reference to <code>this</code> for easy method chaining
2238         */
2239        public ResearchStudyOutcomeMeasureComponent setType(List<CodeableConcept> theType) { 
2240          this.type = theType;
2241          return this;
2242        }
2243
2244        public boolean hasType() { 
2245          if (this.type == null)
2246            return false;
2247          for (CodeableConcept item : this.type)
2248            if (!item.isEmpty())
2249              return true;
2250          return false;
2251        }
2252
2253        public CodeableConcept addType() { //3
2254          CodeableConcept t = new CodeableConcept();
2255          if (this.type == null)
2256            this.type = new ArrayList<CodeableConcept>();
2257          this.type.add(t);
2258          return t;
2259        }
2260
2261        public ResearchStudyOutcomeMeasureComponent addType(CodeableConcept t) { //3
2262          if (t == null)
2263            return this;
2264          if (this.type == null)
2265            this.type = new ArrayList<CodeableConcept>();
2266          this.type.add(t);
2267          return this;
2268        }
2269
2270        /**
2271         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
2272         */
2273        public CodeableConcept getTypeFirstRep() { 
2274          if (getType().isEmpty()) {
2275            addType();
2276          }
2277          return getType().get(0);
2278        }
2279
2280        /**
2281         * @return {@link #description} (Description of the outcome.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2282         */
2283        public MarkdownType getDescriptionElement() { 
2284          if (this.description == null)
2285            if (Configuration.errorOnAutoCreate())
2286              throw new Error("Attempt to auto-create ResearchStudyOutcomeMeasureComponent.description");
2287            else if (Configuration.doAutoCreate())
2288              this.description = new MarkdownType(); // bb
2289          return this.description;
2290        }
2291
2292        public boolean hasDescriptionElement() { 
2293          return this.description != null && !this.description.isEmpty();
2294        }
2295
2296        public boolean hasDescription() { 
2297          return this.description != null && !this.description.isEmpty();
2298        }
2299
2300        /**
2301         * @param value {@link #description} (Description of the outcome.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2302         */
2303        public ResearchStudyOutcomeMeasureComponent setDescriptionElement(MarkdownType value) { 
2304          this.description = value;
2305          return this;
2306        }
2307
2308        /**
2309         * @return Description of the outcome.
2310         */
2311        public String getDescription() { 
2312          return this.description == null ? null : this.description.getValue();
2313        }
2314
2315        /**
2316         * @param value Description of the outcome.
2317         */
2318        public ResearchStudyOutcomeMeasureComponent setDescription(String value) { 
2319          if (value == null)
2320            this.description = null;
2321          else {
2322            if (this.description == null)
2323              this.description = new MarkdownType();
2324            this.description.setValue(value);
2325          }
2326          return this;
2327        }
2328
2329        /**
2330         * @return {@link #reference} (Structured outcome definition.)
2331         */
2332        public Reference getReference() { 
2333          if (this.reference == null)
2334            if (Configuration.errorOnAutoCreate())
2335              throw new Error("Attempt to auto-create ResearchStudyOutcomeMeasureComponent.reference");
2336            else if (Configuration.doAutoCreate())
2337              this.reference = new Reference(); // cc
2338          return this.reference;
2339        }
2340
2341        public boolean hasReference() { 
2342          return this.reference != null && !this.reference.isEmpty();
2343        }
2344
2345        /**
2346         * @param value {@link #reference} (Structured outcome definition.)
2347         */
2348        public ResearchStudyOutcomeMeasureComponent setReference(Reference value) { 
2349          this.reference = value;
2350          return this;
2351        }
2352
2353        protected void listChildren(List<Property> children) {
2354          super.listChildren(children);
2355          children.add(new Property("name", "string", "Label for the outcome.", 0, 1, name));
2356          children.add(new Property("type", "CodeableConcept", "The parameter or characteristic being assessed as one of the values by which the study is assessed.", 0, java.lang.Integer.MAX_VALUE, type));
2357          children.add(new Property("description", "markdown", "Description of the outcome.", 0, 1, description));
2358          children.add(new Property("reference", "Reference(EvidenceVariable)", "Structured outcome definition.", 0, 1, reference));
2359        }
2360
2361        @Override
2362        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2363          switch (_hash) {
2364          case 3373707: /*name*/  return new Property("name", "string", "Label for the outcome.", 0, 1, name);
2365          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The parameter or characteristic being assessed as one of the values by which the study is assessed.", 0, java.lang.Integer.MAX_VALUE, type);
2366          case -1724546052: /*description*/  return new Property("description", "markdown", "Description of the outcome.", 0, 1, description);
2367          case -925155509: /*reference*/  return new Property("reference", "Reference(EvidenceVariable)", "Structured outcome definition.", 0, 1, reference);
2368          default: return super.getNamedProperty(_hash, _name, _checkValid);
2369          }
2370
2371        }
2372
2373      @Override
2374      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2375        switch (hash) {
2376        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2377        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
2378        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2379        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
2380        default: return super.getProperty(hash, name, checkValid);
2381        }
2382
2383      }
2384
2385      @Override
2386      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2387        switch (hash) {
2388        case 3373707: // name
2389          this.name = TypeConvertor.castToString(value); // StringType
2390          return value;
2391        case 3575610: // type
2392          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2393          return value;
2394        case -1724546052: // description
2395          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2396          return value;
2397        case -925155509: // reference
2398          this.reference = TypeConvertor.castToReference(value); // Reference
2399          return value;
2400        default: return super.setProperty(hash, name, value);
2401        }
2402
2403      }
2404
2405      @Override
2406      public Base setProperty(String name, Base value) throws FHIRException {
2407        if (name.equals("name")) {
2408          this.name = TypeConvertor.castToString(value); // StringType
2409        } else if (name.equals("type")) {
2410          this.getType().add(TypeConvertor.castToCodeableConcept(value));
2411        } else if (name.equals("description")) {
2412          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2413        } else if (name.equals("reference")) {
2414          this.reference = TypeConvertor.castToReference(value); // Reference
2415        } else
2416          return super.setProperty(name, value);
2417        return value;
2418      }
2419
2420      @Override
2421      public Base makeProperty(int hash, String name) throws FHIRException {
2422        switch (hash) {
2423        case 3373707:  return getNameElement();
2424        case 3575610:  return addType(); 
2425        case -1724546052:  return getDescriptionElement();
2426        case -925155509:  return getReference();
2427        default: return super.makeProperty(hash, name);
2428        }
2429
2430      }
2431
2432      @Override
2433      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2434        switch (hash) {
2435        case 3373707: /*name*/ return new String[] {"string"};
2436        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2437        case -1724546052: /*description*/ return new String[] {"markdown"};
2438        case -925155509: /*reference*/ return new String[] {"Reference"};
2439        default: return super.getTypesForProperty(hash, name);
2440        }
2441
2442      }
2443
2444      @Override
2445      public Base addChild(String name) throws FHIRException {
2446        if (name.equals("name")) {
2447          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.outcomeMeasure.name");
2448        }
2449        else if (name.equals("type")) {
2450          return addType();
2451        }
2452        else if (name.equals("description")) {
2453          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.outcomeMeasure.description");
2454        }
2455        else if (name.equals("reference")) {
2456          this.reference = new Reference();
2457          return this.reference;
2458        }
2459        else
2460          return super.addChild(name);
2461      }
2462
2463      public ResearchStudyOutcomeMeasureComponent copy() {
2464        ResearchStudyOutcomeMeasureComponent dst = new ResearchStudyOutcomeMeasureComponent();
2465        copyValues(dst);
2466        return dst;
2467      }
2468
2469      public void copyValues(ResearchStudyOutcomeMeasureComponent dst) {
2470        super.copyValues(dst);
2471        dst.name = name == null ? null : name.copy();
2472        if (type != null) {
2473          dst.type = new ArrayList<CodeableConcept>();
2474          for (CodeableConcept i : type)
2475            dst.type.add(i.copy());
2476        };
2477        dst.description = description == null ? null : description.copy();
2478        dst.reference = reference == null ? null : reference.copy();
2479      }
2480
2481      @Override
2482      public boolean equalsDeep(Base other_) {
2483        if (!super.equalsDeep(other_))
2484          return false;
2485        if (!(other_ instanceof ResearchStudyOutcomeMeasureComponent))
2486          return false;
2487        ResearchStudyOutcomeMeasureComponent o = (ResearchStudyOutcomeMeasureComponent) other_;
2488        return compareDeep(name, o.name, true) && compareDeep(type, o.type, true) && compareDeep(description, o.description, true)
2489           && compareDeep(reference, o.reference, true);
2490      }
2491
2492      @Override
2493      public boolean equalsShallow(Base other_) {
2494        if (!super.equalsShallow(other_))
2495          return false;
2496        if (!(other_ instanceof ResearchStudyOutcomeMeasureComponent))
2497          return false;
2498        ResearchStudyOutcomeMeasureComponent o = (ResearchStudyOutcomeMeasureComponent) other_;
2499        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
2500      }
2501
2502      public boolean isEmpty() {
2503        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type, description
2504          , reference);
2505      }
2506
2507  public String fhirType() {
2508    return "ResearchStudy.outcomeMeasure";
2509
2510  }
2511
2512  }
2513
2514    /**
2515     * Canonical identifier for this study resource, represented as a globally unique URI.
2516     */
2517    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=false)
2518    @Description(shortDefinition="Canonical identifier for this study resource", formalDefinition="Canonical identifier for this study resource, represented as a globally unique URI." )
2519    protected UriType url;
2520
2521    /**
2522     * Identifiers assigned to this research study by the sponsor or other systems.
2523     */
2524    @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2525    @Description(shortDefinition="Business Identifier for study", formalDefinition="Identifiers assigned to this research study by the sponsor or other systems." )
2526    protected List<Identifier> identifier;
2527
2528    /**
2529     * The business version for the study record.
2530     */
2531    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2532    @Description(shortDefinition="The business version for the study record", formalDefinition="The business version for the study record." )
2533    protected StringType version;
2534
2535    /**
2536     * Name for this study (computer friendly).
2537     */
2538    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2539    @Description(shortDefinition="Name for this study (computer friendly)", formalDefinition="Name for this study (computer friendly)." )
2540    protected StringType name;
2541
2542    /**
2543     * The human readable name of the research study.
2544     */
2545    @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2546    @Description(shortDefinition="Human readable name of the study", formalDefinition="The human readable name of the research study." )
2547    protected StringType title;
2548
2549    /**
2550     * Additional names for the study.
2551     */
2552    @Child(name = "label", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2553    @Description(shortDefinition="Additional names for the study", formalDefinition="Additional names for the study." )
2554    protected List<ResearchStudyLabelComponent> label;
2555
2556    /**
2557     * The set of steps expected to be performed as part of the execution of the study.
2558     */
2559    @Child(name = "protocol", type = {PlanDefinition.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2560    @Description(shortDefinition="Steps followed in executing study", formalDefinition="The set of steps expected to be performed as part of the execution of the study." )
2561    protected List<Reference> protocol;
2562
2563    /**
2564     * A larger research study of which this particular study is a component or step.
2565     */
2566    @Child(name = "partOf", type = {ResearchStudy.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2567    @Description(shortDefinition="Part of larger study", formalDefinition="A larger research study of which this particular study is a component or step." )
2568    protected List<Reference> partOf;
2569
2570    /**
2571     * Citations, references, URLs and other related documents.  When using relatedArtifact to share URLs, the relatedArtifact.type will often be set to one of "documentation" or "supported-with" and the URL value will often be in relatedArtifact.document.url but another possible location is relatedArtifact.resource when it is a canonical URL.
2572     */
2573    @Child(name = "relatedArtifact", type = {RelatedArtifact.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2574    @Description(shortDefinition="References, URLs, and attachments", formalDefinition="Citations, references, URLs and other related documents.  When using relatedArtifact to share URLs, the relatedArtifact.type will often be set to one of \"documentation\" or \"supported-with\" and the URL value will often be in relatedArtifact.document.url but another possible location is relatedArtifact.resource when it is a canonical URL." )
2575    protected List<RelatedArtifact> relatedArtifact;
2576
2577    /**
2578     * The date (and optionally time) when the ResearchStudy Resource was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.
2579     */
2580    @Child(name = "date", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=false)
2581    @Description(shortDefinition="Date the resource last changed", formalDefinition="The date (and optionally time) when the ResearchStudy Resource was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes." )
2582    protected DateTimeType date;
2583
2584    /**
2585     * The publication state of the resource (not of the study).
2586     */
2587    @Child(name = "status", type = {CodeType.class}, order=10, min=1, max=1, modifier=true, summary=true)
2588    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The publication state of the resource (not of the study)." )
2589    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
2590    protected Enumeration<PublicationStatus> status;
2591
2592    /**
2593     * The type of study based upon the intent of the study activities. A classification of the intent of the study.
2594     */
2595    @Child(name = "primaryPurposeType", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=true)
2596    @Description(shortDefinition="treatment | prevention | diagnostic | supportive-care | screening | health-services-research | basic-science | device-feasibility", formalDefinition="The type of study based upon the intent of the study activities. A classification of the intent of the study." )
2597    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-prim-purp-type")
2598    protected CodeableConcept primaryPurposeType;
2599
2600    /**
2601     * The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.
2602     */
2603    @Child(name = "phase", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=true)
2604    @Description(shortDefinition="n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | phase-2-phase-3 | phase-3 | phase-4", formalDefinition="The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation." )
2605    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-phase")
2606    protected CodeableConcept phase;
2607
2608    /**
2609     * Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.
2610     */
2611    @Child(name = "studyDesign", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2612    @Description(shortDefinition="Classifications of the study design characteristics", formalDefinition="Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc." )
2613    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/study-design")
2614    protected List<CodeableConcept> studyDesign;
2615
2616    /**
2617     * The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.
2618     */
2619    @Child(name = "focus", type = {CodeableReference.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2620    @Description(shortDefinition="Drugs, devices, etc. under study", formalDefinition="The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about." )
2621    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-focus-type")
2622    protected List<CodeableReference> focus;
2623
2624    /**
2625     * The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion "healthy volunteer", but the target condition code would be a Lupus SNOMED code.
2626     */
2627    @Child(name = "condition", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2628    @Description(shortDefinition="Condition being studied", formalDefinition="The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion \"healthy volunteer\", but the target condition code would be a Lupus SNOMED code." )
2629    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
2630    protected List<CodeableConcept> condition;
2631
2632    /**
2633     * Key terms to aid in searching for or filtering the study.
2634     */
2635    @Child(name = "keyword", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2636    @Description(shortDefinition="Used to search for the study", formalDefinition="Key terms to aid in searching for or filtering the study." )
2637    protected List<CodeableConcept> keyword;
2638
2639    /**
2640     * A country, state or other area where the study is taking place rather than its precise geographic location or address.
2641     */
2642    @Child(name = "region", type = {CodeableConcept.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2643    @Description(shortDefinition="Geographic area for the study", formalDefinition="A country, state or other area where the study is taking place rather than its precise geographic location or address." )
2644    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
2645    protected List<CodeableConcept> region;
2646
2647    /**
2648     * A brief text for explaining the study.
2649     */
2650    @Child(name = "descriptionSummary", type = {MarkdownType.class}, order=18, min=0, max=1, modifier=false, summary=false)
2651    @Description(shortDefinition="Brief text explaining the study", formalDefinition="A brief text for explaining the study." )
2652    protected MarkdownType descriptionSummary;
2653
2654    /**
2655     * A detailed and human-readable narrative of the study. E.g., study abstract.
2656     */
2657    @Child(name = "description", type = {MarkdownType.class}, order=19, min=0, max=1, modifier=false, summary=false)
2658    @Description(shortDefinition="Detailed narrative of the study", formalDefinition="A detailed and human-readable narrative of the study. E.g., study abstract." )
2659    protected MarkdownType description;
2660
2661    /**
2662     * Identifies the start date and the expected (or actual, depending on status) end date for the study.
2663     */
2664    @Child(name = "period", type = {Period.class}, order=20, min=0, max=1, modifier=false, summary=true)
2665    @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." )
2666    protected Period period;
2667
2668    /**
2669     * A facility in which study activities are conducted.
2670     */
2671    @Child(name = "site", type = {Location.class, ResearchStudy.class, Organization.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2672    @Description(shortDefinition="Facility where study activities are conducted", formalDefinition="A facility in which study activities are conducted." )
2673    protected List<Reference> site;
2674
2675    /**
2676     * Comments made about the study by the performer, subject or other participants.
2677     */
2678    @Child(name = "note", type = {Annotation.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2679    @Description(shortDefinition="Comments made about the study", formalDefinition="Comments made about the study by the performer, subject or other participants." )
2680    protected List<Annotation> note;
2681
2682    /**
2683     * Additional grouping mechanism or categorization of a research study. Example: FDA regulated device, FDA regulated drug, MPG Paragraph 23b (a German legal requirement), IRB-exempt, etc. Implementation Note: do not use the classifier element to support existing semantics that are already supported thru explicit elements in the resource.
2684     */
2685    @Child(name = "classifier", type = {CodeableConcept.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2686    @Description(shortDefinition="Classification for the study", formalDefinition="Additional grouping mechanism or categorization of a research study. Example: FDA regulated device, FDA regulated drug, MPG Paragraph 23b (a German legal requirement), IRB-exempt, etc. Implementation Note: do not use the classifier element to support existing semantics that are already supported thru explicit elements in the resource." )
2687    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-classifiers")
2688    protected List<CodeableConcept> classifier;
2689
2690    /**
2691     * Sponsors, collaborators, and other parties.
2692     */
2693    @Child(name = "associatedParty", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2694    @Description(shortDefinition="Sponsors, collaborators, and other parties", formalDefinition="Sponsors, collaborators, and other parties." )
2695    protected List<ResearchStudyAssociatedPartyComponent> associatedParty;
2696
2697    /**
2698     * Status of study with time for that status.
2699     */
2700    @Child(name = "progressStatus", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2701    @Description(shortDefinition="Status of study with time for that status", formalDefinition="Status of study with time for that status." )
2702    protected List<ResearchStudyProgressStatusComponent> progressStatus;
2703
2704    /**
2705     * A description and/or code explaining the premature termination of the study.
2706     */
2707    @Child(name = "whyStopped", type = {CodeableConcept.class}, order=26, min=0, max=1, modifier=false, summary=true)
2708    @Description(shortDefinition="accrual-goal-met | closed-due-to-toxicity | closed-due-to-lack-of-study-progress | temporarily-closed-per-study-design", formalDefinition="A description and/or code explaining the premature termination of the study." )
2709    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-study-reason-stopped")
2710    protected CodeableConcept whyStopped;
2711
2712    /**
2713     * Target or actual group of participants enrolled in study.
2714     */
2715    @Child(name = "recruitment", type = {}, order=27, min=0, max=1, modifier=false, summary=true)
2716    @Description(shortDefinition="Target or actual group of participants enrolled in study", formalDefinition="Target or actual group of participants enrolled in study." )
2717    protected ResearchStudyRecruitmentComponent recruitment;
2718
2719    /**
2720     * Describes an expected event or sequence of events for one of the subjects of a study. E.g. for a living subject: exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. E.g. for a stability study: {store sample from lot A at 25 degrees for 1 month}, {store sample from lot A at 40 degrees for 1 month}.
2721     */
2722    @Child(name = "comparisonGroup", type = {}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2723    @Description(shortDefinition="Defined path through the study for a subject", formalDefinition="Describes an expected event or sequence of events for one of the subjects of a study. E.g. for a living subject: exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. E.g. for a stability study: {store sample from lot A at 25 degrees for 1 month}, {store sample from lot A at 40 degrees for 1 month}." )
2724    protected List<ResearchStudyComparisonGroupComponent> comparisonGroup;
2725
2726    /**
2727     * A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study.
2728     */
2729    @Child(name = "objective", type = {}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2730    @Description(shortDefinition="A goal for the study", formalDefinition="A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study." )
2731    protected List<ResearchStudyObjectiveComponent> objective;
2732
2733    /**
2734     * An "outcome measure", "endpoint", "effect measure" or "measure of effect" is a specific measurement or observation used to quantify the effect of experimental variables on the participants in a study, or for observational studies, to describe patterns of diseases or traits or associations with exposures, risk factors or treatment.
2735     */
2736    @Child(name = "outcomeMeasure", type = {}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2737    @Description(shortDefinition="A variable measured during the study", formalDefinition="An \"outcome measure\", \"endpoint\", \"effect measure\" or \"measure of effect\" is a specific measurement or observation used to quantify the effect of experimental variables on the participants in a study, or for observational studies, to describe patterns of diseases or traits or associations with exposures, risk factors or treatment." )
2738    protected List<ResearchStudyOutcomeMeasureComponent> outcomeMeasure;
2739
2740    /**
2741     * Link to one or more sets of results generated by the study.  Could also link to a research registry holding the results such as ClinicalTrials.gov.
2742     */
2743    @Child(name = "result", type = {EvidenceReport.class, Citation.class, DiagnosticReport.class}, order=31, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2744    @Description(shortDefinition="Link to results generated during the study", formalDefinition="Link to one or more sets of results generated by the study.  Could also link to a research registry holding the results such as ClinicalTrials.gov." )
2745    protected List<Reference> result;
2746
2747    private static final long serialVersionUID = -1217395129L;
2748
2749  /**
2750   * Constructor
2751   */
2752    public ResearchStudy() {
2753      super();
2754    }
2755
2756  /**
2757   * Constructor
2758   */
2759    public ResearchStudy(PublicationStatus status) {
2760      super();
2761      this.setStatus(status);
2762    }
2763
2764    /**
2765     * @return {@link #url} (Canonical identifier for this study resource, represented as a globally unique URI.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2766     */
2767    public UriType getUrlElement() { 
2768      if (this.url == null)
2769        if (Configuration.errorOnAutoCreate())
2770          throw new Error("Attempt to auto-create ResearchStudy.url");
2771        else if (Configuration.doAutoCreate())
2772          this.url = new UriType(); // bb
2773      return this.url;
2774    }
2775
2776    public boolean hasUrlElement() { 
2777      return this.url != null && !this.url.isEmpty();
2778    }
2779
2780    public boolean hasUrl() { 
2781      return this.url != null && !this.url.isEmpty();
2782    }
2783
2784    /**
2785     * @param value {@link #url} (Canonical identifier for this study resource, represented as a globally unique URI.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2786     */
2787    public ResearchStudy setUrlElement(UriType value) { 
2788      this.url = value;
2789      return this;
2790    }
2791
2792    /**
2793     * @return Canonical identifier for this study resource, represented as a globally unique URI.
2794     */
2795    public String getUrl() { 
2796      return this.url == null ? null : this.url.getValue();
2797    }
2798
2799    /**
2800     * @param value Canonical identifier for this study resource, represented as a globally unique URI.
2801     */
2802    public ResearchStudy setUrl(String value) { 
2803      if (Utilities.noString(value))
2804        this.url = null;
2805      else {
2806        if (this.url == null)
2807          this.url = new UriType();
2808        this.url.setValue(value);
2809      }
2810      return this;
2811    }
2812
2813    /**
2814     * @return {@link #identifier} (Identifiers assigned to this research study by the sponsor or other systems.)
2815     */
2816    public List<Identifier> getIdentifier() { 
2817      if (this.identifier == null)
2818        this.identifier = new ArrayList<Identifier>();
2819      return this.identifier;
2820    }
2821
2822    /**
2823     * @return Returns a reference to <code>this</code> for easy method chaining
2824     */
2825    public ResearchStudy setIdentifier(List<Identifier> theIdentifier) { 
2826      this.identifier = theIdentifier;
2827      return this;
2828    }
2829
2830    public boolean hasIdentifier() { 
2831      if (this.identifier == null)
2832        return false;
2833      for (Identifier item : this.identifier)
2834        if (!item.isEmpty())
2835          return true;
2836      return false;
2837    }
2838
2839    public Identifier addIdentifier() { //3
2840      Identifier t = new Identifier();
2841      if (this.identifier == null)
2842        this.identifier = new ArrayList<Identifier>();
2843      this.identifier.add(t);
2844      return t;
2845    }
2846
2847    public ResearchStudy addIdentifier(Identifier t) { //3
2848      if (t == null)
2849        return this;
2850      if (this.identifier == null)
2851        this.identifier = new ArrayList<Identifier>();
2852      this.identifier.add(t);
2853      return this;
2854    }
2855
2856    /**
2857     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2858     */
2859    public Identifier getIdentifierFirstRep() { 
2860      if (getIdentifier().isEmpty()) {
2861        addIdentifier();
2862      }
2863      return getIdentifier().get(0);
2864    }
2865
2866    /**
2867     * @return {@link #version} (The business version for the study record.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2868     */
2869    public StringType getVersionElement() { 
2870      if (this.version == null)
2871        if (Configuration.errorOnAutoCreate())
2872          throw new Error("Attempt to auto-create ResearchStudy.version");
2873        else if (Configuration.doAutoCreate())
2874          this.version = new StringType(); // bb
2875      return this.version;
2876    }
2877
2878    public boolean hasVersionElement() { 
2879      return this.version != null && !this.version.isEmpty();
2880    }
2881
2882    public boolean hasVersion() { 
2883      return this.version != null && !this.version.isEmpty();
2884    }
2885
2886    /**
2887     * @param value {@link #version} (The business version for the study record.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2888     */
2889    public ResearchStudy setVersionElement(StringType value) { 
2890      this.version = value;
2891      return this;
2892    }
2893
2894    /**
2895     * @return The business version for the study record.
2896     */
2897    public String getVersion() { 
2898      return this.version == null ? null : this.version.getValue();
2899    }
2900
2901    /**
2902     * @param value The business version for the study record.
2903     */
2904    public ResearchStudy setVersion(String value) { 
2905      if (Utilities.noString(value))
2906        this.version = null;
2907      else {
2908        if (this.version == null)
2909          this.version = new StringType();
2910        this.version.setValue(value);
2911      }
2912      return this;
2913    }
2914
2915    /**
2916     * @return {@link #name} (Name for this study (computer friendly).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2917     */
2918    public StringType getNameElement() { 
2919      if (this.name == null)
2920        if (Configuration.errorOnAutoCreate())
2921          throw new Error("Attempt to auto-create ResearchStudy.name");
2922        else if (Configuration.doAutoCreate())
2923          this.name = new StringType(); // bb
2924      return this.name;
2925    }
2926
2927    public boolean hasNameElement() { 
2928      return this.name != null && !this.name.isEmpty();
2929    }
2930
2931    public boolean hasName() { 
2932      return this.name != null && !this.name.isEmpty();
2933    }
2934
2935    /**
2936     * @param value {@link #name} (Name for this study (computer friendly).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2937     */
2938    public ResearchStudy setNameElement(StringType value) { 
2939      this.name = value;
2940      return this;
2941    }
2942
2943    /**
2944     * @return Name for this study (computer friendly).
2945     */
2946    public String getName() { 
2947      return this.name == null ? null : this.name.getValue();
2948    }
2949
2950    /**
2951     * @param value Name for this study (computer friendly).
2952     */
2953    public ResearchStudy setName(String value) { 
2954      if (Utilities.noString(value))
2955        this.name = null;
2956      else {
2957        if (this.name == null)
2958          this.name = new StringType();
2959        this.name.setValue(value);
2960      }
2961      return this;
2962    }
2963
2964    /**
2965     * @return {@link #title} (The human readable name of the research study.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2966     */
2967    public StringType getTitleElement() { 
2968      if (this.title == null)
2969        if (Configuration.errorOnAutoCreate())
2970          throw new Error("Attempt to auto-create ResearchStudy.title");
2971        else if (Configuration.doAutoCreate())
2972          this.title = new StringType(); // bb
2973      return this.title;
2974    }
2975
2976    public boolean hasTitleElement() { 
2977      return this.title != null && !this.title.isEmpty();
2978    }
2979
2980    public boolean hasTitle() { 
2981      return this.title != null && !this.title.isEmpty();
2982    }
2983
2984    /**
2985     * @param value {@link #title} (The human readable name of the research study.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2986     */
2987    public ResearchStudy setTitleElement(StringType value) { 
2988      this.title = value;
2989      return this;
2990    }
2991
2992    /**
2993     * @return The human readable name of the research study.
2994     */
2995    public String getTitle() { 
2996      return this.title == null ? null : this.title.getValue();
2997    }
2998
2999    /**
3000     * @param value The human readable name of the research study.
3001     */
3002    public ResearchStudy setTitle(String value) { 
3003      if (Utilities.noString(value))
3004        this.title = null;
3005      else {
3006        if (this.title == null)
3007          this.title = new StringType();
3008        this.title.setValue(value);
3009      }
3010      return this;
3011    }
3012
3013    /**
3014     * @return {@link #label} (Additional names for the study.)
3015     */
3016    public List<ResearchStudyLabelComponent> getLabel() { 
3017      if (this.label == null)
3018        this.label = new ArrayList<ResearchStudyLabelComponent>();
3019      return this.label;
3020    }
3021
3022    /**
3023     * @return Returns a reference to <code>this</code> for easy method chaining
3024     */
3025    public ResearchStudy setLabel(List<ResearchStudyLabelComponent> theLabel) { 
3026      this.label = theLabel;
3027      return this;
3028    }
3029
3030    public boolean hasLabel() { 
3031      if (this.label == null)
3032        return false;
3033      for (ResearchStudyLabelComponent item : this.label)
3034        if (!item.isEmpty())
3035          return true;
3036      return false;
3037    }
3038
3039    public ResearchStudyLabelComponent addLabel() { //3
3040      ResearchStudyLabelComponent t = new ResearchStudyLabelComponent();
3041      if (this.label == null)
3042        this.label = new ArrayList<ResearchStudyLabelComponent>();
3043      this.label.add(t);
3044      return t;
3045    }
3046
3047    public ResearchStudy addLabel(ResearchStudyLabelComponent t) { //3
3048      if (t == null)
3049        return this;
3050      if (this.label == null)
3051        this.label = new ArrayList<ResearchStudyLabelComponent>();
3052      this.label.add(t);
3053      return this;
3054    }
3055
3056    /**
3057     * @return The first repetition of repeating field {@link #label}, creating it if it does not already exist {3}
3058     */
3059    public ResearchStudyLabelComponent getLabelFirstRep() { 
3060      if (getLabel().isEmpty()) {
3061        addLabel();
3062      }
3063      return getLabel().get(0);
3064    }
3065
3066    /**
3067     * @return {@link #protocol} (The set of steps expected to be performed as part of the execution of the study.)
3068     */
3069    public List<Reference> getProtocol() { 
3070      if (this.protocol == null)
3071        this.protocol = new ArrayList<Reference>();
3072      return this.protocol;
3073    }
3074
3075    /**
3076     * @return Returns a reference to <code>this</code> for easy method chaining
3077     */
3078    public ResearchStudy setProtocol(List<Reference> theProtocol) { 
3079      this.protocol = theProtocol;
3080      return this;
3081    }
3082
3083    public boolean hasProtocol() { 
3084      if (this.protocol == null)
3085        return false;
3086      for (Reference item : this.protocol)
3087        if (!item.isEmpty())
3088          return true;
3089      return false;
3090    }
3091
3092    public Reference addProtocol() { //3
3093      Reference t = new Reference();
3094      if (this.protocol == null)
3095        this.protocol = new ArrayList<Reference>();
3096      this.protocol.add(t);
3097      return t;
3098    }
3099
3100    public ResearchStudy addProtocol(Reference t) { //3
3101      if (t == null)
3102        return this;
3103      if (this.protocol == null)
3104        this.protocol = new ArrayList<Reference>();
3105      this.protocol.add(t);
3106      return this;
3107    }
3108
3109    /**
3110     * @return The first repetition of repeating field {@link #protocol}, creating it if it does not already exist {3}
3111     */
3112    public Reference getProtocolFirstRep() { 
3113      if (getProtocol().isEmpty()) {
3114        addProtocol();
3115      }
3116      return getProtocol().get(0);
3117    }
3118
3119    /**
3120     * @return {@link #partOf} (A larger research study of which this particular study is a component or step.)
3121     */
3122    public List<Reference> getPartOf() { 
3123      if (this.partOf == null)
3124        this.partOf = new ArrayList<Reference>();
3125      return this.partOf;
3126    }
3127
3128    /**
3129     * @return Returns a reference to <code>this</code> for easy method chaining
3130     */
3131    public ResearchStudy setPartOf(List<Reference> thePartOf) { 
3132      this.partOf = thePartOf;
3133      return this;
3134    }
3135
3136    public boolean hasPartOf() { 
3137      if (this.partOf == null)
3138        return false;
3139      for (Reference item : this.partOf)
3140        if (!item.isEmpty())
3141          return true;
3142      return false;
3143    }
3144
3145    public Reference addPartOf() { //3
3146      Reference t = new Reference();
3147      if (this.partOf == null)
3148        this.partOf = new ArrayList<Reference>();
3149      this.partOf.add(t);
3150      return t;
3151    }
3152
3153    public ResearchStudy addPartOf(Reference t) { //3
3154      if (t == null)
3155        return this;
3156      if (this.partOf == null)
3157        this.partOf = new ArrayList<Reference>();
3158      this.partOf.add(t);
3159      return this;
3160    }
3161
3162    /**
3163     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist {3}
3164     */
3165    public Reference getPartOfFirstRep() { 
3166      if (getPartOf().isEmpty()) {
3167        addPartOf();
3168      }
3169      return getPartOf().get(0);
3170    }
3171
3172    /**
3173     * @return {@link #relatedArtifact} (Citations, references, URLs and other related documents.  When using relatedArtifact to share URLs, the relatedArtifact.type will often be set to one of "documentation" or "supported-with" and the URL value will often be in relatedArtifact.document.url but another possible location is relatedArtifact.resource when it is a canonical URL.)
3174     */
3175    public List<RelatedArtifact> getRelatedArtifact() { 
3176      if (this.relatedArtifact == null)
3177        this.relatedArtifact = new ArrayList<RelatedArtifact>();
3178      return this.relatedArtifact;
3179    }
3180
3181    /**
3182     * @return Returns a reference to <code>this</code> for easy method chaining
3183     */
3184    public ResearchStudy setRelatedArtifact(List<RelatedArtifact> theRelatedArtifact) { 
3185      this.relatedArtifact = theRelatedArtifact;
3186      return this;
3187    }
3188
3189    public boolean hasRelatedArtifact() { 
3190      if (this.relatedArtifact == null)
3191        return false;
3192      for (RelatedArtifact item : this.relatedArtifact)
3193        if (!item.isEmpty())
3194          return true;
3195      return false;
3196    }
3197
3198    public RelatedArtifact addRelatedArtifact() { //3
3199      RelatedArtifact t = new RelatedArtifact();
3200      if (this.relatedArtifact == null)
3201        this.relatedArtifact = new ArrayList<RelatedArtifact>();
3202      this.relatedArtifact.add(t);
3203      return t;
3204    }
3205
3206    public ResearchStudy addRelatedArtifact(RelatedArtifact t) { //3
3207      if (t == null)
3208        return this;
3209      if (this.relatedArtifact == null)
3210        this.relatedArtifact = new ArrayList<RelatedArtifact>();
3211      this.relatedArtifact.add(t);
3212      return this;
3213    }
3214
3215    /**
3216     * @return The first repetition of repeating field {@link #relatedArtifact}, creating it if it does not already exist {3}
3217     */
3218    public RelatedArtifact getRelatedArtifactFirstRep() { 
3219      if (getRelatedArtifact().isEmpty()) {
3220        addRelatedArtifact();
3221      }
3222      return getRelatedArtifact().get(0);
3223    }
3224
3225    /**
3226     * @return {@link #date} (The date (and optionally time) when the ResearchStudy Resource was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
3227     */
3228    public DateTimeType getDateElement() { 
3229      if (this.date == null)
3230        if (Configuration.errorOnAutoCreate())
3231          throw new Error("Attempt to auto-create ResearchStudy.date");
3232        else if (Configuration.doAutoCreate())
3233          this.date = new DateTimeType(); // bb
3234      return this.date;
3235    }
3236
3237    public boolean hasDateElement() { 
3238      return this.date != null && !this.date.isEmpty();
3239    }
3240
3241    public boolean hasDate() { 
3242      return this.date != null && !this.date.isEmpty();
3243    }
3244
3245    /**
3246     * @param value {@link #date} (The date (and optionally time) when the ResearchStudy Resource was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
3247     */
3248    public ResearchStudy setDateElement(DateTimeType value) { 
3249      this.date = value;
3250      return this;
3251    }
3252
3253    /**
3254     * @return The date (and optionally time) when the ResearchStudy Resource was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.
3255     */
3256    public Date getDate() { 
3257      return this.date == null ? null : this.date.getValue();
3258    }
3259
3260    /**
3261     * @param value The date (and optionally time) when the ResearchStudy Resource was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.
3262     */
3263    public ResearchStudy setDate(Date value) { 
3264      if (value == null)
3265        this.date = null;
3266      else {
3267        if (this.date == null)
3268          this.date = new DateTimeType();
3269        this.date.setValue(value);
3270      }
3271      return this;
3272    }
3273
3274    /**
3275     * @return {@link #status} (The publication state of the resource (not of the study).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
3276     */
3277    public Enumeration<PublicationStatus> getStatusElement() { 
3278      if (this.status == null)
3279        if (Configuration.errorOnAutoCreate())
3280          throw new Error("Attempt to auto-create ResearchStudy.status");
3281        else if (Configuration.doAutoCreate())
3282          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
3283      return this.status;
3284    }
3285
3286    public boolean hasStatusElement() { 
3287      return this.status != null && !this.status.isEmpty();
3288    }
3289
3290    public boolean hasStatus() { 
3291      return this.status != null && !this.status.isEmpty();
3292    }
3293
3294    /**
3295     * @param value {@link #status} (The publication state of the resource (not of the study).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
3296     */
3297    public ResearchStudy setStatusElement(Enumeration<PublicationStatus> value) { 
3298      this.status = value;
3299      return this;
3300    }
3301
3302    /**
3303     * @return The publication state of the resource (not of the study).
3304     */
3305    public PublicationStatus getStatus() { 
3306      return this.status == null ? null : this.status.getValue();
3307    }
3308
3309    /**
3310     * @param value The publication state of the resource (not of the study).
3311     */
3312    public ResearchStudy setStatus(PublicationStatus value) { 
3313        if (this.status == null)
3314          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
3315        this.status.setValue(value);
3316      return this;
3317    }
3318
3319    /**
3320     * @return {@link #primaryPurposeType} (The type of study based upon the intent of the study activities. A classification of the intent of the study.)
3321     */
3322    public CodeableConcept getPrimaryPurposeType() { 
3323      if (this.primaryPurposeType == null)
3324        if (Configuration.errorOnAutoCreate())
3325          throw new Error("Attempt to auto-create ResearchStudy.primaryPurposeType");
3326        else if (Configuration.doAutoCreate())
3327          this.primaryPurposeType = new CodeableConcept(); // cc
3328      return this.primaryPurposeType;
3329    }
3330
3331    public boolean hasPrimaryPurposeType() { 
3332      return this.primaryPurposeType != null && !this.primaryPurposeType.isEmpty();
3333    }
3334
3335    /**
3336     * @param value {@link #primaryPurposeType} (The type of study based upon the intent of the study activities. A classification of the intent of the study.)
3337     */
3338    public ResearchStudy setPrimaryPurposeType(CodeableConcept value) { 
3339      this.primaryPurposeType = value;
3340      return this;
3341    }
3342
3343    /**
3344     * @return {@link #phase} (The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.)
3345     */
3346    public CodeableConcept getPhase() { 
3347      if (this.phase == null)
3348        if (Configuration.errorOnAutoCreate())
3349          throw new Error("Attempt to auto-create ResearchStudy.phase");
3350        else if (Configuration.doAutoCreate())
3351          this.phase = new CodeableConcept(); // cc
3352      return this.phase;
3353    }
3354
3355    public boolean hasPhase() { 
3356      return this.phase != null && !this.phase.isEmpty();
3357    }
3358
3359    /**
3360     * @param value {@link #phase} (The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.)
3361     */
3362    public ResearchStudy setPhase(CodeableConcept value) { 
3363      this.phase = value;
3364      return this;
3365    }
3366
3367    /**
3368     * @return {@link #studyDesign} (Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.)
3369     */
3370    public List<CodeableConcept> getStudyDesign() { 
3371      if (this.studyDesign == null)
3372        this.studyDesign = new ArrayList<CodeableConcept>();
3373      return this.studyDesign;
3374    }
3375
3376    /**
3377     * @return Returns a reference to <code>this</code> for easy method chaining
3378     */
3379    public ResearchStudy setStudyDesign(List<CodeableConcept> theStudyDesign) { 
3380      this.studyDesign = theStudyDesign;
3381      return this;
3382    }
3383
3384    public boolean hasStudyDesign() { 
3385      if (this.studyDesign == null)
3386        return false;
3387      for (CodeableConcept item : this.studyDesign)
3388        if (!item.isEmpty())
3389          return true;
3390      return false;
3391    }
3392
3393    public CodeableConcept addStudyDesign() { //3
3394      CodeableConcept t = new CodeableConcept();
3395      if (this.studyDesign == null)
3396        this.studyDesign = new ArrayList<CodeableConcept>();
3397      this.studyDesign.add(t);
3398      return t;
3399    }
3400
3401    public ResearchStudy addStudyDesign(CodeableConcept t) { //3
3402      if (t == null)
3403        return this;
3404      if (this.studyDesign == null)
3405        this.studyDesign = new ArrayList<CodeableConcept>();
3406      this.studyDesign.add(t);
3407      return this;
3408    }
3409
3410    /**
3411     * @return The first repetition of repeating field {@link #studyDesign}, creating it if it does not already exist {3}
3412     */
3413    public CodeableConcept getStudyDesignFirstRep() { 
3414      if (getStudyDesign().isEmpty()) {
3415        addStudyDesign();
3416      }
3417      return getStudyDesign().get(0);
3418    }
3419
3420    /**
3421     * @return {@link #focus} (The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.)
3422     */
3423    public List<CodeableReference> getFocus() { 
3424      if (this.focus == null)
3425        this.focus = new ArrayList<CodeableReference>();
3426      return this.focus;
3427    }
3428
3429    /**
3430     * @return Returns a reference to <code>this</code> for easy method chaining
3431     */
3432    public ResearchStudy setFocus(List<CodeableReference> theFocus) { 
3433      this.focus = theFocus;
3434      return this;
3435    }
3436
3437    public boolean hasFocus() { 
3438      if (this.focus == null)
3439        return false;
3440      for (CodeableReference item : this.focus)
3441        if (!item.isEmpty())
3442          return true;
3443      return false;
3444    }
3445
3446    public CodeableReference addFocus() { //3
3447      CodeableReference t = new CodeableReference();
3448      if (this.focus == null)
3449        this.focus = new ArrayList<CodeableReference>();
3450      this.focus.add(t);
3451      return t;
3452    }
3453
3454    public ResearchStudy addFocus(CodeableReference t) { //3
3455      if (t == null)
3456        return this;
3457      if (this.focus == null)
3458        this.focus = new ArrayList<CodeableReference>();
3459      this.focus.add(t);
3460      return this;
3461    }
3462
3463    /**
3464     * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist {3}
3465     */
3466    public CodeableReference getFocusFirstRep() { 
3467      if (getFocus().isEmpty()) {
3468        addFocus();
3469      }
3470      return getFocus().get(0);
3471    }
3472
3473    /**
3474     * @return {@link #condition} (The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion "healthy volunteer", but the target condition code would be a Lupus SNOMED code.)
3475     */
3476    public List<CodeableConcept> getCondition() { 
3477      if (this.condition == null)
3478        this.condition = new ArrayList<CodeableConcept>();
3479      return this.condition;
3480    }
3481
3482    /**
3483     * @return Returns a reference to <code>this</code> for easy method chaining
3484     */
3485    public ResearchStudy setCondition(List<CodeableConcept> theCondition) { 
3486      this.condition = theCondition;
3487      return this;
3488    }
3489
3490    public boolean hasCondition() { 
3491      if (this.condition == null)
3492        return false;
3493      for (CodeableConcept item : this.condition)
3494        if (!item.isEmpty())
3495          return true;
3496      return false;
3497    }
3498
3499    public CodeableConcept addCondition() { //3
3500      CodeableConcept t = new CodeableConcept();
3501      if (this.condition == null)
3502        this.condition = new ArrayList<CodeableConcept>();
3503      this.condition.add(t);
3504      return t;
3505    }
3506
3507    public ResearchStudy addCondition(CodeableConcept t) { //3
3508      if (t == null)
3509        return this;
3510      if (this.condition == null)
3511        this.condition = new ArrayList<CodeableConcept>();
3512      this.condition.add(t);
3513      return this;
3514    }
3515
3516    /**
3517     * @return The first repetition of repeating field {@link #condition}, creating it if it does not already exist {3}
3518     */
3519    public CodeableConcept getConditionFirstRep() { 
3520      if (getCondition().isEmpty()) {
3521        addCondition();
3522      }
3523      return getCondition().get(0);
3524    }
3525
3526    /**
3527     * @return {@link #keyword} (Key terms to aid in searching for or filtering the study.)
3528     */
3529    public List<CodeableConcept> getKeyword() { 
3530      if (this.keyword == null)
3531        this.keyword = new ArrayList<CodeableConcept>();
3532      return this.keyword;
3533    }
3534
3535    /**
3536     * @return Returns a reference to <code>this</code> for easy method chaining
3537     */
3538    public ResearchStudy setKeyword(List<CodeableConcept> theKeyword) { 
3539      this.keyword = theKeyword;
3540      return this;
3541    }
3542
3543    public boolean hasKeyword() { 
3544      if (this.keyword == null)
3545        return false;
3546      for (CodeableConcept item : this.keyword)
3547        if (!item.isEmpty())
3548          return true;
3549      return false;
3550    }
3551
3552    public CodeableConcept addKeyword() { //3
3553      CodeableConcept t = new CodeableConcept();
3554      if (this.keyword == null)
3555        this.keyword = new ArrayList<CodeableConcept>();
3556      this.keyword.add(t);
3557      return t;
3558    }
3559
3560    public ResearchStudy addKeyword(CodeableConcept t) { //3
3561      if (t == null)
3562        return this;
3563      if (this.keyword == null)
3564        this.keyword = new ArrayList<CodeableConcept>();
3565      this.keyword.add(t);
3566      return this;
3567    }
3568
3569    /**
3570     * @return The first repetition of repeating field {@link #keyword}, creating it if it does not already exist {3}
3571     */
3572    public CodeableConcept getKeywordFirstRep() { 
3573      if (getKeyword().isEmpty()) {
3574        addKeyword();
3575      }
3576      return getKeyword().get(0);
3577    }
3578
3579    /**
3580     * @return {@link #region} (A country, state or other area where the study is taking place rather than its precise geographic location or address.)
3581     */
3582    public List<CodeableConcept> getRegion() { 
3583      if (this.region == null)
3584        this.region = new ArrayList<CodeableConcept>();
3585      return this.region;
3586    }
3587
3588    /**
3589     * @return Returns a reference to <code>this</code> for easy method chaining
3590     */
3591    public ResearchStudy setRegion(List<CodeableConcept> theRegion) { 
3592      this.region = theRegion;
3593      return this;
3594    }
3595
3596    public boolean hasRegion() { 
3597      if (this.region == null)
3598        return false;
3599      for (CodeableConcept item : this.region)
3600        if (!item.isEmpty())
3601          return true;
3602      return false;
3603    }
3604
3605    public CodeableConcept addRegion() { //3
3606      CodeableConcept t = new CodeableConcept();
3607      if (this.region == null)
3608        this.region = new ArrayList<CodeableConcept>();
3609      this.region.add(t);
3610      return t;
3611    }
3612
3613    public ResearchStudy addRegion(CodeableConcept t) { //3
3614      if (t == null)
3615        return this;
3616      if (this.region == null)
3617        this.region = new ArrayList<CodeableConcept>();
3618      this.region.add(t);
3619      return this;
3620    }
3621
3622    /**
3623     * @return The first repetition of repeating field {@link #region}, creating it if it does not already exist {3}
3624     */
3625    public CodeableConcept getRegionFirstRep() { 
3626      if (getRegion().isEmpty()) {
3627        addRegion();
3628      }
3629      return getRegion().get(0);
3630    }
3631
3632    /**
3633     * @return {@link #descriptionSummary} (A brief text for explaining the study.). This is the underlying object with id, value and extensions. The accessor "getDescriptionSummary" gives direct access to the value
3634     */
3635    public MarkdownType getDescriptionSummaryElement() { 
3636      if (this.descriptionSummary == null)
3637        if (Configuration.errorOnAutoCreate())
3638          throw new Error("Attempt to auto-create ResearchStudy.descriptionSummary");
3639        else if (Configuration.doAutoCreate())
3640          this.descriptionSummary = new MarkdownType(); // bb
3641      return this.descriptionSummary;
3642    }
3643
3644    public boolean hasDescriptionSummaryElement() { 
3645      return this.descriptionSummary != null && !this.descriptionSummary.isEmpty();
3646    }
3647
3648    public boolean hasDescriptionSummary() { 
3649      return this.descriptionSummary != null && !this.descriptionSummary.isEmpty();
3650    }
3651
3652    /**
3653     * @param value {@link #descriptionSummary} (A brief text for explaining the study.). This is the underlying object with id, value and extensions. The accessor "getDescriptionSummary" gives direct access to the value
3654     */
3655    public ResearchStudy setDescriptionSummaryElement(MarkdownType value) { 
3656      this.descriptionSummary = value;
3657      return this;
3658    }
3659
3660    /**
3661     * @return A brief text for explaining the study.
3662     */
3663    public String getDescriptionSummary() { 
3664      return this.descriptionSummary == null ? null : this.descriptionSummary.getValue();
3665    }
3666
3667    /**
3668     * @param value A brief text for explaining the study.
3669     */
3670    public ResearchStudy setDescriptionSummary(String value) { 
3671      if (value == null)
3672        this.descriptionSummary = null;
3673      else {
3674        if (this.descriptionSummary == null)
3675          this.descriptionSummary = new MarkdownType();
3676        this.descriptionSummary.setValue(value);
3677      }
3678      return this;
3679    }
3680
3681    /**
3682     * @return {@link #description} (A detailed and human-readable narrative of the study. E.g., study abstract.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3683     */
3684    public MarkdownType getDescriptionElement() { 
3685      if (this.description == null)
3686        if (Configuration.errorOnAutoCreate())
3687          throw new Error("Attempt to auto-create ResearchStudy.description");
3688        else if (Configuration.doAutoCreate())
3689          this.description = new MarkdownType(); // bb
3690      return this.description;
3691    }
3692
3693    public boolean hasDescriptionElement() { 
3694      return this.description != null && !this.description.isEmpty();
3695    }
3696
3697    public boolean hasDescription() { 
3698      return this.description != null && !this.description.isEmpty();
3699    }
3700
3701    /**
3702     * @param value {@link #description} (A detailed and human-readable narrative of the study. E.g., study abstract.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3703     */
3704    public ResearchStudy setDescriptionElement(MarkdownType value) { 
3705      this.description = value;
3706      return this;
3707    }
3708
3709    /**
3710     * @return A detailed and human-readable narrative of the study. E.g., study abstract.
3711     */
3712    public String getDescription() { 
3713      return this.description == null ? null : this.description.getValue();
3714    }
3715
3716    /**
3717     * @param value A detailed and human-readable narrative of the study. E.g., study abstract.
3718     */
3719    public ResearchStudy setDescription(String value) { 
3720      if (value == null)
3721        this.description = null;
3722      else {
3723        if (this.description == null)
3724          this.description = new MarkdownType();
3725        this.description.setValue(value);
3726      }
3727      return this;
3728    }
3729
3730    /**
3731     * @return {@link #period} (Identifies the start date and the expected (or actual, depending on status) end date for the study.)
3732     */
3733    public Period getPeriod() { 
3734      if (this.period == null)
3735        if (Configuration.errorOnAutoCreate())
3736          throw new Error("Attempt to auto-create ResearchStudy.period");
3737        else if (Configuration.doAutoCreate())
3738          this.period = new Period(); // cc
3739      return this.period;
3740    }
3741
3742    public boolean hasPeriod() { 
3743      return this.period != null && !this.period.isEmpty();
3744    }
3745
3746    /**
3747     * @param value {@link #period} (Identifies the start date and the expected (or actual, depending on status) end date for the study.)
3748     */
3749    public ResearchStudy setPeriod(Period value) { 
3750      this.period = value;
3751      return this;
3752    }
3753
3754    /**
3755     * @return {@link #site} (A facility in which study activities are conducted.)
3756     */
3757    public List<Reference> getSite() { 
3758      if (this.site == null)
3759        this.site = new ArrayList<Reference>();
3760      return this.site;
3761    }
3762
3763    /**
3764     * @return Returns a reference to <code>this</code> for easy method chaining
3765     */
3766    public ResearchStudy setSite(List<Reference> theSite) { 
3767      this.site = theSite;
3768      return this;
3769    }
3770
3771    public boolean hasSite() { 
3772      if (this.site == null)
3773        return false;
3774      for (Reference item : this.site)
3775        if (!item.isEmpty())
3776          return true;
3777      return false;
3778    }
3779
3780    public Reference addSite() { //3
3781      Reference t = new Reference();
3782      if (this.site == null)
3783        this.site = new ArrayList<Reference>();
3784      this.site.add(t);
3785      return t;
3786    }
3787
3788    public ResearchStudy addSite(Reference t) { //3
3789      if (t == null)
3790        return this;
3791      if (this.site == null)
3792        this.site = new ArrayList<Reference>();
3793      this.site.add(t);
3794      return this;
3795    }
3796
3797    /**
3798     * @return The first repetition of repeating field {@link #site}, creating it if it does not already exist {3}
3799     */
3800    public Reference getSiteFirstRep() { 
3801      if (getSite().isEmpty()) {
3802        addSite();
3803      }
3804      return getSite().get(0);
3805    }
3806
3807    /**
3808     * @return {@link #note} (Comments made about the study by the performer, subject or other participants.)
3809     */
3810    public List<Annotation> getNote() { 
3811      if (this.note == null)
3812        this.note = new ArrayList<Annotation>();
3813      return this.note;
3814    }
3815
3816    /**
3817     * @return Returns a reference to <code>this</code> for easy method chaining
3818     */
3819    public ResearchStudy setNote(List<Annotation> theNote) { 
3820      this.note = theNote;
3821      return this;
3822    }
3823
3824    public boolean hasNote() { 
3825      if (this.note == null)
3826        return false;
3827      for (Annotation item : this.note)
3828        if (!item.isEmpty())
3829          return true;
3830      return false;
3831    }
3832
3833    public Annotation addNote() { //3
3834      Annotation t = new Annotation();
3835      if (this.note == null)
3836        this.note = new ArrayList<Annotation>();
3837      this.note.add(t);
3838      return t;
3839    }
3840
3841    public ResearchStudy addNote(Annotation t) { //3
3842      if (t == null)
3843        return this;
3844      if (this.note == null)
3845        this.note = new ArrayList<Annotation>();
3846      this.note.add(t);
3847      return this;
3848    }
3849
3850    /**
3851     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
3852     */
3853    public Annotation getNoteFirstRep() { 
3854      if (getNote().isEmpty()) {
3855        addNote();
3856      }
3857      return getNote().get(0);
3858    }
3859
3860    /**
3861     * @return {@link #classifier} (Additional grouping mechanism or categorization of a research study. Example: FDA regulated device, FDA regulated drug, MPG Paragraph 23b (a German legal requirement), IRB-exempt, etc. Implementation Note: do not use the classifier element to support existing semantics that are already supported thru explicit elements in the resource.)
3862     */
3863    public List<CodeableConcept> getClassifier() { 
3864      if (this.classifier == null)
3865        this.classifier = new ArrayList<CodeableConcept>();
3866      return this.classifier;
3867    }
3868
3869    /**
3870     * @return Returns a reference to <code>this</code> for easy method chaining
3871     */
3872    public ResearchStudy setClassifier(List<CodeableConcept> theClassifier) { 
3873      this.classifier = theClassifier;
3874      return this;
3875    }
3876
3877    public boolean hasClassifier() { 
3878      if (this.classifier == null)
3879        return false;
3880      for (CodeableConcept item : this.classifier)
3881        if (!item.isEmpty())
3882          return true;
3883      return false;
3884    }
3885
3886    public CodeableConcept addClassifier() { //3
3887      CodeableConcept t = new CodeableConcept();
3888      if (this.classifier == null)
3889        this.classifier = new ArrayList<CodeableConcept>();
3890      this.classifier.add(t);
3891      return t;
3892    }
3893
3894    public ResearchStudy addClassifier(CodeableConcept t) { //3
3895      if (t == null)
3896        return this;
3897      if (this.classifier == null)
3898        this.classifier = new ArrayList<CodeableConcept>();
3899      this.classifier.add(t);
3900      return this;
3901    }
3902
3903    /**
3904     * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
3905     */
3906    public CodeableConcept getClassifierFirstRep() { 
3907      if (getClassifier().isEmpty()) {
3908        addClassifier();
3909      }
3910      return getClassifier().get(0);
3911    }
3912
3913    /**
3914     * @return {@link #associatedParty} (Sponsors, collaborators, and other parties.)
3915     */
3916    public List<ResearchStudyAssociatedPartyComponent> getAssociatedParty() { 
3917      if (this.associatedParty == null)
3918        this.associatedParty = new ArrayList<ResearchStudyAssociatedPartyComponent>();
3919      return this.associatedParty;
3920    }
3921
3922    /**
3923     * @return Returns a reference to <code>this</code> for easy method chaining
3924     */
3925    public ResearchStudy setAssociatedParty(List<ResearchStudyAssociatedPartyComponent> theAssociatedParty) { 
3926      this.associatedParty = theAssociatedParty;
3927      return this;
3928    }
3929
3930    public boolean hasAssociatedParty() { 
3931      if (this.associatedParty == null)
3932        return false;
3933      for (ResearchStudyAssociatedPartyComponent item : this.associatedParty)
3934        if (!item.isEmpty())
3935          return true;
3936      return false;
3937    }
3938
3939    public ResearchStudyAssociatedPartyComponent addAssociatedParty() { //3
3940      ResearchStudyAssociatedPartyComponent t = new ResearchStudyAssociatedPartyComponent();
3941      if (this.associatedParty == null)
3942        this.associatedParty = new ArrayList<ResearchStudyAssociatedPartyComponent>();
3943      this.associatedParty.add(t);
3944      return t;
3945    }
3946
3947    public ResearchStudy addAssociatedParty(ResearchStudyAssociatedPartyComponent t) { //3
3948      if (t == null)
3949        return this;
3950      if (this.associatedParty == null)
3951        this.associatedParty = new ArrayList<ResearchStudyAssociatedPartyComponent>();
3952      this.associatedParty.add(t);
3953      return this;
3954    }
3955
3956    /**
3957     * @return The first repetition of repeating field {@link #associatedParty}, creating it if it does not already exist {3}
3958     */
3959    public ResearchStudyAssociatedPartyComponent getAssociatedPartyFirstRep() { 
3960      if (getAssociatedParty().isEmpty()) {
3961        addAssociatedParty();
3962      }
3963      return getAssociatedParty().get(0);
3964    }
3965
3966    /**
3967     * @return {@link #progressStatus} (Status of study with time for that status.)
3968     */
3969    public List<ResearchStudyProgressStatusComponent> getProgressStatus() { 
3970      if (this.progressStatus == null)
3971        this.progressStatus = new ArrayList<ResearchStudyProgressStatusComponent>();
3972      return this.progressStatus;
3973    }
3974
3975    /**
3976     * @return Returns a reference to <code>this</code> for easy method chaining
3977     */
3978    public ResearchStudy setProgressStatus(List<ResearchStudyProgressStatusComponent> theProgressStatus) { 
3979      this.progressStatus = theProgressStatus;
3980      return this;
3981    }
3982
3983    public boolean hasProgressStatus() { 
3984      if (this.progressStatus == null)
3985        return false;
3986      for (ResearchStudyProgressStatusComponent item : this.progressStatus)
3987        if (!item.isEmpty())
3988          return true;
3989      return false;
3990    }
3991
3992    public ResearchStudyProgressStatusComponent addProgressStatus() { //3
3993      ResearchStudyProgressStatusComponent t = new ResearchStudyProgressStatusComponent();
3994      if (this.progressStatus == null)
3995        this.progressStatus = new ArrayList<ResearchStudyProgressStatusComponent>();
3996      this.progressStatus.add(t);
3997      return t;
3998    }
3999
4000    public ResearchStudy addProgressStatus(ResearchStudyProgressStatusComponent t) { //3
4001      if (t == null)
4002        return this;
4003      if (this.progressStatus == null)
4004        this.progressStatus = new ArrayList<ResearchStudyProgressStatusComponent>();
4005      this.progressStatus.add(t);
4006      return this;
4007    }
4008
4009    /**
4010     * @return The first repetition of repeating field {@link #progressStatus}, creating it if it does not already exist {3}
4011     */
4012    public ResearchStudyProgressStatusComponent getProgressStatusFirstRep() { 
4013      if (getProgressStatus().isEmpty()) {
4014        addProgressStatus();
4015      }
4016      return getProgressStatus().get(0);
4017    }
4018
4019    /**
4020     * @return {@link #whyStopped} (A description and/or code explaining the premature termination of the study.)
4021     */
4022    public CodeableConcept getWhyStopped() { 
4023      if (this.whyStopped == null)
4024        if (Configuration.errorOnAutoCreate())
4025          throw new Error("Attempt to auto-create ResearchStudy.whyStopped");
4026        else if (Configuration.doAutoCreate())
4027          this.whyStopped = new CodeableConcept(); // cc
4028      return this.whyStopped;
4029    }
4030
4031    public boolean hasWhyStopped() { 
4032      return this.whyStopped != null && !this.whyStopped.isEmpty();
4033    }
4034
4035    /**
4036     * @param value {@link #whyStopped} (A description and/or code explaining the premature termination of the study.)
4037     */
4038    public ResearchStudy setWhyStopped(CodeableConcept value) { 
4039      this.whyStopped = value;
4040      return this;
4041    }
4042
4043    /**
4044     * @return {@link #recruitment} (Target or actual group of participants enrolled in study.)
4045     */
4046    public ResearchStudyRecruitmentComponent getRecruitment() { 
4047      if (this.recruitment == null)
4048        if (Configuration.errorOnAutoCreate())
4049          throw new Error("Attempt to auto-create ResearchStudy.recruitment");
4050        else if (Configuration.doAutoCreate())
4051          this.recruitment = new ResearchStudyRecruitmentComponent(); // cc
4052      return this.recruitment;
4053    }
4054
4055    public boolean hasRecruitment() { 
4056      return this.recruitment != null && !this.recruitment.isEmpty();
4057    }
4058
4059    /**
4060     * @param value {@link #recruitment} (Target or actual group of participants enrolled in study.)
4061     */
4062    public ResearchStudy setRecruitment(ResearchStudyRecruitmentComponent value) { 
4063      this.recruitment = value;
4064      return this;
4065    }
4066
4067    /**
4068     * @return {@link #comparisonGroup} (Describes an expected event or sequence of events for one of the subjects of a study. E.g. for a living subject: exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. E.g. for a stability study: {store sample from lot A at 25 degrees for 1 month}, {store sample from lot A at 40 degrees for 1 month}.)
4069     */
4070    public List<ResearchStudyComparisonGroupComponent> getComparisonGroup() { 
4071      if (this.comparisonGroup == null)
4072        this.comparisonGroup = new ArrayList<ResearchStudyComparisonGroupComponent>();
4073      return this.comparisonGroup;
4074    }
4075
4076    /**
4077     * @return Returns a reference to <code>this</code> for easy method chaining
4078     */
4079    public ResearchStudy setComparisonGroup(List<ResearchStudyComparisonGroupComponent> theComparisonGroup) { 
4080      this.comparisonGroup = theComparisonGroup;
4081      return this;
4082    }
4083
4084    public boolean hasComparisonGroup() { 
4085      if (this.comparisonGroup == null)
4086        return false;
4087      for (ResearchStudyComparisonGroupComponent item : this.comparisonGroup)
4088        if (!item.isEmpty())
4089          return true;
4090      return false;
4091    }
4092
4093    public ResearchStudyComparisonGroupComponent addComparisonGroup() { //3
4094      ResearchStudyComparisonGroupComponent t = new ResearchStudyComparisonGroupComponent();
4095      if (this.comparisonGroup == null)
4096        this.comparisonGroup = new ArrayList<ResearchStudyComparisonGroupComponent>();
4097      this.comparisonGroup.add(t);
4098      return t;
4099    }
4100
4101    public ResearchStudy addComparisonGroup(ResearchStudyComparisonGroupComponent t) { //3
4102      if (t == null)
4103        return this;
4104      if (this.comparisonGroup == null)
4105        this.comparisonGroup = new ArrayList<ResearchStudyComparisonGroupComponent>();
4106      this.comparisonGroup.add(t);
4107      return this;
4108    }
4109
4110    /**
4111     * @return The first repetition of repeating field {@link #comparisonGroup}, creating it if it does not already exist {3}
4112     */
4113    public ResearchStudyComparisonGroupComponent getComparisonGroupFirstRep() { 
4114      if (getComparisonGroup().isEmpty()) {
4115        addComparisonGroup();
4116      }
4117      return getComparisonGroup().get(0);
4118    }
4119
4120    /**
4121     * @return {@link #objective} (A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study.)
4122     */
4123    public List<ResearchStudyObjectiveComponent> getObjective() { 
4124      if (this.objective == null)
4125        this.objective = new ArrayList<ResearchStudyObjectiveComponent>();
4126      return this.objective;
4127    }
4128
4129    /**
4130     * @return Returns a reference to <code>this</code> for easy method chaining
4131     */
4132    public ResearchStudy setObjective(List<ResearchStudyObjectiveComponent> theObjective) { 
4133      this.objective = theObjective;
4134      return this;
4135    }
4136
4137    public boolean hasObjective() { 
4138      if (this.objective == null)
4139        return false;
4140      for (ResearchStudyObjectiveComponent item : this.objective)
4141        if (!item.isEmpty())
4142          return true;
4143      return false;
4144    }
4145
4146    public ResearchStudyObjectiveComponent addObjective() { //3
4147      ResearchStudyObjectiveComponent t = new ResearchStudyObjectiveComponent();
4148      if (this.objective == null)
4149        this.objective = new ArrayList<ResearchStudyObjectiveComponent>();
4150      this.objective.add(t);
4151      return t;
4152    }
4153
4154    public ResearchStudy addObjective(ResearchStudyObjectiveComponent t) { //3
4155      if (t == null)
4156        return this;
4157      if (this.objective == null)
4158        this.objective = new ArrayList<ResearchStudyObjectiveComponent>();
4159      this.objective.add(t);
4160      return this;
4161    }
4162
4163    /**
4164     * @return The first repetition of repeating field {@link #objective}, creating it if it does not already exist {3}
4165     */
4166    public ResearchStudyObjectiveComponent getObjectiveFirstRep() { 
4167      if (getObjective().isEmpty()) {
4168        addObjective();
4169      }
4170      return getObjective().get(0);
4171    }
4172
4173    /**
4174     * @return {@link #outcomeMeasure} (An "outcome measure", "endpoint", "effect measure" or "measure of effect" is a specific measurement or observation used to quantify the effect of experimental variables on the participants in a study, or for observational studies, to describe patterns of diseases or traits or associations with exposures, risk factors or treatment.)
4175     */
4176    public List<ResearchStudyOutcomeMeasureComponent> getOutcomeMeasure() { 
4177      if (this.outcomeMeasure == null)
4178        this.outcomeMeasure = new ArrayList<ResearchStudyOutcomeMeasureComponent>();
4179      return this.outcomeMeasure;
4180    }
4181
4182    /**
4183     * @return Returns a reference to <code>this</code> for easy method chaining
4184     */
4185    public ResearchStudy setOutcomeMeasure(List<ResearchStudyOutcomeMeasureComponent> theOutcomeMeasure) { 
4186      this.outcomeMeasure = theOutcomeMeasure;
4187      return this;
4188    }
4189
4190    public boolean hasOutcomeMeasure() { 
4191      if (this.outcomeMeasure == null)
4192        return false;
4193      for (ResearchStudyOutcomeMeasureComponent item : this.outcomeMeasure)
4194        if (!item.isEmpty())
4195          return true;
4196      return false;
4197    }
4198
4199    public ResearchStudyOutcomeMeasureComponent addOutcomeMeasure() { //3
4200      ResearchStudyOutcomeMeasureComponent t = new ResearchStudyOutcomeMeasureComponent();
4201      if (this.outcomeMeasure == null)
4202        this.outcomeMeasure = new ArrayList<ResearchStudyOutcomeMeasureComponent>();
4203      this.outcomeMeasure.add(t);
4204      return t;
4205    }
4206
4207    public ResearchStudy addOutcomeMeasure(ResearchStudyOutcomeMeasureComponent t) { //3
4208      if (t == null)
4209        return this;
4210      if (this.outcomeMeasure == null)
4211        this.outcomeMeasure = new ArrayList<ResearchStudyOutcomeMeasureComponent>();
4212      this.outcomeMeasure.add(t);
4213      return this;
4214    }
4215
4216    /**
4217     * @return The first repetition of repeating field {@link #outcomeMeasure}, creating it if it does not already exist {3}
4218     */
4219    public ResearchStudyOutcomeMeasureComponent getOutcomeMeasureFirstRep() { 
4220      if (getOutcomeMeasure().isEmpty()) {
4221        addOutcomeMeasure();
4222      }
4223      return getOutcomeMeasure().get(0);
4224    }
4225
4226    /**
4227     * @return {@link #result} (Link to one or more sets of results generated by the study.  Could also link to a research registry holding the results such as ClinicalTrials.gov.)
4228     */
4229    public List<Reference> getResult() { 
4230      if (this.result == null)
4231        this.result = new ArrayList<Reference>();
4232      return this.result;
4233    }
4234
4235    /**
4236     * @return Returns a reference to <code>this</code> for easy method chaining
4237     */
4238    public ResearchStudy setResult(List<Reference> theResult) { 
4239      this.result = theResult;
4240      return this;
4241    }
4242
4243    public boolean hasResult() { 
4244      if (this.result == null)
4245        return false;
4246      for (Reference item : this.result)
4247        if (!item.isEmpty())
4248          return true;
4249      return false;
4250    }
4251
4252    public Reference addResult() { //3
4253      Reference t = new Reference();
4254      if (this.result == null)
4255        this.result = new ArrayList<Reference>();
4256      this.result.add(t);
4257      return t;
4258    }
4259
4260    public ResearchStudy addResult(Reference t) { //3
4261      if (t == null)
4262        return this;
4263      if (this.result == null)
4264        this.result = new ArrayList<Reference>();
4265      this.result.add(t);
4266      return this;
4267    }
4268
4269    /**
4270     * @return The first repetition of repeating field {@link #result}, creating it if it does not already exist {3}
4271     */
4272    public Reference getResultFirstRep() { 
4273      if (getResult().isEmpty()) {
4274        addResult();
4275      }
4276      return getResult().get(0);
4277    }
4278
4279      protected void listChildren(List<Property> children) {
4280        super.listChildren(children);
4281        children.add(new Property("url", "uri", "Canonical identifier for this study resource, represented as a globally unique URI.", 0, 1, url));
4282        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));
4283        children.add(new Property("version", "string", "The business version for the study record.", 0, 1, version));
4284        children.add(new Property("name", "string", "Name for this study (computer friendly).", 0, 1, name));
4285        children.add(new Property("title", "string", "The human readable name of the research study.", 0, 1, title));
4286        children.add(new Property("label", "", "Additional names for the study.", 0, java.lang.Integer.MAX_VALUE, label));
4287        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));
4288        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));
4289        children.add(new Property("relatedArtifact", "RelatedArtifact", "Citations, references, URLs and other related documents.  When using relatedArtifact to share URLs, the relatedArtifact.type will often be set to one of \"documentation\" or \"supported-with\" and the URL value will often be in relatedArtifact.document.url but another possible location is relatedArtifact.resource when it is a canonical URL.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact));
4290        children.add(new Property("date", "dateTime", "The date (and optionally time) when the ResearchStudy Resource was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.", 0, 1, date));
4291        children.add(new Property("status", "code", "The publication state of the resource (not of the study).", 0, 1, status));
4292        children.add(new Property("primaryPurposeType", "CodeableConcept", "The type of study based upon the intent of the study activities. A classification of the intent of the study.", 0, 1, primaryPurposeType));
4293        children.add(new Property("phase", "CodeableConcept", "The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.", 0, 1, phase));
4294        children.add(new Property("studyDesign", "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, studyDesign));
4295        children.add(new Property("focus", "CodeableReference(Medication|MedicinalProductDefinition|SubstanceDefinition|EvidenceVariable)", "The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.", 0, java.lang.Integer.MAX_VALUE, focus));
4296        children.add(new Property("condition", "CodeableConcept", "The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion \"healthy volunteer\", but the target condition code would be a Lupus SNOMED code.", 0, java.lang.Integer.MAX_VALUE, condition));
4297        children.add(new Property("keyword", "CodeableConcept", "Key terms to aid in searching for or filtering the study.", 0, java.lang.Integer.MAX_VALUE, keyword));
4298        children.add(new Property("region", "CodeableConcept", "A country, state or other area where the study is taking place rather than its precise geographic location or address.", 0, java.lang.Integer.MAX_VALUE, region));
4299        children.add(new Property("descriptionSummary", "markdown", "A brief text for explaining the study.", 0, 1, descriptionSummary));
4300        children.add(new Property("description", "markdown", "A detailed and human-readable narrative of the study. E.g., study abstract.", 0, 1, description));
4301        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));
4302        children.add(new Property("site", "Reference(Location|ResearchStudy|Organization)", "A facility in which study activities are conducted.", 0, java.lang.Integer.MAX_VALUE, site));
4303        children.add(new Property("note", "Annotation", "Comments made about the study by the performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note));
4304        children.add(new Property("classifier", "CodeableConcept", "Additional grouping mechanism or categorization of a research study. Example: FDA regulated device, FDA regulated drug, MPG Paragraph 23b (a German legal requirement), IRB-exempt, etc. Implementation Note: do not use the classifier element to support existing semantics that are already supported thru explicit elements in the resource.", 0, java.lang.Integer.MAX_VALUE, classifier));
4305        children.add(new Property("associatedParty", "", "Sponsors, collaborators, and other parties.", 0, java.lang.Integer.MAX_VALUE, associatedParty));
4306        children.add(new Property("progressStatus", "", "Status of study with time for that status.", 0, java.lang.Integer.MAX_VALUE, progressStatus));
4307        children.add(new Property("whyStopped", "CodeableConcept", "A description and/or code explaining the premature termination of the study.", 0, 1, whyStopped));
4308        children.add(new Property("recruitment", "", "Target or actual group of participants enrolled in study.", 0, 1, recruitment));
4309        children.add(new Property("comparisonGroup", "", "Describes an expected event or sequence of events for one of the subjects of a study. E.g. for a living subject: exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. E.g. for a stability study: {store sample from lot A at 25 degrees for 1 month}, {store sample from lot A at 40 degrees for 1 month}.", 0, java.lang.Integer.MAX_VALUE, comparisonGroup));
4310        children.add(new Property("objective", "", "A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study.", 0, java.lang.Integer.MAX_VALUE, objective));
4311        children.add(new Property("outcomeMeasure", "", "An \"outcome measure\", \"endpoint\", \"effect measure\" or \"measure of effect\" is a specific measurement or observation used to quantify the effect of experimental variables on the participants in a study, or for observational studies, to describe patterns of diseases or traits or associations with exposures, risk factors or treatment.", 0, java.lang.Integer.MAX_VALUE, outcomeMeasure));
4312        children.add(new Property("result", "Reference(EvidenceReport|Citation|DiagnosticReport)", "Link to one or more sets of results generated by the study.  Could also link to a research registry holding the results such as ClinicalTrials.gov.", 0, java.lang.Integer.MAX_VALUE, result));
4313      }
4314
4315      @Override
4316      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4317        switch (_hash) {
4318        case 116079: /*url*/  return new Property("url", "uri", "Canonical identifier for this study resource, represented as a globally unique URI.", 0, 1, url);
4319        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);
4320        case 351608024: /*version*/  return new Property("version", "string", "The business version for the study record.", 0, 1, version);
4321        case 3373707: /*name*/  return new Property("name", "string", "Name for this study (computer friendly).", 0, 1, name);
4322        case 110371416: /*title*/  return new Property("title", "string", "The human readable name of the research study.", 0, 1, title);
4323        case 102727412: /*label*/  return new Property("label", "", "Additional names for the study.", 0, java.lang.Integer.MAX_VALUE, label);
4324        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);
4325        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);
4326        case 666807069: /*relatedArtifact*/  return new Property("relatedArtifact", "RelatedArtifact", "Citations, references, URLs and other related documents.  When using relatedArtifact to share URLs, the relatedArtifact.type will often be set to one of \"documentation\" or \"supported-with\" and the URL value will often be in relatedArtifact.document.url but another possible location is relatedArtifact.resource when it is a canonical URL.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact);
4327        case 3076014: /*date*/  return new Property("date", "dateTime", "The date (and optionally time) when the ResearchStudy Resource was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ResearchStudy Resource changes.", 0, 1, date);
4328        case -892481550: /*status*/  return new Property("status", "code", "The publication state of the resource (not of the study).", 0, 1, status);
4329        case -2132842986: /*primaryPurposeType*/  return new Property("primaryPurposeType", "CodeableConcept", "The type of study based upon the intent of the study activities. A classification of the intent of the study.", 0, 1, primaryPurposeType);
4330        case 106629499: /*phase*/  return new Property("phase", "CodeableConcept", "The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.", 0, 1, phase);
4331        case 1709211879: /*studyDesign*/  return new Property("studyDesign", "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, studyDesign);
4332        case 97604824: /*focus*/  return new Property("focus", "CodeableReference(Medication|MedicinalProductDefinition|SubstanceDefinition|EvidenceVariable)", "The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.", 0, java.lang.Integer.MAX_VALUE, focus);
4333        case -861311717: /*condition*/  return new Property("condition", "CodeableConcept", "The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion \"healthy volunteer\", but the target condition code would be a Lupus SNOMED code.", 0, java.lang.Integer.MAX_VALUE, condition);
4334        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);
4335        case -934795532: /*region*/  return new Property("region", "CodeableConcept", "A country, state or other area where the study is taking place rather than its precise geographic location or address.", 0, java.lang.Integer.MAX_VALUE, region);
4336        case 21530634: /*descriptionSummary*/  return new Property("descriptionSummary", "markdown", "A brief text for explaining the study.", 0, 1, descriptionSummary);
4337        case -1724546052: /*description*/  return new Property("description", "markdown", "A detailed and human-readable narrative of the study. E.g., study abstract.", 0, 1, description);
4338        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);
4339        case 3530567: /*site*/  return new Property("site", "Reference(Location|ResearchStudy|Organization)", "A facility in which study activities are conducted.", 0, java.lang.Integer.MAX_VALUE, site);
4340        case 3387378: /*note*/  return new Property("note", "Annotation", "Comments made about the study by the performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note);
4341        case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "Additional grouping mechanism or categorization of a research study. Example: FDA regulated device, FDA regulated drug, MPG Paragraph 23b (a German legal requirement), IRB-exempt, etc. Implementation Note: do not use the classifier element to support existing semantics that are already supported thru explicit elements in the resource.", 0, java.lang.Integer.MAX_VALUE, classifier);
4342        case -1841460864: /*associatedParty*/  return new Property("associatedParty", "", "Sponsors, collaborators, and other parties.", 0, java.lang.Integer.MAX_VALUE, associatedParty);
4343        case -1897502593: /*progressStatus*/  return new Property("progressStatus", "", "Status of study with time for that status.", 0, java.lang.Integer.MAX_VALUE, progressStatus);
4344        case -699986715: /*whyStopped*/  return new Property("whyStopped", "CodeableConcept", "A description and/or code explaining the premature termination of the study.", 0, 1, whyStopped);
4345        case 780783004: /*recruitment*/  return new Property("recruitment", "", "Target or actual group of participants enrolled in study.", 0, 1, recruitment);
4346        case -138266634: /*comparisonGroup*/  return new Property("comparisonGroup", "", "Describes an expected event or sequence of events for one of the subjects of a study. E.g. for a living subject: exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. E.g. for a stability study: {store sample from lot A at 25 degrees for 1 month}, {store sample from lot A at 40 degrees for 1 month}.", 0, java.lang.Integer.MAX_VALUE, comparisonGroup);
4347        case -1489585863: /*objective*/  return new Property("objective", "", "A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study.", 0, java.lang.Integer.MAX_VALUE, objective);
4348        case -1510689364: /*outcomeMeasure*/  return new Property("outcomeMeasure", "", "An \"outcome measure\", \"endpoint\", \"effect measure\" or \"measure of effect\" is a specific measurement or observation used to quantify the effect of experimental variables on the participants in a study, or for observational studies, to describe patterns of diseases or traits or associations with exposures, risk factors or treatment.", 0, java.lang.Integer.MAX_VALUE, outcomeMeasure);
4349        case -934426595: /*result*/  return new Property("result", "Reference(EvidenceReport|Citation|DiagnosticReport)", "Link to one or more sets of results generated by the study.  Could also link to a research registry holding the results such as ClinicalTrials.gov.", 0, java.lang.Integer.MAX_VALUE, result);
4350        default: return super.getNamedProperty(_hash, _name, _checkValid);
4351        }
4352
4353      }
4354
4355      @Override
4356      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4357        switch (hash) {
4358        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
4359        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
4360        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
4361        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
4362        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
4363        case 102727412: /*label*/ return this.label == null ? new Base[0] : this.label.toArray(new Base[this.label.size()]); // ResearchStudyLabelComponent
4364        case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : this.protocol.toArray(new Base[this.protocol.size()]); // Reference
4365        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
4366        case 666807069: /*relatedArtifact*/ return this.relatedArtifact == null ? new Base[0] : this.relatedArtifact.toArray(new Base[this.relatedArtifact.size()]); // RelatedArtifact
4367        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
4368        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
4369        case -2132842986: /*primaryPurposeType*/ return this.primaryPurposeType == null ? new Base[0] : new Base[] {this.primaryPurposeType}; // CodeableConcept
4370        case 106629499: /*phase*/ return this.phase == null ? new Base[0] : new Base[] {this.phase}; // CodeableConcept
4371        case 1709211879: /*studyDesign*/ return this.studyDesign == null ? new Base[0] : this.studyDesign.toArray(new Base[this.studyDesign.size()]); // CodeableConcept
4372        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // CodeableReference
4373        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // CodeableConcept
4374        case -814408215: /*keyword*/ return this.keyword == null ? new Base[0] : this.keyword.toArray(new Base[this.keyword.size()]); // CodeableConcept
4375        case -934795532: /*region*/ return this.region == null ? new Base[0] : this.region.toArray(new Base[this.region.size()]); // CodeableConcept
4376        case 21530634: /*descriptionSummary*/ return this.descriptionSummary == null ? new Base[0] : new Base[] {this.descriptionSummary}; // MarkdownType
4377        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
4378        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
4379        case 3530567: /*site*/ return this.site == null ? new Base[0] : this.site.toArray(new Base[this.site.size()]); // Reference
4380        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
4381        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
4382        case -1841460864: /*associatedParty*/ return this.associatedParty == null ? new Base[0] : this.associatedParty.toArray(new Base[this.associatedParty.size()]); // ResearchStudyAssociatedPartyComponent
4383        case -1897502593: /*progressStatus*/ return this.progressStatus == null ? new Base[0] : this.progressStatus.toArray(new Base[this.progressStatus.size()]); // ResearchStudyProgressStatusComponent
4384        case -699986715: /*whyStopped*/ return this.whyStopped == null ? new Base[0] : new Base[] {this.whyStopped}; // CodeableConcept
4385        case 780783004: /*recruitment*/ return this.recruitment == null ? new Base[0] : new Base[] {this.recruitment}; // ResearchStudyRecruitmentComponent
4386        case -138266634: /*comparisonGroup*/ return this.comparisonGroup == null ? new Base[0] : this.comparisonGroup.toArray(new Base[this.comparisonGroup.size()]); // ResearchStudyComparisonGroupComponent
4387        case -1489585863: /*objective*/ return this.objective == null ? new Base[0] : this.objective.toArray(new Base[this.objective.size()]); // ResearchStudyObjectiveComponent
4388        case -1510689364: /*outcomeMeasure*/ return this.outcomeMeasure == null ? new Base[0] : this.outcomeMeasure.toArray(new Base[this.outcomeMeasure.size()]); // ResearchStudyOutcomeMeasureComponent
4389        case -934426595: /*result*/ return this.result == null ? new Base[0] : this.result.toArray(new Base[this.result.size()]); // Reference
4390        default: return super.getProperty(hash, name, checkValid);
4391        }
4392
4393      }
4394
4395      @Override
4396      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4397        switch (hash) {
4398        case 116079: // url
4399          this.url = TypeConvertor.castToUri(value); // UriType
4400          return value;
4401        case -1618432855: // identifier
4402          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
4403          return value;
4404        case 351608024: // version
4405          this.version = TypeConvertor.castToString(value); // StringType
4406          return value;
4407        case 3373707: // name
4408          this.name = TypeConvertor.castToString(value); // StringType
4409          return value;
4410        case 110371416: // title
4411          this.title = TypeConvertor.castToString(value); // StringType
4412          return value;
4413        case 102727412: // label
4414          this.getLabel().add((ResearchStudyLabelComponent) value); // ResearchStudyLabelComponent
4415          return value;
4416        case -989163880: // protocol
4417          this.getProtocol().add(TypeConvertor.castToReference(value)); // Reference
4418          return value;
4419        case -995410646: // partOf
4420          this.getPartOf().add(TypeConvertor.castToReference(value)); // Reference
4421          return value;
4422        case 666807069: // relatedArtifact
4423          this.getRelatedArtifact().add(TypeConvertor.castToRelatedArtifact(value)); // RelatedArtifact
4424          return value;
4425        case 3076014: // date
4426          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
4427          return value;
4428        case -892481550: // status
4429          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
4430          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4431          return value;
4432        case -2132842986: // primaryPurposeType
4433          this.primaryPurposeType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4434          return value;
4435        case 106629499: // phase
4436          this.phase = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4437          return value;
4438        case 1709211879: // studyDesign
4439          this.getStudyDesign().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4440          return value;
4441        case 97604824: // focus
4442          this.getFocus().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
4443          return value;
4444        case -861311717: // condition
4445          this.getCondition().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4446          return value;
4447        case -814408215: // keyword
4448          this.getKeyword().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4449          return value;
4450        case -934795532: // region
4451          this.getRegion().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4452          return value;
4453        case 21530634: // descriptionSummary
4454          this.descriptionSummary = TypeConvertor.castToMarkdown(value); // MarkdownType
4455          return value;
4456        case -1724546052: // description
4457          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
4458          return value;
4459        case -991726143: // period
4460          this.period = TypeConvertor.castToPeriod(value); // Period
4461          return value;
4462        case 3530567: // site
4463          this.getSite().add(TypeConvertor.castToReference(value)); // Reference
4464          return value;
4465        case 3387378: // note
4466          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
4467          return value;
4468        case -281470431: // classifier
4469          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4470          return value;
4471        case -1841460864: // associatedParty
4472          this.getAssociatedParty().add((ResearchStudyAssociatedPartyComponent) value); // ResearchStudyAssociatedPartyComponent
4473          return value;
4474        case -1897502593: // progressStatus
4475          this.getProgressStatus().add((ResearchStudyProgressStatusComponent) value); // ResearchStudyProgressStatusComponent
4476          return value;
4477        case -699986715: // whyStopped
4478          this.whyStopped = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4479          return value;
4480        case 780783004: // recruitment
4481          this.recruitment = (ResearchStudyRecruitmentComponent) value; // ResearchStudyRecruitmentComponent
4482          return value;
4483        case -138266634: // comparisonGroup
4484          this.getComparisonGroup().add((ResearchStudyComparisonGroupComponent) value); // ResearchStudyComparisonGroupComponent
4485          return value;
4486        case -1489585863: // objective
4487          this.getObjective().add((ResearchStudyObjectiveComponent) value); // ResearchStudyObjectiveComponent
4488          return value;
4489        case -1510689364: // outcomeMeasure
4490          this.getOutcomeMeasure().add((ResearchStudyOutcomeMeasureComponent) value); // ResearchStudyOutcomeMeasureComponent
4491          return value;
4492        case -934426595: // result
4493          this.getResult().add(TypeConvertor.castToReference(value)); // Reference
4494          return value;
4495        default: return super.setProperty(hash, name, value);
4496        }
4497
4498      }
4499
4500      @Override
4501      public Base setProperty(String name, Base value) throws FHIRException {
4502        if (name.equals("url")) {
4503          this.url = TypeConvertor.castToUri(value); // UriType
4504        } else if (name.equals("identifier")) {
4505          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
4506        } else if (name.equals("version")) {
4507          this.version = TypeConvertor.castToString(value); // StringType
4508        } else if (name.equals("name")) {
4509          this.name = TypeConvertor.castToString(value); // StringType
4510        } else if (name.equals("title")) {
4511          this.title = TypeConvertor.castToString(value); // StringType
4512        } else if (name.equals("label")) {
4513          this.getLabel().add((ResearchStudyLabelComponent) value);
4514        } else if (name.equals("protocol")) {
4515          this.getProtocol().add(TypeConvertor.castToReference(value));
4516        } else if (name.equals("partOf")) {
4517          this.getPartOf().add(TypeConvertor.castToReference(value));
4518        } else if (name.equals("relatedArtifact")) {
4519          this.getRelatedArtifact().add(TypeConvertor.castToRelatedArtifact(value));
4520        } else if (name.equals("date")) {
4521          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
4522        } else if (name.equals("status")) {
4523          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
4524          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4525        } else if (name.equals("primaryPurposeType")) {
4526          this.primaryPurposeType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4527        } else if (name.equals("phase")) {
4528          this.phase = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4529        } else if (name.equals("studyDesign")) {
4530          this.getStudyDesign().add(TypeConvertor.castToCodeableConcept(value));
4531        } else if (name.equals("focus")) {
4532          this.getFocus().add(TypeConvertor.castToCodeableReference(value));
4533        } else if (name.equals("condition")) {
4534          this.getCondition().add(TypeConvertor.castToCodeableConcept(value));
4535        } else if (name.equals("keyword")) {
4536          this.getKeyword().add(TypeConvertor.castToCodeableConcept(value));
4537        } else if (name.equals("region")) {
4538          this.getRegion().add(TypeConvertor.castToCodeableConcept(value));
4539        } else if (name.equals("descriptionSummary")) {
4540          this.descriptionSummary = TypeConvertor.castToMarkdown(value); // MarkdownType
4541        } else if (name.equals("description")) {
4542          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
4543        } else if (name.equals("period")) {
4544          this.period = TypeConvertor.castToPeriod(value); // Period
4545        } else if (name.equals("site")) {
4546          this.getSite().add(TypeConvertor.castToReference(value));
4547        } else if (name.equals("note")) {
4548          this.getNote().add(TypeConvertor.castToAnnotation(value));
4549        } else if (name.equals("classifier")) {
4550          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
4551        } else if (name.equals("associatedParty")) {
4552          this.getAssociatedParty().add((ResearchStudyAssociatedPartyComponent) value);
4553        } else if (name.equals("progressStatus")) {
4554          this.getProgressStatus().add((ResearchStudyProgressStatusComponent) value);
4555        } else if (name.equals("whyStopped")) {
4556          this.whyStopped = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4557        } else if (name.equals("recruitment")) {
4558          this.recruitment = (ResearchStudyRecruitmentComponent) value; // ResearchStudyRecruitmentComponent
4559        } else if (name.equals("comparisonGroup")) {
4560          this.getComparisonGroup().add((ResearchStudyComparisonGroupComponent) value);
4561        } else if (name.equals("objective")) {
4562          this.getObjective().add((ResearchStudyObjectiveComponent) value);
4563        } else if (name.equals("outcomeMeasure")) {
4564          this.getOutcomeMeasure().add((ResearchStudyOutcomeMeasureComponent) value);
4565        } else if (name.equals("result")) {
4566          this.getResult().add(TypeConvertor.castToReference(value));
4567        } else
4568          return super.setProperty(name, value);
4569        return value;
4570      }
4571
4572      @Override
4573      public Base makeProperty(int hash, String name) throws FHIRException {
4574        switch (hash) {
4575        case 116079:  return getUrlElement();
4576        case -1618432855:  return addIdentifier(); 
4577        case 351608024:  return getVersionElement();
4578        case 3373707:  return getNameElement();
4579        case 110371416:  return getTitleElement();
4580        case 102727412:  return addLabel(); 
4581        case -989163880:  return addProtocol(); 
4582        case -995410646:  return addPartOf(); 
4583        case 666807069:  return addRelatedArtifact(); 
4584        case 3076014:  return getDateElement();
4585        case -892481550:  return getStatusElement();
4586        case -2132842986:  return getPrimaryPurposeType();
4587        case 106629499:  return getPhase();
4588        case 1709211879:  return addStudyDesign(); 
4589        case 97604824:  return addFocus(); 
4590        case -861311717:  return addCondition(); 
4591        case -814408215:  return addKeyword(); 
4592        case -934795532:  return addRegion(); 
4593        case 21530634:  return getDescriptionSummaryElement();
4594        case -1724546052:  return getDescriptionElement();
4595        case -991726143:  return getPeriod();
4596        case 3530567:  return addSite(); 
4597        case 3387378:  return addNote(); 
4598        case -281470431:  return addClassifier(); 
4599        case -1841460864:  return addAssociatedParty(); 
4600        case -1897502593:  return addProgressStatus(); 
4601        case -699986715:  return getWhyStopped();
4602        case 780783004:  return getRecruitment();
4603        case -138266634:  return addComparisonGroup(); 
4604        case -1489585863:  return addObjective(); 
4605        case -1510689364:  return addOutcomeMeasure(); 
4606        case -934426595:  return addResult(); 
4607        default: return super.makeProperty(hash, name);
4608        }
4609
4610      }
4611
4612      @Override
4613      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4614        switch (hash) {
4615        case 116079: /*url*/ return new String[] {"uri"};
4616        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
4617        case 351608024: /*version*/ return new String[] {"string"};
4618        case 3373707: /*name*/ return new String[] {"string"};
4619        case 110371416: /*title*/ return new String[] {"string"};
4620        case 102727412: /*label*/ return new String[] {};
4621        case -989163880: /*protocol*/ return new String[] {"Reference"};
4622        case -995410646: /*partOf*/ return new String[] {"Reference"};
4623        case 666807069: /*relatedArtifact*/ return new String[] {"RelatedArtifact"};
4624        case 3076014: /*date*/ return new String[] {"dateTime"};
4625        case -892481550: /*status*/ return new String[] {"code"};
4626        case -2132842986: /*primaryPurposeType*/ return new String[] {"CodeableConcept"};
4627        case 106629499: /*phase*/ return new String[] {"CodeableConcept"};
4628        case 1709211879: /*studyDesign*/ return new String[] {"CodeableConcept"};
4629        case 97604824: /*focus*/ return new String[] {"CodeableReference"};
4630        case -861311717: /*condition*/ return new String[] {"CodeableConcept"};
4631        case -814408215: /*keyword*/ return new String[] {"CodeableConcept"};
4632        case -934795532: /*region*/ return new String[] {"CodeableConcept"};
4633        case 21530634: /*descriptionSummary*/ return new String[] {"markdown"};
4634        case -1724546052: /*description*/ return new String[] {"markdown"};
4635        case -991726143: /*period*/ return new String[] {"Period"};
4636        case 3530567: /*site*/ return new String[] {"Reference"};
4637        case 3387378: /*note*/ return new String[] {"Annotation"};
4638        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
4639        case -1841460864: /*associatedParty*/ return new String[] {};
4640        case -1897502593: /*progressStatus*/ return new String[] {};
4641        case -699986715: /*whyStopped*/ return new String[] {"CodeableConcept"};
4642        case 780783004: /*recruitment*/ return new String[] {};
4643        case -138266634: /*comparisonGroup*/ return new String[] {};
4644        case -1489585863: /*objective*/ return new String[] {};
4645        case -1510689364: /*outcomeMeasure*/ return new String[] {};
4646        case -934426595: /*result*/ return new String[] {"Reference"};
4647        default: return super.getTypesForProperty(hash, name);
4648        }
4649
4650      }
4651
4652      @Override
4653      public Base addChild(String name) throws FHIRException {
4654        if (name.equals("url")) {
4655          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.url");
4656        }
4657        else if (name.equals("identifier")) {
4658          return addIdentifier();
4659        }
4660        else if (name.equals("version")) {
4661          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.version");
4662        }
4663        else if (name.equals("name")) {
4664          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.name");
4665        }
4666        else if (name.equals("title")) {
4667          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.title");
4668        }
4669        else if (name.equals("label")) {
4670          return addLabel();
4671        }
4672        else if (name.equals("protocol")) {
4673          return addProtocol();
4674        }
4675        else if (name.equals("partOf")) {
4676          return addPartOf();
4677        }
4678        else if (name.equals("relatedArtifact")) {
4679          return addRelatedArtifact();
4680        }
4681        else if (name.equals("date")) {
4682          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.date");
4683        }
4684        else if (name.equals("status")) {
4685          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.status");
4686        }
4687        else if (name.equals("primaryPurposeType")) {
4688          this.primaryPurposeType = new CodeableConcept();
4689          return this.primaryPurposeType;
4690        }
4691        else if (name.equals("phase")) {
4692          this.phase = new CodeableConcept();
4693          return this.phase;
4694        }
4695        else if (name.equals("studyDesign")) {
4696          return addStudyDesign();
4697        }
4698        else if (name.equals("focus")) {
4699          return addFocus();
4700        }
4701        else if (name.equals("condition")) {
4702          return addCondition();
4703        }
4704        else if (name.equals("keyword")) {
4705          return addKeyword();
4706        }
4707        else if (name.equals("region")) {
4708          return addRegion();
4709        }
4710        else if (name.equals("descriptionSummary")) {
4711          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.descriptionSummary");
4712        }
4713        else if (name.equals("description")) {
4714          throw new FHIRException("Cannot call addChild on a primitive type ResearchStudy.description");
4715        }
4716        else if (name.equals("period")) {
4717          this.period = new Period();
4718          return this.period;
4719        }
4720        else if (name.equals("site")) {
4721          return addSite();
4722        }
4723        else if (name.equals("note")) {
4724          return addNote();
4725        }
4726        else if (name.equals("classifier")) {
4727          return addClassifier();
4728        }
4729        else if (name.equals("associatedParty")) {
4730          return addAssociatedParty();
4731        }
4732        else if (name.equals("progressStatus")) {
4733          return addProgressStatus();
4734        }
4735        else if (name.equals("whyStopped")) {
4736          this.whyStopped = new CodeableConcept();
4737          return this.whyStopped;
4738        }
4739        else if (name.equals("recruitment")) {
4740          this.recruitment = new ResearchStudyRecruitmentComponent();
4741          return this.recruitment;
4742        }
4743        else if (name.equals("comparisonGroup")) {
4744          return addComparisonGroup();
4745        }
4746        else if (name.equals("objective")) {
4747          return addObjective();
4748        }
4749        else if (name.equals("outcomeMeasure")) {
4750          return addOutcomeMeasure();
4751        }
4752        else if (name.equals("result")) {
4753          return addResult();
4754        }
4755        else
4756          return super.addChild(name);
4757      }
4758
4759  public String fhirType() {
4760    return "ResearchStudy";
4761
4762  }
4763
4764      public ResearchStudy copy() {
4765        ResearchStudy dst = new ResearchStudy();
4766        copyValues(dst);
4767        return dst;
4768      }
4769
4770      public void copyValues(ResearchStudy dst) {
4771        super.copyValues(dst);
4772        dst.url = url == null ? null : url.copy();
4773        if (identifier != null) {
4774          dst.identifier = new ArrayList<Identifier>();
4775          for (Identifier i : identifier)
4776            dst.identifier.add(i.copy());
4777        };
4778        dst.version = version == null ? null : version.copy();
4779        dst.name = name == null ? null : name.copy();
4780        dst.title = title == null ? null : title.copy();
4781        if (label != null) {
4782          dst.label = new ArrayList<ResearchStudyLabelComponent>();
4783          for (ResearchStudyLabelComponent i : label)
4784            dst.label.add(i.copy());
4785        };
4786        if (protocol != null) {
4787          dst.protocol = new ArrayList<Reference>();
4788          for (Reference i : protocol)
4789            dst.protocol.add(i.copy());
4790        };
4791        if (partOf != null) {
4792          dst.partOf = new ArrayList<Reference>();
4793          for (Reference i : partOf)
4794            dst.partOf.add(i.copy());
4795        };
4796        if (relatedArtifact != null) {
4797          dst.relatedArtifact = new ArrayList<RelatedArtifact>();
4798          for (RelatedArtifact i : relatedArtifact)
4799            dst.relatedArtifact.add(i.copy());
4800        };
4801        dst.date = date == null ? null : date.copy();
4802        dst.status = status == null ? null : status.copy();
4803        dst.primaryPurposeType = primaryPurposeType == null ? null : primaryPurposeType.copy();
4804        dst.phase = phase == null ? null : phase.copy();
4805        if (studyDesign != null) {
4806          dst.studyDesign = new ArrayList<CodeableConcept>();
4807          for (CodeableConcept i : studyDesign)
4808            dst.studyDesign.add(i.copy());
4809        };
4810        if (focus != null) {
4811          dst.focus = new ArrayList<CodeableReference>();
4812          for (CodeableReference i : focus)
4813            dst.focus.add(i.copy());
4814        };
4815        if (condition != null) {
4816          dst.condition = new ArrayList<CodeableConcept>();
4817          for (CodeableConcept i : condition)
4818            dst.condition.add(i.copy());
4819        };
4820        if (keyword != null) {
4821          dst.keyword = new ArrayList<CodeableConcept>();
4822          for (CodeableConcept i : keyword)
4823            dst.keyword.add(i.copy());
4824        };
4825        if (region != null) {
4826          dst.region = new ArrayList<CodeableConcept>();
4827          for (CodeableConcept i : region)
4828            dst.region.add(i.copy());
4829        };
4830        dst.descriptionSummary = descriptionSummary == null ? null : descriptionSummary.copy();
4831        dst.description = description == null ? null : description.copy();
4832        dst.period = period == null ? null : period.copy();
4833        if (site != null) {
4834          dst.site = new ArrayList<Reference>();
4835          for (Reference i : site)
4836            dst.site.add(i.copy());
4837        };
4838        if (note != null) {
4839          dst.note = new ArrayList<Annotation>();
4840          for (Annotation i : note)
4841            dst.note.add(i.copy());
4842        };
4843        if (classifier != null) {
4844          dst.classifier = new ArrayList<CodeableConcept>();
4845          for (CodeableConcept i : classifier)
4846            dst.classifier.add(i.copy());
4847        };
4848        if (associatedParty != null) {
4849          dst.associatedParty = new ArrayList<ResearchStudyAssociatedPartyComponent>();
4850          for (ResearchStudyAssociatedPartyComponent i : associatedParty)
4851            dst.associatedParty.add(i.copy());
4852        };
4853        if (progressStatus != null) {
4854          dst.progressStatus = new ArrayList<ResearchStudyProgressStatusComponent>();
4855          for (ResearchStudyProgressStatusComponent i : progressStatus)
4856            dst.progressStatus.add(i.copy());
4857        };
4858        dst.whyStopped = whyStopped == null ? null : whyStopped.copy();
4859        dst.recruitment = recruitment == null ? null : recruitment.copy();
4860        if (comparisonGroup != null) {
4861          dst.comparisonGroup = new ArrayList<ResearchStudyComparisonGroupComponent>();
4862          for (ResearchStudyComparisonGroupComponent i : comparisonGroup)
4863            dst.comparisonGroup.add(i.copy());
4864        };
4865        if (objective != null) {
4866          dst.objective = new ArrayList<ResearchStudyObjectiveComponent>();
4867          for (ResearchStudyObjectiveComponent i : objective)
4868            dst.objective.add(i.copy());
4869        };
4870        if (outcomeMeasure != null) {
4871          dst.outcomeMeasure = new ArrayList<ResearchStudyOutcomeMeasureComponent>();
4872          for (ResearchStudyOutcomeMeasureComponent i : outcomeMeasure)
4873            dst.outcomeMeasure.add(i.copy());
4874        };
4875        if (result != null) {
4876          dst.result = new ArrayList<Reference>();
4877          for (Reference i : result)
4878            dst.result.add(i.copy());
4879        };
4880      }
4881
4882      protected ResearchStudy typedCopy() {
4883        return copy();
4884      }
4885
4886      @Override
4887      public boolean equalsDeep(Base other_) {
4888        if (!super.equalsDeep(other_))
4889          return false;
4890        if (!(other_ instanceof ResearchStudy))
4891          return false;
4892        ResearchStudy o = (ResearchStudy) other_;
4893        return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true)
4894           && compareDeep(name, o.name, true) && compareDeep(title, o.title, true) && compareDeep(label, o.label, true)
4895           && compareDeep(protocol, o.protocol, true) && compareDeep(partOf, o.partOf, true) && compareDeep(relatedArtifact, o.relatedArtifact, true)
4896           && compareDeep(date, o.date, true) && compareDeep(status, o.status, true) && compareDeep(primaryPurposeType, o.primaryPurposeType, true)
4897           && compareDeep(phase, o.phase, true) && compareDeep(studyDesign, o.studyDesign, true) && compareDeep(focus, o.focus, true)
4898           && compareDeep(condition, o.condition, true) && compareDeep(keyword, o.keyword, true) && compareDeep(region, o.region, true)
4899           && compareDeep(descriptionSummary, o.descriptionSummary, true) && compareDeep(description, o.description, true)
4900           && compareDeep(period, o.period, true) && compareDeep(site, o.site, true) && compareDeep(note, o.note, true)
4901           && compareDeep(classifier, o.classifier, true) && compareDeep(associatedParty, o.associatedParty, true)
4902           && compareDeep(progressStatus, o.progressStatus, true) && compareDeep(whyStopped, o.whyStopped, true)
4903           && compareDeep(recruitment, o.recruitment, true) && compareDeep(comparisonGroup, o.comparisonGroup, true)
4904           && compareDeep(objective, o.objective, true) && compareDeep(outcomeMeasure, o.outcomeMeasure, true)
4905           && compareDeep(result, o.result, true);
4906      }
4907
4908      @Override
4909      public boolean equalsShallow(Base other_) {
4910        if (!super.equalsShallow(other_))
4911          return false;
4912        if (!(other_ instanceof ResearchStudy))
4913          return false;
4914        ResearchStudy o = (ResearchStudy) other_;
4915        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true)
4916           && compareValues(title, o.title, true) && compareValues(date, o.date, true) && compareValues(status, o.status, true)
4917           && compareValues(descriptionSummary, o.descriptionSummary, true) && compareValues(description, o.description, true)
4918          ;
4919      }
4920
4921      public boolean isEmpty() {
4922        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, identifier, version
4923          , name, title, label, protocol, partOf, relatedArtifact, date, status, primaryPurposeType
4924          , phase, studyDesign, focus, condition, keyword, region, descriptionSummary, description
4925          , period, site, note, classifier, associatedParty, progressStatus, whyStopped
4926          , recruitment, comparisonGroup, objective, outcomeMeasure, result);
4927      }
4928
4929  @Override
4930  public ResourceType getResourceType() {
4931    return ResourceType.ResearchStudy;
4932   }
4933
4934 /**
4935   * Search parameter: <b>condition</b>
4936   * <p>
4937   * Description: <b>Condition being studied</b><br>
4938   * Type: <b>token</b><br>
4939   * Path: <b>ResearchStudy.condition</b><br>
4940   * </p>
4941   */
4942  @SearchParamDefinition(name="condition", path="ResearchStudy.condition", description="Condition being studied", type="token" )
4943  public static final String SP_CONDITION = "condition";
4944 /**
4945   * <b>Fluent Client</b> search parameter constant for <b>condition</b>
4946   * <p>
4947   * Description: <b>Condition being studied</b><br>
4948   * Type: <b>token</b><br>
4949   * Path: <b>ResearchStudy.condition</b><br>
4950   * </p>
4951   */
4952  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONDITION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONDITION);
4953
4954 /**
4955   * Search parameter: <b>date</b>
4956   * <p>
4957   * Description: <b>When the study began and ended</b><br>
4958   * Type: <b>date</b><br>
4959   * Path: <b>ResearchStudy.period</b><br>
4960   * </p>
4961   */
4962  @SearchParamDefinition(name="date", path="ResearchStudy.period", description="When the study began and ended", type="date" )
4963  public static final String SP_DATE = "date";
4964 /**
4965   * <b>Fluent Client</b> search parameter constant for <b>date</b>
4966   * <p>
4967   * Description: <b>When the study began and ended</b><br>
4968   * Type: <b>date</b><br>
4969   * Path: <b>ResearchStudy.period</b><br>
4970   * </p>
4971   */
4972  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
4973
4974 /**
4975   * Search parameter: <b>focus</b>
4976   * <p>
4977   * Description: <b>Drugs, devices, etc. under study</b><br>
4978   * Type: <b>token</b><br>
4979   * Path: <b>ResearchStudy.focus</b><br>
4980   * </p>
4981   */
4982  @SearchParamDefinition(name="focus", path="ResearchStudy.focus", description="Drugs, devices, etc. under study", type="token" )
4983  public static final String SP_FOCUS = "focus";
4984 /**
4985   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
4986   * <p>
4987   * Description: <b>Drugs, devices, etc. under study</b><br>
4988   * Type: <b>token</b><br>
4989   * Path: <b>ResearchStudy.focus</b><br>
4990   * </p>
4991   */
4992  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FOCUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FOCUS);
4993
4994 /**
4995   * Search parameter: <b>identifier</b>
4996   * <p>
4997   * Description: <b>Business Identifier for study</b><br>
4998   * Type: <b>token</b><br>
4999   * Path: <b>ResearchStudy.identifier</b><br>
5000   * </p>
5001   */
5002  @SearchParamDefinition(name="identifier", path="ResearchStudy.identifier", description="Business Identifier for study", type="token" )
5003  public static final String SP_IDENTIFIER = "identifier";
5004 /**
5005   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
5006   * <p>
5007   * Description: <b>Business Identifier for study</b><br>
5008   * Type: <b>token</b><br>
5009   * Path: <b>ResearchStudy.identifier</b><br>
5010   * </p>
5011   */
5012  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
5013
5014 /**
5015   * Search parameter: <b>keyword</b>
5016   * <p>
5017   * Description: <b>Used to search for the study</b><br>
5018   * Type: <b>token</b><br>
5019   * Path: <b>ResearchStudy.keyword</b><br>
5020   * </p>
5021   */
5022  @SearchParamDefinition(name="keyword", path="ResearchStudy.keyword", description="Used to search for the study", type="token" )
5023  public static final String SP_KEYWORD = "keyword";
5024 /**
5025   * <b>Fluent Client</b> search parameter constant for <b>keyword</b>
5026   * <p>
5027   * Description: <b>Used to search for the study</b><br>
5028   * Type: <b>token</b><br>
5029   * Path: <b>ResearchStudy.keyword</b><br>
5030   * </p>
5031   */
5032  public static final ca.uhn.fhir.rest.gclient.TokenClientParam KEYWORD = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KEYWORD);
5033
5034 /**
5035   * Search parameter: <b>partof</b>
5036   * <p>
5037   * Description: <b>Part of larger study</b><br>
5038   * Type: <b>reference</b><br>
5039   * Path: <b>ResearchStudy.partOf</b><br>
5040   * </p>
5041   */
5042  @SearchParamDefinition(name="partof", path="ResearchStudy.partOf", description="Part of larger study", type="reference", target={ResearchStudy.class } )
5043  public static final String SP_PARTOF = "partof";
5044 /**
5045   * <b>Fluent Client</b> search parameter constant for <b>partof</b>
5046   * <p>
5047   * Description: <b>Part of larger study</b><br>
5048   * Type: <b>reference</b><br>
5049   * Path: <b>ResearchStudy.partOf</b><br>
5050   * </p>
5051   */
5052  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTOF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTOF);
5053
5054/**
5055   * Constant for fluent queries to be used to add include statements. Specifies
5056   * the path value of "<b>ResearchStudy:partof</b>".
5057   */
5058  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include("ResearchStudy:partof").toLocked();
5059
5060 /**
5061   * Search parameter: <b>protocol</b>
5062   * <p>
5063   * Description: <b>Steps followed in executing study</b><br>
5064   * Type: <b>reference</b><br>
5065   * Path: <b>ResearchStudy.protocol</b><br>
5066   * </p>
5067   */
5068  @SearchParamDefinition(name="protocol", path="ResearchStudy.protocol", description="Steps followed in executing study", type="reference", target={PlanDefinition.class } )
5069  public static final String SP_PROTOCOL = "protocol";
5070 /**
5071   * <b>Fluent Client</b> search parameter constant for <b>protocol</b>
5072   * <p>
5073   * Description: <b>Steps followed in executing study</b><br>
5074   * Type: <b>reference</b><br>
5075   * Path: <b>ResearchStudy.protocol</b><br>
5076   * </p>
5077   */
5078  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROTOCOL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROTOCOL);
5079
5080/**
5081   * Constant for fluent queries to be used to add include statements. Specifies
5082   * the path value of "<b>ResearchStudy:protocol</b>".
5083   */
5084  public static final ca.uhn.fhir.model.api.Include INCLUDE_PROTOCOL = new ca.uhn.fhir.model.api.Include("ResearchStudy:protocol").toLocked();
5085
5086 /**
5087   * Search parameter: <b>recruitment_actual</b>
5088   * <p>
5089   * Description: <b>Actual number of participants enrolled in study across all groups</b><br>
5090   * Type: <b>number</b><br>
5091   * Path: <b>ResearchStudy.recruitment.actualNumber</b><br>
5092   * </p>
5093   */
5094  @SearchParamDefinition(name="recruitment_actual", path="ResearchStudy.recruitment.actualNumber", description="Actual number of participants enrolled in study across all groups", type="number" )
5095  public static final String SP_RECRUITMENTACTUAL = "recruitment_actual";
5096 /**
5097   * <b>Fluent Client</b> search parameter constant for <b>recruitment_actual</b>
5098   * <p>
5099   * Description: <b>Actual number of participants enrolled in study across all groups</b><br>
5100   * Type: <b>number</b><br>
5101   * Path: <b>ResearchStudy.recruitment.actualNumber</b><br>
5102   * </p>
5103   */
5104  public static final ca.uhn.fhir.rest.gclient.NumberClientParam RECRUITMENTACTUAL = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_RECRUITMENTACTUAL);
5105
5106 /**
5107   * Search parameter: <b>recruitment_target</b>
5108   * <p>
5109   * Description: <b>Target number of participants enrolled in study across all groups</b><br>
5110   * Type: <b>number</b><br>
5111   * Path: <b>ResearchStudy.recruitment.targetNumber</b><br>
5112   * </p>
5113   */
5114  @SearchParamDefinition(name="recruitment_target", path="ResearchStudy.recruitment.targetNumber", description="Target number of participants enrolled in study across all groups", type="number" )
5115  public static final String SP_RECRUITMENTTARGET = "recruitment_target";
5116 /**
5117   * <b>Fluent Client</b> search parameter constant for <b>recruitment_target</b>
5118   * <p>
5119   * Description: <b>Target number of participants enrolled in study across all groups</b><br>
5120   * Type: <b>number</b><br>
5121   * Path: <b>ResearchStudy.recruitment.targetNumber</b><br>
5122   * </p>
5123   */
5124  public static final ca.uhn.fhir.rest.gclient.NumberClientParam RECRUITMENTTARGET = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_RECRUITMENTTARGET);
5125
5126 /**
5127   * Search parameter: <b>region</b>
5128   * <p>
5129   * Description: <b>Geographic area for the study</b><br>
5130   * Type: <b>token</b><br>
5131   * Path: <b>ResearchStudy.region</b><br>
5132   * </p>
5133   */
5134  @SearchParamDefinition(name="region", path="ResearchStudy.region", description="Geographic area for the study", type="token" )
5135  public static final String SP_REGION = "region";
5136 /**
5137   * <b>Fluent Client</b> search parameter constant for <b>region</b>
5138   * <p>
5139   * Description: <b>Geographic area for the study</b><br>
5140   * Type: <b>token</b><br>
5141   * Path: <b>ResearchStudy.region</b><br>
5142   * </p>
5143   */
5144  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REGION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REGION);
5145
5146 /**
5147   * Search parameter: <b>site</b>
5148   * <p>
5149   * Description: <b>Facility where study activities are conducted</b><br>
5150   * Type: <b>reference</b><br>
5151   * Path: <b>ResearchStudy.site</b><br>
5152   * </p>
5153   */
5154  @SearchParamDefinition(name="site", path="ResearchStudy.site", description="Facility where study activities are conducted", type="reference", target={Location.class, Organization.class, ResearchStudy.class } )
5155  public static final String SP_SITE = "site";
5156 /**
5157   * <b>Fluent Client</b> search parameter constant for <b>site</b>
5158   * <p>
5159   * Description: <b>Facility where study activities are conducted</b><br>
5160   * Type: <b>reference</b><br>
5161   * Path: <b>ResearchStudy.site</b><br>
5162   * </p>
5163   */
5164  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SITE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SITE);
5165
5166/**
5167   * Constant for fluent queries to be used to add include statements. Specifies
5168   * the path value of "<b>ResearchStudy:site</b>".
5169   */
5170  public static final ca.uhn.fhir.model.api.Include INCLUDE_SITE = new ca.uhn.fhir.model.api.Include("ResearchStudy:site").toLocked();
5171
5172 /**
5173   * Search parameter: <b>status</b>
5174   * <p>
5175   * Description: <b>active | active-but-not-recruiting | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | enrolling-by-invitation | in-review | not-yet-recruiting | recruiting | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | terminated | withdrawn</b><br>
5176   * Type: <b>token</b><br>
5177   * Path: <b>ResearchStudy.status</b><br>
5178   * </p>
5179   */
5180  @SearchParamDefinition(name="status", path="ResearchStudy.status", description="active | active-but-not-recruiting | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | enrolling-by-invitation | in-review | not-yet-recruiting | recruiting | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | terminated | withdrawn", type="token" )
5181  public static final String SP_STATUS = "status";
5182 /**
5183   * <b>Fluent Client</b> search parameter constant for <b>status</b>
5184   * <p>
5185   * Description: <b>active | active-but-not-recruiting | administratively-completed | approved | closed-to-accrual | closed-to-accrual-and-intervention | completed | disapproved | enrolling-by-invitation | in-review | not-yet-recruiting | recruiting | temporarily-closed-to-accrual | temporarily-closed-to-accrual-and-intervention | terminated | withdrawn</b><br>
5186   * Type: <b>token</b><br>
5187   * Path: <b>ResearchStudy.status</b><br>
5188   * </p>
5189   */
5190  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
5191
5192 /**
5193   * Search parameter: <b>title</b>
5194   * <p>
5195   * Description: <b>Name for this study</b><br>
5196   * Type: <b>string</b><br>
5197   * Path: <b>ResearchStudy.title</b><br>
5198   * </p>
5199   */
5200  @SearchParamDefinition(name="title", path="ResearchStudy.title", description="Name for this study", type="string" )
5201  public static final String SP_TITLE = "title";
5202 /**
5203   * <b>Fluent Client</b> search parameter constant for <b>title</b>
5204   * <p>
5205   * Description: <b>Name for this study</b><br>
5206   * Type: <b>string</b><br>
5207   * Path: <b>ResearchStudy.title</b><br>
5208   * </p>
5209   */
5210  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
5211
5212
5213}
5214