001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
033import java.util.ArrayList;
034import java.util.Date;
035import java.util.List;
036
037import org.hl7.fhir.exceptions.FHIRException;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039import org.hl7.fhir.r4.model.Enumerations.PublicationStatus;
040import org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory;
041import org.hl7.fhir.utilities.Utilities;
042
043import ca.uhn.fhir.model.api.annotation.Block;
044import ca.uhn.fhir.model.api.annotation.Child;
045import ca.uhn.fhir.model.api.annotation.ChildOrder;
046import ca.uhn.fhir.model.api.annotation.Description;
047import ca.uhn.fhir.model.api.annotation.ResourceDef;
048import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
049
050/**
051 * The ResearchElementDefinition resource describes a "PICO" element that
052 * knowledge (evidence, assertion, recommendation) is about.
053 */
054@ResourceDef(name = "ResearchElementDefinition", profile = "http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition")
055@ChildOrder(names = { "url", "identifier", "version", "name", "title", "shortTitle", "subtitle", "status",
056    "experimental", "subject[x]", "date", "publisher", "contact", "description", "comment", "useContext",
057    "jurisdiction", "purpose", "usage", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "topic",
058    "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "type", "variableType",
059    "characteristic" })
060public class ResearchElementDefinition extends MetadataResource {
061
062  public enum ResearchElementType {
063    /**
064     * The element defines the population that forms the basis for research.
065     */
066    POPULATION,
067    /**
068     * The element defines an exposure within the population that is being
069     * researched.
070     */
071    EXPOSURE,
072    /**
073     * The element defines an outcome within the population that is being
074     * researched.
075     */
076    OUTCOME,
077    /**
078     * added to help the parsers with the generic types
079     */
080    NULL;
081
082    public static ResearchElementType fromCode(String codeString) throws FHIRException {
083      if (codeString == null || "".equals(codeString))
084        return null;
085      if ("population".equals(codeString))
086        return POPULATION;
087      if ("exposure".equals(codeString))
088        return EXPOSURE;
089      if ("outcome".equals(codeString))
090        return OUTCOME;
091      if (Configuration.isAcceptInvalidEnums())
092        return null;
093      else
094        throw new FHIRException("Unknown ResearchElementType code '" + codeString + "'");
095    }
096
097    public String toCode() {
098      switch (this) {
099      case POPULATION:
100        return "population";
101      case EXPOSURE:
102        return "exposure";
103      case OUTCOME:
104        return "outcome";
105      case NULL:
106        return null;
107      default:
108        return "?";
109      }
110    }
111
112    public String getSystem() {
113      switch (this) {
114      case POPULATION:
115        return "http://hl7.org/fhir/research-element-type";
116      case EXPOSURE:
117        return "http://hl7.org/fhir/research-element-type";
118      case OUTCOME:
119        return "http://hl7.org/fhir/research-element-type";
120      case NULL:
121        return null;
122      default:
123        return "?";
124      }
125    }
126
127    public String getDefinition() {
128      switch (this) {
129      case POPULATION:
130        return "The element defines the population that forms the basis for research.";
131      case EXPOSURE:
132        return "The element defines an exposure within the population that is being researched.";
133      case OUTCOME:
134        return "The element defines an outcome within the population that is being researched.";
135      case NULL:
136        return null;
137      default:
138        return "?";
139      }
140    }
141
142    public String getDisplay() {
143      switch (this) {
144      case POPULATION:
145        return "Population";
146      case EXPOSURE:
147        return "Exposure";
148      case OUTCOME:
149        return "Outcome";
150      case NULL:
151        return null;
152      default:
153        return "?";
154      }
155    }
156  }
157
158  public static class ResearchElementTypeEnumFactory implements EnumFactory<ResearchElementType> {
159    public ResearchElementType fromCode(String codeString) throws IllegalArgumentException {
160      if (codeString == null || "".equals(codeString))
161        if (codeString == null || "".equals(codeString))
162          return null;
163      if ("population".equals(codeString))
164        return ResearchElementType.POPULATION;
165      if ("exposure".equals(codeString))
166        return ResearchElementType.EXPOSURE;
167      if ("outcome".equals(codeString))
168        return ResearchElementType.OUTCOME;
169      throw new IllegalArgumentException("Unknown ResearchElementType code '" + codeString + "'");
170    }
171
172    public Enumeration<ResearchElementType> fromType(PrimitiveType<?> code) throws FHIRException {
173      if (code == null)
174        return null;
175      if (code.isEmpty())
176        return new Enumeration<ResearchElementType>(this, ResearchElementType.NULL, code);
177      String codeString = code.asStringValue();
178      if (codeString == null || "".equals(codeString))
179        return new Enumeration<ResearchElementType>(this, ResearchElementType.NULL, code);
180      if ("population".equals(codeString))
181        return new Enumeration<ResearchElementType>(this, ResearchElementType.POPULATION, code);
182      if ("exposure".equals(codeString))
183        return new Enumeration<ResearchElementType>(this, ResearchElementType.EXPOSURE, code);
184      if ("outcome".equals(codeString))
185        return new Enumeration<ResearchElementType>(this, ResearchElementType.OUTCOME, code);
186      throw new FHIRException("Unknown ResearchElementType code '" + codeString + "'");
187    }
188
189    public String toCode(ResearchElementType code) {
190      if (code == ResearchElementType.POPULATION)
191        return "population";
192      if (code == ResearchElementType.EXPOSURE)
193        return "exposure";
194      if (code == ResearchElementType.OUTCOME)
195        return "outcome";
196      return "?";
197    }
198
199    public String toSystem(ResearchElementType code) {
200      return code.getSystem();
201    }
202  }
203
204  public enum VariableType {
205    /**
206     * The variable is dichotomous, such as present or absent.
207     */
208    DICHOTOMOUS,
209    /**
210     * The variable is a continuous result such as a quantity.
211     */
212    CONTINUOUS,
213    /**
214     * The variable is described narratively rather than quantitatively.
215     */
216    DESCRIPTIVE,
217    /**
218     * added to help the parsers with the generic types
219     */
220    NULL;
221
222    public static VariableType fromCode(String codeString) throws FHIRException {
223      if (codeString == null || "".equals(codeString))
224        return null;
225      if ("dichotomous".equals(codeString))
226        return DICHOTOMOUS;
227      if ("continuous".equals(codeString))
228        return CONTINUOUS;
229      if ("descriptive".equals(codeString))
230        return DESCRIPTIVE;
231      if (Configuration.isAcceptInvalidEnums())
232        return null;
233      else
234        throw new FHIRException("Unknown VariableType code '" + codeString + "'");
235    }
236
237    public String toCode() {
238      switch (this) {
239      case DICHOTOMOUS:
240        return "dichotomous";
241      case CONTINUOUS:
242        return "continuous";
243      case DESCRIPTIVE:
244        return "descriptive";
245      case NULL:
246        return null;
247      default:
248        return "?";
249      }
250    }
251
252    public String getSystem() {
253      switch (this) {
254      case DICHOTOMOUS:
255        return "http://hl7.org/fhir/variable-type";
256      case CONTINUOUS:
257        return "http://hl7.org/fhir/variable-type";
258      case DESCRIPTIVE:
259        return "http://hl7.org/fhir/variable-type";
260      case NULL:
261        return null;
262      default:
263        return "?";
264      }
265    }
266
267    public String getDefinition() {
268      switch (this) {
269      case DICHOTOMOUS:
270        return "The variable is dichotomous, such as present or absent.";
271      case CONTINUOUS:
272        return "The variable is a continuous result such as a quantity.";
273      case DESCRIPTIVE:
274        return "The variable is described narratively rather than quantitatively.";
275      case NULL:
276        return null;
277      default:
278        return "?";
279      }
280    }
281
282    public String getDisplay() {
283      switch (this) {
284      case DICHOTOMOUS:
285        return "Dichotomous";
286      case CONTINUOUS:
287        return "Continuous";
288      case DESCRIPTIVE:
289        return "Descriptive";
290      case NULL:
291        return null;
292      default:
293        return "?";
294      }
295    }
296  }
297
298  public static class VariableTypeEnumFactory implements EnumFactory<VariableType> {
299    public VariableType fromCode(String codeString) throws IllegalArgumentException {
300      if (codeString == null || "".equals(codeString))
301        if (codeString == null || "".equals(codeString))
302          return null;
303      if ("dichotomous".equals(codeString))
304        return VariableType.DICHOTOMOUS;
305      if ("continuous".equals(codeString))
306        return VariableType.CONTINUOUS;
307      if ("descriptive".equals(codeString))
308        return VariableType.DESCRIPTIVE;
309      throw new IllegalArgumentException("Unknown VariableType code '" + codeString + "'");
310    }
311
312    public Enumeration<VariableType> fromType(PrimitiveType<?> code) throws FHIRException {
313      if (code == null)
314        return null;
315      if (code.isEmpty())
316        return new Enumeration<VariableType>(this, VariableType.NULL, code);
317      String codeString = code.asStringValue();
318      if (codeString == null || "".equals(codeString))
319        return new Enumeration<VariableType>(this, VariableType.NULL, code);
320      if ("dichotomous".equals(codeString))
321        return new Enumeration<VariableType>(this, VariableType.DICHOTOMOUS, code);
322      if ("continuous".equals(codeString))
323        return new Enumeration<VariableType>(this, VariableType.CONTINUOUS, code);
324      if ("descriptive".equals(codeString))
325        return new Enumeration<VariableType>(this, VariableType.DESCRIPTIVE, code);
326      throw new FHIRException("Unknown VariableType code '" + codeString + "'");
327    }
328
329    public String toCode(VariableType code) {
330      if (code == VariableType.DICHOTOMOUS)
331        return "dichotomous";
332      if (code == VariableType.CONTINUOUS)
333        return "continuous";
334      if (code == VariableType.DESCRIPTIVE)
335        return "descriptive";
336      return "?";
337    }
338
339    public String toSystem(VariableType code) {
340      return code.getSystem();
341    }
342  }
343
344  public enum GroupMeasure {
345    /**
346     * Aggregated using Mean of participant values.
347     */
348    MEAN,
349    /**
350     * Aggregated using Median of participant values.
351     */
352    MEDIAN,
353    /**
354     * Aggregated using Mean of study mean values.
355     */
356    MEANOFMEAN,
357    /**
358     * Aggregated using Mean of study median values.
359     */
360    MEANOFMEDIAN,
361    /**
362     * Aggregated using Median of study mean values.
363     */
364    MEDIANOFMEAN,
365    /**
366     * Aggregated using Median of study median values.
367     */
368    MEDIANOFMEDIAN,
369    /**
370     * added to help the parsers with the generic types
371     */
372    NULL;
373
374    public static GroupMeasure fromCode(String codeString) throws FHIRException {
375      if (codeString == null || "".equals(codeString))
376        return null;
377      if ("mean".equals(codeString))
378        return MEAN;
379      if ("median".equals(codeString))
380        return MEDIAN;
381      if ("mean-of-mean".equals(codeString))
382        return MEANOFMEAN;
383      if ("mean-of-median".equals(codeString))
384        return MEANOFMEDIAN;
385      if ("median-of-mean".equals(codeString))
386        return MEDIANOFMEAN;
387      if ("median-of-median".equals(codeString))
388        return MEDIANOFMEDIAN;
389      if (Configuration.isAcceptInvalidEnums())
390        return null;
391      else
392        throw new FHIRException("Unknown GroupMeasure code '" + codeString + "'");
393    }
394
395    public String toCode() {
396      switch (this) {
397      case MEAN:
398        return "mean";
399      case MEDIAN:
400        return "median";
401      case MEANOFMEAN:
402        return "mean-of-mean";
403      case MEANOFMEDIAN:
404        return "mean-of-median";
405      case MEDIANOFMEAN:
406        return "median-of-mean";
407      case MEDIANOFMEDIAN:
408        return "median-of-median";
409      case NULL:
410        return null;
411      default:
412        return "?";
413      }
414    }
415
416    public String getSystem() {
417      switch (this) {
418      case MEAN:
419        return "http://hl7.org/fhir/group-measure";
420      case MEDIAN:
421        return "http://hl7.org/fhir/group-measure";
422      case MEANOFMEAN:
423        return "http://hl7.org/fhir/group-measure";
424      case MEANOFMEDIAN:
425        return "http://hl7.org/fhir/group-measure";
426      case MEDIANOFMEAN:
427        return "http://hl7.org/fhir/group-measure";
428      case MEDIANOFMEDIAN:
429        return "http://hl7.org/fhir/group-measure";
430      case NULL:
431        return null;
432      default:
433        return "?";
434      }
435    }
436
437    public String getDefinition() {
438      switch (this) {
439      case MEAN:
440        return "Aggregated using Mean of participant values.";
441      case MEDIAN:
442        return "Aggregated using Median of participant values.";
443      case MEANOFMEAN:
444        return "Aggregated using Mean of study mean values.";
445      case MEANOFMEDIAN:
446        return "Aggregated using Mean of study median values.";
447      case MEDIANOFMEAN:
448        return "Aggregated using Median of study mean values.";
449      case MEDIANOFMEDIAN:
450        return "Aggregated using Median of study median values.";
451      case NULL:
452        return null;
453      default:
454        return "?";
455      }
456    }
457
458    public String getDisplay() {
459      switch (this) {
460      case MEAN:
461        return "Mean";
462      case MEDIAN:
463        return "Median";
464      case MEANOFMEAN:
465        return "Mean of Study Means";
466      case MEANOFMEDIAN:
467        return "Mean of Study Medins";
468      case MEDIANOFMEAN:
469        return "Median of Study Means";
470      case MEDIANOFMEDIAN:
471        return "Median of Study Medians";
472      case NULL:
473        return null;
474      default:
475        return "?";
476      }
477    }
478  }
479
480  public static class GroupMeasureEnumFactory implements EnumFactory<GroupMeasure> {
481    public GroupMeasure fromCode(String codeString) throws IllegalArgumentException {
482      if (codeString == null || "".equals(codeString))
483        if (codeString == null || "".equals(codeString))
484          return null;
485      if ("mean".equals(codeString))
486        return GroupMeasure.MEAN;
487      if ("median".equals(codeString))
488        return GroupMeasure.MEDIAN;
489      if ("mean-of-mean".equals(codeString))
490        return GroupMeasure.MEANOFMEAN;
491      if ("mean-of-median".equals(codeString))
492        return GroupMeasure.MEANOFMEDIAN;
493      if ("median-of-mean".equals(codeString))
494        return GroupMeasure.MEDIANOFMEAN;
495      if ("median-of-median".equals(codeString))
496        return GroupMeasure.MEDIANOFMEDIAN;
497      throw new IllegalArgumentException("Unknown GroupMeasure code '" + codeString + "'");
498    }
499
500    public Enumeration<GroupMeasure> fromType(PrimitiveType<?> code) throws FHIRException {
501      if (code == null)
502        return null;
503      if (code.isEmpty())
504        return new Enumeration<GroupMeasure>(this, GroupMeasure.NULL, code);
505      String codeString = code.asStringValue();
506      if (codeString == null || "".equals(codeString))
507        return new Enumeration<GroupMeasure>(this, GroupMeasure.NULL, code);
508      if ("mean".equals(codeString))
509        return new Enumeration<GroupMeasure>(this, GroupMeasure.MEAN, code);
510      if ("median".equals(codeString))
511        return new Enumeration<GroupMeasure>(this, GroupMeasure.MEDIAN, code);
512      if ("mean-of-mean".equals(codeString))
513        return new Enumeration<GroupMeasure>(this, GroupMeasure.MEANOFMEAN, code);
514      if ("mean-of-median".equals(codeString))
515        return new Enumeration<GroupMeasure>(this, GroupMeasure.MEANOFMEDIAN, code);
516      if ("median-of-mean".equals(codeString))
517        return new Enumeration<GroupMeasure>(this, GroupMeasure.MEDIANOFMEAN, code);
518      if ("median-of-median".equals(codeString))
519        return new Enumeration<GroupMeasure>(this, GroupMeasure.MEDIANOFMEDIAN, code);
520      throw new FHIRException("Unknown GroupMeasure code '" + codeString + "'");
521    }
522
523    public String toCode(GroupMeasure code) {
524      if (code == GroupMeasure.MEAN)
525        return "mean";
526      if (code == GroupMeasure.MEDIAN)
527        return "median";
528      if (code == GroupMeasure.MEANOFMEAN)
529        return "mean-of-mean";
530      if (code == GroupMeasure.MEANOFMEDIAN)
531        return "mean-of-median";
532      if (code == GroupMeasure.MEDIANOFMEAN)
533        return "median-of-mean";
534      if (code == GroupMeasure.MEDIANOFMEDIAN)
535        return "median-of-median";
536      return "?";
537    }
538
539    public String toSystem(GroupMeasure code) {
540      return code.getSystem();
541    }
542  }
543
544  @Block()
545  public static class ResearchElementDefinitionCharacteristicComponent extends BackboneElement
546      implements IBaseBackboneElement {
547    /**
548     * Define members of the research element using Codes (such as condition,
549     * medication, or observation), Expressions ( using an expression language such
550     * as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in
551     * the last year).
552     */
553    @Child(name = "definition", type = { CodeableConcept.class, CanonicalType.class, Expression.class,
554        DataRequirement.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
555    @Description(shortDefinition = "What code or expression defines members?", formalDefinition = "Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).")
556    protected Type definition;
557
558    /**
559     * Use UsageContext to define the members of the population, such as Age Ranges,
560     * Genders, Settings.
561     */
562    @Child(name = "usageContext", type = {
563        UsageContext.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
564    @Description(shortDefinition = "What code/value pairs define members?", formalDefinition = "Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings.")
565    protected List<UsageContext> usageContext;
566
567    /**
568     * When true, members with this characteristic are excluded from the element.
569     */
570    @Child(name = "exclude", type = {
571        BooleanType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
572    @Description(shortDefinition = "Whether the characteristic includes or excludes members", formalDefinition = "When true, members with this characteristic are excluded from the element.")
573    protected BooleanType exclude;
574
575    /**
576     * Specifies the UCUM unit for the outcome.
577     */
578    @Child(name = "unitOfMeasure", type = {
579        CodeableConcept.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
580    @Description(shortDefinition = "What unit is the outcome described in?", formalDefinition = "Specifies the UCUM unit for the outcome.")
581    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/ucum-units")
582    protected CodeableConcept unitOfMeasure;
583
584    /**
585     * A narrative description of the time period the study covers.
586     */
587    @Child(name = "studyEffectiveDescription", type = {
588        StringType.class }, order = 5, min = 0, max = 1, modifier = false, summary = false)
589    @Description(shortDefinition = "What time period does the study cover", formalDefinition = "A narrative description of the time period the study covers.")
590    protected StringType studyEffectiveDescription;
591
592    /**
593     * Indicates what effective period the study covers.
594     */
595    @Child(name = "studyEffective", type = { DateTimeType.class, Period.class, Duration.class,
596        Timing.class }, order = 6, min = 0, max = 1, modifier = false, summary = false)
597    @Description(shortDefinition = "What time period does the study cover", formalDefinition = "Indicates what effective period the study covers.")
598    protected Type studyEffective;
599
600    /**
601     * Indicates duration from the study initiation.
602     */
603    @Child(name = "studyEffectiveTimeFromStart", type = {
604        Duration.class }, order = 7, min = 0, max = 1, modifier = false, summary = false)
605    @Description(shortDefinition = "Observation time from study start", formalDefinition = "Indicates duration from the study initiation.")
606    protected Duration studyEffectiveTimeFromStart;
607
608    /**
609     * Indicates how elements are aggregated within the study effective period.
610     */
611    @Child(name = "studyEffectiveGroupMeasure", type = {
612        CodeType.class }, order = 8, min = 0, max = 1, modifier = false, summary = false)
613    @Description(shortDefinition = "mean | median | mean-of-mean | mean-of-median | median-of-mean | median-of-median", formalDefinition = "Indicates how elements are aggregated within the study effective period.")
614    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/group-measure")
615    protected Enumeration<GroupMeasure> studyEffectiveGroupMeasure;
616
617    /**
618     * A narrative description of the time period the study covers.
619     */
620    @Child(name = "participantEffectiveDescription", type = {
621        StringType.class }, order = 9, min = 0, max = 1, modifier = false, summary = false)
622    @Description(shortDefinition = "What time period do participants cover", formalDefinition = "A narrative description of the time period the study covers.")
623    protected StringType participantEffectiveDescription;
624
625    /**
626     * Indicates what effective period the study covers.
627     */
628    @Child(name = "participantEffective", type = { DateTimeType.class, Period.class, Duration.class,
629        Timing.class }, order = 10, min = 0, max = 1, modifier = false, summary = false)
630    @Description(shortDefinition = "What time period do participants cover", formalDefinition = "Indicates what effective period the study covers.")
631    protected Type participantEffective;
632
633    /**
634     * Indicates duration from the participant's study entry.
635     */
636    @Child(name = "participantEffectiveTimeFromStart", type = {
637        Duration.class }, order = 11, min = 0, max = 1, modifier = false, summary = false)
638    @Description(shortDefinition = "Observation time from study start", formalDefinition = "Indicates duration from the participant's study entry.")
639    protected Duration participantEffectiveTimeFromStart;
640
641    /**
642     * Indicates how elements are aggregated within the study effective period.
643     */
644    @Child(name = "participantEffectiveGroupMeasure", type = {
645        CodeType.class }, order = 12, min = 0, max = 1, modifier = false, summary = false)
646    @Description(shortDefinition = "mean | median | mean-of-mean | mean-of-median | median-of-mean | median-of-median", formalDefinition = "Indicates how elements are aggregated within the study effective period.")
647    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/group-measure")
648    protected Enumeration<GroupMeasure> participantEffectiveGroupMeasure;
649
650    private static final long serialVersionUID = -1102952665L;
651
652    /**
653     * Constructor
654     */
655    public ResearchElementDefinitionCharacteristicComponent() {
656      super();
657    }
658
659    /**
660     * Constructor
661     */
662    public ResearchElementDefinitionCharacteristicComponent(Type definition) {
663      super();
664      this.definition = definition;
665    }
666
667    /**
668     * @return {@link #definition} (Define members of the research element using
669     *         Codes (such as condition, medication, or observation), Expressions (
670     *         using an expression language such as FHIRPath or CQL) or
671     *         DataRequirements (such as Diabetes diagnosis onset in the last
672     *         year).)
673     */
674    public Type getDefinition() {
675      return this.definition;
676    }
677
678    /**
679     * @return {@link #definition} (Define members of the research element using
680     *         Codes (such as condition, medication, or observation), Expressions (
681     *         using an expression language such as FHIRPath or CQL) or
682     *         DataRequirements (such as Diabetes diagnosis onset in the last
683     *         year).)
684     */
685    public CodeableConcept getDefinitionCodeableConcept() throws FHIRException {
686      if (this.definition == null)
687        this.definition = new CodeableConcept();
688      if (!(this.definition instanceof CodeableConcept))
689        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "
690            + this.definition.getClass().getName() + " was encountered");
691      return (CodeableConcept) this.definition;
692    }
693
694    public boolean hasDefinitionCodeableConcept() {
695      return this != null && this.definition instanceof CodeableConcept;
696    }
697
698    /**
699     * @return {@link #definition} (Define members of the research element using
700     *         Codes (such as condition, medication, or observation), Expressions (
701     *         using an expression language such as FHIRPath or CQL) or
702     *         DataRequirements (such as Diabetes diagnosis onset in the last
703     *         year).)
704     */
705    public CanonicalType getDefinitionCanonicalType() throws FHIRException {
706      if (this.definition == null)
707        this.definition = new CanonicalType();
708      if (!(this.definition instanceof CanonicalType))
709        throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "
710            + this.definition.getClass().getName() + " was encountered");
711      return (CanonicalType) this.definition;
712    }
713
714    public boolean hasDefinitionCanonicalType() {
715      return this != null && this.definition instanceof CanonicalType;
716    }
717
718    /**
719     * @return {@link #definition} (Define members of the research element using
720     *         Codes (such as condition, medication, or observation), Expressions (
721     *         using an expression language such as FHIRPath or CQL) or
722     *         DataRequirements (such as Diabetes diagnosis onset in the last
723     *         year).)
724     */
725    public Expression getDefinitionExpression() throws FHIRException {
726      if (this.definition == null)
727        this.definition = new Expression();
728      if (!(this.definition instanceof Expression))
729        throw new FHIRException("Type mismatch: the type Expression was expected, but "
730            + this.definition.getClass().getName() + " was encountered");
731      return (Expression) this.definition;
732    }
733
734    public boolean hasDefinitionExpression() {
735      return this != null && this.definition instanceof Expression;
736    }
737
738    /**
739     * @return {@link #definition} (Define members of the research element using
740     *         Codes (such as condition, medication, or observation), Expressions (
741     *         using an expression language such as FHIRPath or CQL) or
742     *         DataRequirements (such as Diabetes diagnosis onset in the last
743     *         year).)
744     */
745    public DataRequirement getDefinitionDataRequirement() throws FHIRException {
746      if (this.definition == null)
747        this.definition = new DataRequirement();
748      if (!(this.definition instanceof DataRequirement))
749        throw new FHIRException("Type mismatch: the type DataRequirement was expected, but "
750            + this.definition.getClass().getName() + " was encountered");
751      return (DataRequirement) this.definition;
752    }
753
754    public boolean hasDefinitionDataRequirement() {
755      return this != null && this.definition instanceof DataRequirement;
756    }
757
758    public boolean hasDefinition() {
759      return this.definition != null && !this.definition.isEmpty();
760    }
761
762    /**
763     * @param value {@link #definition} (Define members of the research element
764     *              using Codes (such as condition, medication, or observation),
765     *              Expressions ( using an expression language such as FHIRPath or
766     *              CQL) or DataRequirements (such as Diabetes diagnosis onset in
767     *              the last year).)
768     */
769    public ResearchElementDefinitionCharacteristicComponent setDefinition(Type value) {
770      if (value != null && !(value instanceof CodeableConcept || value instanceof CanonicalType
771          || value instanceof Expression || value instanceof DataRequirement))
772        throw new Error(
773            "Not the right type for ResearchElementDefinition.characteristic.definition[x]: " + value.fhirType());
774      this.definition = value;
775      return this;
776    }
777
778    /**
779     * @return {@link #usageContext} (Use UsageContext to define the members of the
780     *         population, such as Age Ranges, Genders, Settings.)
781     */
782    public List<UsageContext> getUsageContext() {
783      if (this.usageContext == null)
784        this.usageContext = new ArrayList<UsageContext>();
785      return this.usageContext;
786    }
787
788    /**
789     * @return Returns a reference to <code>this</code> for easy method chaining
790     */
791    public ResearchElementDefinitionCharacteristicComponent setUsageContext(List<UsageContext> theUsageContext) {
792      this.usageContext = theUsageContext;
793      return this;
794    }
795
796    public boolean hasUsageContext() {
797      if (this.usageContext == null)
798        return false;
799      for (UsageContext item : this.usageContext)
800        if (!item.isEmpty())
801          return true;
802      return false;
803    }
804
805    public UsageContext addUsageContext() { // 3
806      UsageContext t = new UsageContext();
807      if (this.usageContext == null)
808        this.usageContext = new ArrayList<UsageContext>();
809      this.usageContext.add(t);
810      return t;
811    }
812
813    public ResearchElementDefinitionCharacteristicComponent addUsageContext(UsageContext t) { // 3
814      if (t == null)
815        return this;
816      if (this.usageContext == null)
817        this.usageContext = new ArrayList<UsageContext>();
818      this.usageContext.add(t);
819      return this;
820    }
821
822    /**
823     * @return The first repetition of repeating field {@link #usageContext},
824     *         creating it if it does not already exist
825     */
826    public UsageContext getUsageContextFirstRep() {
827      if (getUsageContext().isEmpty()) {
828        addUsageContext();
829      }
830      return getUsageContext().get(0);
831    }
832
833    /**
834     * @return {@link #exclude} (When true, members with this characteristic are
835     *         excluded from the element.). This is the underlying object with id,
836     *         value and extensions. The accessor "getExclude" gives direct access
837     *         to the value
838     */
839    public BooleanType getExcludeElement() {
840      if (this.exclude == null)
841        if (Configuration.errorOnAutoCreate())
842          throw new Error("Attempt to auto-create ResearchElementDefinitionCharacteristicComponent.exclude");
843        else if (Configuration.doAutoCreate())
844          this.exclude = new BooleanType(); // bb
845      return this.exclude;
846    }
847
848    public boolean hasExcludeElement() {
849      return this.exclude != null && !this.exclude.isEmpty();
850    }
851
852    public boolean hasExclude() {
853      return this.exclude != null && !this.exclude.isEmpty();
854    }
855
856    /**
857     * @param value {@link #exclude} (When true, members with this characteristic
858     *              are excluded from the element.). This is the underlying object
859     *              with id, value and extensions. The accessor "getExclude" gives
860     *              direct access to the value
861     */
862    public ResearchElementDefinitionCharacteristicComponent setExcludeElement(BooleanType value) {
863      this.exclude = value;
864      return this;
865    }
866
867    /**
868     * @return When true, members with this characteristic are excluded from the
869     *         element.
870     */
871    public boolean getExclude() {
872      return this.exclude == null || this.exclude.isEmpty() ? false : this.exclude.getValue();
873    }
874
875    /**
876     * @param value When true, members with this characteristic are excluded from
877     *              the element.
878     */
879    public ResearchElementDefinitionCharacteristicComponent setExclude(boolean value) {
880      if (this.exclude == null)
881        this.exclude = new BooleanType();
882      this.exclude.setValue(value);
883      return this;
884    }
885
886    /**
887     * @return {@link #unitOfMeasure} (Specifies the UCUM unit for the outcome.)
888     */
889    public CodeableConcept getUnitOfMeasure() {
890      if (this.unitOfMeasure == null)
891        if (Configuration.errorOnAutoCreate())
892          throw new Error("Attempt to auto-create ResearchElementDefinitionCharacteristicComponent.unitOfMeasure");
893        else if (Configuration.doAutoCreate())
894          this.unitOfMeasure = new CodeableConcept(); // cc
895      return this.unitOfMeasure;
896    }
897
898    public boolean hasUnitOfMeasure() {
899      return this.unitOfMeasure != null && !this.unitOfMeasure.isEmpty();
900    }
901
902    /**
903     * @param value {@link #unitOfMeasure} (Specifies the UCUM unit for the
904     *              outcome.)
905     */
906    public ResearchElementDefinitionCharacteristicComponent setUnitOfMeasure(CodeableConcept value) {
907      this.unitOfMeasure = value;
908      return this;
909    }
910
911    /**
912     * @return {@link #studyEffectiveDescription} (A narrative description of the
913     *         time period the study covers.). This is the underlying object with
914     *         id, value and extensions. The accessor "getStudyEffectiveDescription"
915     *         gives direct access to the value
916     */
917    public StringType getStudyEffectiveDescriptionElement() {
918      if (this.studyEffectiveDescription == null)
919        if (Configuration.errorOnAutoCreate())
920          throw new Error(
921              "Attempt to auto-create ResearchElementDefinitionCharacteristicComponent.studyEffectiveDescription");
922        else if (Configuration.doAutoCreate())
923          this.studyEffectiveDescription = new StringType(); // bb
924      return this.studyEffectiveDescription;
925    }
926
927    public boolean hasStudyEffectiveDescriptionElement() {
928      return this.studyEffectiveDescription != null && !this.studyEffectiveDescription.isEmpty();
929    }
930
931    public boolean hasStudyEffectiveDescription() {
932      return this.studyEffectiveDescription != null && !this.studyEffectiveDescription.isEmpty();
933    }
934
935    /**
936     * @param value {@link #studyEffectiveDescription} (A narrative description of
937     *              the time period the study covers.). This is the underlying
938     *              object with id, value and extensions. The accessor
939     *              "getStudyEffectiveDescription" gives direct access to the value
940     */
941    public ResearchElementDefinitionCharacteristicComponent setStudyEffectiveDescriptionElement(StringType value) {
942      this.studyEffectiveDescription = value;
943      return this;
944    }
945
946    /**
947     * @return A narrative description of the time period the study covers.
948     */
949    public String getStudyEffectiveDescription() {
950      return this.studyEffectiveDescription == null ? null : this.studyEffectiveDescription.getValue();
951    }
952
953    /**
954     * @param value A narrative description of the time period the study covers.
955     */
956    public ResearchElementDefinitionCharacteristicComponent setStudyEffectiveDescription(String value) {
957      if (Utilities.noString(value))
958        this.studyEffectiveDescription = null;
959      else {
960        if (this.studyEffectiveDescription == null)
961          this.studyEffectiveDescription = new StringType();
962        this.studyEffectiveDescription.setValue(value);
963      }
964      return this;
965    }
966
967    /**
968     * @return {@link #studyEffective} (Indicates what effective period the study
969     *         covers.)
970     */
971    public Type getStudyEffective() {
972      return this.studyEffective;
973    }
974
975    /**
976     * @return {@link #studyEffective} (Indicates what effective period the study
977     *         covers.)
978     */
979    public DateTimeType getStudyEffectiveDateTimeType() throws FHIRException {
980      if (this.studyEffective == null)
981        this.studyEffective = new DateTimeType();
982      if (!(this.studyEffective instanceof DateTimeType))
983        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "
984            + this.studyEffective.getClass().getName() + " was encountered");
985      return (DateTimeType) this.studyEffective;
986    }
987
988    public boolean hasStudyEffectiveDateTimeType() {
989      return this != null && this.studyEffective instanceof DateTimeType;
990    }
991
992    /**
993     * @return {@link #studyEffective} (Indicates what effective period the study
994     *         covers.)
995     */
996    public Period getStudyEffectivePeriod() throws FHIRException {
997      if (this.studyEffective == null)
998        this.studyEffective = new Period();
999      if (!(this.studyEffective instanceof Period))
1000        throw new FHIRException("Type mismatch: the type Period was expected, but "
1001            + this.studyEffective.getClass().getName() + " was encountered");
1002      return (Period) this.studyEffective;
1003    }
1004
1005    public boolean hasStudyEffectivePeriod() {
1006      return this != null && this.studyEffective instanceof Period;
1007    }
1008
1009    /**
1010     * @return {@link #studyEffective} (Indicates what effective period the study
1011     *         covers.)
1012     */
1013    public Duration getStudyEffectiveDuration() throws FHIRException {
1014      if (this.studyEffective == null)
1015        this.studyEffective = new Duration();
1016      if (!(this.studyEffective instanceof Duration))
1017        throw new FHIRException("Type mismatch: the type Duration was expected, but "
1018            + this.studyEffective.getClass().getName() + " was encountered");
1019      return (Duration) this.studyEffective;
1020    }
1021
1022    public boolean hasStudyEffectiveDuration() {
1023      return this != null && this.studyEffective instanceof Duration;
1024    }
1025
1026    /**
1027     * @return {@link #studyEffective} (Indicates what effective period the study
1028     *         covers.)
1029     */
1030    public Timing getStudyEffectiveTiming() throws FHIRException {
1031      if (this.studyEffective == null)
1032        this.studyEffective = new Timing();
1033      if (!(this.studyEffective instanceof Timing))
1034        throw new FHIRException("Type mismatch: the type Timing was expected, but "
1035            + this.studyEffective.getClass().getName() + " was encountered");
1036      return (Timing) this.studyEffective;
1037    }
1038
1039    public boolean hasStudyEffectiveTiming() {
1040      return this != null && this.studyEffective instanceof Timing;
1041    }
1042
1043    public boolean hasStudyEffective() {
1044      return this.studyEffective != null && !this.studyEffective.isEmpty();
1045    }
1046
1047    /**
1048     * @param value {@link #studyEffective} (Indicates what effective period the
1049     *              study covers.)
1050     */
1051    public ResearchElementDefinitionCharacteristicComponent setStudyEffective(Type value) {
1052      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Duration
1053          || value instanceof Timing))
1054        throw new Error(
1055            "Not the right type for ResearchElementDefinition.characteristic.studyEffective[x]: " + value.fhirType());
1056      this.studyEffective = value;
1057      return this;
1058    }
1059
1060    /**
1061     * @return {@link #studyEffectiveTimeFromStart} (Indicates duration from the
1062     *         study initiation.)
1063     */
1064    public Duration getStudyEffectiveTimeFromStart() {
1065      if (this.studyEffectiveTimeFromStart == null)
1066        if (Configuration.errorOnAutoCreate())
1067          throw new Error(
1068              "Attempt to auto-create ResearchElementDefinitionCharacteristicComponent.studyEffectiveTimeFromStart");
1069        else if (Configuration.doAutoCreate())
1070          this.studyEffectiveTimeFromStart = new Duration(); // cc
1071      return this.studyEffectiveTimeFromStart;
1072    }
1073
1074    public boolean hasStudyEffectiveTimeFromStart() {
1075      return this.studyEffectiveTimeFromStart != null && !this.studyEffectiveTimeFromStart.isEmpty();
1076    }
1077
1078    /**
1079     * @param value {@link #studyEffectiveTimeFromStart} (Indicates duration from
1080     *              the study initiation.)
1081     */
1082    public ResearchElementDefinitionCharacteristicComponent setStudyEffectiveTimeFromStart(Duration value) {
1083      this.studyEffectiveTimeFromStart = value;
1084      return this;
1085    }
1086
1087    /**
1088     * @return {@link #studyEffectiveGroupMeasure} (Indicates how elements are
1089     *         aggregated within the study effective period.). This is the
1090     *         underlying object with id, value and extensions. The accessor
1091     *         "getStudyEffectiveGroupMeasure" gives direct access to the value
1092     */
1093    public Enumeration<GroupMeasure> getStudyEffectiveGroupMeasureElement() {
1094      if (this.studyEffectiveGroupMeasure == null)
1095        if (Configuration.errorOnAutoCreate())
1096          throw new Error(
1097              "Attempt to auto-create ResearchElementDefinitionCharacteristicComponent.studyEffectiveGroupMeasure");
1098        else if (Configuration.doAutoCreate())
1099          this.studyEffectiveGroupMeasure = new Enumeration<GroupMeasure>(new GroupMeasureEnumFactory()); // bb
1100      return this.studyEffectiveGroupMeasure;
1101    }
1102
1103    public boolean hasStudyEffectiveGroupMeasureElement() {
1104      return this.studyEffectiveGroupMeasure != null && !this.studyEffectiveGroupMeasure.isEmpty();
1105    }
1106
1107    public boolean hasStudyEffectiveGroupMeasure() {
1108      return this.studyEffectiveGroupMeasure != null && !this.studyEffectiveGroupMeasure.isEmpty();
1109    }
1110
1111    /**
1112     * @param value {@link #studyEffectiveGroupMeasure} (Indicates how elements are
1113     *              aggregated within the study effective period.). This is the
1114     *              underlying object with id, value and extensions. The accessor
1115     *              "getStudyEffectiveGroupMeasure" gives direct access to the value
1116     */
1117    public ResearchElementDefinitionCharacteristicComponent setStudyEffectiveGroupMeasureElement(
1118        Enumeration<GroupMeasure> value) {
1119      this.studyEffectiveGroupMeasure = value;
1120      return this;
1121    }
1122
1123    /**
1124     * @return Indicates how elements are aggregated within the study effective
1125     *         period.
1126     */
1127    public GroupMeasure getStudyEffectiveGroupMeasure() {
1128      return this.studyEffectiveGroupMeasure == null ? null : this.studyEffectiveGroupMeasure.getValue();
1129    }
1130
1131    /**
1132     * @param value Indicates how elements are aggregated within the study effective
1133     *              period.
1134     */
1135    public ResearchElementDefinitionCharacteristicComponent setStudyEffectiveGroupMeasure(GroupMeasure value) {
1136      if (value == null)
1137        this.studyEffectiveGroupMeasure = null;
1138      else {
1139        if (this.studyEffectiveGroupMeasure == null)
1140          this.studyEffectiveGroupMeasure = new Enumeration<GroupMeasure>(new GroupMeasureEnumFactory());
1141        this.studyEffectiveGroupMeasure.setValue(value);
1142      }
1143      return this;
1144    }
1145
1146    /**
1147     * @return {@link #participantEffectiveDescription} (A narrative description of
1148     *         the time period the study covers.). This is the underlying object
1149     *         with id, value and extensions. The accessor
1150     *         "getParticipantEffectiveDescription" gives direct access to the value
1151     */
1152    public StringType getParticipantEffectiveDescriptionElement() {
1153      if (this.participantEffectiveDescription == null)
1154        if (Configuration.errorOnAutoCreate())
1155          throw new Error(
1156              "Attempt to auto-create ResearchElementDefinitionCharacteristicComponent.participantEffectiveDescription");
1157        else if (Configuration.doAutoCreate())
1158          this.participantEffectiveDescription = new StringType(); // bb
1159      return this.participantEffectiveDescription;
1160    }
1161
1162    public boolean hasParticipantEffectiveDescriptionElement() {
1163      return this.participantEffectiveDescription != null && !this.participantEffectiveDescription.isEmpty();
1164    }
1165
1166    public boolean hasParticipantEffectiveDescription() {
1167      return this.participantEffectiveDescription != null && !this.participantEffectiveDescription.isEmpty();
1168    }
1169
1170    /**
1171     * @param value {@link #participantEffectiveDescription} (A narrative
1172     *              description of the time period the study covers.). This is the
1173     *              underlying object with id, value and extensions. The accessor
1174     *              "getParticipantEffectiveDescription" gives direct access to the
1175     *              value
1176     */
1177    public ResearchElementDefinitionCharacteristicComponent setParticipantEffectiveDescriptionElement(
1178        StringType value) {
1179      this.participantEffectiveDescription = value;
1180      return this;
1181    }
1182
1183    /**
1184     * @return A narrative description of the time period the study covers.
1185     */
1186    public String getParticipantEffectiveDescription() {
1187      return this.participantEffectiveDescription == null ? null : this.participantEffectiveDescription.getValue();
1188    }
1189
1190    /**
1191     * @param value A narrative description of the time period the study covers.
1192     */
1193    public ResearchElementDefinitionCharacteristicComponent setParticipantEffectiveDescription(String value) {
1194      if (Utilities.noString(value))
1195        this.participantEffectiveDescription = null;
1196      else {
1197        if (this.participantEffectiveDescription == null)
1198          this.participantEffectiveDescription = new StringType();
1199        this.participantEffectiveDescription.setValue(value);
1200      }
1201      return this;
1202    }
1203
1204    /**
1205     * @return {@link #participantEffective} (Indicates what effective period the
1206     *         study covers.)
1207     */
1208    public Type getParticipantEffective() {
1209      return this.participantEffective;
1210    }
1211
1212    /**
1213     * @return {@link #participantEffective} (Indicates what effective period the
1214     *         study covers.)
1215     */
1216    public DateTimeType getParticipantEffectiveDateTimeType() throws FHIRException {
1217      if (this.participantEffective == null)
1218        this.participantEffective = new DateTimeType();
1219      if (!(this.participantEffective instanceof DateTimeType))
1220        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "
1221            + this.participantEffective.getClass().getName() + " was encountered");
1222      return (DateTimeType) this.participantEffective;
1223    }
1224
1225    public boolean hasParticipantEffectiveDateTimeType() {
1226      return this != null && this.participantEffective instanceof DateTimeType;
1227    }
1228
1229    /**
1230     * @return {@link #participantEffective} (Indicates what effective period the
1231     *         study covers.)
1232     */
1233    public Period getParticipantEffectivePeriod() throws FHIRException {
1234      if (this.participantEffective == null)
1235        this.participantEffective = new Period();
1236      if (!(this.participantEffective instanceof Period))
1237        throw new FHIRException("Type mismatch: the type Period was expected, but "
1238            + this.participantEffective.getClass().getName() + " was encountered");
1239      return (Period) this.participantEffective;
1240    }
1241
1242    public boolean hasParticipantEffectivePeriod() {
1243      return this != null && this.participantEffective instanceof Period;
1244    }
1245
1246    /**
1247     * @return {@link #participantEffective} (Indicates what effective period the
1248     *         study covers.)
1249     */
1250    public Duration getParticipantEffectiveDuration() throws FHIRException {
1251      if (this.participantEffective == null)
1252        this.participantEffective = new Duration();
1253      if (!(this.participantEffective instanceof Duration))
1254        throw new FHIRException("Type mismatch: the type Duration was expected, but "
1255            + this.participantEffective.getClass().getName() + " was encountered");
1256      return (Duration) this.participantEffective;
1257    }
1258
1259    public boolean hasParticipantEffectiveDuration() {
1260      return this != null && this.participantEffective instanceof Duration;
1261    }
1262
1263    /**
1264     * @return {@link #participantEffective} (Indicates what effective period the
1265     *         study covers.)
1266     */
1267    public Timing getParticipantEffectiveTiming() throws FHIRException {
1268      if (this.participantEffective == null)
1269        this.participantEffective = new Timing();
1270      if (!(this.participantEffective instanceof Timing))
1271        throw new FHIRException("Type mismatch: the type Timing was expected, but "
1272            + this.participantEffective.getClass().getName() + " was encountered");
1273      return (Timing) this.participantEffective;
1274    }
1275
1276    public boolean hasParticipantEffectiveTiming() {
1277      return this != null && this.participantEffective instanceof Timing;
1278    }
1279
1280    public boolean hasParticipantEffective() {
1281      return this.participantEffective != null && !this.participantEffective.isEmpty();
1282    }
1283
1284    /**
1285     * @param value {@link #participantEffective} (Indicates what effective period
1286     *              the study covers.)
1287     */
1288    public ResearchElementDefinitionCharacteristicComponent setParticipantEffective(Type value) {
1289      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Duration
1290          || value instanceof Timing))
1291        throw new Error("Not the right type for ResearchElementDefinition.characteristic.participantEffective[x]: "
1292            + value.fhirType());
1293      this.participantEffective = value;
1294      return this;
1295    }
1296
1297    /**
1298     * @return {@link #participantEffectiveTimeFromStart} (Indicates duration from
1299     *         the participant's study entry.)
1300     */
1301    public Duration getParticipantEffectiveTimeFromStart() {
1302      if (this.participantEffectiveTimeFromStart == null)
1303        if (Configuration.errorOnAutoCreate())
1304          throw new Error(
1305              "Attempt to auto-create ResearchElementDefinitionCharacteristicComponent.participantEffectiveTimeFromStart");
1306        else if (Configuration.doAutoCreate())
1307          this.participantEffectiveTimeFromStart = new Duration(); // cc
1308      return this.participantEffectiveTimeFromStart;
1309    }
1310
1311    public boolean hasParticipantEffectiveTimeFromStart() {
1312      return this.participantEffectiveTimeFromStart != null && !this.participantEffectiveTimeFromStart.isEmpty();
1313    }
1314
1315    /**
1316     * @param value {@link #participantEffectiveTimeFromStart} (Indicates duration
1317     *              from the participant's study entry.)
1318     */
1319    public ResearchElementDefinitionCharacteristicComponent setParticipantEffectiveTimeFromStart(Duration value) {
1320      this.participantEffectiveTimeFromStart = value;
1321      return this;
1322    }
1323
1324    /**
1325     * @return {@link #participantEffectiveGroupMeasure} (Indicates how elements are
1326     *         aggregated within the study effective period.). This is the
1327     *         underlying object with id, value and extensions. The accessor
1328     *         "getParticipantEffectiveGroupMeasure" gives direct access to the
1329     *         value
1330     */
1331    public Enumeration<GroupMeasure> getParticipantEffectiveGroupMeasureElement() {
1332      if (this.participantEffectiveGroupMeasure == null)
1333        if (Configuration.errorOnAutoCreate())
1334          throw new Error(
1335              "Attempt to auto-create ResearchElementDefinitionCharacteristicComponent.participantEffectiveGroupMeasure");
1336        else if (Configuration.doAutoCreate())
1337          this.participantEffectiveGroupMeasure = new Enumeration<GroupMeasure>(new GroupMeasureEnumFactory()); // bb
1338      return this.participantEffectiveGroupMeasure;
1339    }
1340
1341    public boolean hasParticipantEffectiveGroupMeasureElement() {
1342      return this.participantEffectiveGroupMeasure != null && !this.participantEffectiveGroupMeasure.isEmpty();
1343    }
1344
1345    public boolean hasParticipantEffectiveGroupMeasure() {
1346      return this.participantEffectiveGroupMeasure != null && !this.participantEffectiveGroupMeasure.isEmpty();
1347    }
1348
1349    /**
1350     * @param value {@link #participantEffectiveGroupMeasure} (Indicates how
1351     *              elements are aggregated within the study effective period.).
1352     *              This is the underlying object with id, value and extensions. The
1353     *              accessor "getParticipantEffectiveGroupMeasure" gives direct
1354     *              access to the value
1355     */
1356    public ResearchElementDefinitionCharacteristicComponent setParticipantEffectiveGroupMeasureElement(
1357        Enumeration<GroupMeasure> value) {
1358      this.participantEffectiveGroupMeasure = value;
1359      return this;
1360    }
1361
1362    /**
1363     * @return Indicates how elements are aggregated within the study effective
1364     *         period.
1365     */
1366    public GroupMeasure getParticipantEffectiveGroupMeasure() {
1367      return this.participantEffectiveGroupMeasure == null ? null : this.participantEffectiveGroupMeasure.getValue();
1368    }
1369
1370    /**
1371     * @param value Indicates how elements are aggregated within the study effective
1372     *              period.
1373     */
1374    public ResearchElementDefinitionCharacteristicComponent setParticipantEffectiveGroupMeasure(GroupMeasure value) {
1375      if (value == null)
1376        this.participantEffectiveGroupMeasure = null;
1377      else {
1378        if (this.participantEffectiveGroupMeasure == null)
1379          this.participantEffectiveGroupMeasure = new Enumeration<GroupMeasure>(new GroupMeasureEnumFactory());
1380        this.participantEffectiveGroupMeasure.setValue(value);
1381      }
1382      return this;
1383    }
1384
1385    protected void listChildren(List<Property> children) {
1386      super.listChildren(children);
1387      children.add(new Property("definition[x]", "CodeableConcept|canonical(ValueSet)|Expression|DataRequirement",
1388          "Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).",
1389          0, 1, definition));
1390      children.add(new Property("usageContext", "UsageContext",
1391          "Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings.", 0,
1392          java.lang.Integer.MAX_VALUE, usageContext));
1393      children.add(new Property("exclude", "boolean",
1394          "When true, members with this characteristic are excluded from the element.", 0, 1, exclude));
1395      children.add(new Property("unitOfMeasure", "CodeableConcept", "Specifies the UCUM unit for the outcome.", 0, 1,
1396          unitOfMeasure));
1397      children.add(new Property("studyEffectiveDescription", "string",
1398          "A narrative description of the time period the study covers.", 0, 1, studyEffectiveDescription));
1399      children.add(new Property("studyEffective[x]", "dateTime|Period|Duration|Timing",
1400          "Indicates what effective period the study covers.", 0, 1, studyEffective));
1401      children.add(new Property("studyEffectiveTimeFromStart", "Duration",
1402          "Indicates duration from the study initiation.", 0, 1, studyEffectiveTimeFromStart));
1403      children.add(new Property("studyEffectiveGroupMeasure", "code",
1404          "Indicates how elements are aggregated within the study effective period.", 0, 1,
1405          studyEffectiveGroupMeasure));
1406      children.add(new Property("participantEffectiveDescription", "string",
1407          "A narrative description of the time period the study covers.", 0, 1, participantEffectiveDescription));
1408      children.add(new Property("participantEffective[x]", "dateTime|Period|Duration|Timing",
1409          "Indicates what effective period the study covers.", 0, 1, participantEffective));
1410      children.add(new Property("participantEffectiveTimeFromStart", "Duration",
1411          "Indicates duration from the participant's study entry.", 0, 1, participantEffectiveTimeFromStart));
1412      children.add(new Property("participantEffectiveGroupMeasure", "code",
1413          "Indicates how elements are aggregated within the study effective period.", 0, 1,
1414          participantEffectiveGroupMeasure));
1415    }
1416
1417    @Override
1418    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1419      switch (_hash) {
1420      case -1139422643:
1421        /* definition[x] */ return new Property("definition[x]",
1422            "CodeableConcept|canonical(ValueSet)|Expression|DataRequirement",
1423            "Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).",
1424            0, 1, definition);
1425      case -1014418093:
1426        /* definition */ return new Property("definition[x]",
1427            "CodeableConcept|canonical(ValueSet)|Expression|DataRequirement",
1428            "Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).",
1429            0, 1, definition);
1430      case -1446002226:
1431        /* definitionCodeableConcept */ return new Property("definition[x]",
1432            "CodeableConcept|canonical(ValueSet)|Expression|DataRequirement",
1433            "Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).",
1434            0, 1, definition);
1435      case 933485793:
1436        /* definitionCanonical */ return new Property("definition[x]",
1437            "CodeableConcept|canonical(ValueSet)|Expression|DataRequirement",
1438            "Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).",
1439            0, 1, definition);
1440      case 1463703627:
1441        /* definitionExpression */ return new Property("definition[x]",
1442            "CodeableConcept|canonical(ValueSet)|Expression|DataRequirement",
1443            "Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).",
1444            0, 1, definition);
1445      case -660350874:
1446        /* definitionDataRequirement */ return new Property("definition[x]",
1447            "CodeableConcept|canonical(ValueSet)|Expression|DataRequirement",
1448            "Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).",
1449            0, 1, definition);
1450      case 907012302:
1451        /* usageContext */ return new Property("usageContext", "UsageContext",
1452            "Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings.", 0,
1453            java.lang.Integer.MAX_VALUE, usageContext);
1454      case -1321148966:
1455        /* exclude */ return new Property("exclude", "boolean",
1456            "When true, members with this characteristic are excluded from the element.", 0, 1, exclude);
1457      case -750257565:
1458        /* unitOfMeasure */ return new Property("unitOfMeasure", "CodeableConcept",
1459            "Specifies the UCUM unit for the outcome.", 0, 1, unitOfMeasure);
1460      case 237553470:
1461        /* studyEffectiveDescription */ return new Property("studyEffectiveDescription", "string",
1462            "A narrative description of the time period the study covers.", 0, 1, studyEffectiveDescription);
1463      case -1832549918:
1464        /* studyEffective[x] */ return new Property("studyEffective[x]", "dateTime|Period|Duration|Timing",
1465            "Indicates what effective period the study covers.", 0, 1, studyEffective);
1466      case -836391458:
1467        /* studyEffective */ return new Property("studyEffective[x]", "dateTime|Period|Duration|Timing",
1468            "Indicates what effective period the study covers.", 0, 1, studyEffective);
1469      case 439780249:
1470        /* studyEffectiveDateTime */ return new Property("studyEffective[x]", "dateTime|Period|Duration|Timing",
1471            "Indicates what effective period the study covers.", 0, 1, studyEffective);
1472      case -497045185:
1473        /* studyEffectivePeriod */ return new Property("studyEffective[x]", "dateTime|Period|Duration|Timing",
1474            "Indicates what effective period the study covers.", 0, 1, studyEffective);
1475      case 949985682:
1476        /* studyEffectiveDuration */ return new Property("studyEffective[x]", "dateTime|Period|Duration|Timing",
1477            "Indicates what effective period the study covers.", 0, 1, studyEffective);
1478      case -378983480:
1479        /* studyEffectiveTiming */ return new Property("studyEffective[x]", "dateTime|Period|Duration|Timing",
1480            "Indicates what effective period the study covers.", 0, 1, studyEffective);
1481      case -2107828915:
1482        /* studyEffectiveTimeFromStart */ return new Property("studyEffectiveTimeFromStart", "Duration",
1483            "Indicates duration from the study initiation.", 0, 1, studyEffectiveTimeFromStart);
1484      case 1284435677:
1485        /* studyEffectiveGroupMeasure */ return new Property("studyEffectiveGroupMeasure", "code",
1486            "Indicates how elements are aggregated within the study effective period.", 0, 1,
1487            studyEffectiveGroupMeasure);
1488      case 1333186472:
1489        /* participantEffectiveDescription */ return new Property("participantEffectiveDescription", "string",
1490            "A narrative description of the time period the study covers.", 0, 1, participantEffectiveDescription);
1491      case 1777308748:
1492        /* participantEffective[x] */ return new Property("participantEffective[x]", "dateTime|Period|Duration|Timing",
1493            "Indicates what effective period the study covers.", 0, 1, participantEffective);
1494      case 1376306100:
1495        /* participantEffective */ return new Property("participantEffective[x]", "dateTime|Period|Duration|Timing",
1496            "Indicates what effective period the study covers.", 0, 1, participantEffective);
1497      case -1721146513:
1498        /* participantEffectiveDateTime */ return new Property("participantEffective[x]",
1499            "dateTime|Period|Duration|Timing", "Indicates what effective period the study covers.", 0, 1,
1500            participantEffective);
1501      case -883650923:
1502        /* participantEffectivePeriod */ return new Property("participantEffective[x]",
1503            "dateTime|Period|Duration|Timing", "Indicates what effective period the study covers.", 0, 1,
1504            participantEffective);
1505      case -1210941080:
1506        /* participantEffectiveDuration */ return new Property("participantEffective[x]",
1507            "dateTime|Period|Duration|Timing", "Indicates what effective period the study covers.", 0, 1,
1508            participantEffective);
1509      case -765589218:
1510        /* participantEffectiveTiming */ return new Property("participantEffective[x]",
1511            "dateTime|Period|Duration|Timing", "Indicates what effective period the study covers.", 0, 1,
1512            participantEffective);
1513      case -1471501513:
1514        /* participantEffectiveTimeFromStart */ return new Property("participantEffectiveTimeFromStart", "Duration",
1515            "Indicates duration from the participant's study entry.", 0, 1, participantEffectiveTimeFromStart);
1516      case 889320371:
1517        /* participantEffectiveGroupMeasure */ return new Property("participantEffectiveGroupMeasure", "code",
1518            "Indicates how elements are aggregated within the study effective period.", 0, 1,
1519            participantEffectiveGroupMeasure);
1520      default:
1521        return super.getNamedProperty(_hash, _name, _checkValid);
1522      }
1523
1524    }
1525
1526    @Override
1527    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1528      switch (hash) {
1529      case -1014418093:
1530        /* definition */ return this.definition == null ? new Base[0] : new Base[] { this.definition }; // Type
1531      case 907012302:
1532        /* usageContext */ return this.usageContext == null ? new Base[0]
1533            : this.usageContext.toArray(new Base[this.usageContext.size()]); // UsageContext
1534      case -1321148966:
1535        /* exclude */ return this.exclude == null ? new Base[0] : new Base[] { this.exclude }; // BooleanType
1536      case -750257565:
1537        /* unitOfMeasure */ return this.unitOfMeasure == null ? new Base[0] : new Base[] { this.unitOfMeasure }; // CodeableConcept
1538      case 237553470:
1539        /* studyEffectiveDescription */ return this.studyEffectiveDescription == null ? new Base[0]
1540            : new Base[] { this.studyEffectiveDescription }; // StringType
1541      case -836391458:
1542        /* studyEffective */ return this.studyEffective == null ? new Base[0] : new Base[] { this.studyEffective }; // Type
1543      case -2107828915:
1544        /* studyEffectiveTimeFromStart */ return this.studyEffectiveTimeFromStart == null ? new Base[0]
1545            : new Base[] { this.studyEffectiveTimeFromStart }; // Duration
1546      case 1284435677:
1547        /* studyEffectiveGroupMeasure */ return this.studyEffectiveGroupMeasure == null ? new Base[0]
1548            : new Base[] { this.studyEffectiveGroupMeasure }; // Enumeration<GroupMeasure>
1549      case 1333186472:
1550        /* participantEffectiveDescription */ return this.participantEffectiveDescription == null ? new Base[0]
1551            : new Base[] { this.participantEffectiveDescription }; // StringType
1552      case 1376306100:
1553        /* participantEffective */ return this.participantEffective == null ? new Base[0]
1554            : new Base[] { this.participantEffective }; // Type
1555      case -1471501513:
1556        /* participantEffectiveTimeFromStart */ return this.participantEffectiveTimeFromStart == null ? new Base[0]
1557            : new Base[] { this.participantEffectiveTimeFromStart }; // Duration
1558      case 889320371:
1559        /* participantEffectiveGroupMeasure */ return this.participantEffectiveGroupMeasure == null ? new Base[0]
1560            : new Base[] { this.participantEffectiveGroupMeasure }; // Enumeration<GroupMeasure>
1561      default:
1562        return super.getProperty(hash, name, checkValid);
1563      }
1564
1565    }
1566
1567    @Override
1568    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1569      switch (hash) {
1570      case -1014418093: // definition
1571        this.definition = castToType(value); // Type
1572        return value;
1573      case 907012302: // usageContext
1574        this.getUsageContext().add(castToUsageContext(value)); // UsageContext
1575        return value;
1576      case -1321148966: // exclude
1577        this.exclude = castToBoolean(value); // BooleanType
1578        return value;
1579      case -750257565: // unitOfMeasure
1580        this.unitOfMeasure = castToCodeableConcept(value); // CodeableConcept
1581        return value;
1582      case 237553470: // studyEffectiveDescription
1583        this.studyEffectiveDescription = castToString(value); // StringType
1584        return value;
1585      case -836391458: // studyEffective
1586        this.studyEffective = castToType(value); // Type
1587        return value;
1588      case -2107828915: // studyEffectiveTimeFromStart
1589        this.studyEffectiveTimeFromStart = castToDuration(value); // Duration
1590        return value;
1591      case 1284435677: // studyEffectiveGroupMeasure
1592        value = new GroupMeasureEnumFactory().fromType(castToCode(value));
1593        this.studyEffectiveGroupMeasure = (Enumeration) value; // Enumeration<GroupMeasure>
1594        return value;
1595      case 1333186472: // participantEffectiveDescription
1596        this.participantEffectiveDescription = castToString(value); // StringType
1597        return value;
1598      case 1376306100: // participantEffective
1599        this.participantEffective = castToType(value); // Type
1600        return value;
1601      case -1471501513: // participantEffectiveTimeFromStart
1602        this.participantEffectiveTimeFromStart = castToDuration(value); // Duration
1603        return value;
1604      case 889320371: // participantEffectiveGroupMeasure
1605        value = new GroupMeasureEnumFactory().fromType(castToCode(value));
1606        this.participantEffectiveGroupMeasure = (Enumeration) value; // Enumeration<GroupMeasure>
1607        return value;
1608      default:
1609        return super.setProperty(hash, name, value);
1610      }
1611
1612    }
1613
1614    @Override
1615    public Base setProperty(String name, Base value) throws FHIRException {
1616      if (name.equals("definition[x]")) {
1617        this.definition = castToType(value); // Type
1618      } else if (name.equals("usageContext")) {
1619        this.getUsageContext().add(castToUsageContext(value));
1620      } else if (name.equals("exclude")) {
1621        this.exclude = castToBoolean(value); // BooleanType
1622      } else if (name.equals("unitOfMeasure")) {
1623        this.unitOfMeasure = castToCodeableConcept(value); // CodeableConcept
1624      } else if (name.equals("studyEffectiveDescription")) {
1625        this.studyEffectiveDescription = castToString(value); // StringType
1626      } else if (name.equals("studyEffective[x]")) {
1627        this.studyEffective = castToType(value); // Type
1628      } else if (name.equals("studyEffectiveTimeFromStart")) {
1629        this.studyEffectiveTimeFromStart = castToDuration(value); // Duration
1630      } else if (name.equals("studyEffectiveGroupMeasure")) {
1631        value = new GroupMeasureEnumFactory().fromType(castToCode(value));
1632        this.studyEffectiveGroupMeasure = (Enumeration) value; // Enumeration<GroupMeasure>
1633      } else if (name.equals("participantEffectiveDescription")) {
1634        this.participantEffectiveDescription = castToString(value); // StringType
1635      } else if (name.equals("participantEffective[x]")) {
1636        this.participantEffective = castToType(value); // Type
1637      } else if (name.equals("participantEffectiveTimeFromStart")) {
1638        this.participantEffectiveTimeFromStart = castToDuration(value); // Duration
1639      } else if (name.equals("participantEffectiveGroupMeasure")) {
1640        value = new GroupMeasureEnumFactory().fromType(castToCode(value));
1641        this.participantEffectiveGroupMeasure = (Enumeration) value; // Enumeration<GroupMeasure>
1642      } else
1643        return super.setProperty(name, value);
1644      return value;
1645    }
1646
1647    @Override
1648    public Base makeProperty(int hash, String name) throws FHIRException {
1649      switch (hash) {
1650      case -1139422643:
1651        return getDefinition();
1652      case -1014418093:
1653        return getDefinition();
1654      case 907012302:
1655        return addUsageContext();
1656      case -1321148966:
1657        return getExcludeElement();
1658      case -750257565:
1659        return getUnitOfMeasure();
1660      case 237553470:
1661        return getStudyEffectiveDescriptionElement();
1662      case -1832549918:
1663        return getStudyEffective();
1664      case -836391458:
1665        return getStudyEffective();
1666      case -2107828915:
1667        return getStudyEffectiveTimeFromStart();
1668      case 1284435677:
1669        return getStudyEffectiveGroupMeasureElement();
1670      case 1333186472:
1671        return getParticipantEffectiveDescriptionElement();
1672      case 1777308748:
1673        return getParticipantEffective();
1674      case 1376306100:
1675        return getParticipantEffective();
1676      case -1471501513:
1677        return getParticipantEffectiveTimeFromStart();
1678      case 889320371:
1679        return getParticipantEffectiveGroupMeasureElement();
1680      default:
1681        return super.makeProperty(hash, name);
1682      }
1683
1684    }
1685
1686    @Override
1687    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1688      switch (hash) {
1689      case -1014418093:
1690        /* definition */ return new String[] { "CodeableConcept", "canonical", "Expression", "DataRequirement" };
1691      case 907012302:
1692        /* usageContext */ return new String[] { "UsageContext" };
1693      case -1321148966:
1694        /* exclude */ return new String[] { "boolean" };
1695      case -750257565:
1696        /* unitOfMeasure */ return new String[] { "CodeableConcept" };
1697      case 237553470:
1698        /* studyEffectiveDescription */ return new String[] { "string" };
1699      case -836391458:
1700        /* studyEffective */ return new String[] { "dateTime", "Period", "Duration", "Timing" };
1701      case -2107828915:
1702        /* studyEffectiveTimeFromStart */ return new String[] { "Duration" };
1703      case 1284435677:
1704        /* studyEffectiveGroupMeasure */ return new String[] { "code" };
1705      case 1333186472:
1706        /* participantEffectiveDescription */ return new String[] { "string" };
1707      case 1376306100:
1708        /* participantEffective */ return new String[] { "dateTime", "Period", "Duration", "Timing" };
1709      case -1471501513:
1710        /* participantEffectiveTimeFromStart */ return new String[] { "Duration" };
1711      case 889320371:
1712        /* participantEffectiveGroupMeasure */ return new String[] { "code" };
1713      default:
1714        return super.getTypesForProperty(hash, name);
1715      }
1716
1717    }
1718
1719    @Override
1720    public Base addChild(String name) throws FHIRException {
1721      if (name.equals("definitionCodeableConcept")) {
1722        this.definition = new CodeableConcept();
1723        return this.definition;
1724      } else if (name.equals("definitionCanonical")) {
1725        this.definition = new CanonicalType();
1726        return this.definition;
1727      } else if (name.equals("definitionExpression")) {
1728        this.definition = new Expression();
1729        return this.definition;
1730      } else if (name.equals("definitionDataRequirement")) {
1731        this.definition = new DataRequirement();
1732        return this.definition;
1733      } else if (name.equals("usageContext")) {
1734        return addUsageContext();
1735      } else if (name.equals("exclude")) {
1736        throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.exclude");
1737      } else if (name.equals("unitOfMeasure")) {
1738        this.unitOfMeasure = new CodeableConcept();
1739        return this.unitOfMeasure;
1740      } else if (name.equals("studyEffectiveDescription")) {
1741        throw new FHIRException(
1742            "Cannot call addChild on a singleton property ResearchElementDefinition.studyEffectiveDescription");
1743      } else if (name.equals("studyEffectiveDateTime")) {
1744        this.studyEffective = new DateTimeType();
1745        return this.studyEffective;
1746      } else if (name.equals("studyEffectivePeriod")) {
1747        this.studyEffective = new Period();
1748        return this.studyEffective;
1749      } else if (name.equals("studyEffectiveDuration")) {
1750        this.studyEffective = new Duration();
1751        return this.studyEffective;
1752      } else if (name.equals("studyEffectiveTiming")) {
1753        this.studyEffective = new Timing();
1754        return this.studyEffective;
1755      } else if (name.equals("studyEffectiveTimeFromStart")) {
1756        this.studyEffectiveTimeFromStart = new Duration();
1757        return this.studyEffectiveTimeFromStart;
1758      } else if (name.equals("studyEffectiveGroupMeasure")) {
1759        throw new FHIRException(
1760            "Cannot call addChild on a singleton property ResearchElementDefinition.studyEffectiveGroupMeasure");
1761      } else if (name.equals("participantEffectiveDescription")) {
1762        throw new FHIRException(
1763            "Cannot call addChild on a singleton property ResearchElementDefinition.participantEffectiveDescription");
1764      } else if (name.equals("participantEffectiveDateTime")) {
1765        this.participantEffective = new DateTimeType();
1766        return this.participantEffective;
1767      } else if (name.equals("participantEffectivePeriod")) {
1768        this.participantEffective = new Period();
1769        return this.participantEffective;
1770      } else if (name.equals("participantEffectiveDuration")) {
1771        this.participantEffective = new Duration();
1772        return this.participantEffective;
1773      } else if (name.equals("participantEffectiveTiming")) {
1774        this.participantEffective = new Timing();
1775        return this.participantEffective;
1776      } else if (name.equals("participantEffectiveTimeFromStart")) {
1777        this.participantEffectiveTimeFromStart = new Duration();
1778        return this.participantEffectiveTimeFromStart;
1779      } else if (name.equals("participantEffectiveGroupMeasure")) {
1780        throw new FHIRException(
1781            "Cannot call addChild on a singleton property ResearchElementDefinition.participantEffectiveGroupMeasure");
1782      } else
1783        return super.addChild(name);
1784    }
1785
1786    public ResearchElementDefinitionCharacteristicComponent copy() {
1787      ResearchElementDefinitionCharacteristicComponent dst = new ResearchElementDefinitionCharacteristicComponent();
1788      copyValues(dst);
1789      return dst;
1790    }
1791
1792    public void copyValues(ResearchElementDefinitionCharacteristicComponent dst) {
1793      super.copyValues(dst);
1794      dst.definition = definition == null ? null : definition.copy();
1795      if (usageContext != null) {
1796        dst.usageContext = new ArrayList<UsageContext>();
1797        for (UsageContext i : usageContext)
1798          dst.usageContext.add(i.copy());
1799      }
1800      ;
1801      dst.exclude = exclude == null ? null : exclude.copy();
1802      dst.unitOfMeasure = unitOfMeasure == null ? null : unitOfMeasure.copy();
1803      dst.studyEffectiveDescription = studyEffectiveDescription == null ? null : studyEffectiveDescription.copy();
1804      dst.studyEffective = studyEffective == null ? null : studyEffective.copy();
1805      dst.studyEffectiveTimeFromStart = studyEffectiveTimeFromStart == null ? null : studyEffectiveTimeFromStart.copy();
1806      dst.studyEffectiveGroupMeasure = studyEffectiveGroupMeasure == null ? null : studyEffectiveGroupMeasure.copy();
1807      dst.participantEffectiveDescription = participantEffectiveDescription == null ? null
1808          : participantEffectiveDescription.copy();
1809      dst.participantEffective = participantEffective == null ? null : participantEffective.copy();
1810      dst.participantEffectiveTimeFromStart = participantEffectiveTimeFromStart == null ? null
1811          : participantEffectiveTimeFromStart.copy();
1812      dst.participantEffectiveGroupMeasure = participantEffectiveGroupMeasure == null ? null
1813          : participantEffectiveGroupMeasure.copy();
1814    }
1815
1816    @Override
1817    public boolean equalsDeep(Base other_) {
1818      if (!super.equalsDeep(other_))
1819        return false;
1820      if (!(other_ instanceof ResearchElementDefinitionCharacteristicComponent))
1821        return false;
1822      ResearchElementDefinitionCharacteristicComponent o = (ResearchElementDefinitionCharacteristicComponent) other_;
1823      return compareDeep(definition, o.definition, true) && compareDeep(usageContext, o.usageContext, true)
1824          && compareDeep(exclude, o.exclude, true) && compareDeep(unitOfMeasure, o.unitOfMeasure, true)
1825          && compareDeep(studyEffectiveDescription, o.studyEffectiveDescription, true)
1826          && compareDeep(studyEffective, o.studyEffective, true)
1827          && compareDeep(studyEffectiveTimeFromStart, o.studyEffectiveTimeFromStart, true)
1828          && compareDeep(studyEffectiveGroupMeasure, o.studyEffectiveGroupMeasure, true)
1829          && compareDeep(participantEffectiveDescription, o.participantEffectiveDescription, true)
1830          && compareDeep(participantEffective, o.participantEffective, true)
1831          && compareDeep(participantEffectiveTimeFromStart, o.participantEffectiveTimeFromStart, true)
1832          && compareDeep(participantEffectiveGroupMeasure, o.participantEffectiveGroupMeasure, true);
1833    }
1834
1835    @Override
1836    public boolean equalsShallow(Base other_) {
1837      if (!super.equalsShallow(other_))
1838        return false;
1839      if (!(other_ instanceof ResearchElementDefinitionCharacteristicComponent))
1840        return false;
1841      ResearchElementDefinitionCharacteristicComponent o = (ResearchElementDefinitionCharacteristicComponent) other_;
1842      return compareValues(exclude, o.exclude, true)
1843          && compareValues(studyEffectiveDescription, o.studyEffectiveDescription, true)
1844          && compareValues(studyEffectiveGroupMeasure, o.studyEffectiveGroupMeasure, true)
1845          && compareValues(participantEffectiveDescription, o.participantEffectiveDescription, true)
1846          && compareValues(participantEffectiveGroupMeasure, o.participantEffectiveGroupMeasure, true);
1847    }
1848
1849    public boolean isEmpty() {
1850      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(definition, usageContext, exclude, unitOfMeasure,
1851          studyEffectiveDescription, studyEffective, studyEffectiveTimeFromStart, studyEffectiveGroupMeasure,
1852          participantEffectiveDescription, participantEffective, participantEffectiveTimeFromStart,
1853          participantEffectiveGroupMeasure);
1854    }
1855
1856    public String fhirType() {
1857      return "ResearchElementDefinition.characteristic";
1858
1859    }
1860
1861  }
1862
1863  /**
1864   * A formal identifier that is used to identify this research element definition
1865   * when it is represented in other formats, or referenced in a specification,
1866   * model, design or an instance.
1867   */
1868  @Child(name = "identifier", type = {
1869      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1870  @Description(shortDefinition = "Additional identifier for the research element definition", formalDefinition = "A formal identifier that is used to identify this research element definition when it is represented in other formats, or referenced in a specification, model, design or an instance.")
1871  protected List<Identifier> identifier;
1872
1873  /**
1874   * The short title provides an alternate title for use in informal descriptive
1875   * contexts where the full, formal title is not necessary.
1876   */
1877  @Child(name = "shortTitle", type = {
1878      StringType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
1879  @Description(shortDefinition = "Title for use in informal contexts", formalDefinition = "The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.")
1880  protected StringType shortTitle;
1881
1882  /**
1883   * An explanatory or alternate title for the ResearchElementDefinition giving
1884   * additional information about its content.
1885   */
1886  @Child(name = "subtitle", type = { StringType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
1887  @Description(shortDefinition = "Subordinate title of the ResearchElementDefinition", formalDefinition = "An explanatory or alternate title for the ResearchElementDefinition giving additional information about its content.")
1888  protected StringType subtitle;
1889
1890  /**
1891   * The intended subjects for the ResearchElementDefinition. If this element is
1892   * not provided, a Patient subject is assumed, but the subject of the
1893   * ResearchElementDefinition can be anything.
1894   */
1895  @Child(name = "subject", type = { CodeableConcept.class,
1896      Group.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
1897  @Description(shortDefinition = "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, Device", formalDefinition = "The intended subjects for the ResearchElementDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchElementDefinition can be anything.")
1898  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/subject-type")
1899  protected Type subject;
1900
1901  /**
1902   * A human-readable string to clarify or explain concepts about the resource.
1903   */
1904  @Child(name = "comment", type = {
1905      StringType.class }, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1906  @Description(shortDefinition = "Used for footnotes or explanatory notes", formalDefinition = "A human-readable string to clarify or explain concepts about the resource.")
1907  protected List<StringType> comment;
1908
1909  /**
1910   * Explanation of why this research element definition is needed and why it has
1911   * been designed as it has.
1912   */
1913  @Child(name = "purpose", type = {
1914      MarkdownType.class }, order = 5, min = 0, max = 1, modifier = false, summary = false)
1915  @Description(shortDefinition = "Why this research element definition is defined", formalDefinition = "Explanation of why this research element definition is needed and why it has been designed as it has.")
1916  protected MarkdownType purpose;
1917
1918  /**
1919   * A detailed description, from a clinical perspective, of how the
1920   * ResearchElementDefinition is used.
1921   */
1922  @Child(name = "usage", type = { StringType.class }, order = 6, min = 0, max = 1, modifier = false, summary = false)
1923  @Description(shortDefinition = "Describes the clinical usage of the ResearchElementDefinition", formalDefinition = "A detailed description, from a clinical perspective, of how the ResearchElementDefinition is used.")
1924  protected StringType usage;
1925
1926  /**
1927   * A copyright statement relating to the research element definition and/or its
1928   * contents. Copyright statements are generally legal restrictions on the use
1929   * and publishing of the research element definition.
1930   */
1931  @Child(name = "copyright", type = {
1932      MarkdownType.class }, order = 7, min = 0, max = 1, modifier = false, summary = false)
1933  @Description(shortDefinition = "Use and/or publishing restrictions", formalDefinition = "A copyright statement relating to the research element definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research element definition.")
1934  protected MarkdownType copyright;
1935
1936  /**
1937   * The date on which the resource content was approved by the publisher.
1938   * Approval happens once when the content is officially approved for usage.
1939   */
1940  @Child(name = "approvalDate", type = {
1941      DateType.class }, order = 8, min = 0, max = 1, modifier = false, summary = false)
1942  @Description(shortDefinition = "When the research element definition was approved by publisher", formalDefinition = "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.")
1943  protected DateType approvalDate;
1944
1945  /**
1946   * The date on which the resource content was last reviewed. Review happens
1947   * periodically after approval but does not change the original approval date.
1948   */
1949  @Child(name = "lastReviewDate", type = {
1950      DateType.class }, order = 9, min = 0, max = 1, modifier = false, summary = false)
1951  @Description(shortDefinition = "When the research element definition was last reviewed", formalDefinition = "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.")
1952  protected DateType lastReviewDate;
1953
1954  /**
1955   * The period during which the research element definition content was or is
1956   * planned to be in active use.
1957   */
1958  @Child(name = "effectivePeriod", type = {
1959      Period.class }, order = 10, min = 0, max = 1, modifier = false, summary = true)
1960  @Description(shortDefinition = "When the research element definition is expected to be used", formalDefinition = "The period during which the research element definition content was or is planned to be in active use.")
1961  protected Period effectivePeriod;
1962
1963  /**
1964   * Descriptive topics related to the content of the ResearchElementDefinition.
1965   * Topics provide a high-level categorization grouping types of
1966   * ResearchElementDefinitions that can be useful for filtering and searching.
1967   */
1968  @Child(name = "topic", type = {
1969      CodeableConcept.class }, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1970  @Description(shortDefinition = "The category of the ResearchElementDefinition, such as Education, Treatment, Assessment, etc.", formalDefinition = "Descriptive topics related to the content of the ResearchElementDefinition. Topics provide a high-level categorization grouping types of ResearchElementDefinitions that can be useful for filtering and searching.")
1971  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/definition-topic")
1972  protected List<CodeableConcept> topic;
1973
1974  /**
1975   * An individiual or organization primarily involved in the creation and
1976   * maintenance of the content.
1977   */
1978  @Child(name = "author", type = {
1979      ContactDetail.class }, order = 12, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1980  @Description(shortDefinition = "Who authored the content", formalDefinition = "An individiual or organization primarily involved in the creation and maintenance of the content.")
1981  protected List<ContactDetail> author;
1982
1983  /**
1984   * An individual or organization primarily responsible for internal coherence of
1985   * the content.
1986   */
1987  @Child(name = "editor", type = {
1988      ContactDetail.class }, order = 13, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1989  @Description(shortDefinition = "Who edited the content", formalDefinition = "An individual or organization primarily responsible for internal coherence of the content.")
1990  protected List<ContactDetail> editor;
1991
1992  /**
1993   * An individual or organization primarily responsible for review of some aspect
1994   * of the content.
1995   */
1996  @Child(name = "reviewer", type = {
1997      ContactDetail.class }, order = 14, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1998  @Description(shortDefinition = "Who reviewed the content", formalDefinition = "An individual or organization primarily responsible for review of some aspect of the content.")
1999  protected List<ContactDetail> reviewer;
2000
2001  /**
2002   * An individual or organization responsible for officially endorsing the
2003   * content for use in some setting.
2004   */
2005  @Child(name = "endorser", type = {
2006      ContactDetail.class }, order = 15, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
2007  @Description(shortDefinition = "Who endorsed the content", formalDefinition = "An individual or organization responsible for officially endorsing the content for use in some setting.")
2008  protected List<ContactDetail> endorser;
2009
2010  /**
2011   * Related artifacts such as additional documentation, justification, or
2012   * bibliographic references.
2013   */
2014  @Child(name = "relatedArtifact", type = {
2015      RelatedArtifact.class }, order = 16, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
2016  @Description(shortDefinition = "Additional documentation, citations, etc.", formalDefinition = "Related artifacts such as additional documentation, justification, or bibliographic references.")
2017  protected List<RelatedArtifact> relatedArtifact;
2018
2019  /**
2020   * A reference to a Library resource containing the formal logic used by the
2021   * ResearchElementDefinition.
2022   */
2023  @Child(name = "library", type = {
2024      CanonicalType.class }, order = 17, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
2025  @Description(shortDefinition = "Logic used by the ResearchElementDefinition", formalDefinition = "A reference to a Library resource containing the formal logic used by the ResearchElementDefinition.")
2026  protected List<CanonicalType> library;
2027
2028  /**
2029   * The type of research element, a population, an exposure, or an outcome.
2030   */
2031  @Child(name = "type", type = { CodeType.class }, order = 18, min = 1, max = 1, modifier = false, summary = true)
2032  @Description(shortDefinition = "population | exposure | outcome", formalDefinition = "The type of research element, a population, an exposure, or an outcome.")
2033  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/research-element-type")
2034  protected Enumeration<ResearchElementType> type;
2035
2036  /**
2037   * The type of the outcome (e.g. Dichotomous, Continuous, or Descriptive).
2038   */
2039  @Child(name = "variableType", type = {
2040      CodeType.class }, order = 19, min = 0, max = 1, modifier = false, summary = false)
2041  @Description(shortDefinition = "dichotomous | continuous | descriptive", formalDefinition = "The type of the outcome (e.g. Dichotomous, Continuous, or Descriptive).")
2042  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/variable-type")
2043  protected Enumeration<VariableType> variableType;
2044
2045  /**
2046   * A characteristic that defines the members of the research element. Multiple
2047   * characteristics are applied with "and" semantics.
2048   */
2049  @Child(name = "characteristic", type = {}, order = 20, min = 1, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2050  @Description(shortDefinition = "What defines the members of the research element", formalDefinition = "A characteristic that defines the members of the research element. Multiple characteristics are applied with \"and\" semantics.")
2051  protected List<ResearchElementDefinitionCharacteristicComponent> characteristic;
2052
2053  private static final long serialVersionUID = 1483216033L;
2054
2055  /**
2056   * Constructor
2057   */
2058  public ResearchElementDefinition() {
2059    super();
2060  }
2061
2062  /**
2063   * Constructor
2064   */
2065  public ResearchElementDefinition(Enumeration<PublicationStatus> status, Enumeration<ResearchElementType> type) {
2066    super();
2067    this.status = status;
2068    this.type = type;
2069  }
2070
2071  /**
2072   * @return {@link #url} (An absolute URI that is used to identify this research
2073   *         element definition when it is referenced in a specification, model,
2074   *         design or an instance; also called its canonical identifier. This
2075   *         SHOULD be globally unique and SHOULD be a literal address at which at
2076   *         which an authoritative instance of this research element definition
2077   *         is (or will be) published. This URL can be the target of a canonical
2078   *         reference. It SHALL remain the same when the research element
2079   *         definition is stored on different servers.). This is the underlying
2080   *         object with id, value and extensions. The accessor "getUrl" gives
2081   *         direct access to the value
2082   */
2083  public UriType getUrlElement() {
2084    if (this.url == null)
2085      if (Configuration.errorOnAutoCreate())
2086        throw new Error("Attempt to auto-create ResearchElementDefinition.url");
2087      else if (Configuration.doAutoCreate())
2088        this.url = new UriType(); // bb
2089    return this.url;
2090  }
2091
2092  public boolean hasUrlElement() {
2093    return this.url != null && !this.url.isEmpty();
2094  }
2095
2096  public boolean hasUrl() {
2097    return this.url != null && !this.url.isEmpty();
2098  }
2099
2100  /**
2101   * @param value {@link #url} (An absolute URI that is used to identify this
2102   *              research element definition when it is referenced in a
2103   *              specification, model, design or an instance; also called its
2104   *              canonical identifier. This SHOULD be globally unique and SHOULD
2105   *              be a literal address at which at which an authoritative instance
2106   *              of this research element definition is (or will be) published.
2107   *              This URL can be the target of a canonical reference. It SHALL
2108   *              remain the same when the research element definition is stored
2109   *              on different servers.). This is the underlying object with id,
2110   *              value and extensions. The accessor "getUrl" gives direct access
2111   *              to the value
2112   */
2113  public ResearchElementDefinition setUrlElement(UriType value) {
2114    this.url = value;
2115    return this;
2116  }
2117
2118  /**
2119   * @return An absolute URI that is used to identify this research element
2120   *         definition when it is referenced in a specification, model, design or
2121   *         an instance; also called its canonical identifier. This SHOULD be
2122   *         globally unique and SHOULD be a literal address at which at which an
2123   *         authoritative instance of this research element definition is (or
2124   *         will be) published. This URL can be the target of a canonical
2125   *         reference. It SHALL remain the same when the research element
2126   *         definition is stored on different servers.
2127   */
2128  public String getUrl() {
2129    return this.url == null ? null : this.url.getValue();
2130  }
2131
2132  /**
2133   * @param value An absolute URI that is used to identify this research element
2134   *              definition when it is referenced in a specification, model,
2135   *              design or an instance; also called its canonical identifier.
2136   *              This SHOULD be globally unique and SHOULD be a literal address
2137   *              at which at which an authoritative instance of this research
2138   *              element definition is (or will be) published. This URL can be
2139   *              the target of a canonical reference. It SHALL remain the same
2140   *              when the research element definition is stored on different
2141   *              servers.
2142   */
2143  public ResearchElementDefinition setUrl(String value) {
2144    if (Utilities.noString(value))
2145      this.url = null;
2146    else {
2147      if (this.url == null)
2148        this.url = new UriType();
2149      this.url.setValue(value);
2150    }
2151    return this;
2152  }
2153
2154  /**
2155   * @return {@link #identifier} (A formal identifier that is used to identify
2156   *         this research element definition when it is represented in other
2157   *         formats, or referenced in a specification, model, design or an
2158   *         instance.)
2159   */
2160  public List<Identifier> getIdentifier() {
2161    if (this.identifier == null)
2162      this.identifier = new ArrayList<Identifier>();
2163    return this.identifier;
2164  }
2165
2166  /**
2167   * @return Returns a reference to <code>this</code> for easy method chaining
2168   */
2169  public ResearchElementDefinition setIdentifier(List<Identifier> theIdentifier) {
2170    this.identifier = theIdentifier;
2171    return this;
2172  }
2173
2174  public boolean hasIdentifier() {
2175    if (this.identifier == null)
2176      return false;
2177    for (Identifier item : this.identifier)
2178      if (!item.isEmpty())
2179        return true;
2180    return false;
2181  }
2182
2183  public Identifier addIdentifier() { // 3
2184    Identifier t = new Identifier();
2185    if (this.identifier == null)
2186      this.identifier = new ArrayList<Identifier>();
2187    this.identifier.add(t);
2188    return t;
2189  }
2190
2191  public ResearchElementDefinition addIdentifier(Identifier t) { // 3
2192    if (t == null)
2193      return this;
2194    if (this.identifier == null)
2195      this.identifier = new ArrayList<Identifier>();
2196    this.identifier.add(t);
2197    return this;
2198  }
2199
2200  /**
2201   * @return The first repetition of repeating field {@link #identifier}, creating
2202   *         it if it does not already exist
2203   */
2204  public Identifier getIdentifierFirstRep() {
2205    if (getIdentifier().isEmpty()) {
2206      addIdentifier();
2207    }
2208    return getIdentifier().get(0);
2209  }
2210
2211  /**
2212   * @return {@link #version} (The identifier that is used to identify this
2213   *         version of the research element definition when it is referenced in a
2214   *         specification, model, design or instance. This is an arbitrary value
2215   *         managed by the research element definition author and is not expected
2216   *         to be globally unique. For example, it might be a timestamp (e.g.
2217   *         yyyymmdd) if a managed version is not available. There is also no
2218   *         expectation that versions can be placed in a lexicographical
2219   *         sequence. To provide a version consistent with the Decision Support
2220   *         Service specification, use the format Major.Minor.Revision (e.g.
2221   *         1.0.0). For more information on versioning knowledge assets, refer to
2222   *         the Decision Support Service specification. Note that a version is
2223   *         required for non-experimental active artifacts.). This is the
2224   *         underlying object with id, value and extensions. The accessor
2225   *         "getVersion" gives direct access to the value
2226   */
2227  public StringType getVersionElement() {
2228    if (this.version == null)
2229      if (Configuration.errorOnAutoCreate())
2230        throw new Error("Attempt to auto-create ResearchElementDefinition.version");
2231      else if (Configuration.doAutoCreate())
2232        this.version = new StringType(); // bb
2233    return this.version;
2234  }
2235
2236  public boolean hasVersionElement() {
2237    return this.version != null && !this.version.isEmpty();
2238  }
2239
2240  public boolean hasVersion() {
2241    return this.version != null && !this.version.isEmpty();
2242  }
2243
2244  /**
2245   * @param value {@link #version} (The identifier that is used to identify this
2246   *              version of the research element definition when it is referenced
2247   *              in a specification, model, design or instance. This is an
2248   *              arbitrary value managed by the research element definition
2249   *              author and is not expected to be globally unique. For example,
2250   *              it might be a timestamp (e.g. yyyymmdd) if a managed version is
2251   *              not available. There is also no expectation that versions can be
2252   *              placed in a lexicographical sequence. To provide a version
2253   *              consistent with the Decision Support Service specification, use
2254   *              the format Major.Minor.Revision (e.g. 1.0.0). For more
2255   *              information on versioning knowledge assets, refer to the
2256   *              Decision Support Service specification. Note that a version is
2257   *              required for non-experimental active artifacts.). This is the
2258   *              underlying object with id, value and extensions. The accessor
2259   *              "getVersion" gives direct access to the value
2260   */
2261  public ResearchElementDefinition setVersionElement(StringType value) {
2262    this.version = value;
2263    return this;
2264  }
2265
2266  /**
2267   * @return The identifier that is used to identify this version of the research
2268   *         element definition when it is referenced in a specification, model,
2269   *         design or instance. This is an arbitrary value managed by the
2270   *         research element definition author and is not expected to be globally
2271   *         unique. For example, it might be a timestamp (e.g. yyyymmdd) if a
2272   *         managed version is not available. There is also no expectation that
2273   *         versions can be placed in a lexicographical sequence. To provide a
2274   *         version consistent with the Decision Support Service specification,
2275   *         use the format Major.Minor.Revision (e.g. 1.0.0). For more
2276   *         information on versioning knowledge assets, refer to the Decision
2277   *         Support Service specification. Note that a version is required for
2278   *         non-experimental active artifacts.
2279   */
2280  public String getVersion() {
2281    return this.version == null ? null : this.version.getValue();
2282  }
2283
2284  /**
2285   * @param value The identifier that is used to identify this version of the
2286   *              research element definition when it is referenced in a
2287   *              specification, model, design or instance. This is an arbitrary
2288   *              value managed by the research element definition author and is
2289   *              not expected to be globally unique. For example, it might be a
2290   *              timestamp (e.g. yyyymmdd) if a managed version is not available.
2291   *              There is also no expectation that versions can be placed in a
2292   *              lexicographical sequence. To provide a version consistent with
2293   *              the Decision Support Service specification, use the format
2294   *              Major.Minor.Revision (e.g. 1.0.0). For more information on
2295   *              versioning knowledge assets, refer to the Decision Support
2296   *              Service specification. Note that a version is required for
2297   *              non-experimental active artifacts.
2298   */
2299  public ResearchElementDefinition setVersion(String value) {
2300    if (Utilities.noString(value))
2301      this.version = null;
2302    else {
2303      if (this.version == null)
2304        this.version = new StringType();
2305      this.version.setValue(value);
2306    }
2307    return this;
2308  }
2309
2310  /**
2311   * @return {@link #name} (A natural language name identifying the research
2312   *         element definition. This name should be usable as an identifier for
2313   *         the module by machine processing applications such as code
2314   *         generation.). This is the underlying object with id, value and
2315   *         extensions. The accessor "getName" gives direct access to the value
2316   */
2317  public StringType getNameElement() {
2318    if (this.name == null)
2319      if (Configuration.errorOnAutoCreate())
2320        throw new Error("Attempt to auto-create ResearchElementDefinition.name");
2321      else if (Configuration.doAutoCreate())
2322        this.name = new StringType(); // bb
2323    return this.name;
2324  }
2325
2326  public boolean hasNameElement() {
2327    return this.name != null && !this.name.isEmpty();
2328  }
2329
2330  public boolean hasName() {
2331    return this.name != null && !this.name.isEmpty();
2332  }
2333
2334  /**
2335   * @param value {@link #name} (A natural language name identifying the research
2336   *              element definition. This name should be usable as an identifier
2337   *              for the module by machine processing applications such as code
2338   *              generation.). This is the underlying object with id, value and
2339   *              extensions. The accessor "getName" gives direct access to the
2340   *              value
2341   */
2342  public ResearchElementDefinition setNameElement(StringType value) {
2343    this.name = value;
2344    return this;
2345  }
2346
2347  /**
2348   * @return A natural language name identifying the research element definition.
2349   *         This name should be usable as an identifier for the module by machine
2350   *         processing applications such as code generation.
2351   */
2352  public String getName() {
2353    return this.name == null ? null : this.name.getValue();
2354  }
2355
2356  /**
2357   * @param value A natural language name identifying the research element
2358   *              definition. This name should be usable as an identifier for the
2359   *              module by machine processing applications such as code
2360   *              generation.
2361   */
2362  public ResearchElementDefinition setName(String value) {
2363    if (Utilities.noString(value))
2364      this.name = null;
2365    else {
2366      if (this.name == null)
2367        this.name = new StringType();
2368      this.name.setValue(value);
2369    }
2370    return this;
2371  }
2372
2373  /**
2374   * @return {@link #title} (A short, descriptive, user-friendly title for the
2375   *         research element definition.). This is the underlying object with id,
2376   *         value and extensions. The accessor "getTitle" gives direct access to
2377   *         the value
2378   */
2379  public StringType getTitleElement() {
2380    if (this.title == null)
2381      if (Configuration.errorOnAutoCreate())
2382        throw new Error("Attempt to auto-create ResearchElementDefinition.title");
2383      else if (Configuration.doAutoCreate())
2384        this.title = new StringType(); // bb
2385    return this.title;
2386  }
2387
2388  public boolean hasTitleElement() {
2389    return this.title != null && !this.title.isEmpty();
2390  }
2391
2392  public boolean hasTitle() {
2393    return this.title != null && !this.title.isEmpty();
2394  }
2395
2396  /**
2397   * @param value {@link #title} (A short, descriptive, user-friendly title for
2398   *              the research element definition.). This is the underlying object
2399   *              with id, value and extensions. The accessor "getTitle" gives
2400   *              direct access to the value
2401   */
2402  public ResearchElementDefinition setTitleElement(StringType value) {
2403    this.title = value;
2404    return this;
2405  }
2406
2407  /**
2408   * @return A short, descriptive, user-friendly title for the research element
2409   *         definition.
2410   */
2411  public String getTitle() {
2412    return this.title == null ? null : this.title.getValue();
2413  }
2414
2415  /**
2416   * @param value A short, descriptive, user-friendly title for the research
2417   *              element definition.
2418   */
2419  public ResearchElementDefinition setTitle(String value) {
2420    if (Utilities.noString(value))
2421      this.title = null;
2422    else {
2423      if (this.title == null)
2424        this.title = new StringType();
2425      this.title.setValue(value);
2426    }
2427    return this;
2428  }
2429
2430  /**
2431   * @return {@link #shortTitle} (The short title provides an alternate title for
2432   *         use in informal descriptive contexts where the full, formal title is
2433   *         not necessary.). This is the underlying object with id, value and
2434   *         extensions. The accessor "getShortTitle" gives direct access to the
2435   *         value
2436   */
2437  public StringType getShortTitleElement() {
2438    if (this.shortTitle == null)
2439      if (Configuration.errorOnAutoCreate())
2440        throw new Error("Attempt to auto-create ResearchElementDefinition.shortTitle");
2441      else if (Configuration.doAutoCreate())
2442        this.shortTitle = new StringType(); // bb
2443    return this.shortTitle;
2444  }
2445
2446  public boolean hasShortTitleElement() {
2447    return this.shortTitle != null && !this.shortTitle.isEmpty();
2448  }
2449
2450  public boolean hasShortTitle() {
2451    return this.shortTitle != null && !this.shortTitle.isEmpty();
2452  }
2453
2454  /**
2455   * @param value {@link #shortTitle} (The short title provides an alternate title
2456   *              for use in informal descriptive contexts where the full, formal
2457   *              title is not necessary.). This is the underlying object with id,
2458   *              value and extensions. The accessor "getShortTitle" gives direct
2459   *              access to the value
2460   */
2461  public ResearchElementDefinition setShortTitleElement(StringType value) {
2462    this.shortTitle = value;
2463    return this;
2464  }
2465
2466  /**
2467   * @return The short title provides an alternate title for use in informal
2468   *         descriptive contexts where the full, formal title is not necessary.
2469   */
2470  public String getShortTitle() {
2471    return this.shortTitle == null ? null : this.shortTitle.getValue();
2472  }
2473
2474  /**
2475   * @param value The short title provides an alternate title for use in informal
2476   *              descriptive contexts where the full, formal title is not
2477   *              necessary.
2478   */
2479  public ResearchElementDefinition setShortTitle(String value) {
2480    if (Utilities.noString(value))
2481      this.shortTitle = null;
2482    else {
2483      if (this.shortTitle == null)
2484        this.shortTitle = new StringType();
2485      this.shortTitle.setValue(value);
2486    }
2487    return this;
2488  }
2489
2490  /**
2491   * @return {@link #subtitle} (An explanatory or alternate title for the
2492   *         ResearchElementDefinition giving additional information about its
2493   *         content.). This is the underlying object with id, value and
2494   *         extensions. The accessor "getSubtitle" gives direct access to the
2495   *         value
2496   */
2497  public StringType getSubtitleElement() {
2498    if (this.subtitle == null)
2499      if (Configuration.errorOnAutoCreate())
2500        throw new Error("Attempt to auto-create ResearchElementDefinition.subtitle");
2501      else if (Configuration.doAutoCreate())
2502        this.subtitle = new StringType(); // bb
2503    return this.subtitle;
2504  }
2505
2506  public boolean hasSubtitleElement() {
2507    return this.subtitle != null && !this.subtitle.isEmpty();
2508  }
2509
2510  public boolean hasSubtitle() {
2511    return this.subtitle != null && !this.subtitle.isEmpty();
2512  }
2513
2514  /**
2515   * @param value {@link #subtitle} (An explanatory or alternate title for the
2516   *              ResearchElementDefinition giving additional information about
2517   *              its content.). This is the underlying object with id, value and
2518   *              extensions. The accessor "getSubtitle" gives direct access to
2519   *              the value
2520   */
2521  public ResearchElementDefinition setSubtitleElement(StringType value) {
2522    this.subtitle = value;
2523    return this;
2524  }
2525
2526  /**
2527   * @return An explanatory or alternate title for the ResearchElementDefinition
2528   *         giving additional information about its content.
2529   */
2530  public String getSubtitle() {
2531    return this.subtitle == null ? null : this.subtitle.getValue();
2532  }
2533
2534  /**
2535   * @param value An explanatory or alternate title for the
2536   *              ResearchElementDefinition giving additional information about
2537   *              its content.
2538   */
2539  public ResearchElementDefinition setSubtitle(String value) {
2540    if (Utilities.noString(value))
2541      this.subtitle = null;
2542    else {
2543      if (this.subtitle == null)
2544        this.subtitle = new StringType();
2545      this.subtitle.setValue(value);
2546    }
2547    return this;
2548  }
2549
2550  /**
2551   * @return {@link #status} (The status of this research element definition.
2552   *         Enables tracking the life-cycle of the content.). This is the
2553   *         underlying object with id, value and extensions. The accessor
2554   *         "getStatus" gives direct access to the value
2555   */
2556  public Enumeration<PublicationStatus> getStatusElement() {
2557    if (this.status == null)
2558      if (Configuration.errorOnAutoCreate())
2559        throw new Error("Attempt to auto-create ResearchElementDefinition.status");
2560      else if (Configuration.doAutoCreate())
2561        this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
2562    return this.status;
2563  }
2564
2565  public boolean hasStatusElement() {
2566    return this.status != null && !this.status.isEmpty();
2567  }
2568
2569  public boolean hasStatus() {
2570    return this.status != null && !this.status.isEmpty();
2571  }
2572
2573  /**
2574   * @param value {@link #status} (The status of this research element definition.
2575   *              Enables tracking the life-cycle of the content.). This is the
2576   *              underlying object with id, value and extensions. The accessor
2577   *              "getStatus" gives direct access to the value
2578   */
2579  public ResearchElementDefinition setStatusElement(Enumeration<PublicationStatus> value) {
2580    this.status = value;
2581    return this;
2582  }
2583
2584  /**
2585   * @return The status of this research element definition. Enables tracking the
2586   *         life-cycle of the content.
2587   */
2588  public PublicationStatus getStatus() {
2589    return this.status == null ? null : this.status.getValue();
2590  }
2591
2592  /**
2593   * @param value The status of this research element definition. Enables tracking
2594   *              the life-cycle of the content.
2595   */
2596  public ResearchElementDefinition setStatus(PublicationStatus value) {
2597    if (this.status == null)
2598      this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
2599    this.status.setValue(value);
2600    return this;
2601  }
2602
2603  /**
2604   * @return {@link #experimental} (A Boolean value to indicate that this research
2605   *         element definition is authored for testing purposes (or
2606   *         education/evaluation/marketing) and is not intended to be used for
2607   *         genuine usage.). This is the underlying object with id, value and
2608   *         extensions. The accessor "getExperimental" gives direct access to the
2609   *         value
2610   */
2611  public BooleanType getExperimentalElement() {
2612    if (this.experimental == null)
2613      if (Configuration.errorOnAutoCreate())
2614        throw new Error("Attempt to auto-create ResearchElementDefinition.experimental");
2615      else if (Configuration.doAutoCreate())
2616        this.experimental = new BooleanType(); // bb
2617    return this.experimental;
2618  }
2619
2620  public boolean hasExperimentalElement() {
2621    return this.experimental != null && !this.experimental.isEmpty();
2622  }
2623
2624  public boolean hasExperimental() {
2625    return this.experimental != null && !this.experimental.isEmpty();
2626  }
2627
2628  /**
2629   * @param value {@link #experimental} (A Boolean value to indicate that this
2630   *              research element definition is authored for testing purposes (or
2631   *              education/evaluation/marketing) and is not intended to be used
2632   *              for genuine usage.). This is the underlying object with id,
2633   *              value and extensions. The accessor "getExperimental" gives
2634   *              direct access to the value
2635   */
2636  public ResearchElementDefinition setExperimentalElement(BooleanType value) {
2637    this.experimental = value;
2638    return this;
2639  }
2640
2641  /**
2642   * @return A Boolean value to indicate that this research element definition is
2643   *         authored for testing purposes (or education/evaluation/marketing) and
2644   *         is not intended to be used for genuine usage.
2645   */
2646  public boolean getExperimental() {
2647    return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
2648  }
2649
2650  /**
2651   * @param value A Boolean value to indicate that this research element
2652   *              definition is authored for testing purposes (or
2653   *              education/evaluation/marketing) and is not intended to be used
2654   *              for genuine usage.
2655   */
2656  public ResearchElementDefinition setExperimental(boolean value) {
2657    if (this.experimental == null)
2658      this.experimental = new BooleanType();
2659    this.experimental.setValue(value);
2660    return this;
2661  }
2662
2663  /**
2664   * @return {@link #subject} (The intended subjects for the
2665   *         ResearchElementDefinition. If this element is not provided, a Patient
2666   *         subject is assumed, but the subject of the ResearchElementDefinition
2667   *         can be anything.)
2668   */
2669  public Type getSubject() {
2670    return this.subject;
2671  }
2672
2673  /**
2674   * @return {@link #subject} (The intended subjects for the
2675   *         ResearchElementDefinition. If this element is not provided, a Patient
2676   *         subject is assumed, but the subject of the ResearchElementDefinition
2677   *         can be anything.)
2678   */
2679  public CodeableConcept getSubjectCodeableConcept() throws FHIRException {
2680    if (this.subject == null)
2681      this.subject = new CodeableConcept();
2682    if (!(this.subject instanceof CodeableConcept))
2683      throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "
2684          + this.subject.getClass().getName() + " was encountered");
2685    return (CodeableConcept) this.subject;
2686  }
2687
2688  public boolean hasSubjectCodeableConcept() {
2689    return this != null && this.subject instanceof CodeableConcept;
2690  }
2691
2692  /**
2693   * @return {@link #subject} (The intended subjects for the
2694   *         ResearchElementDefinition. If this element is not provided, a Patient
2695   *         subject is assumed, but the subject of the ResearchElementDefinition
2696   *         can be anything.)
2697   */
2698  public Reference getSubjectReference() throws FHIRException {
2699    if (this.subject == null)
2700      this.subject = new Reference();
2701    if (!(this.subject instanceof Reference))
2702      throw new FHIRException("Type mismatch: the type Reference was expected, but " + this.subject.getClass().getName()
2703          + " was encountered");
2704    return (Reference) this.subject;
2705  }
2706
2707  public boolean hasSubjectReference() {
2708    return this != null && this.subject instanceof Reference;
2709  }
2710
2711  public boolean hasSubject() {
2712    return this.subject != null && !this.subject.isEmpty();
2713  }
2714
2715  /**
2716   * @param value {@link #subject} (The intended subjects for the
2717   *              ResearchElementDefinition. If this element is not provided, a
2718   *              Patient subject is assumed, but the subject of the
2719   *              ResearchElementDefinition can be anything.)
2720   */
2721  public ResearchElementDefinition setSubject(Type value) {
2722    if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
2723      throw new Error("Not the right type for ResearchElementDefinition.subject[x]: " + value.fhirType());
2724    this.subject = value;
2725    return this;
2726  }
2727
2728  /**
2729   * @return {@link #date} (The date (and optionally time) when the research
2730   *         element definition was published. The date must change when the
2731   *         business version changes and it must change if the status code
2732   *         changes. In addition, it should change when the substantive content
2733   *         of the research element definition changes.). This is the underlying
2734   *         object with id, value and extensions. The accessor "getDate" gives
2735   *         direct access to the value
2736   */
2737  public DateTimeType getDateElement() {
2738    if (this.date == null)
2739      if (Configuration.errorOnAutoCreate())
2740        throw new Error("Attempt to auto-create ResearchElementDefinition.date");
2741      else if (Configuration.doAutoCreate())
2742        this.date = new DateTimeType(); // bb
2743    return this.date;
2744  }
2745
2746  public boolean hasDateElement() {
2747    return this.date != null && !this.date.isEmpty();
2748  }
2749
2750  public boolean hasDate() {
2751    return this.date != null && !this.date.isEmpty();
2752  }
2753
2754  /**
2755   * @param value {@link #date} (The date (and optionally time) when the research
2756   *              element definition was published. The date must change when the
2757   *              business version changes and it must change if the status code
2758   *              changes. In addition, it should change when the substantive
2759   *              content of the research element definition changes.). This is
2760   *              the underlying object with id, value and extensions. The
2761   *              accessor "getDate" gives direct access to the value
2762   */
2763  public ResearchElementDefinition setDateElement(DateTimeType value) {
2764    this.date = value;
2765    return this;
2766  }
2767
2768  /**
2769   * @return The date (and optionally time) when the research element definition
2770   *         was published. The date must change when the business version changes
2771   *         and it must change if the status code changes. In addition, it should
2772   *         change when the substantive content of the research element
2773   *         definition changes.
2774   */
2775  public Date getDate() {
2776    return this.date == null ? null : this.date.getValue();
2777  }
2778
2779  /**
2780   * @param value The date (and optionally time) when the research element
2781   *              definition was published. The date must change when the business
2782   *              version changes and it must change if the status code changes.
2783   *              In addition, it should change when the substantive content of
2784   *              the research element definition changes.
2785   */
2786  public ResearchElementDefinition setDate(Date value) {
2787    if (value == null)
2788      this.date = null;
2789    else {
2790      if (this.date == null)
2791        this.date = new DateTimeType();
2792      this.date.setValue(value);
2793    }
2794    return this;
2795  }
2796
2797  /**
2798   * @return {@link #publisher} (The name of the organization or individual that
2799   *         published the research element definition.). This is the underlying
2800   *         object with id, value and extensions. The accessor "getPublisher"
2801   *         gives direct access to the value
2802   */
2803  public StringType getPublisherElement() {
2804    if (this.publisher == null)
2805      if (Configuration.errorOnAutoCreate())
2806        throw new Error("Attempt to auto-create ResearchElementDefinition.publisher");
2807      else if (Configuration.doAutoCreate())
2808        this.publisher = new StringType(); // bb
2809    return this.publisher;
2810  }
2811
2812  public boolean hasPublisherElement() {
2813    return this.publisher != null && !this.publisher.isEmpty();
2814  }
2815
2816  public boolean hasPublisher() {
2817    return this.publisher != null && !this.publisher.isEmpty();
2818  }
2819
2820  /**
2821   * @param value {@link #publisher} (The name of the organization or individual
2822   *              that published the research element definition.). This is the
2823   *              underlying object with id, value and extensions. The accessor
2824   *              "getPublisher" gives direct access to the value
2825   */
2826  public ResearchElementDefinition setPublisherElement(StringType value) {
2827    this.publisher = value;
2828    return this;
2829  }
2830
2831  /**
2832   * @return The name of the organization or individual that published the
2833   *         research element definition.
2834   */
2835  public String getPublisher() {
2836    return this.publisher == null ? null : this.publisher.getValue();
2837  }
2838
2839  /**
2840   * @param value The name of the organization or individual that published the
2841   *              research element definition.
2842   */
2843  public ResearchElementDefinition setPublisher(String value) {
2844    if (Utilities.noString(value))
2845      this.publisher = null;
2846    else {
2847      if (this.publisher == null)
2848        this.publisher = new StringType();
2849      this.publisher.setValue(value);
2850    }
2851    return this;
2852  }
2853
2854  /**
2855   * @return {@link #contact} (Contact details to assist a user in finding and
2856   *         communicating with the publisher.)
2857   */
2858  public List<ContactDetail> getContact() {
2859    if (this.contact == null)
2860      this.contact = new ArrayList<ContactDetail>();
2861    return this.contact;
2862  }
2863
2864  /**
2865   * @return Returns a reference to <code>this</code> for easy method chaining
2866   */
2867  public ResearchElementDefinition setContact(List<ContactDetail> theContact) {
2868    this.contact = theContact;
2869    return this;
2870  }
2871
2872  public boolean hasContact() {
2873    if (this.contact == null)
2874      return false;
2875    for (ContactDetail item : this.contact)
2876      if (!item.isEmpty())
2877        return true;
2878    return false;
2879  }
2880
2881  public ContactDetail addContact() { // 3
2882    ContactDetail t = new ContactDetail();
2883    if (this.contact == null)
2884      this.contact = new ArrayList<ContactDetail>();
2885    this.contact.add(t);
2886    return t;
2887  }
2888
2889  public ResearchElementDefinition addContact(ContactDetail t) { // 3
2890    if (t == null)
2891      return this;
2892    if (this.contact == null)
2893      this.contact = new ArrayList<ContactDetail>();
2894    this.contact.add(t);
2895    return this;
2896  }
2897
2898  /**
2899   * @return The first repetition of repeating field {@link #contact}, creating it
2900   *         if it does not already exist
2901   */
2902  public ContactDetail getContactFirstRep() {
2903    if (getContact().isEmpty()) {
2904      addContact();
2905    }
2906    return getContact().get(0);
2907  }
2908
2909  /**
2910   * @return {@link #description} (A free text natural language description of the
2911   *         research element definition from a consumer's perspective.). This is
2912   *         the underlying object with id, value and extensions. The accessor
2913   *         "getDescription" gives direct access to the value
2914   */
2915  public MarkdownType getDescriptionElement() {
2916    if (this.description == null)
2917      if (Configuration.errorOnAutoCreate())
2918        throw new Error("Attempt to auto-create ResearchElementDefinition.description");
2919      else if (Configuration.doAutoCreate())
2920        this.description = new MarkdownType(); // bb
2921    return this.description;
2922  }
2923
2924  public boolean hasDescriptionElement() {
2925    return this.description != null && !this.description.isEmpty();
2926  }
2927
2928  public boolean hasDescription() {
2929    return this.description != null && !this.description.isEmpty();
2930  }
2931
2932  /**
2933   * @param value {@link #description} (A free text natural language description
2934   *              of the research element definition from a consumer's
2935   *              perspective.). This is the underlying object with id, value and
2936   *              extensions. The accessor "getDescription" gives direct access to
2937   *              the value
2938   */
2939  public ResearchElementDefinition setDescriptionElement(MarkdownType value) {
2940    this.description = value;
2941    return this;
2942  }
2943
2944  /**
2945   * @return A free text natural language description of the research element
2946   *         definition from a consumer's perspective.
2947   */
2948  public String getDescription() {
2949    return this.description == null ? null : this.description.getValue();
2950  }
2951
2952  /**
2953   * @param value A free text natural language description of the research element
2954   *              definition from a consumer's perspective.
2955   */
2956  public ResearchElementDefinition setDescription(String value) {
2957    if (value == null)
2958      this.description = null;
2959    else {
2960      if (this.description == null)
2961        this.description = new MarkdownType();
2962      this.description.setValue(value);
2963    }
2964    return this;
2965  }
2966
2967  /**
2968   * @return {@link #comment} (A human-readable string to clarify or explain
2969   *         concepts about the resource.)
2970   */
2971  public List<StringType> getComment() {
2972    if (this.comment == null)
2973      this.comment = new ArrayList<StringType>();
2974    return this.comment;
2975  }
2976
2977  /**
2978   * @return Returns a reference to <code>this</code> for easy method chaining
2979   */
2980  public ResearchElementDefinition setComment(List<StringType> theComment) {
2981    this.comment = theComment;
2982    return this;
2983  }
2984
2985  public boolean hasComment() {
2986    if (this.comment == null)
2987      return false;
2988    for (StringType item : this.comment)
2989      if (!item.isEmpty())
2990        return true;
2991    return false;
2992  }
2993
2994  /**
2995   * @return {@link #comment} (A human-readable string to clarify or explain
2996   *         concepts about the resource.)
2997   */
2998  public StringType addCommentElement() {// 2
2999    StringType t = new StringType();
3000    if (this.comment == null)
3001      this.comment = new ArrayList<StringType>();
3002    this.comment.add(t);
3003    return t;
3004  }
3005
3006  /**
3007   * @param value {@link #comment} (A human-readable string to clarify or explain
3008   *              concepts about the resource.)
3009   */
3010  public ResearchElementDefinition addComment(String value) { // 1
3011    StringType t = new StringType();
3012    t.setValue(value);
3013    if (this.comment == null)
3014      this.comment = new ArrayList<StringType>();
3015    this.comment.add(t);
3016    return this;
3017  }
3018
3019  /**
3020   * @param value {@link #comment} (A human-readable string to clarify or explain
3021   *              concepts about the resource.)
3022   */
3023  public boolean hasComment(String value) {
3024    if (this.comment == null)
3025      return false;
3026    for (StringType v : this.comment)
3027      if (v.getValue().equals(value)) // string
3028        return true;
3029    return false;
3030  }
3031
3032  /**
3033   * @return {@link #useContext} (The content was developed with a focus and
3034   *         intent of supporting the contexts that are listed. These contexts may
3035   *         be general categories (gender, age, ...) or may be references to
3036   *         specific programs (insurance plans, studies, ...) and may be used to
3037   *         assist with indexing and searching for appropriate research element
3038   *         definition instances.)
3039   */
3040  public List<UsageContext> getUseContext() {
3041    if (this.useContext == null)
3042      this.useContext = new ArrayList<UsageContext>();
3043    return this.useContext;
3044  }
3045
3046  /**
3047   * @return Returns a reference to <code>this</code> for easy method chaining
3048   */
3049  public ResearchElementDefinition setUseContext(List<UsageContext> theUseContext) {
3050    this.useContext = theUseContext;
3051    return this;
3052  }
3053
3054  public boolean hasUseContext() {
3055    if (this.useContext == null)
3056      return false;
3057    for (UsageContext item : this.useContext)
3058      if (!item.isEmpty())
3059        return true;
3060    return false;
3061  }
3062
3063  public UsageContext addUseContext() { // 3
3064    UsageContext t = new UsageContext();
3065    if (this.useContext == null)
3066      this.useContext = new ArrayList<UsageContext>();
3067    this.useContext.add(t);
3068    return t;
3069  }
3070
3071  public ResearchElementDefinition addUseContext(UsageContext t) { // 3
3072    if (t == null)
3073      return this;
3074    if (this.useContext == null)
3075      this.useContext = new ArrayList<UsageContext>();
3076    this.useContext.add(t);
3077    return this;
3078  }
3079
3080  /**
3081   * @return The first repetition of repeating field {@link #useContext}, creating
3082   *         it if it does not already exist
3083   */
3084  public UsageContext getUseContextFirstRep() {
3085    if (getUseContext().isEmpty()) {
3086      addUseContext();
3087    }
3088    return getUseContext().get(0);
3089  }
3090
3091  /**
3092   * @return {@link #jurisdiction} (A legal or geographic region in which the
3093   *         research element definition is intended to be used.)
3094   */
3095  public List<CodeableConcept> getJurisdiction() {
3096    if (this.jurisdiction == null)
3097      this.jurisdiction = new ArrayList<CodeableConcept>();
3098    return this.jurisdiction;
3099  }
3100
3101  /**
3102   * @return Returns a reference to <code>this</code> for easy method chaining
3103   */
3104  public ResearchElementDefinition setJurisdiction(List<CodeableConcept> theJurisdiction) {
3105    this.jurisdiction = theJurisdiction;
3106    return this;
3107  }
3108
3109  public boolean hasJurisdiction() {
3110    if (this.jurisdiction == null)
3111      return false;
3112    for (CodeableConcept item : this.jurisdiction)
3113      if (!item.isEmpty())
3114        return true;
3115    return false;
3116  }
3117
3118  public CodeableConcept addJurisdiction() { // 3
3119    CodeableConcept t = new CodeableConcept();
3120    if (this.jurisdiction == null)
3121      this.jurisdiction = new ArrayList<CodeableConcept>();
3122    this.jurisdiction.add(t);
3123    return t;
3124  }
3125
3126  public ResearchElementDefinition addJurisdiction(CodeableConcept t) { // 3
3127    if (t == null)
3128      return this;
3129    if (this.jurisdiction == null)
3130      this.jurisdiction = new ArrayList<CodeableConcept>();
3131    this.jurisdiction.add(t);
3132    return this;
3133  }
3134
3135  /**
3136   * @return The first repetition of repeating field {@link #jurisdiction},
3137   *         creating it if it does not already exist
3138   */
3139  public CodeableConcept getJurisdictionFirstRep() {
3140    if (getJurisdiction().isEmpty()) {
3141      addJurisdiction();
3142    }
3143    return getJurisdiction().get(0);
3144  }
3145
3146  /**
3147   * @return {@link #purpose} (Explanation of why this research element definition
3148   *         is needed and why it has been designed as it has.). This is the
3149   *         underlying object with id, value and extensions. The accessor
3150   *         "getPurpose" gives direct access to the value
3151   */
3152  public MarkdownType getPurposeElement() {
3153    if (this.purpose == null)
3154      if (Configuration.errorOnAutoCreate())
3155        throw new Error("Attempt to auto-create ResearchElementDefinition.purpose");
3156      else if (Configuration.doAutoCreate())
3157        this.purpose = new MarkdownType(); // bb
3158    return this.purpose;
3159  }
3160
3161  public boolean hasPurposeElement() {
3162    return this.purpose != null && !this.purpose.isEmpty();
3163  }
3164
3165  public boolean hasPurpose() {
3166    return this.purpose != null && !this.purpose.isEmpty();
3167  }
3168
3169  /**
3170   * @param value {@link #purpose} (Explanation of why this research element
3171   *              definition is needed and why it has been designed as it has.).
3172   *              This is the underlying object with id, value and extensions. The
3173   *              accessor "getPurpose" gives direct access to the value
3174   */
3175  public ResearchElementDefinition setPurposeElement(MarkdownType value) {
3176    this.purpose = value;
3177    return this;
3178  }
3179
3180  /**
3181   * @return Explanation of why this research element definition is needed and why
3182   *         it has been designed as it has.
3183   */
3184  public String getPurpose() {
3185    return this.purpose == null ? null : this.purpose.getValue();
3186  }
3187
3188  /**
3189   * @param value Explanation of why this research element definition is needed
3190   *              and why it has been designed as it has.
3191   */
3192  public ResearchElementDefinition setPurpose(String value) {
3193    if (value == null)
3194      this.purpose = null;
3195    else {
3196      if (this.purpose == null)
3197        this.purpose = new MarkdownType();
3198      this.purpose.setValue(value);
3199    }
3200    return this;
3201  }
3202
3203  /**
3204   * @return {@link #usage} (A detailed description, from a clinical perspective,
3205   *         of how the ResearchElementDefinition is used.). This is the
3206   *         underlying object with id, value and extensions. The accessor
3207   *         "getUsage" gives direct access to the value
3208   */
3209  public StringType getUsageElement() {
3210    if (this.usage == null)
3211      if (Configuration.errorOnAutoCreate())
3212        throw new Error("Attempt to auto-create ResearchElementDefinition.usage");
3213      else if (Configuration.doAutoCreate())
3214        this.usage = new StringType(); // bb
3215    return this.usage;
3216  }
3217
3218  public boolean hasUsageElement() {
3219    return this.usage != null && !this.usage.isEmpty();
3220  }
3221
3222  public boolean hasUsage() {
3223    return this.usage != null && !this.usage.isEmpty();
3224  }
3225
3226  /**
3227   * @param value {@link #usage} (A detailed description, from a clinical
3228   *              perspective, of how the ResearchElementDefinition is used.).
3229   *              This is the underlying object with id, value and extensions. The
3230   *              accessor "getUsage" gives direct access to the value
3231   */
3232  public ResearchElementDefinition setUsageElement(StringType value) {
3233    this.usage = value;
3234    return this;
3235  }
3236
3237  /**
3238   * @return A detailed description, from a clinical perspective, of how the
3239   *         ResearchElementDefinition is used.
3240   */
3241  public String getUsage() {
3242    return this.usage == null ? null : this.usage.getValue();
3243  }
3244
3245  /**
3246   * @param value A detailed description, from a clinical perspective, of how the
3247   *              ResearchElementDefinition is used.
3248   */
3249  public ResearchElementDefinition setUsage(String value) {
3250    if (Utilities.noString(value))
3251      this.usage = null;
3252    else {
3253      if (this.usage == null)
3254        this.usage = new StringType();
3255      this.usage.setValue(value);
3256    }
3257    return this;
3258  }
3259
3260  /**
3261   * @return {@link #copyright} (A copyright statement relating to the research
3262   *         element definition and/or its contents. Copyright statements are
3263   *         generally legal restrictions on the use and publishing of the
3264   *         research element definition.). This is the underlying object with id,
3265   *         value and extensions. The accessor "getCopyright" gives direct access
3266   *         to the value
3267   */
3268  public MarkdownType getCopyrightElement() {
3269    if (this.copyright == null)
3270      if (Configuration.errorOnAutoCreate())
3271        throw new Error("Attempt to auto-create ResearchElementDefinition.copyright");
3272      else if (Configuration.doAutoCreate())
3273        this.copyright = new MarkdownType(); // bb
3274    return this.copyright;
3275  }
3276
3277  public boolean hasCopyrightElement() {
3278    return this.copyright != null && !this.copyright.isEmpty();
3279  }
3280
3281  public boolean hasCopyright() {
3282    return this.copyright != null && !this.copyright.isEmpty();
3283  }
3284
3285  /**
3286   * @param value {@link #copyright} (A copyright statement relating to the
3287   *              research element definition and/or its contents. Copyright
3288   *              statements are generally legal restrictions on the use and
3289   *              publishing of the research element definition.). This is the
3290   *              underlying object with id, value and extensions. The accessor
3291   *              "getCopyright" gives direct access to the value
3292   */
3293  public ResearchElementDefinition setCopyrightElement(MarkdownType value) {
3294    this.copyright = value;
3295    return this;
3296  }
3297
3298  /**
3299   * @return A copyright statement relating to the research element definition
3300   *         and/or its contents. Copyright statements are generally legal
3301   *         restrictions on the use and publishing of the research element
3302   *         definition.
3303   */
3304  public String getCopyright() {
3305    return this.copyright == null ? null : this.copyright.getValue();
3306  }
3307
3308  /**
3309   * @param value A copyright statement relating to the research element
3310   *              definition and/or its contents. Copyright statements are
3311   *              generally legal restrictions on the use and publishing of the
3312   *              research element definition.
3313   */
3314  public ResearchElementDefinition setCopyright(String value) {
3315    if (value == null)
3316      this.copyright = null;
3317    else {
3318      if (this.copyright == null)
3319        this.copyright = new MarkdownType();
3320      this.copyright.setValue(value);
3321    }
3322    return this;
3323  }
3324
3325  /**
3326   * @return {@link #approvalDate} (The date on which the resource content was
3327   *         approved by the publisher. Approval happens once when the content is
3328   *         officially approved for usage.). This is the underlying object with
3329   *         id, value and extensions. The accessor "getApprovalDate" gives direct
3330   *         access to the value
3331   */
3332  public DateType getApprovalDateElement() {
3333    if (this.approvalDate == null)
3334      if (Configuration.errorOnAutoCreate())
3335        throw new Error("Attempt to auto-create ResearchElementDefinition.approvalDate");
3336      else if (Configuration.doAutoCreate())
3337        this.approvalDate = new DateType(); // bb
3338    return this.approvalDate;
3339  }
3340
3341  public boolean hasApprovalDateElement() {
3342    return this.approvalDate != null && !this.approvalDate.isEmpty();
3343  }
3344
3345  public boolean hasApprovalDate() {
3346    return this.approvalDate != null && !this.approvalDate.isEmpty();
3347  }
3348
3349  /**
3350   * @param value {@link #approvalDate} (The date on which the resource content
3351   *              was approved by the publisher. Approval happens once when the
3352   *              content is officially approved for usage.). This is the
3353   *              underlying object with id, value and extensions. The accessor
3354   *              "getApprovalDate" gives direct access to the value
3355   */
3356  public ResearchElementDefinition setApprovalDateElement(DateType value) {
3357    this.approvalDate = value;
3358    return this;
3359  }
3360
3361  /**
3362   * @return The date on which the resource content was approved by the publisher.
3363   *         Approval happens once when the content is officially approved for
3364   *         usage.
3365   */
3366  public Date getApprovalDate() {
3367    return this.approvalDate == null ? null : this.approvalDate.getValue();
3368  }
3369
3370  /**
3371   * @param value The date on which the resource content was approved by the
3372   *              publisher. Approval happens once when the content is officially
3373   *              approved for usage.
3374   */
3375  public ResearchElementDefinition setApprovalDate(Date value) {
3376    if (value == null)
3377      this.approvalDate = null;
3378    else {
3379      if (this.approvalDate == null)
3380        this.approvalDate = new DateType();
3381      this.approvalDate.setValue(value);
3382    }
3383    return this;
3384  }
3385
3386  /**
3387   * @return {@link #lastReviewDate} (The date on which the resource content was
3388   *         last reviewed. Review happens periodically after approval but does
3389   *         not change the original approval date.). This is the underlying
3390   *         object with id, value and extensions. The accessor
3391   *         "getLastReviewDate" gives direct access to the value
3392   */
3393  public DateType getLastReviewDateElement() {
3394    if (this.lastReviewDate == null)
3395      if (Configuration.errorOnAutoCreate())
3396        throw new Error("Attempt to auto-create ResearchElementDefinition.lastReviewDate");
3397      else if (Configuration.doAutoCreate())
3398        this.lastReviewDate = new DateType(); // bb
3399    return this.lastReviewDate;
3400  }
3401
3402  public boolean hasLastReviewDateElement() {
3403    return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
3404  }
3405
3406  public boolean hasLastReviewDate() {
3407    return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
3408  }
3409
3410  /**
3411   * @param value {@link #lastReviewDate} (The date on which the resource content
3412   *              was last reviewed. Review happens periodically after approval
3413   *              but does not change the original approval date.). This is the
3414   *              underlying object with id, value and extensions. The accessor
3415   *              "getLastReviewDate" gives direct access to the value
3416   */
3417  public ResearchElementDefinition setLastReviewDateElement(DateType value) {
3418    this.lastReviewDate = value;
3419    return this;
3420  }
3421
3422  /**
3423   * @return The date on which the resource content was last reviewed. Review
3424   *         happens periodically after approval but does not change the original
3425   *         approval date.
3426   */
3427  public Date getLastReviewDate() {
3428    return this.lastReviewDate == null ? null : this.lastReviewDate.getValue();
3429  }
3430
3431  /**
3432   * @param value The date on which the resource content was last reviewed. Review
3433   *              happens periodically after approval but does not change the
3434   *              original approval date.
3435   */
3436  public ResearchElementDefinition setLastReviewDate(Date value) {
3437    if (value == null)
3438      this.lastReviewDate = null;
3439    else {
3440      if (this.lastReviewDate == null)
3441        this.lastReviewDate = new DateType();
3442      this.lastReviewDate.setValue(value);
3443    }
3444    return this;
3445  }
3446
3447  /**
3448   * @return {@link #effectivePeriod} (The period during which the research
3449   *         element definition content was or is planned to be in active use.)
3450   */
3451  public Period getEffectivePeriod() {
3452    if (this.effectivePeriod == null)
3453      if (Configuration.errorOnAutoCreate())
3454        throw new Error("Attempt to auto-create ResearchElementDefinition.effectivePeriod");
3455      else if (Configuration.doAutoCreate())
3456        this.effectivePeriod = new Period(); // cc
3457    return this.effectivePeriod;
3458  }
3459
3460  public boolean hasEffectivePeriod() {
3461    return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
3462  }
3463
3464  /**
3465   * @param value {@link #effectivePeriod} (The period during which the research
3466   *              element definition content was or is planned to be in active
3467   *              use.)
3468   */
3469  public ResearchElementDefinition setEffectivePeriod(Period value) {
3470    this.effectivePeriod = value;
3471    return this;
3472  }
3473
3474  /**
3475   * @return {@link #topic} (Descriptive topics related to the content of the
3476   *         ResearchElementDefinition. Topics provide a high-level categorization
3477   *         grouping types of ResearchElementDefinitions that can be useful for
3478   *         filtering and searching.)
3479   */
3480  public List<CodeableConcept> getTopic() {
3481    if (this.topic == null)
3482      this.topic = new ArrayList<CodeableConcept>();
3483    return this.topic;
3484  }
3485
3486  /**
3487   * @return Returns a reference to <code>this</code> for easy method chaining
3488   */
3489  public ResearchElementDefinition setTopic(List<CodeableConcept> theTopic) {
3490    this.topic = theTopic;
3491    return this;
3492  }
3493
3494  public boolean hasTopic() {
3495    if (this.topic == null)
3496      return false;
3497    for (CodeableConcept item : this.topic)
3498      if (!item.isEmpty())
3499        return true;
3500    return false;
3501  }
3502
3503  public CodeableConcept addTopic() { // 3
3504    CodeableConcept t = new CodeableConcept();
3505    if (this.topic == null)
3506      this.topic = new ArrayList<CodeableConcept>();
3507    this.topic.add(t);
3508    return t;
3509  }
3510
3511  public ResearchElementDefinition addTopic(CodeableConcept t) { // 3
3512    if (t == null)
3513      return this;
3514    if (this.topic == null)
3515      this.topic = new ArrayList<CodeableConcept>();
3516    this.topic.add(t);
3517    return this;
3518  }
3519
3520  /**
3521   * @return The first repetition of repeating field {@link #topic}, creating it
3522   *         if it does not already exist
3523   */
3524  public CodeableConcept getTopicFirstRep() {
3525    if (getTopic().isEmpty()) {
3526      addTopic();
3527    }
3528    return getTopic().get(0);
3529  }
3530
3531  /**
3532   * @return {@link #author} (An individiual or organization primarily involved in
3533   *         the creation and maintenance of the content.)
3534   */
3535  public List<ContactDetail> getAuthor() {
3536    if (this.author == null)
3537      this.author = new ArrayList<ContactDetail>();
3538    return this.author;
3539  }
3540
3541  /**
3542   * @return Returns a reference to <code>this</code> for easy method chaining
3543   */
3544  public ResearchElementDefinition setAuthor(List<ContactDetail> theAuthor) {
3545    this.author = theAuthor;
3546    return this;
3547  }
3548
3549  public boolean hasAuthor() {
3550    if (this.author == null)
3551      return false;
3552    for (ContactDetail item : this.author)
3553      if (!item.isEmpty())
3554        return true;
3555    return false;
3556  }
3557
3558  public ContactDetail addAuthor() { // 3
3559    ContactDetail t = new ContactDetail();
3560    if (this.author == null)
3561      this.author = new ArrayList<ContactDetail>();
3562    this.author.add(t);
3563    return t;
3564  }
3565
3566  public ResearchElementDefinition addAuthor(ContactDetail t) { // 3
3567    if (t == null)
3568      return this;
3569    if (this.author == null)
3570      this.author = new ArrayList<ContactDetail>();
3571    this.author.add(t);
3572    return this;
3573  }
3574
3575  /**
3576   * @return The first repetition of repeating field {@link #author}, creating it
3577   *         if it does not already exist
3578   */
3579  public ContactDetail getAuthorFirstRep() {
3580    if (getAuthor().isEmpty()) {
3581      addAuthor();
3582    }
3583    return getAuthor().get(0);
3584  }
3585
3586  /**
3587   * @return {@link #editor} (An individual or organization primarily responsible
3588   *         for internal coherence of the content.)
3589   */
3590  public List<ContactDetail> getEditor() {
3591    if (this.editor == null)
3592      this.editor = new ArrayList<ContactDetail>();
3593    return this.editor;
3594  }
3595
3596  /**
3597   * @return Returns a reference to <code>this</code> for easy method chaining
3598   */
3599  public ResearchElementDefinition setEditor(List<ContactDetail> theEditor) {
3600    this.editor = theEditor;
3601    return this;
3602  }
3603
3604  public boolean hasEditor() {
3605    if (this.editor == null)
3606      return false;
3607    for (ContactDetail item : this.editor)
3608      if (!item.isEmpty())
3609        return true;
3610    return false;
3611  }
3612
3613  public ContactDetail addEditor() { // 3
3614    ContactDetail t = new ContactDetail();
3615    if (this.editor == null)
3616      this.editor = new ArrayList<ContactDetail>();
3617    this.editor.add(t);
3618    return t;
3619  }
3620
3621  public ResearchElementDefinition addEditor(ContactDetail t) { // 3
3622    if (t == null)
3623      return this;
3624    if (this.editor == null)
3625      this.editor = new ArrayList<ContactDetail>();
3626    this.editor.add(t);
3627    return this;
3628  }
3629
3630  /**
3631   * @return The first repetition of repeating field {@link #editor}, creating it
3632   *         if it does not already exist
3633   */
3634  public ContactDetail getEditorFirstRep() {
3635    if (getEditor().isEmpty()) {
3636      addEditor();
3637    }
3638    return getEditor().get(0);
3639  }
3640
3641  /**
3642   * @return {@link #reviewer} (An individual or organization primarily
3643   *         responsible for review of some aspect of the content.)
3644   */
3645  public List<ContactDetail> getReviewer() {
3646    if (this.reviewer == null)
3647      this.reviewer = new ArrayList<ContactDetail>();
3648    return this.reviewer;
3649  }
3650
3651  /**
3652   * @return Returns a reference to <code>this</code> for easy method chaining
3653   */
3654  public ResearchElementDefinition setReviewer(List<ContactDetail> theReviewer) {
3655    this.reviewer = theReviewer;
3656    return this;
3657  }
3658
3659  public boolean hasReviewer() {
3660    if (this.reviewer == null)
3661      return false;
3662    for (ContactDetail item : this.reviewer)
3663      if (!item.isEmpty())
3664        return true;
3665    return false;
3666  }
3667
3668  public ContactDetail addReviewer() { // 3
3669    ContactDetail t = new ContactDetail();
3670    if (this.reviewer == null)
3671      this.reviewer = new ArrayList<ContactDetail>();
3672    this.reviewer.add(t);
3673    return t;
3674  }
3675
3676  public ResearchElementDefinition addReviewer(ContactDetail t) { // 3
3677    if (t == null)
3678      return this;
3679    if (this.reviewer == null)
3680      this.reviewer = new ArrayList<ContactDetail>();
3681    this.reviewer.add(t);
3682    return this;
3683  }
3684
3685  /**
3686   * @return The first repetition of repeating field {@link #reviewer}, creating
3687   *         it if it does not already exist
3688   */
3689  public ContactDetail getReviewerFirstRep() {
3690    if (getReviewer().isEmpty()) {
3691      addReviewer();
3692    }
3693    return getReviewer().get(0);
3694  }
3695
3696  /**
3697   * @return {@link #endorser} (An individual or organization responsible for
3698   *         officially endorsing the content for use in some setting.)
3699   */
3700  public List<ContactDetail> getEndorser() {
3701    if (this.endorser == null)
3702      this.endorser = new ArrayList<ContactDetail>();
3703    return this.endorser;
3704  }
3705
3706  /**
3707   * @return Returns a reference to <code>this</code> for easy method chaining
3708   */
3709  public ResearchElementDefinition setEndorser(List<ContactDetail> theEndorser) {
3710    this.endorser = theEndorser;
3711    return this;
3712  }
3713
3714  public boolean hasEndorser() {
3715    if (this.endorser == null)
3716      return false;
3717    for (ContactDetail item : this.endorser)
3718      if (!item.isEmpty())
3719        return true;
3720    return false;
3721  }
3722
3723  public ContactDetail addEndorser() { // 3
3724    ContactDetail t = new ContactDetail();
3725    if (this.endorser == null)
3726      this.endorser = new ArrayList<ContactDetail>();
3727    this.endorser.add(t);
3728    return t;
3729  }
3730
3731  public ResearchElementDefinition addEndorser(ContactDetail t) { // 3
3732    if (t == null)
3733      return this;
3734    if (this.endorser == null)
3735      this.endorser = new ArrayList<ContactDetail>();
3736    this.endorser.add(t);
3737    return this;
3738  }
3739
3740  /**
3741   * @return The first repetition of repeating field {@link #endorser}, creating
3742   *         it if it does not already exist
3743   */
3744  public ContactDetail getEndorserFirstRep() {
3745    if (getEndorser().isEmpty()) {
3746      addEndorser();
3747    }
3748    return getEndorser().get(0);
3749  }
3750
3751  /**
3752   * @return {@link #relatedArtifact} (Related artifacts such as additional
3753   *         documentation, justification, or bibliographic references.)
3754   */
3755  public List<RelatedArtifact> getRelatedArtifact() {
3756    if (this.relatedArtifact == null)
3757      this.relatedArtifact = new ArrayList<RelatedArtifact>();
3758    return this.relatedArtifact;
3759  }
3760
3761  /**
3762   * @return Returns a reference to <code>this</code> for easy method chaining
3763   */
3764  public ResearchElementDefinition setRelatedArtifact(List<RelatedArtifact> theRelatedArtifact) {
3765    this.relatedArtifact = theRelatedArtifact;
3766    return this;
3767  }
3768
3769  public boolean hasRelatedArtifact() {
3770    if (this.relatedArtifact == null)
3771      return false;
3772    for (RelatedArtifact item : this.relatedArtifact)
3773      if (!item.isEmpty())
3774        return true;
3775    return false;
3776  }
3777
3778  public RelatedArtifact addRelatedArtifact() { // 3
3779    RelatedArtifact t = new RelatedArtifact();
3780    if (this.relatedArtifact == null)
3781      this.relatedArtifact = new ArrayList<RelatedArtifact>();
3782    this.relatedArtifact.add(t);
3783    return t;
3784  }
3785
3786  public ResearchElementDefinition addRelatedArtifact(RelatedArtifact t) { // 3
3787    if (t == null)
3788      return this;
3789    if (this.relatedArtifact == null)
3790      this.relatedArtifact = new ArrayList<RelatedArtifact>();
3791    this.relatedArtifact.add(t);
3792    return this;
3793  }
3794
3795  /**
3796   * @return The first repetition of repeating field {@link #relatedArtifact},
3797   *         creating it if it does not already exist
3798   */
3799  public RelatedArtifact getRelatedArtifactFirstRep() {
3800    if (getRelatedArtifact().isEmpty()) {
3801      addRelatedArtifact();
3802    }
3803    return getRelatedArtifact().get(0);
3804  }
3805
3806  /**
3807   * @return {@link #library} (A reference to a Library resource containing the
3808   *         formal logic used by the ResearchElementDefinition.)
3809   */
3810  public List<CanonicalType> getLibrary() {
3811    if (this.library == null)
3812      this.library = new ArrayList<CanonicalType>();
3813    return this.library;
3814  }
3815
3816  /**
3817   * @return Returns a reference to <code>this</code> for easy method chaining
3818   */
3819  public ResearchElementDefinition setLibrary(List<CanonicalType> theLibrary) {
3820    this.library = theLibrary;
3821    return this;
3822  }
3823
3824  public boolean hasLibrary() {
3825    if (this.library == null)
3826      return false;
3827    for (CanonicalType item : this.library)
3828      if (!item.isEmpty())
3829        return true;
3830    return false;
3831  }
3832
3833  /**
3834   * @return {@link #library} (A reference to a Library resource containing the
3835   *         formal logic used by the ResearchElementDefinition.)
3836   */
3837  public CanonicalType addLibraryElement() {// 2
3838    CanonicalType t = new CanonicalType();
3839    if (this.library == null)
3840      this.library = new ArrayList<CanonicalType>();
3841    this.library.add(t);
3842    return t;
3843  }
3844
3845  /**
3846   * @param value {@link #library} (A reference to a Library resource containing
3847   *              the formal logic used by the ResearchElementDefinition.)
3848   */
3849  public ResearchElementDefinition addLibrary(String value) { // 1
3850    CanonicalType t = new CanonicalType();
3851    t.setValue(value);
3852    if (this.library == null)
3853      this.library = new ArrayList<CanonicalType>();
3854    this.library.add(t);
3855    return this;
3856  }
3857
3858  /**
3859   * @param value {@link #library} (A reference to a Library resource containing
3860   *              the formal logic used by the ResearchElementDefinition.)
3861   */
3862  public boolean hasLibrary(String value) {
3863    if (this.library == null)
3864      return false;
3865    for (CanonicalType v : this.library)
3866      if (v.getValue().equals(value)) // canonical(Library)
3867        return true;
3868    return false;
3869  }
3870
3871  /**
3872   * @return {@link #type} (The type of research element, a population, an
3873   *         exposure, or an outcome.). This is the underlying object with id,
3874   *         value and extensions. The accessor "getType" gives direct access to
3875   *         the value
3876   */
3877  public Enumeration<ResearchElementType> getTypeElement() {
3878    if (this.type == null)
3879      if (Configuration.errorOnAutoCreate())
3880        throw new Error("Attempt to auto-create ResearchElementDefinition.type");
3881      else if (Configuration.doAutoCreate())
3882        this.type = new Enumeration<ResearchElementType>(new ResearchElementTypeEnumFactory()); // bb
3883    return this.type;
3884  }
3885
3886  public boolean hasTypeElement() {
3887    return this.type != null && !this.type.isEmpty();
3888  }
3889
3890  public boolean hasType() {
3891    return this.type != null && !this.type.isEmpty();
3892  }
3893
3894  /**
3895   * @param value {@link #type} (The type of research element, a population, an
3896   *              exposure, or an outcome.). This is the underlying object with
3897   *              id, value and extensions. The accessor "getType" gives direct
3898   *              access to the value
3899   */
3900  public ResearchElementDefinition setTypeElement(Enumeration<ResearchElementType> value) {
3901    this.type = value;
3902    return this;
3903  }
3904
3905  /**
3906   * @return The type of research element, a population, an exposure, or an
3907   *         outcome.
3908   */
3909  public ResearchElementType getType() {
3910    return this.type == null ? null : this.type.getValue();
3911  }
3912
3913  /**
3914   * @param value The type of research element, a population, an exposure, or an
3915   *              outcome.
3916   */
3917  public ResearchElementDefinition setType(ResearchElementType value) {
3918    if (this.type == null)
3919      this.type = new Enumeration<ResearchElementType>(new ResearchElementTypeEnumFactory());
3920    this.type.setValue(value);
3921    return this;
3922  }
3923
3924  /**
3925   * @return {@link #variableType} (The type of the outcome (e.g. Dichotomous,
3926   *         Continuous, or Descriptive).). This is the underlying object with id,
3927   *         value and extensions. The accessor "getVariableType" gives direct
3928   *         access to the value
3929   */
3930  public Enumeration<VariableType> getVariableTypeElement() {
3931    if (this.variableType == null)
3932      if (Configuration.errorOnAutoCreate())
3933        throw new Error("Attempt to auto-create ResearchElementDefinition.variableType");
3934      else if (Configuration.doAutoCreate())
3935        this.variableType = new Enumeration<VariableType>(new VariableTypeEnumFactory()); // bb
3936    return this.variableType;
3937  }
3938
3939  public boolean hasVariableTypeElement() {
3940    return this.variableType != null && !this.variableType.isEmpty();
3941  }
3942
3943  public boolean hasVariableType() {
3944    return this.variableType != null && !this.variableType.isEmpty();
3945  }
3946
3947  /**
3948   * @param value {@link #variableType} (The type of the outcome (e.g.
3949   *              Dichotomous, Continuous, or Descriptive).). This is the
3950   *              underlying object with id, value and extensions. The accessor
3951   *              "getVariableType" gives direct access to the value
3952   */
3953  public ResearchElementDefinition setVariableTypeElement(Enumeration<VariableType> value) {
3954    this.variableType = value;
3955    return this;
3956  }
3957
3958  /**
3959   * @return The type of the outcome (e.g. Dichotomous, Continuous, or
3960   *         Descriptive).
3961   */
3962  public VariableType getVariableType() {
3963    return this.variableType == null ? null : this.variableType.getValue();
3964  }
3965
3966  /**
3967   * @param value The type of the outcome (e.g. Dichotomous, Continuous, or
3968   *              Descriptive).
3969   */
3970  public ResearchElementDefinition setVariableType(VariableType value) {
3971    if (value == null)
3972      this.variableType = null;
3973    else {
3974      if (this.variableType == null)
3975        this.variableType = new Enumeration<VariableType>(new VariableTypeEnumFactory());
3976      this.variableType.setValue(value);
3977    }
3978    return this;
3979  }
3980
3981  /**
3982   * @return {@link #characteristic} (A characteristic that defines the members of
3983   *         the research element. Multiple characteristics are applied with "and"
3984   *         semantics.)
3985   */
3986  public List<ResearchElementDefinitionCharacteristicComponent> getCharacteristic() {
3987    if (this.characteristic == null)
3988      this.characteristic = new ArrayList<ResearchElementDefinitionCharacteristicComponent>();
3989    return this.characteristic;
3990  }
3991
3992  /**
3993   * @return Returns a reference to <code>this</code> for easy method chaining
3994   */
3995  public ResearchElementDefinition setCharacteristic(
3996      List<ResearchElementDefinitionCharacteristicComponent> theCharacteristic) {
3997    this.characteristic = theCharacteristic;
3998    return this;
3999  }
4000
4001  public boolean hasCharacteristic() {
4002    if (this.characteristic == null)
4003      return false;
4004    for (ResearchElementDefinitionCharacteristicComponent item : this.characteristic)
4005      if (!item.isEmpty())
4006        return true;
4007    return false;
4008  }
4009
4010  public ResearchElementDefinitionCharacteristicComponent addCharacteristic() { // 3
4011    ResearchElementDefinitionCharacteristicComponent t = new ResearchElementDefinitionCharacteristicComponent();
4012    if (this.characteristic == null)
4013      this.characteristic = new ArrayList<ResearchElementDefinitionCharacteristicComponent>();
4014    this.characteristic.add(t);
4015    return t;
4016  }
4017
4018  public ResearchElementDefinition addCharacteristic(ResearchElementDefinitionCharacteristicComponent t) { // 3
4019    if (t == null)
4020      return this;
4021    if (this.characteristic == null)
4022      this.characteristic = new ArrayList<ResearchElementDefinitionCharacteristicComponent>();
4023    this.characteristic.add(t);
4024    return this;
4025  }
4026
4027  /**
4028   * @return The first repetition of repeating field {@link #characteristic},
4029   *         creating it if it does not already exist
4030   */
4031  public ResearchElementDefinitionCharacteristicComponent getCharacteristicFirstRep() {
4032    if (getCharacteristic().isEmpty()) {
4033      addCharacteristic();
4034    }
4035    return getCharacteristic().get(0);
4036  }
4037
4038  protected void listChildren(List<Property> children) {
4039    super.listChildren(children);
4040    children.add(new Property("url", "uri",
4041        "An absolute URI that is used to identify this research element definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this research element definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the research element definition is stored on different servers.",
4042        0, 1, url));
4043    children.add(new Property("identifier", "Identifier",
4044        "A formal identifier that is used to identify this research element definition when it is represented in other formats, or referenced in a specification, model, design or an instance.",
4045        0, java.lang.Integer.MAX_VALUE, identifier));
4046    children.add(new Property("version", "string",
4047        "The identifier that is used to identify this version of the research element definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the research element definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.",
4048        0, 1, version));
4049    children.add(new Property("name", "string",
4050        "A natural language name identifying the research element definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.",
4051        0, 1, name));
4052    children.add(new Property("title", "string",
4053        "A short, descriptive, user-friendly title for the research element definition.", 0, 1, title));
4054    children.add(new Property("shortTitle", "string",
4055        "The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.",
4056        0, 1, shortTitle));
4057    children.add(new Property("subtitle", "string",
4058        "An explanatory or alternate title for the ResearchElementDefinition giving additional information about its content.",
4059        0, 1, subtitle));
4060    children.add(new Property("status", "code",
4061        "The status of this research element definition. Enables tracking the life-cycle of the content.", 0, 1,
4062        status));
4063    children.add(new Property("experimental", "boolean",
4064        "A Boolean value to indicate that this research element definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.",
4065        0, 1, experimental));
4066    children.add(new Property("subject[x]", "CodeableConcept|Reference(Group)",
4067        "The intended subjects for the ResearchElementDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchElementDefinition can be anything.",
4068        0, 1, subject));
4069    children.add(new Property("date", "dateTime",
4070        "The date  (and optionally time) when the research element definition was published. 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 research element definition changes.",
4071        0, 1, date));
4072    children.add(new Property("publisher", "string",
4073        "The name of the organization or individual that published the research element definition.", 0, 1, publisher));
4074    children.add(new Property("contact", "ContactDetail",
4075        "Contact details to assist a user in finding and communicating with the publisher.", 0,
4076        java.lang.Integer.MAX_VALUE, contact));
4077    children.add(new Property("description", "markdown",
4078        "A free text natural language description of the research element definition from a consumer's perspective.", 0,
4079        1, description));
4080    children.add(
4081        new Property("comment", "string", "A human-readable string to clarify or explain concepts about the resource.",
4082            0, java.lang.Integer.MAX_VALUE, comment));
4083    children.add(new Property("useContext", "UsageContext",
4084        "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate research element definition instances.",
4085        0, java.lang.Integer.MAX_VALUE, useContext));
4086    children.add(new Property("jurisdiction", "CodeableConcept",
4087        "A legal or geographic region in which the research element definition is intended to be used.", 0,
4088        java.lang.Integer.MAX_VALUE, jurisdiction));
4089    children.add(new Property("purpose", "markdown",
4090        "Explanation of why this research element definition is needed and why it has been designed as it has.", 0, 1,
4091        purpose));
4092    children.add(new Property("usage", "string",
4093        "A detailed description, from a clinical perspective, of how the ResearchElementDefinition is used.", 0, 1,
4094        usage));
4095    children.add(new Property("copyright", "markdown",
4096        "A copyright statement relating to the research element definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research element definition.",
4097        0, 1, copyright));
4098    children.add(new Property("approvalDate", "date",
4099        "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.",
4100        0, 1, approvalDate));
4101    children.add(new Property("lastReviewDate", "date",
4102        "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.",
4103        0, 1, lastReviewDate));
4104    children.add(new Property("effectivePeriod", "Period",
4105        "The period during which the research element definition content was or is planned to be in active use.", 0, 1,
4106        effectivePeriod));
4107    children.add(new Property("topic", "CodeableConcept",
4108        "Descriptive topics related to the content of the ResearchElementDefinition. Topics provide a high-level categorization grouping types of ResearchElementDefinitions that can be useful for filtering and searching.",
4109        0, java.lang.Integer.MAX_VALUE, topic));
4110    children.add(new Property("author", "ContactDetail",
4111        "An individiual or organization primarily involved in the creation and maintenance of the content.", 0,
4112        java.lang.Integer.MAX_VALUE, author));
4113    children.add(new Property("editor", "ContactDetail",
4114        "An individual or organization primarily responsible for internal coherence of the content.", 0,
4115        java.lang.Integer.MAX_VALUE, editor));
4116    children.add(new Property("reviewer", "ContactDetail",
4117        "An individual or organization primarily responsible for review of some aspect of the content.", 0,
4118        java.lang.Integer.MAX_VALUE, reviewer));
4119    children.add(new Property("endorser", "ContactDetail",
4120        "An individual or organization responsible for officially endorsing the content for use in some setting.", 0,
4121        java.lang.Integer.MAX_VALUE, endorser));
4122    children.add(new Property("relatedArtifact", "RelatedArtifact",
4123        "Related artifacts such as additional documentation, justification, or bibliographic references.", 0,
4124        java.lang.Integer.MAX_VALUE, relatedArtifact));
4125    children.add(new Property("library", "canonical(Library)",
4126        "A reference to a Library resource containing the formal logic used by the ResearchElementDefinition.", 0,
4127        java.lang.Integer.MAX_VALUE, library));
4128    children.add(new Property("type", "code", "The type of research element, a population, an exposure, or an outcome.",
4129        0, 1, type));
4130    children.add(new Property("variableType", "code",
4131        "The type of the outcome (e.g. Dichotomous, Continuous, or Descriptive).", 0, 1, variableType));
4132    children.add(new Property("characteristic", "",
4133        "A characteristic that defines the members of the research element. Multiple characteristics are applied with \"and\" semantics.",
4134        0, java.lang.Integer.MAX_VALUE, characteristic));
4135  }
4136
4137  @Override
4138  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4139    switch (_hash) {
4140    case 116079:
4141      /* url */ return new Property("url", "uri",
4142          "An absolute URI that is used to identify this research element definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this research element definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the research element definition is stored on different servers.",
4143          0, 1, url);
4144    case -1618432855:
4145      /* identifier */ return new Property("identifier", "Identifier",
4146          "A formal identifier that is used to identify this research element definition when it is represented in other formats, or referenced in a specification, model, design or an instance.",
4147          0, java.lang.Integer.MAX_VALUE, identifier);
4148    case 351608024:
4149      /* version */ return new Property("version", "string",
4150          "The identifier that is used to identify this version of the research element definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the research element definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.",
4151          0, 1, version);
4152    case 3373707:
4153      /* name */ return new Property("name", "string",
4154          "A natural language name identifying the research element definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.",
4155          0, 1, name);
4156    case 110371416:
4157      /* title */ return new Property("title", "string",
4158          "A short, descriptive, user-friendly title for the research element definition.", 0, 1, title);
4159    case 1555503932:
4160      /* shortTitle */ return new Property("shortTitle", "string",
4161          "The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.",
4162          0, 1, shortTitle);
4163    case -2060497896:
4164      /* subtitle */ return new Property("subtitle", "string",
4165          "An explanatory or alternate title for the ResearchElementDefinition giving additional information about its content.",
4166          0, 1, subtitle);
4167    case -892481550:
4168      /* status */ return new Property("status", "code",
4169          "The status of this research element definition. Enables tracking the life-cycle of the content.", 0, 1,
4170          status);
4171    case -404562712:
4172      /* experimental */ return new Property("experimental", "boolean",
4173          "A Boolean value to indicate that this research element definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.",
4174          0, 1, experimental);
4175    case -573640748:
4176      /* subject[x] */ return new Property("subject[x]", "CodeableConcept|Reference(Group)",
4177          "The intended subjects for the ResearchElementDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchElementDefinition can be anything.",
4178          0, 1, subject);
4179    case -1867885268:
4180      /* subject */ return new Property("subject[x]", "CodeableConcept|Reference(Group)",
4181          "The intended subjects for the ResearchElementDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchElementDefinition can be anything.",
4182          0, 1, subject);
4183    case -1257122603:
4184      /* subjectCodeableConcept */ return new Property("subject[x]", "CodeableConcept|Reference(Group)",
4185          "The intended subjects for the ResearchElementDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchElementDefinition can be anything.",
4186          0, 1, subject);
4187    case 772938623:
4188      /* subjectReference */ return new Property("subject[x]", "CodeableConcept|Reference(Group)",
4189          "The intended subjects for the ResearchElementDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchElementDefinition can be anything.",
4190          0, 1, subject);
4191    case 3076014:
4192      /* date */ return new Property("date", "dateTime",
4193          "The date  (and optionally time) when the research element definition was published. 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 research element definition changes.",
4194          0, 1, date);
4195    case 1447404028:
4196      /* publisher */ return new Property("publisher", "string",
4197          "The name of the organization or individual that published the research element definition.", 0, 1,
4198          publisher);
4199    case 951526432:
4200      /* contact */ return new Property("contact", "ContactDetail",
4201          "Contact details to assist a user in finding and communicating with the publisher.", 0,
4202          java.lang.Integer.MAX_VALUE, contact);
4203    case -1724546052:
4204      /* description */ return new Property("description", "markdown",
4205          "A free text natural language description of the research element definition from a consumer's perspective.",
4206          0, 1, description);
4207    case 950398559:
4208      /* comment */ return new Property("comment", "string",
4209          "A human-readable string to clarify or explain concepts about the resource.", 0, java.lang.Integer.MAX_VALUE,
4210          comment);
4211    case -669707736:
4212      /* useContext */ return new Property("useContext", "UsageContext",
4213          "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate research element definition instances.",
4214          0, java.lang.Integer.MAX_VALUE, useContext);
4215    case -507075711:
4216      /* jurisdiction */ return new Property("jurisdiction", "CodeableConcept",
4217          "A legal or geographic region in which the research element definition is intended to be used.", 0,
4218          java.lang.Integer.MAX_VALUE, jurisdiction);
4219    case -220463842:
4220      /* purpose */ return new Property("purpose", "markdown",
4221          "Explanation of why this research element definition is needed and why it has been designed as it has.", 0, 1,
4222          purpose);
4223    case 111574433:
4224      /* usage */ return new Property("usage", "string",
4225          "A detailed description, from a clinical perspective, of how the ResearchElementDefinition is used.", 0, 1,
4226          usage);
4227    case 1522889671:
4228      /* copyright */ return new Property("copyright", "markdown",
4229          "A copyright statement relating to the research element definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research element definition.",
4230          0, 1, copyright);
4231    case 223539345:
4232      /* approvalDate */ return new Property("approvalDate", "date",
4233          "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.",
4234          0, 1, approvalDate);
4235    case -1687512484:
4236      /* lastReviewDate */ return new Property("lastReviewDate", "date",
4237          "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.",
4238          0, 1, lastReviewDate);
4239    case -403934648:
4240      /* effectivePeriod */ return new Property("effectivePeriod", "Period",
4241          "The period during which the research element definition content was or is planned to be in active use.", 0,
4242          1, effectivePeriod);
4243    case 110546223:
4244      /* topic */ return new Property("topic", "CodeableConcept",
4245          "Descriptive topics related to the content of the ResearchElementDefinition. Topics provide a high-level categorization grouping types of ResearchElementDefinitions that can be useful for filtering and searching.",
4246          0, java.lang.Integer.MAX_VALUE, topic);
4247    case -1406328437:
4248      /* author */ return new Property("author", "ContactDetail",
4249          "An individiual or organization primarily involved in the creation and maintenance of the content.", 0,
4250          java.lang.Integer.MAX_VALUE, author);
4251    case -1307827859:
4252      /* editor */ return new Property("editor", "ContactDetail",
4253          "An individual or organization primarily responsible for internal coherence of the content.", 0,
4254          java.lang.Integer.MAX_VALUE, editor);
4255    case -261190139:
4256      /* reviewer */ return new Property("reviewer", "ContactDetail",
4257          "An individual or organization primarily responsible for review of some aspect of the content.", 0,
4258          java.lang.Integer.MAX_VALUE, reviewer);
4259    case 1740277666:
4260      /* endorser */ return new Property("endorser", "ContactDetail",
4261          "An individual or organization responsible for officially endorsing the content for use in some setting.", 0,
4262          java.lang.Integer.MAX_VALUE, endorser);
4263    case 666807069:
4264      /* relatedArtifact */ return new Property("relatedArtifact", "RelatedArtifact",
4265          "Related artifacts such as additional documentation, justification, or bibliographic references.", 0,
4266          java.lang.Integer.MAX_VALUE, relatedArtifact);
4267    case 166208699:
4268      /* library */ return new Property("library", "canonical(Library)",
4269          "A reference to a Library resource containing the formal logic used by the ResearchElementDefinition.", 0,
4270          java.lang.Integer.MAX_VALUE, library);
4271    case 3575610:
4272      /* type */ return new Property("type", "code",
4273          "The type of research element, a population, an exposure, or an outcome.", 0, 1, type);
4274    case -372820010:
4275      /* variableType */ return new Property("variableType", "code",
4276          "The type of the outcome (e.g. Dichotomous, Continuous, or Descriptive).", 0, 1, variableType);
4277    case 366313883:
4278      /* characteristic */ return new Property("characteristic", "",
4279          "A characteristic that defines the members of the research element. Multiple characteristics are applied with \"and\" semantics.",
4280          0, java.lang.Integer.MAX_VALUE, characteristic);
4281    default:
4282      return super.getNamedProperty(_hash, _name, _checkValid);
4283    }
4284
4285  }
4286
4287  @Override
4288  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4289    switch (hash) {
4290    case 116079:
4291      /* url */ return this.url == null ? new Base[0] : new Base[] { this.url }; // UriType
4292    case -1618432855:
4293      /* identifier */ return this.identifier == null ? new Base[0]
4294          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
4295    case 351608024:
4296      /* version */ return this.version == null ? new Base[0] : new Base[] { this.version }; // StringType
4297    case 3373707:
4298      /* name */ return this.name == null ? new Base[0] : new Base[] { this.name }; // StringType
4299    case 110371416:
4300      /* title */ return this.title == null ? new Base[0] : new Base[] { this.title }; // StringType
4301    case 1555503932:
4302      /* shortTitle */ return this.shortTitle == null ? new Base[0] : new Base[] { this.shortTitle }; // StringType
4303    case -2060497896:
4304      /* subtitle */ return this.subtitle == null ? new Base[0] : new Base[] { this.subtitle }; // StringType
4305    case -892481550:
4306      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<PublicationStatus>
4307    case -404562712:
4308      /* experimental */ return this.experimental == null ? new Base[0] : new Base[] { this.experimental }; // BooleanType
4309    case -1867885268:
4310      /* subject */ return this.subject == null ? new Base[0] : new Base[] { this.subject }; // Type
4311    case 3076014:
4312      /* date */ return this.date == null ? new Base[0] : new Base[] { this.date }; // DateTimeType
4313    case 1447404028:
4314      /* publisher */ return this.publisher == null ? new Base[0] : new Base[] { this.publisher }; // StringType
4315    case 951526432:
4316      /* contact */ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
4317    case -1724546052:
4318      /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // MarkdownType
4319    case 950398559:
4320      /* comment */ return this.comment == null ? new Base[0] : this.comment.toArray(new Base[this.comment.size()]); // StringType
4321    case -669707736:
4322      /* useContext */ return this.useContext == null ? new Base[0]
4323          : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
4324    case -507075711:
4325      /* jurisdiction */ return this.jurisdiction == null ? new Base[0]
4326          : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
4327    case -220463842:
4328      /* purpose */ return this.purpose == null ? new Base[0] : new Base[] { this.purpose }; // MarkdownType
4329    case 111574433:
4330      /* usage */ return this.usage == null ? new Base[0] : new Base[] { this.usage }; // StringType
4331    case 1522889671:
4332      /* copyright */ return this.copyright == null ? new Base[0] : new Base[] { this.copyright }; // MarkdownType
4333    case 223539345:
4334      /* approvalDate */ return this.approvalDate == null ? new Base[0] : new Base[] { this.approvalDate }; // DateType
4335    case -1687512484:
4336      /* lastReviewDate */ return this.lastReviewDate == null ? new Base[0] : new Base[] { this.lastReviewDate }; // DateType
4337    case -403934648:
4338      /* effectivePeriod */ return this.effectivePeriod == null ? new Base[0] : new Base[] { this.effectivePeriod }; // Period
4339    case 110546223:
4340      /* topic */ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // CodeableConcept
4341    case -1406328437:
4342      /* author */ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // ContactDetail
4343    case -1307827859:
4344      /* editor */ return this.editor == null ? new Base[0] : this.editor.toArray(new Base[this.editor.size()]); // ContactDetail
4345    case -261190139:
4346      /* reviewer */ return this.reviewer == null ? new Base[0] : this.reviewer.toArray(new Base[this.reviewer.size()]); // ContactDetail
4347    case 1740277666:
4348      /* endorser */ return this.endorser == null ? new Base[0] : this.endorser.toArray(new Base[this.endorser.size()]); // ContactDetail
4349    case 666807069:
4350      /* relatedArtifact */ return this.relatedArtifact == null ? new Base[0]
4351          : this.relatedArtifact.toArray(new Base[this.relatedArtifact.size()]); // RelatedArtifact
4352    case 166208699:
4353      /* library */ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // CanonicalType
4354    case 3575610:
4355      /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // Enumeration<ResearchElementType>
4356    case -372820010:
4357      /* variableType */ return this.variableType == null ? new Base[0] : new Base[] { this.variableType }; // Enumeration<VariableType>
4358    case 366313883:
4359      /* characteristic */ return this.characteristic == null ? new Base[0]
4360          : this.characteristic.toArray(new Base[this.characteristic.size()]); // ResearchElementDefinitionCharacteristicComponent
4361    default:
4362      return super.getProperty(hash, name, checkValid);
4363    }
4364
4365  }
4366
4367  @Override
4368  public Base setProperty(int hash, String name, Base value) throws FHIRException {
4369    switch (hash) {
4370    case 116079: // url
4371      this.url = castToUri(value); // UriType
4372      return value;
4373    case -1618432855: // identifier
4374      this.getIdentifier().add(castToIdentifier(value)); // Identifier
4375      return value;
4376    case 351608024: // version
4377      this.version = castToString(value); // StringType
4378      return value;
4379    case 3373707: // name
4380      this.name = castToString(value); // StringType
4381      return value;
4382    case 110371416: // title
4383      this.title = castToString(value); // StringType
4384      return value;
4385    case 1555503932: // shortTitle
4386      this.shortTitle = castToString(value); // StringType
4387      return value;
4388    case -2060497896: // subtitle
4389      this.subtitle = castToString(value); // StringType
4390      return value;
4391    case -892481550: // status
4392      value = new PublicationStatusEnumFactory().fromType(castToCode(value));
4393      this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4394      return value;
4395    case -404562712: // experimental
4396      this.experimental = castToBoolean(value); // BooleanType
4397      return value;
4398    case -1867885268: // subject
4399      this.subject = castToType(value); // Type
4400      return value;
4401    case 3076014: // date
4402      this.date = castToDateTime(value); // DateTimeType
4403      return value;
4404    case 1447404028: // publisher
4405      this.publisher = castToString(value); // StringType
4406      return value;
4407    case 951526432: // contact
4408      this.getContact().add(castToContactDetail(value)); // ContactDetail
4409      return value;
4410    case -1724546052: // description
4411      this.description = castToMarkdown(value); // MarkdownType
4412      return value;
4413    case 950398559: // comment
4414      this.getComment().add(castToString(value)); // StringType
4415      return value;
4416    case -669707736: // useContext
4417      this.getUseContext().add(castToUsageContext(value)); // UsageContext
4418      return value;
4419    case -507075711: // jurisdiction
4420      this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
4421      return value;
4422    case -220463842: // purpose
4423      this.purpose = castToMarkdown(value); // MarkdownType
4424      return value;
4425    case 111574433: // usage
4426      this.usage = castToString(value); // StringType
4427      return value;
4428    case 1522889671: // copyright
4429      this.copyright = castToMarkdown(value); // MarkdownType
4430      return value;
4431    case 223539345: // approvalDate
4432      this.approvalDate = castToDate(value); // DateType
4433      return value;
4434    case -1687512484: // lastReviewDate
4435      this.lastReviewDate = castToDate(value); // DateType
4436      return value;
4437    case -403934648: // effectivePeriod
4438      this.effectivePeriod = castToPeriod(value); // Period
4439      return value;
4440    case 110546223: // topic
4441      this.getTopic().add(castToCodeableConcept(value)); // CodeableConcept
4442      return value;
4443    case -1406328437: // author
4444      this.getAuthor().add(castToContactDetail(value)); // ContactDetail
4445      return value;
4446    case -1307827859: // editor
4447      this.getEditor().add(castToContactDetail(value)); // ContactDetail
4448      return value;
4449    case -261190139: // reviewer
4450      this.getReviewer().add(castToContactDetail(value)); // ContactDetail
4451      return value;
4452    case 1740277666: // endorser
4453      this.getEndorser().add(castToContactDetail(value)); // ContactDetail
4454      return value;
4455    case 666807069: // relatedArtifact
4456      this.getRelatedArtifact().add(castToRelatedArtifact(value)); // RelatedArtifact
4457      return value;
4458    case 166208699: // library
4459      this.getLibrary().add(castToCanonical(value)); // CanonicalType
4460      return value;
4461    case 3575610: // type
4462      value = new ResearchElementTypeEnumFactory().fromType(castToCode(value));
4463      this.type = (Enumeration) value; // Enumeration<ResearchElementType>
4464      return value;
4465    case -372820010: // variableType
4466      value = new VariableTypeEnumFactory().fromType(castToCode(value));
4467      this.variableType = (Enumeration) value; // Enumeration<VariableType>
4468      return value;
4469    case 366313883: // characteristic
4470      this.getCharacteristic().add((ResearchElementDefinitionCharacteristicComponent) value); // ResearchElementDefinitionCharacteristicComponent
4471      return value;
4472    default:
4473      return super.setProperty(hash, name, value);
4474    }
4475
4476  }
4477
4478  @Override
4479  public Base setProperty(String name, Base value) throws FHIRException {
4480    if (name.equals("url")) {
4481      this.url = castToUri(value); // UriType
4482    } else if (name.equals("identifier")) {
4483      this.getIdentifier().add(castToIdentifier(value));
4484    } else if (name.equals("version")) {
4485      this.version = castToString(value); // StringType
4486    } else if (name.equals("name")) {
4487      this.name = castToString(value); // StringType
4488    } else if (name.equals("title")) {
4489      this.title = castToString(value); // StringType
4490    } else if (name.equals("shortTitle")) {
4491      this.shortTitle = castToString(value); // StringType
4492    } else if (name.equals("subtitle")) {
4493      this.subtitle = castToString(value); // StringType
4494    } else if (name.equals("status")) {
4495      value = new PublicationStatusEnumFactory().fromType(castToCode(value));
4496      this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4497    } else if (name.equals("experimental")) {
4498      this.experimental = castToBoolean(value); // BooleanType
4499    } else if (name.equals("subject[x]")) {
4500      this.subject = castToType(value); // Type
4501    } else if (name.equals("date")) {
4502      this.date = castToDateTime(value); // DateTimeType
4503    } else if (name.equals("publisher")) {
4504      this.publisher = castToString(value); // StringType
4505    } else if (name.equals("contact")) {
4506      this.getContact().add(castToContactDetail(value));
4507    } else if (name.equals("description")) {
4508      this.description = castToMarkdown(value); // MarkdownType
4509    } else if (name.equals("comment")) {
4510      this.getComment().add(castToString(value));
4511    } else if (name.equals("useContext")) {
4512      this.getUseContext().add(castToUsageContext(value));
4513    } else if (name.equals("jurisdiction")) {
4514      this.getJurisdiction().add(castToCodeableConcept(value));
4515    } else if (name.equals("purpose")) {
4516      this.purpose = castToMarkdown(value); // MarkdownType
4517    } else if (name.equals("usage")) {
4518      this.usage = castToString(value); // StringType
4519    } else if (name.equals("copyright")) {
4520      this.copyright = castToMarkdown(value); // MarkdownType
4521    } else if (name.equals("approvalDate")) {
4522      this.approvalDate = castToDate(value); // DateType
4523    } else if (name.equals("lastReviewDate")) {
4524      this.lastReviewDate = castToDate(value); // DateType
4525    } else if (name.equals("effectivePeriod")) {
4526      this.effectivePeriod = castToPeriod(value); // Period
4527    } else if (name.equals("topic")) {
4528      this.getTopic().add(castToCodeableConcept(value));
4529    } else if (name.equals("author")) {
4530      this.getAuthor().add(castToContactDetail(value));
4531    } else if (name.equals("editor")) {
4532      this.getEditor().add(castToContactDetail(value));
4533    } else if (name.equals("reviewer")) {
4534      this.getReviewer().add(castToContactDetail(value));
4535    } else if (name.equals("endorser")) {
4536      this.getEndorser().add(castToContactDetail(value));
4537    } else if (name.equals("relatedArtifact")) {
4538      this.getRelatedArtifact().add(castToRelatedArtifact(value));
4539    } else if (name.equals("library")) {
4540      this.getLibrary().add(castToCanonical(value));
4541    } else if (name.equals("type")) {
4542      value = new ResearchElementTypeEnumFactory().fromType(castToCode(value));
4543      this.type = (Enumeration) value; // Enumeration<ResearchElementType>
4544    } else if (name.equals("variableType")) {
4545      value = new VariableTypeEnumFactory().fromType(castToCode(value));
4546      this.variableType = (Enumeration) value; // Enumeration<VariableType>
4547    } else if (name.equals("characteristic")) {
4548      this.getCharacteristic().add((ResearchElementDefinitionCharacteristicComponent) value);
4549    } else
4550      return super.setProperty(name, value);
4551    return value;
4552  }
4553
4554  @Override
4555  public Base makeProperty(int hash, String name) throws FHIRException {
4556    switch (hash) {
4557    case 116079:
4558      return getUrlElement();
4559    case -1618432855:
4560      return addIdentifier();
4561    case 351608024:
4562      return getVersionElement();
4563    case 3373707:
4564      return getNameElement();
4565    case 110371416:
4566      return getTitleElement();
4567    case 1555503932:
4568      return getShortTitleElement();
4569    case -2060497896:
4570      return getSubtitleElement();
4571    case -892481550:
4572      return getStatusElement();
4573    case -404562712:
4574      return getExperimentalElement();
4575    case -573640748:
4576      return getSubject();
4577    case -1867885268:
4578      return getSubject();
4579    case 3076014:
4580      return getDateElement();
4581    case 1447404028:
4582      return getPublisherElement();
4583    case 951526432:
4584      return addContact();
4585    case -1724546052:
4586      return getDescriptionElement();
4587    case 950398559:
4588      return addCommentElement();
4589    case -669707736:
4590      return addUseContext();
4591    case -507075711:
4592      return addJurisdiction();
4593    case -220463842:
4594      return getPurposeElement();
4595    case 111574433:
4596      return getUsageElement();
4597    case 1522889671:
4598      return getCopyrightElement();
4599    case 223539345:
4600      return getApprovalDateElement();
4601    case -1687512484:
4602      return getLastReviewDateElement();
4603    case -403934648:
4604      return getEffectivePeriod();
4605    case 110546223:
4606      return addTopic();
4607    case -1406328437:
4608      return addAuthor();
4609    case -1307827859:
4610      return addEditor();
4611    case -261190139:
4612      return addReviewer();
4613    case 1740277666:
4614      return addEndorser();
4615    case 666807069:
4616      return addRelatedArtifact();
4617    case 166208699:
4618      return addLibraryElement();
4619    case 3575610:
4620      return getTypeElement();
4621    case -372820010:
4622      return getVariableTypeElement();
4623    case 366313883:
4624      return addCharacteristic();
4625    default:
4626      return super.makeProperty(hash, name);
4627    }
4628
4629  }
4630
4631  @Override
4632  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4633    switch (hash) {
4634    case 116079:
4635      /* url */ return new String[] { "uri" };
4636    case -1618432855:
4637      /* identifier */ return new String[] { "Identifier" };
4638    case 351608024:
4639      /* version */ return new String[] { "string" };
4640    case 3373707:
4641      /* name */ return new String[] { "string" };
4642    case 110371416:
4643      /* title */ return new String[] { "string" };
4644    case 1555503932:
4645      /* shortTitle */ return new String[] { "string" };
4646    case -2060497896:
4647      /* subtitle */ return new String[] { "string" };
4648    case -892481550:
4649      /* status */ return new String[] { "code" };
4650    case -404562712:
4651      /* experimental */ return new String[] { "boolean" };
4652    case -1867885268:
4653      /* subject */ return new String[] { "CodeableConcept", "Reference" };
4654    case 3076014:
4655      /* date */ return new String[] { "dateTime" };
4656    case 1447404028:
4657      /* publisher */ return new String[] { "string" };
4658    case 951526432:
4659      /* contact */ return new String[] { "ContactDetail" };
4660    case -1724546052:
4661      /* description */ return new String[] { "markdown" };
4662    case 950398559:
4663      /* comment */ return new String[] { "string" };
4664    case -669707736:
4665      /* useContext */ return new String[] { "UsageContext" };
4666    case -507075711:
4667      /* jurisdiction */ return new String[] { "CodeableConcept" };
4668    case -220463842:
4669      /* purpose */ return new String[] { "markdown" };
4670    case 111574433:
4671      /* usage */ return new String[] { "string" };
4672    case 1522889671:
4673      /* copyright */ return new String[] { "markdown" };
4674    case 223539345:
4675      /* approvalDate */ return new String[] { "date" };
4676    case -1687512484:
4677      /* lastReviewDate */ return new String[] { "date" };
4678    case -403934648:
4679      /* effectivePeriod */ return new String[] { "Period" };
4680    case 110546223:
4681      /* topic */ return new String[] { "CodeableConcept" };
4682    case -1406328437:
4683      /* author */ return new String[] { "ContactDetail" };
4684    case -1307827859:
4685      /* editor */ return new String[] { "ContactDetail" };
4686    case -261190139:
4687      /* reviewer */ return new String[] { "ContactDetail" };
4688    case 1740277666:
4689      /* endorser */ return new String[] { "ContactDetail" };
4690    case 666807069:
4691      /* relatedArtifact */ return new String[] { "RelatedArtifact" };
4692    case 166208699:
4693      /* library */ return new String[] { "canonical" };
4694    case 3575610:
4695      /* type */ return new String[] { "code" };
4696    case -372820010:
4697      /* variableType */ return new String[] { "code" };
4698    case 366313883:
4699      /* characteristic */ return new String[] {};
4700    default:
4701      return super.getTypesForProperty(hash, name);
4702    }
4703
4704  }
4705
4706  @Override
4707  public Base addChild(String name) throws FHIRException {
4708    if (name.equals("url")) {
4709      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.url");
4710    } else if (name.equals("identifier")) {
4711      return addIdentifier();
4712    } else if (name.equals("version")) {
4713      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.version");
4714    } else if (name.equals("name")) {
4715      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.name");
4716    } else if (name.equals("title")) {
4717      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.title");
4718    } else if (name.equals("shortTitle")) {
4719      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.shortTitle");
4720    } else if (name.equals("subtitle")) {
4721      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.subtitle");
4722    } else if (name.equals("status")) {
4723      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.status");
4724    } else if (name.equals("experimental")) {
4725      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.experimental");
4726    } else if (name.equals("subjectCodeableConcept")) {
4727      this.subject = new CodeableConcept();
4728      return this.subject;
4729    } else if (name.equals("subjectReference")) {
4730      this.subject = new Reference();
4731      return this.subject;
4732    } else if (name.equals("date")) {
4733      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.date");
4734    } else if (name.equals("publisher")) {
4735      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.publisher");
4736    } else if (name.equals("contact")) {
4737      return addContact();
4738    } else if (name.equals("description")) {
4739      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.description");
4740    } else if (name.equals("comment")) {
4741      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.comment");
4742    } else if (name.equals("useContext")) {
4743      return addUseContext();
4744    } else if (name.equals("jurisdiction")) {
4745      return addJurisdiction();
4746    } else if (name.equals("purpose")) {
4747      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.purpose");
4748    } else if (name.equals("usage")) {
4749      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.usage");
4750    } else if (name.equals("copyright")) {
4751      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.copyright");
4752    } else if (name.equals("approvalDate")) {
4753      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.approvalDate");
4754    } else if (name.equals("lastReviewDate")) {
4755      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.lastReviewDate");
4756    } else if (name.equals("effectivePeriod")) {
4757      this.effectivePeriod = new Period();
4758      return this.effectivePeriod;
4759    } else if (name.equals("topic")) {
4760      return addTopic();
4761    } else if (name.equals("author")) {
4762      return addAuthor();
4763    } else if (name.equals("editor")) {
4764      return addEditor();
4765    } else if (name.equals("reviewer")) {
4766      return addReviewer();
4767    } else if (name.equals("endorser")) {
4768      return addEndorser();
4769    } else if (name.equals("relatedArtifact")) {
4770      return addRelatedArtifact();
4771    } else if (name.equals("library")) {
4772      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.library");
4773    } else if (name.equals("type")) {
4774      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.type");
4775    } else if (name.equals("variableType")) {
4776      throw new FHIRException("Cannot call addChild on a singleton property ResearchElementDefinition.variableType");
4777    } else if (name.equals("characteristic")) {
4778      return addCharacteristic();
4779    } else
4780      return super.addChild(name);
4781  }
4782
4783  public String fhirType() {
4784    return "ResearchElementDefinition";
4785
4786  }
4787
4788  public ResearchElementDefinition copy() {
4789    ResearchElementDefinition dst = new ResearchElementDefinition();
4790    copyValues(dst);
4791    return dst;
4792  }
4793
4794  public void copyValues(ResearchElementDefinition dst) {
4795    super.copyValues(dst);
4796    dst.url = url == null ? null : url.copy();
4797    if (identifier != null) {
4798      dst.identifier = new ArrayList<Identifier>();
4799      for (Identifier i : identifier)
4800        dst.identifier.add(i.copy());
4801    }
4802    ;
4803    dst.version = version == null ? null : version.copy();
4804    dst.name = name == null ? null : name.copy();
4805    dst.title = title == null ? null : title.copy();
4806    dst.shortTitle = shortTitle == null ? null : shortTitle.copy();
4807    dst.subtitle = subtitle == null ? null : subtitle.copy();
4808    dst.status = status == null ? null : status.copy();
4809    dst.experimental = experimental == null ? null : experimental.copy();
4810    dst.subject = subject == null ? null : subject.copy();
4811    dst.date = date == null ? null : date.copy();
4812    dst.publisher = publisher == null ? null : publisher.copy();
4813    if (contact != null) {
4814      dst.contact = new ArrayList<ContactDetail>();
4815      for (ContactDetail i : contact)
4816        dst.contact.add(i.copy());
4817    }
4818    ;
4819    dst.description = description == null ? null : description.copy();
4820    if (comment != null) {
4821      dst.comment = new ArrayList<StringType>();
4822      for (StringType i : comment)
4823        dst.comment.add(i.copy());
4824    }
4825    ;
4826    if (useContext != null) {
4827      dst.useContext = new ArrayList<UsageContext>();
4828      for (UsageContext i : useContext)
4829        dst.useContext.add(i.copy());
4830    }
4831    ;
4832    if (jurisdiction != null) {
4833      dst.jurisdiction = new ArrayList<CodeableConcept>();
4834      for (CodeableConcept i : jurisdiction)
4835        dst.jurisdiction.add(i.copy());
4836    }
4837    ;
4838    dst.purpose = purpose == null ? null : purpose.copy();
4839    dst.usage = usage == null ? null : usage.copy();
4840    dst.copyright = copyright == null ? null : copyright.copy();
4841    dst.approvalDate = approvalDate == null ? null : approvalDate.copy();
4842    dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy();
4843    dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
4844    if (topic != null) {
4845      dst.topic = new ArrayList<CodeableConcept>();
4846      for (CodeableConcept i : topic)
4847        dst.topic.add(i.copy());
4848    }
4849    ;
4850    if (author != null) {
4851      dst.author = new ArrayList<ContactDetail>();
4852      for (ContactDetail i : author)
4853        dst.author.add(i.copy());
4854    }
4855    ;
4856    if (editor != null) {
4857      dst.editor = new ArrayList<ContactDetail>();
4858      for (ContactDetail i : editor)
4859        dst.editor.add(i.copy());
4860    }
4861    ;
4862    if (reviewer != null) {
4863      dst.reviewer = new ArrayList<ContactDetail>();
4864      for (ContactDetail i : reviewer)
4865        dst.reviewer.add(i.copy());
4866    }
4867    ;
4868    if (endorser != null) {
4869      dst.endorser = new ArrayList<ContactDetail>();
4870      for (ContactDetail i : endorser)
4871        dst.endorser.add(i.copy());
4872    }
4873    ;
4874    if (relatedArtifact != null) {
4875      dst.relatedArtifact = new ArrayList<RelatedArtifact>();
4876      for (RelatedArtifact i : relatedArtifact)
4877        dst.relatedArtifact.add(i.copy());
4878    }
4879    ;
4880    if (library != null) {
4881      dst.library = new ArrayList<CanonicalType>();
4882      for (CanonicalType i : library)
4883        dst.library.add(i.copy());
4884    }
4885    ;
4886    dst.type = type == null ? null : type.copy();
4887    dst.variableType = variableType == null ? null : variableType.copy();
4888    if (characteristic != null) {
4889      dst.characteristic = new ArrayList<ResearchElementDefinitionCharacteristicComponent>();
4890      for (ResearchElementDefinitionCharacteristicComponent i : characteristic)
4891        dst.characteristic.add(i.copy());
4892    }
4893    ;
4894  }
4895
4896  protected ResearchElementDefinition typedCopy() {
4897    return copy();
4898  }
4899
4900  @Override
4901  public boolean equalsDeep(Base other_) {
4902    if (!super.equalsDeep(other_))
4903      return false;
4904    if (!(other_ instanceof ResearchElementDefinition))
4905      return false;
4906    ResearchElementDefinition o = (ResearchElementDefinition) other_;
4907    return compareDeep(identifier, o.identifier, true) && compareDeep(shortTitle, o.shortTitle, true)
4908        && compareDeep(subtitle, o.subtitle, true) && compareDeep(subject, o.subject, true)
4909        && compareDeep(comment, o.comment, true) && compareDeep(purpose, o.purpose, true)
4910        && compareDeep(usage, o.usage, true) && compareDeep(copyright, o.copyright, true)
4911        && compareDeep(approvalDate, o.approvalDate, true) && compareDeep(lastReviewDate, o.lastReviewDate, true)
4912        && compareDeep(effectivePeriod, o.effectivePeriod, true) && compareDeep(topic, o.topic, true)
4913        && compareDeep(author, o.author, true) && compareDeep(editor, o.editor, true)
4914        && compareDeep(reviewer, o.reviewer, true) && compareDeep(endorser, o.endorser, true)
4915        && compareDeep(relatedArtifact, o.relatedArtifact, true) && compareDeep(library, o.library, true)
4916        && compareDeep(type, o.type, true) && compareDeep(variableType, o.variableType, true)
4917        && compareDeep(characteristic, o.characteristic, true);
4918  }
4919
4920  @Override
4921  public boolean equalsShallow(Base other_) {
4922    if (!super.equalsShallow(other_))
4923      return false;
4924    if (!(other_ instanceof ResearchElementDefinition))
4925      return false;
4926    ResearchElementDefinition o = (ResearchElementDefinition) other_;
4927    return compareValues(shortTitle, o.shortTitle, true) && compareValues(subtitle, o.subtitle, true)
4928        && compareValues(comment, o.comment, true) && compareValues(purpose, o.purpose, true)
4929        && compareValues(usage, o.usage, true) && compareValues(copyright, o.copyright, true)
4930        && compareValues(approvalDate, o.approvalDate, true) && compareValues(lastReviewDate, o.lastReviewDate, true)
4931        && compareValues(type, o.type, true) && compareValues(variableType, o.variableType, true);
4932  }
4933
4934  public boolean isEmpty() {
4935    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, shortTitle, subtitle, subject, comment,
4936        purpose, usage, copyright, approvalDate, lastReviewDate, effectivePeriod, topic, author, editor, reviewer,
4937        endorser, relatedArtifact, library, type, variableType, characteristic);
4938  }
4939
4940  @Override
4941  public ResourceType getResourceType() {
4942    return ResourceType.ResearchElementDefinition;
4943  }
4944
4945  /**
4946   * Search parameter: <b>date</b>
4947   * <p>
4948   * Description: <b>The research element definition publication date</b><br>
4949   * Type: <b>date</b><br>
4950   * Path: <b>ResearchElementDefinition.date</b><br>
4951   * </p>
4952   */
4953  @SearchParamDefinition(name = "date", path = "ResearchElementDefinition.date", description = "The research element definition publication date", type = "date")
4954  public static final String SP_DATE = "date";
4955  /**
4956   * <b>Fluent Client</b> search parameter constant for <b>date</b>
4957   * <p>
4958   * Description: <b>The research element definition publication date</b><br>
4959   * Type: <b>date</b><br>
4960   * Path: <b>ResearchElementDefinition.date</b><br>
4961   * </p>
4962   */
4963  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
4964      SP_DATE);
4965
4966  /**
4967   * Search parameter: <b>identifier</b>
4968   * <p>
4969   * Description: <b>External identifier for the research element
4970   * definition</b><br>
4971   * Type: <b>token</b><br>
4972   * Path: <b>ResearchElementDefinition.identifier</b><br>
4973   * </p>
4974   */
4975  @SearchParamDefinition(name = "identifier", path = "ResearchElementDefinition.identifier", description = "External identifier for the research element definition", type = "token")
4976  public static final String SP_IDENTIFIER = "identifier";
4977  /**
4978   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4979   * <p>
4980   * Description: <b>External identifier for the research element
4981   * definition</b><br>
4982   * Type: <b>token</b><br>
4983   * Path: <b>ResearchElementDefinition.identifier</b><br>
4984   * </p>
4985   */
4986  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4987      SP_IDENTIFIER);
4988
4989  /**
4990   * Search parameter: <b>successor</b>
4991   * <p>
4992   * Description: <b>What resource is being referenced</b><br>
4993   * Type: <b>reference</b><br>
4994   * Path: <b>ResearchElementDefinition.relatedArtifact.resource</b><br>
4995   * </p>
4996   */
4997  @SearchParamDefinition(name = "successor", path = "ResearchElementDefinition.relatedArtifact.where(type='successor').resource", description = "What resource is being referenced", type = "reference")
4998  public static final String SP_SUCCESSOR = "successor";
4999  /**
5000   * <b>Fluent Client</b> search parameter constant for <b>successor</b>
5001   * <p>
5002   * Description: <b>What resource is being referenced</b><br>
5003   * Type: <b>reference</b><br>
5004   * Path: <b>ResearchElementDefinition.relatedArtifact.resource</b><br>
5005   * </p>
5006   */
5007  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUCCESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
5008      SP_SUCCESSOR);
5009
5010  /**
5011   * Constant for fluent queries to be used to add include statements. Specifies
5012   * the path value of "<b>ResearchElementDefinition:successor</b>".
5013   */
5014  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUCCESSOR = new ca.uhn.fhir.model.api.Include(
5015      "ResearchElementDefinition:successor").toLocked();
5016
5017  /**
5018   * Search parameter: <b>context-type-value</b>
5019   * <p>
5020   * Description: <b>A use context type and value assigned to the research element
5021   * definition</b><br>
5022   * Type: <b>composite</b><br>
5023   * Path: <b></b><br>
5024   * </p>
5025   */
5026  @SearchParamDefinition(name = "context-type-value", path = "ResearchElementDefinition.useContext", description = "A use context type and value assigned to the research element definition", type = "composite", compositeOf = {
5027      "context-type", "context" })
5028  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
5029  /**
5030   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
5031   * <p>
5032   * Description: <b>A use context type and value assigned to the research element
5033   * definition</b><br>
5034   * Type: <b>composite</b><br>
5035   * Path: <b></b><br>
5036   * </p>
5037   */
5038  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CONTEXT_TYPE_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(
5039      SP_CONTEXT_TYPE_VALUE);
5040
5041  /**
5042   * Search parameter: <b>jurisdiction</b>
5043   * <p>
5044   * Description: <b>Intended jurisdiction for the research element
5045   * definition</b><br>
5046   * Type: <b>token</b><br>
5047   * Path: <b>ResearchElementDefinition.jurisdiction</b><br>
5048   * </p>
5049   */
5050  @SearchParamDefinition(name = "jurisdiction", path = "ResearchElementDefinition.jurisdiction", description = "Intended jurisdiction for the research element definition", type = "token")
5051  public static final String SP_JURISDICTION = "jurisdiction";
5052  /**
5053   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
5054   * <p>
5055   * Description: <b>Intended jurisdiction for the research element
5056   * definition</b><br>
5057   * Type: <b>token</b><br>
5058   * Path: <b>ResearchElementDefinition.jurisdiction</b><br>
5059   * </p>
5060   */
5061  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5062      SP_JURISDICTION);
5063
5064  /**
5065   * Search parameter: <b>description</b>
5066   * <p>
5067   * Description: <b>The description of the research element definition</b><br>
5068   * Type: <b>string</b><br>
5069   * Path: <b>ResearchElementDefinition.description</b><br>
5070   * </p>
5071   */
5072  @SearchParamDefinition(name = "description", path = "ResearchElementDefinition.description", description = "The description of the research element definition", type = "string")
5073  public static final String SP_DESCRIPTION = "description";
5074  /**
5075   * <b>Fluent Client</b> search parameter constant for <b>description</b>
5076   * <p>
5077   * Description: <b>The description of the research element definition</b><br>
5078   * Type: <b>string</b><br>
5079   * Path: <b>ResearchElementDefinition.description</b><br>
5080   * </p>
5081   */
5082  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(
5083      SP_DESCRIPTION);
5084
5085  /**
5086   * Search parameter: <b>derived-from</b>
5087   * <p>
5088   * Description: <b>What resource is being referenced</b><br>
5089   * Type: <b>reference</b><br>
5090   * Path: <b>ResearchElementDefinition.relatedArtifact.resource</b><br>
5091   * </p>
5092   */
5093  @SearchParamDefinition(name = "derived-from", path = "ResearchElementDefinition.relatedArtifact.where(type='derived-from').resource", description = "What resource is being referenced", type = "reference")
5094  public static final String SP_DERIVED_FROM = "derived-from";
5095  /**
5096   * <b>Fluent Client</b> search parameter constant for <b>derived-from</b>
5097   * <p>
5098   * Description: <b>What resource is being referenced</b><br>
5099   * Type: <b>reference</b><br>
5100   * Path: <b>ResearchElementDefinition.relatedArtifact.resource</b><br>
5101   * </p>
5102   */
5103  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DERIVED_FROM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
5104      SP_DERIVED_FROM);
5105
5106  /**
5107   * Constant for fluent queries to be used to add include statements. Specifies
5108   * the path value of "<b>ResearchElementDefinition:derived-from</b>".
5109   */
5110  public static final ca.uhn.fhir.model.api.Include INCLUDE_DERIVED_FROM = new ca.uhn.fhir.model.api.Include(
5111      "ResearchElementDefinition:derived-from").toLocked();
5112
5113  /**
5114   * Search parameter: <b>context-type</b>
5115   * <p>
5116   * Description: <b>A type of use context assigned to the research element
5117   * definition</b><br>
5118   * Type: <b>token</b><br>
5119   * Path: <b>ResearchElementDefinition.useContext.code</b><br>
5120   * </p>
5121   */
5122  @SearchParamDefinition(name = "context-type", path = "ResearchElementDefinition.useContext.code", description = "A type of use context assigned to the research element definition", type = "token")
5123  public static final String SP_CONTEXT_TYPE = "context-type";
5124  /**
5125   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
5126   * <p>
5127   * Description: <b>A type of use context assigned to the research element
5128   * definition</b><br>
5129   * Type: <b>token</b><br>
5130   * Path: <b>ResearchElementDefinition.useContext.code</b><br>
5131   * </p>
5132   */
5133  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5134      SP_CONTEXT_TYPE);
5135
5136  /**
5137   * Search parameter: <b>predecessor</b>
5138   * <p>
5139   * Description: <b>What resource is being referenced</b><br>
5140   * Type: <b>reference</b><br>
5141   * Path: <b>ResearchElementDefinition.relatedArtifact.resource</b><br>
5142   * </p>
5143   */
5144  @SearchParamDefinition(name = "predecessor", path = "ResearchElementDefinition.relatedArtifact.where(type='predecessor').resource", description = "What resource is being referenced", type = "reference")
5145  public static final String SP_PREDECESSOR = "predecessor";
5146  /**
5147   * <b>Fluent Client</b> search parameter constant for <b>predecessor</b>
5148   * <p>
5149   * Description: <b>What resource is being referenced</b><br>
5150   * Type: <b>reference</b><br>
5151   * Path: <b>ResearchElementDefinition.relatedArtifact.resource</b><br>
5152   * </p>
5153   */
5154  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PREDECESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
5155      SP_PREDECESSOR);
5156
5157  /**
5158   * Constant for fluent queries to be used to add include statements. Specifies
5159   * the path value of "<b>ResearchElementDefinition:predecessor</b>".
5160   */
5161  public static final ca.uhn.fhir.model.api.Include INCLUDE_PREDECESSOR = new ca.uhn.fhir.model.api.Include(
5162      "ResearchElementDefinition:predecessor").toLocked();
5163
5164  /**
5165   * Search parameter: <b>title</b>
5166   * <p>
5167   * Description: <b>The human-friendly name of the research element
5168   * definition</b><br>
5169   * Type: <b>string</b><br>
5170   * Path: <b>ResearchElementDefinition.title</b><br>
5171   * </p>
5172   */
5173  @SearchParamDefinition(name = "title", path = "ResearchElementDefinition.title", description = "The human-friendly name of the research element definition", type = "string")
5174  public static final String SP_TITLE = "title";
5175  /**
5176   * <b>Fluent Client</b> search parameter constant for <b>title</b>
5177   * <p>
5178   * Description: <b>The human-friendly name of the research element
5179   * definition</b><br>
5180   * Type: <b>string</b><br>
5181   * Path: <b>ResearchElementDefinition.title</b><br>
5182   * </p>
5183   */
5184  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(
5185      SP_TITLE);
5186
5187  /**
5188   * Search parameter: <b>composed-of</b>
5189   * <p>
5190   * Description: <b>What resource is being referenced</b><br>
5191   * Type: <b>reference</b><br>
5192   * Path: <b>ResearchElementDefinition.relatedArtifact.resource</b><br>
5193   * </p>
5194   */
5195  @SearchParamDefinition(name = "composed-of", path = "ResearchElementDefinition.relatedArtifact.where(type='composed-of').resource", description = "What resource is being referenced", type = "reference")
5196  public static final String SP_COMPOSED_OF = "composed-of";
5197  /**
5198   * <b>Fluent Client</b> search parameter constant for <b>composed-of</b>
5199   * <p>
5200   * Description: <b>What resource is being referenced</b><br>
5201   * Type: <b>reference</b><br>
5202   * Path: <b>ResearchElementDefinition.relatedArtifact.resource</b><br>
5203   * </p>
5204   */
5205  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPOSED_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
5206      SP_COMPOSED_OF);
5207
5208  /**
5209   * Constant for fluent queries to be used to add include statements. Specifies
5210   * the path value of "<b>ResearchElementDefinition:composed-of</b>".
5211   */
5212  public static final ca.uhn.fhir.model.api.Include INCLUDE_COMPOSED_OF = new ca.uhn.fhir.model.api.Include(
5213      "ResearchElementDefinition:composed-of").toLocked();
5214
5215  /**
5216   * Search parameter: <b>version</b>
5217   * <p>
5218   * Description: <b>The business version of the research element
5219   * definition</b><br>
5220   * Type: <b>token</b><br>
5221   * Path: <b>ResearchElementDefinition.version</b><br>
5222   * </p>
5223   */
5224  @SearchParamDefinition(name = "version", path = "ResearchElementDefinition.version", description = "The business version of the research element definition", type = "token")
5225  public static final String SP_VERSION = "version";
5226  /**
5227   * <b>Fluent Client</b> search parameter constant for <b>version</b>
5228   * <p>
5229   * Description: <b>The business version of the research element
5230   * definition</b><br>
5231   * Type: <b>token</b><br>
5232   * Path: <b>ResearchElementDefinition.version</b><br>
5233   * </p>
5234   */
5235  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5236      SP_VERSION);
5237
5238  /**
5239   * Search parameter: <b>url</b>
5240   * <p>
5241   * Description: <b>The uri that identifies the research element
5242   * definition</b><br>
5243   * Type: <b>uri</b><br>
5244   * Path: <b>ResearchElementDefinition.url</b><br>
5245   * </p>
5246   */
5247  @SearchParamDefinition(name = "url", path = "ResearchElementDefinition.url", description = "The uri that identifies the research element definition", type = "uri")
5248  public static final String SP_URL = "url";
5249  /**
5250   * <b>Fluent Client</b> search parameter constant for <b>url</b>
5251   * <p>
5252   * Description: <b>The uri that identifies the research element
5253   * definition</b><br>
5254   * Type: <b>uri</b><br>
5255   * Path: <b>ResearchElementDefinition.url</b><br>
5256   * </p>
5257   */
5258  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
5259
5260  /**
5261   * Search parameter: <b>context-quantity</b>
5262   * <p>
5263   * Description: <b>A quantity- or range-valued use context assigned to the
5264   * research element definition</b><br>
5265   * Type: <b>quantity</b><br>
5266   * Path: <b>ResearchElementDefinition.useContext.valueQuantity,
5267   * ResearchElementDefinition.useContext.valueRange</b><br>
5268   * </p>
5269   */
5270  @SearchParamDefinition(name = "context-quantity", path = "(ResearchElementDefinition.useContext.value as Quantity) | (ResearchElementDefinition.useContext.value as Range)", description = "A quantity- or range-valued use context assigned to the research element definition", type = "quantity")
5271  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
5272  /**
5273   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
5274   * <p>
5275   * Description: <b>A quantity- or range-valued use context assigned to the
5276   * research element definition</b><br>
5277   * Type: <b>quantity</b><br>
5278   * Path: <b>ResearchElementDefinition.useContext.valueQuantity,
5279   * ResearchElementDefinition.useContext.valueRange</b><br>
5280   * </p>
5281   */
5282  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(
5283      SP_CONTEXT_QUANTITY);
5284
5285  /**
5286   * Search parameter: <b>effective</b>
5287   * <p>
5288   * Description: <b>The time during which the research element definition is
5289   * intended to be in use</b><br>
5290   * Type: <b>date</b><br>
5291   * Path: <b>ResearchElementDefinition.effectivePeriod</b><br>
5292   * </p>
5293   */
5294  @SearchParamDefinition(name = "effective", path = "ResearchElementDefinition.effectivePeriod", description = "The time during which the research element definition is intended to be in use", type = "date")
5295  public static final String SP_EFFECTIVE = "effective";
5296  /**
5297   * <b>Fluent Client</b> search parameter constant for <b>effective</b>
5298   * <p>
5299   * Description: <b>The time during which the research element definition is
5300   * intended to be in use</b><br>
5301   * Type: <b>date</b><br>
5302   * Path: <b>ResearchElementDefinition.effectivePeriod</b><br>
5303   * </p>
5304   */
5305  public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVE = new ca.uhn.fhir.rest.gclient.DateClientParam(
5306      SP_EFFECTIVE);
5307
5308  /**
5309   * Search parameter: <b>depends-on</b>
5310   * <p>
5311   * Description: <b>What resource is being referenced</b><br>
5312   * Type: <b>reference</b><br>
5313   * Path: <b>ResearchElementDefinition.relatedArtifact.resource,
5314   * ResearchElementDefinition.library</b><br>
5315   * </p>
5316   */
5317  @SearchParamDefinition(name = "depends-on", path = "ResearchElementDefinition.relatedArtifact.where(type='depends-on').resource | ResearchElementDefinition.library", description = "What resource is being referenced", type = "reference")
5318  public static final String SP_DEPENDS_ON = "depends-on";
5319  /**
5320   * <b>Fluent Client</b> search parameter constant for <b>depends-on</b>
5321   * <p>
5322   * Description: <b>What resource is being referenced</b><br>
5323   * Type: <b>reference</b><br>
5324   * Path: <b>ResearchElementDefinition.relatedArtifact.resource,
5325   * ResearchElementDefinition.library</b><br>
5326   * </p>
5327   */
5328  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEPENDS_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
5329      SP_DEPENDS_ON);
5330
5331  /**
5332   * Constant for fluent queries to be used to add include statements. Specifies
5333   * the path value of "<b>ResearchElementDefinition:depends-on</b>".
5334   */
5335  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEPENDS_ON = new ca.uhn.fhir.model.api.Include(
5336      "ResearchElementDefinition:depends-on").toLocked();
5337
5338  /**
5339   * Search parameter: <b>name</b>
5340   * <p>
5341   * Description: <b>Computationally friendly name of the research element
5342   * definition</b><br>
5343   * Type: <b>string</b><br>
5344   * Path: <b>ResearchElementDefinition.name</b><br>
5345   * </p>
5346   */
5347  @SearchParamDefinition(name = "name", path = "ResearchElementDefinition.name", description = "Computationally friendly name of the research element definition", type = "string")
5348  public static final String SP_NAME = "name";
5349  /**
5350   * <b>Fluent Client</b> search parameter constant for <b>name</b>
5351   * <p>
5352   * Description: <b>Computationally friendly name of the research element
5353   * definition</b><br>
5354   * Type: <b>string</b><br>
5355   * Path: <b>ResearchElementDefinition.name</b><br>
5356   * </p>
5357   */
5358  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(
5359      SP_NAME);
5360
5361  /**
5362   * Search parameter: <b>context</b>
5363   * <p>
5364   * Description: <b>A use context assigned to the research element
5365   * definition</b><br>
5366   * Type: <b>token</b><br>
5367   * Path: <b>ResearchElementDefinition.useContext.valueCodeableConcept</b><br>
5368   * </p>
5369   */
5370  @SearchParamDefinition(name = "context", path = "(ResearchElementDefinition.useContext.value as CodeableConcept)", description = "A use context assigned to the research element definition", type = "token")
5371  public static final String SP_CONTEXT = "context";
5372  /**
5373   * <b>Fluent Client</b> search parameter constant for <b>context</b>
5374   * <p>
5375   * Description: <b>A use context assigned to the research element
5376   * definition</b><br>
5377   * Type: <b>token</b><br>
5378   * Path: <b>ResearchElementDefinition.useContext.valueCodeableConcept</b><br>
5379   * </p>
5380   */
5381  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5382      SP_CONTEXT);
5383
5384  /**
5385   * Search parameter: <b>publisher</b>
5386   * <p>
5387   * Description: <b>Name of the publisher of the research element
5388   * definition</b><br>
5389   * Type: <b>string</b><br>
5390   * Path: <b>ResearchElementDefinition.publisher</b><br>
5391   * </p>
5392   */
5393  @SearchParamDefinition(name = "publisher", path = "ResearchElementDefinition.publisher", description = "Name of the publisher of the research element definition", type = "string")
5394  public static final String SP_PUBLISHER = "publisher";
5395  /**
5396   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
5397   * <p>
5398   * Description: <b>Name of the publisher of the research element
5399   * definition</b><br>
5400   * Type: <b>string</b><br>
5401   * Path: <b>ResearchElementDefinition.publisher</b><br>
5402   * </p>
5403   */
5404  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(
5405      SP_PUBLISHER);
5406
5407  /**
5408   * Search parameter: <b>topic</b>
5409   * <p>
5410   * Description: <b>Topics associated with the ResearchElementDefinition</b><br>
5411   * Type: <b>token</b><br>
5412   * Path: <b>ResearchElementDefinition.topic</b><br>
5413   * </p>
5414   */
5415  @SearchParamDefinition(name = "topic", path = "ResearchElementDefinition.topic", description = "Topics associated with the ResearchElementDefinition", type = "token")
5416  public static final String SP_TOPIC = "topic";
5417  /**
5418   * <b>Fluent Client</b> search parameter constant for <b>topic</b>
5419   * <p>
5420   * Description: <b>Topics associated with the ResearchElementDefinition</b><br>
5421   * Type: <b>token</b><br>
5422   * Path: <b>ResearchElementDefinition.topic</b><br>
5423   * </p>
5424   */
5425  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5426      SP_TOPIC);
5427
5428  /**
5429   * Search parameter: <b>context-type-quantity</b>
5430   * <p>
5431   * Description: <b>A use context type and quantity- or range-based value
5432   * assigned to the research element definition</b><br>
5433   * Type: <b>composite</b><br>
5434   * Path: <b></b><br>
5435   * </p>
5436   */
5437  @SearchParamDefinition(name = "context-type-quantity", path = "ResearchElementDefinition.useContext", description = "A use context type and quantity- or range-based value assigned to the research element definition", type = "composite", compositeOf = {
5438      "context-type", "context-quantity" })
5439  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
5440  /**
5441   * <b>Fluent Client</b> search parameter constant for
5442   * <b>context-type-quantity</b>
5443   * <p>
5444   * Description: <b>A use context type and quantity- or range-based value
5445   * assigned to the research element definition</b><br>
5446   * Type: <b>composite</b><br>
5447   * Path: <b></b><br>
5448   * </p>
5449   */
5450  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CONTEXT_TYPE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(
5451      SP_CONTEXT_TYPE_QUANTITY);
5452
5453  /**
5454   * Search parameter: <b>status</b>
5455   * <p>
5456   * Description: <b>The current status of the research element definition</b><br>
5457   * Type: <b>token</b><br>
5458   * Path: <b>ResearchElementDefinition.status</b><br>
5459   * </p>
5460   */
5461  @SearchParamDefinition(name = "status", path = "ResearchElementDefinition.status", description = "The current status of the research element definition", type = "token")
5462  public static final String SP_STATUS = "status";
5463  /**
5464   * <b>Fluent Client</b> search parameter constant for <b>status</b>
5465   * <p>
5466   * Description: <b>The current status of the research element definition</b><br>
5467   * Type: <b>token</b><br>
5468   * Path: <b>ResearchElementDefinition.status</b><br>
5469   * </p>
5470   */
5471  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
5472      SP_STATUS);
5473
5474}