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 * A ValueSet resource instance specifies a set of codes drawn from one or more
052 * code systems, intended for use in a particular context. Value sets link
053 * between [[[CodeSystem]]] definitions and their use in [coded
054 * elements](terminologies.html).
055 */
056@ResourceDef(name = "ValueSet", profile = "http://hl7.org/fhir/StructureDefinition/ValueSet")
057@ChildOrder(names = { "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher",
058    "contact", "description", "useContext", "jurisdiction", "immutable", "purpose", "copyright", "compose",
059    "expansion" })
060public class ValueSet extends MetadataResource {
061
062  public enum FilterOperator {
063    /**
064     * The specified property of the code equals the provided value.
065     */
066    EQUAL,
067    /**
068     * Includes all concept ids that have a transitive is-a relationship with the
069     * concept Id provided as the value, including the provided concept itself
070     * (include descendant codes and self).
071     */
072    ISA,
073    /**
074     * Includes all concept ids that have a transitive is-a relationship with the
075     * concept Id provided as the value, excluding the provided concept itself i.e.
076     * include descendant codes only).
077     */
078    DESCENDENTOF,
079    /**
080     * The specified property of the code does not have an is-a relationship with
081     * the provided value.
082     */
083    ISNOTA,
084    /**
085     * The specified property of the code matches the regex specified in the
086     * provided value.
087     */
088    REGEX,
089    /**
090     * The specified property of the code is in the set of codes or concepts
091     * specified in the provided value (comma separated list).
092     */
093    IN,
094    /**
095     * The specified property of the code is not in the set of codes or concepts
096     * specified in the provided value (comma separated list).
097     */
098    NOTIN,
099    /**
100     * Includes all concept ids that have a transitive is-a relationship from the
101     * concept Id provided as the value, including the provided concept itself (i.e.
102     * include ancestor codes and self).
103     */
104    GENERALIZES,
105    /**
106     * The specified property of the code has at least one value (if the specified
107     * value is true; if the specified value is false, then matches when the
108     * specified property of the code has no values).
109     */
110    EXISTS,
111    /**
112     * added to help the parsers with the generic types
113     */
114    NULL;
115
116    public static FilterOperator fromCode(String codeString) throws FHIRException {
117      if (codeString == null || "".equals(codeString))
118        return null;
119      if ("=".equals(codeString))
120        return EQUAL;
121      if ("is-a".equals(codeString))
122        return ISA;
123      if ("descendent-of".equals(codeString))
124        return DESCENDENTOF;
125      if ("is-not-a".equals(codeString))
126        return ISNOTA;
127      if ("regex".equals(codeString))
128        return REGEX;
129      if ("in".equals(codeString))
130        return IN;
131      if ("not-in".equals(codeString))
132        return NOTIN;
133      if ("generalizes".equals(codeString))
134        return GENERALIZES;
135      if ("exists".equals(codeString))
136        return EXISTS;
137      if (Configuration.isAcceptInvalidEnums())
138        return null;
139      else
140        throw new FHIRException("Unknown FilterOperator code '" + codeString + "'");
141    }
142
143    public String toCode() {
144      switch (this) {
145      case EQUAL:
146        return "=";
147      case ISA:
148        return "is-a";
149      case DESCENDENTOF:
150        return "descendent-of";
151      case ISNOTA:
152        return "is-not-a";
153      case REGEX:
154        return "regex";
155      case IN:
156        return "in";
157      case NOTIN:
158        return "not-in";
159      case GENERALIZES:
160        return "generalizes";
161      case EXISTS:
162        return "exists";
163      case NULL:
164        return null;
165      default:
166        return "?";
167      }
168    }
169
170    public String getSystem() {
171      switch (this) {
172      case EQUAL:
173        return "http://hl7.org/fhir/filter-operator";
174      case ISA:
175        return "http://hl7.org/fhir/filter-operator";
176      case DESCENDENTOF:
177        return "http://hl7.org/fhir/filter-operator";
178      case ISNOTA:
179        return "http://hl7.org/fhir/filter-operator";
180      case REGEX:
181        return "http://hl7.org/fhir/filter-operator";
182      case IN:
183        return "http://hl7.org/fhir/filter-operator";
184      case NOTIN:
185        return "http://hl7.org/fhir/filter-operator";
186      case GENERALIZES:
187        return "http://hl7.org/fhir/filter-operator";
188      case EXISTS:
189        return "http://hl7.org/fhir/filter-operator";
190      case NULL:
191        return null;
192      default:
193        return "?";
194      }
195    }
196
197    public String getDefinition() {
198      switch (this) {
199      case EQUAL:
200        return "The specified property of the code equals the provided value.";
201      case ISA:
202        return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (include descendant codes and self).";
203      case DESCENDENTOF:
204        return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself i.e. include descendant codes only).";
205      case ISNOTA:
206        return "The specified property of the code does not have an is-a relationship with the provided value.";
207      case REGEX:
208        return "The specified property of the code  matches the regex specified in the provided value.";
209      case IN:
210        return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).";
211      case NOTIN:
212        return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).";
213      case GENERALIZES:
214        return "Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (i.e. include ancestor codes and self).";
215      case EXISTS:
216        return "The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values).";
217      case NULL:
218        return null;
219      default:
220        return "?";
221      }
222    }
223
224    public String getDisplay() {
225      switch (this) {
226      case EQUAL:
227        return "Equals";
228      case ISA:
229        return "Is A (by subsumption)";
230      case DESCENDENTOF:
231        return "Descendent Of (by subsumption)";
232      case ISNOTA:
233        return "Not (Is A) (by subsumption)";
234      case REGEX:
235        return "Regular Expression";
236      case IN:
237        return "In Set";
238      case NOTIN:
239        return "Not in Set";
240      case GENERALIZES:
241        return "Generalizes (by Subsumption)";
242      case EXISTS:
243        return "Exists";
244      case NULL:
245        return null;
246      default:
247        return "?";
248      }
249    }
250  }
251
252  public static class FilterOperatorEnumFactory implements EnumFactory<FilterOperator> {
253    public FilterOperator fromCode(String codeString) throws IllegalArgumentException {
254      if (codeString == null || "".equals(codeString))
255        if (codeString == null || "".equals(codeString))
256          return null;
257      if ("=".equals(codeString))
258        return FilterOperator.EQUAL;
259      if ("is-a".equals(codeString))
260        return FilterOperator.ISA;
261      if ("descendent-of".equals(codeString))
262        return FilterOperator.DESCENDENTOF;
263      if ("is-not-a".equals(codeString))
264        return FilterOperator.ISNOTA;
265      if ("regex".equals(codeString))
266        return FilterOperator.REGEX;
267      if ("in".equals(codeString))
268        return FilterOperator.IN;
269      if ("not-in".equals(codeString))
270        return FilterOperator.NOTIN;
271      if ("generalizes".equals(codeString))
272        return FilterOperator.GENERALIZES;
273      if ("exists".equals(codeString))
274        return FilterOperator.EXISTS;
275      throw new IllegalArgumentException("Unknown FilterOperator code '" + codeString + "'");
276    }
277
278    public Enumeration<FilterOperator> fromType(PrimitiveType<?> code) throws FHIRException {
279      if (code == null)
280        return null;
281      if (code.isEmpty())
282        return new Enumeration<FilterOperator>(this, FilterOperator.NULL, code);
283      String codeString = code.asStringValue();
284      if (codeString == null || "".equals(codeString))
285        return new Enumeration<FilterOperator>(this, FilterOperator.NULL, code);
286      if ("=".equals(codeString))
287        return new Enumeration<FilterOperator>(this, FilterOperator.EQUAL, code);
288      if ("is-a".equals(codeString))
289        return new Enumeration<FilterOperator>(this, FilterOperator.ISA, code);
290      if ("descendent-of".equals(codeString))
291        return new Enumeration<FilterOperator>(this, FilterOperator.DESCENDENTOF, code);
292      if ("is-not-a".equals(codeString))
293        return new Enumeration<FilterOperator>(this, FilterOperator.ISNOTA, code);
294      if ("regex".equals(codeString))
295        return new Enumeration<FilterOperator>(this, FilterOperator.REGEX, code);
296      if ("in".equals(codeString))
297        return new Enumeration<FilterOperator>(this, FilterOperator.IN, code);
298      if ("not-in".equals(codeString))
299        return new Enumeration<FilterOperator>(this, FilterOperator.NOTIN, code);
300      if ("generalizes".equals(codeString))
301        return new Enumeration<FilterOperator>(this, FilterOperator.GENERALIZES, code);
302      if ("exists".equals(codeString))
303        return new Enumeration<FilterOperator>(this, FilterOperator.EXISTS, code);
304      throw new FHIRException("Unknown FilterOperator code '" + codeString + "'");
305    }
306
307    public String toCode(FilterOperator code) {
308      if (code == FilterOperator.EQUAL)
309        return "=";
310      if (code == FilterOperator.ISA)
311        return "is-a";
312      if (code == FilterOperator.DESCENDENTOF)
313        return "descendent-of";
314      if (code == FilterOperator.ISNOTA)
315        return "is-not-a";
316      if (code == FilterOperator.REGEX)
317        return "regex";
318      if (code == FilterOperator.IN)
319        return "in";
320      if (code == FilterOperator.NOTIN)
321        return "not-in";
322      if (code == FilterOperator.GENERALIZES)
323        return "generalizes";
324      if (code == FilterOperator.EXISTS)
325        return "exists";
326      return "?";
327    }
328
329    public String toSystem(FilterOperator code) {
330      return code.getSystem();
331    }
332  }
333
334  @Block()
335  public static class ValueSetComposeComponent extends BackboneElement implements IBaseBackboneElement {
336    /**
337     * The Locked Date is the effective date that is used to determine the version
338     * of all referenced Code Systems and Value Set Definitions included in the
339     * compose that are not already tied to a specific version.
340     */
341    @Child(name = "lockedDate", type = {
342        DateType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
343    @Description(shortDefinition = "Fixed date for references with no specified version (transitive)", formalDefinition = "The Locked Date is  the effective date that is used to determine the version of all referenced Code Systems and Value Set Definitions included in the compose that are not already tied to a specific version.")
344    protected DateType lockedDate;
345
346    /**
347     * Whether inactive codes - codes that are not approved for current use - are in
348     * the value set. If inactive = true, inactive codes are to be included in the
349     * expansion, if inactive = false, the inactive codes will not be included in
350     * the expansion. If absent, the behavior is determined by the implementation,
351     * or by the applicable $expand parameters (but generally, inactive codes would
352     * be expected to be included).
353     */
354    @Child(name = "inactive", type = {
355        BooleanType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
356    @Description(shortDefinition = "Whether inactive codes are in the value set", formalDefinition = "Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable $expand parameters (but generally, inactive codes would be expected to be included).")
357    protected BooleanType inactive;
358
359    /**
360     * Include one or more codes from a code system or other value set(s).
361     */
362    @Child(name = "include", type = {}, order = 3, min = 1, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
363    @Description(shortDefinition = "Include one or more codes from a code system or other value set(s)", formalDefinition = "Include one or more codes from a code system or other value set(s).")
364    protected List<ConceptSetComponent> include;
365
366    /**
367     * Exclude one or more codes from the value set based on code system filters
368     * and/or other value sets.
369     */
370    @Child(name = "exclude", type = {
371        ConceptSetComponent.class }, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
372    @Description(shortDefinition = "Explicitly exclude codes from a code system or other value sets", formalDefinition = "Exclude one or more codes from the value set based on code system filters and/or other value sets.")
373    protected List<ConceptSetComponent> exclude;
374
375    private static final long serialVersionUID = -765941757L;
376
377    /**
378     * Constructor
379     */
380    public ValueSetComposeComponent() {
381      super();
382    }
383
384    /**
385     * @return {@link #lockedDate} (The Locked Date is the effective date that is
386     *         used to determine the version of all referenced Code Systems and
387     *         Value Set Definitions included in the compose that are not already
388     *         tied to a specific version.). This is the underlying object with id,
389     *         value and extensions. The accessor "getLockedDate" gives direct
390     *         access to the value
391     */
392    public DateType getLockedDateElement() {
393      if (this.lockedDate == null)
394        if (Configuration.errorOnAutoCreate())
395          throw new Error("Attempt to auto-create ValueSetComposeComponent.lockedDate");
396        else if (Configuration.doAutoCreate())
397          this.lockedDate = new DateType(); // bb
398      return this.lockedDate;
399    }
400
401    public boolean hasLockedDateElement() {
402      return this.lockedDate != null && !this.lockedDate.isEmpty();
403    }
404
405    public boolean hasLockedDate() {
406      return this.lockedDate != null && !this.lockedDate.isEmpty();
407    }
408
409    /**
410     * @param value {@link #lockedDate} (The Locked Date is the effective date that
411     *              is used to determine the version of all referenced Code Systems
412     *              and Value Set Definitions included in the compose that are not
413     *              already tied to a specific version.). This is the underlying
414     *              object with id, value and extensions. The accessor
415     *              "getLockedDate" gives direct access to the value
416     */
417    public ValueSetComposeComponent setLockedDateElement(DateType value) {
418      this.lockedDate = value;
419      return this;
420    }
421
422    /**
423     * @return The Locked Date is the effective date that is used to determine the
424     *         version of all referenced Code Systems and Value Set Definitions
425     *         included in the compose that are not already tied to a specific
426     *         version.
427     */
428    public Date getLockedDate() {
429      return this.lockedDate == null ? null : this.lockedDate.getValue();
430    }
431
432    /**
433     * @param value The Locked Date is the effective date that is used to determine
434     *              the version of all referenced Code Systems and Value Set
435     *              Definitions included in the compose that are not already tied to
436     *              a specific version.
437     */
438    public ValueSetComposeComponent setLockedDate(Date value) {
439      if (value == null)
440        this.lockedDate = null;
441      else {
442        if (this.lockedDate == null)
443          this.lockedDate = new DateType();
444        this.lockedDate.setValue(value);
445      }
446      return this;
447    }
448
449    /**
450     * @return {@link #inactive} (Whether inactive codes - codes that are not
451     *         approved for current use - are in the value set. If inactive = true,
452     *         inactive codes are to be included in the expansion, if inactive =
453     *         false, the inactive codes will not be included in the expansion. If
454     *         absent, the behavior is determined by the implementation, or by the
455     *         applicable $expand parameters (but generally, inactive codes would be
456     *         expected to be included).). This is the underlying object with id,
457     *         value and extensions. The accessor "getInactive" gives direct access
458     *         to the value
459     */
460    public BooleanType getInactiveElement() {
461      if (this.inactive == null)
462        if (Configuration.errorOnAutoCreate())
463          throw new Error("Attempt to auto-create ValueSetComposeComponent.inactive");
464        else if (Configuration.doAutoCreate())
465          this.inactive = new BooleanType(); // bb
466      return this.inactive;
467    }
468
469    public boolean hasInactiveElement() {
470      return this.inactive != null && !this.inactive.isEmpty();
471    }
472
473    public boolean hasInactive() {
474      return this.inactive != null && !this.inactive.isEmpty();
475    }
476
477    /**
478     * @param value {@link #inactive} (Whether inactive codes - codes that are not
479     *              approved for current use - are in the value set. If inactive =
480     *              true, inactive codes are to be included in the expansion, if
481     *              inactive = false, the inactive codes will not be included in the
482     *              expansion. If absent, the behavior is determined by the
483     *              implementation, or by the applicable $expand parameters (but
484     *              generally, inactive codes would be expected to be included).).
485     *              This is the underlying object with id, value and extensions. The
486     *              accessor "getInactive" gives direct access to the value
487     */
488    public ValueSetComposeComponent setInactiveElement(BooleanType value) {
489      this.inactive = value;
490      return this;
491    }
492
493    /**
494     * @return Whether inactive codes - codes that are not approved for current use
495     *         - are in the value set. If inactive = true, inactive codes are to be
496     *         included in the expansion, if inactive = false, the inactive codes
497     *         will not be included in the expansion. If absent, the behavior is
498     *         determined by the implementation, or by the applicable $expand
499     *         parameters (but generally, inactive codes would be expected to be
500     *         included).
501     */
502    public boolean getInactive() {
503      return this.inactive == null || this.inactive.isEmpty() ? false : this.inactive.getValue();
504    }
505
506    /**
507     * @param value Whether inactive codes - codes that are not approved for current
508     *              use - are in the value set. If inactive = true, inactive codes
509     *              are to be included in the expansion, if inactive = false, the
510     *              inactive codes will not be included in the expansion. If absent,
511     *              the behavior is determined by the implementation, or by the
512     *              applicable $expand parameters (but generally, inactive codes
513     *              would be expected to be included).
514     */
515    public ValueSetComposeComponent setInactive(boolean value) {
516      if (this.inactive == null)
517        this.inactive = new BooleanType();
518      this.inactive.setValue(value);
519      return this;
520    }
521
522    /**
523     * @return {@link #include} (Include one or more codes from a code system or
524     *         other value set(s).)
525     */
526    public List<ConceptSetComponent> getInclude() {
527      if (this.include == null)
528        this.include = new ArrayList<ConceptSetComponent>();
529      return this.include;
530    }
531
532    /**
533     * @return Returns a reference to <code>this</code> for easy method chaining
534     */
535    public ValueSetComposeComponent setInclude(List<ConceptSetComponent> theInclude) {
536      this.include = theInclude;
537      return this;
538    }
539
540    public boolean hasInclude() {
541      if (this.include == null)
542        return false;
543      for (ConceptSetComponent item : this.include)
544        if (!item.isEmpty())
545          return true;
546      return false;
547    }
548
549    public ConceptSetComponent addInclude() { // 3
550      ConceptSetComponent t = new ConceptSetComponent();
551      if (this.include == null)
552        this.include = new ArrayList<ConceptSetComponent>();
553      this.include.add(t);
554      return t;
555    }
556
557    public ValueSetComposeComponent addInclude(ConceptSetComponent t) { // 3
558      if (t == null)
559        return this;
560      if (this.include == null)
561        this.include = new ArrayList<ConceptSetComponent>();
562      this.include.add(t);
563      return this;
564    }
565
566    /**
567     * @return The first repetition of repeating field {@link #include}, creating it
568     *         if it does not already exist
569     */
570    public ConceptSetComponent getIncludeFirstRep() {
571      if (getInclude().isEmpty()) {
572        addInclude();
573      }
574      return getInclude().get(0);
575    }
576
577    /**
578     * @return {@link #exclude} (Exclude one or more codes from the value set based
579     *         on code system filters and/or other value sets.)
580     */
581    public List<ConceptSetComponent> getExclude() {
582      if (this.exclude == null)
583        this.exclude = new ArrayList<ConceptSetComponent>();
584      return this.exclude;
585    }
586
587    /**
588     * @return Returns a reference to <code>this</code> for easy method chaining
589     */
590    public ValueSetComposeComponent setExclude(List<ConceptSetComponent> theExclude) {
591      this.exclude = theExclude;
592      return this;
593    }
594
595    public boolean hasExclude() {
596      if (this.exclude == null)
597        return false;
598      for (ConceptSetComponent item : this.exclude)
599        if (!item.isEmpty())
600          return true;
601      return false;
602    }
603
604    public ConceptSetComponent addExclude() { // 3
605      ConceptSetComponent t = new ConceptSetComponent();
606      if (this.exclude == null)
607        this.exclude = new ArrayList<ConceptSetComponent>();
608      this.exclude.add(t);
609      return t;
610    }
611
612    public ValueSetComposeComponent addExclude(ConceptSetComponent t) { // 3
613      if (t == null)
614        return this;
615      if (this.exclude == null)
616        this.exclude = new ArrayList<ConceptSetComponent>();
617      this.exclude.add(t);
618      return this;
619    }
620
621    /**
622     * @return The first repetition of repeating field {@link #exclude}, creating it
623     *         if it does not already exist
624     */
625    public ConceptSetComponent getExcludeFirstRep() {
626      if (getExclude().isEmpty()) {
627        addExclude();
628      }
629      return getExclude().get(0);
630    }
631
632    protected void listChildren(List<Property> children) {
633      super.listChildren(children);
634      children.add(new Property("lockedDate", "date",
635          "The Locked Date is  the effective date that is used to determine the version of all referenced Code Systems and Value Set Definitions included in the compose that are not already tied to a specific version.",
636          0, 1, lockedDate));
637      children.add(new Property("inactive", "boolean",
638          "Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable $expand parameters (but generally, inactive codes would be expected to be included).",
639          0, 1, inactive));
640      children.add(new Property("include", "", "Include one or more codes from a code system or other value set(s).", 0,
641          java.lang.Integer.MAX_VALUE, include));
642      children.add(new Property("exclude", "@ValueSet.compose.include",
643          "Exclude one or more codes from the value set based on code system filters and/or other value sets.", 0,
644          java.lang.Integer.MAX_VALUE, exclude));
645    }
646
647    @Override
648    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
649      switch (_hash) {
650      case 1391591896:
651        /* lockedDate */ return new Property("lockedDate", "date",
652            "The Locked Date is  the effective date that is used to determine the version of all referenced Code Systems and Value Set Definitions included in the compose that are not already tied to a specific version.",
653            0, 1, lockedDate);
654      case 24665195:
655        /* inactive */ return new Property("inactive", "boolean",
656            "Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable $expand parameters (but generally, inactive codes would be expected to be included).",
657            0, 1, inactive);
658      case 1942574248:
659        /* include */ return new Property("include", "",
660            "Include one or more codes from a code system or other value set(s).", 0, java.lang.Integer.MAX_VALUE,
661            include);
662      case -1321148966:
663        /* exclude */ return new Property("exclude", "@ValueSet.compose.include",
664            "Exclude one or more codes from the value set based on code system filters and/or other value sets.", 0,
665            java.lang.Integer.MAX_VALUE, exclude);
666      default:
667        return super.getNamedProperty(_hash, _name, _checkValid);
668      }
669
670    }
671
672    @Override
673    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
674      switch (hash) {
675      case 1391591896:
676        /* lockedDate */ return this.lockedDate == null ? new Base[0] : new Base[] { this.lockedDate }; // DateType
677      case 24665195:
678        /* inactive */ return this.inactive == null ? new Base[0] : new Base[] { this.inactive }; // BooleanType
679      case 1942574248:
680        /* include */ return this.include == null ? new Base[0] : this.include.toArray(new Base[this.include.size()]); // ConceptSetComponent
681      case -1321148966:
682        /* exclude */ return this.exclude == null ? new Base[0] : this.exclude.toArray(new Base[this.exclude.size()]); // ConceptSetComponent
683      default:
684        return super.getProperty(hash, name, checkValid);
685      }
686
687    }
688
689    @Override
690    public Base setProperty(int hash, String name, Base value) throws FHIRException {
691      switch (hash) {
692      case 1391591896: // lockedDate
693        this.lockedDate = castToDate(value); // DateType
694        return value;
695      case 24665195: // inactive
696        this.inactive = castToBoolean(value); // BooleanType
697        return value;
698      case 1942574248: // include
699        this.getInclude().add((ConceptSetComponent) value); // ConceptSetComponent
700        return value;
701      case -1321148966: // exclude
702        this.getExclude().add((ConceptSetComponent) value); // ConceptSetComponent
703        return value;
704      default:
705        return super.setProperty(hash, name, value);
706      }
707
708    }
709
710    @Override
711    public Base setProperty(String name, Base value) throws FHIRException {
712      if (name.equals("lockedDate")) {
713        this.lockedDate = castToDate(value); // DateType
714      } else if (name.equals("inactive")) {
715        this.inactive = castToBoolean(value); // BooleanType
716      } else if (name.equals("include")) {
717        this.getInclude().add((ConceptSetComponent) value);
718      } else if (name.equals("exclude")) {
719        this.getExclude().add((ConceptSetComponent) value);
720      } else
721        return super.setProperty(name, value);
722      return value;
723    }
724
725  @Override
726  public void removeChild(String name, Base value) throws FHIRException {
727      if (name.equals("lockedDate")) {
728        this.lockedDate = null;
729      } else if (name.equals("inactive")) {
730        this.inactive = null;
731      } else if (name.equals("include")) {
732        this.getInclude().remove((ConceptSetComponent) value);
733      } else if (name.equals("exclude")) {
734        this.getExclude().remove((ConceptSetComponent) value);
735      } else
736        super.removeChild(name, value);
737      
738    }
739
740    @Override
741    public Base makeProperty(int hash, String name) throws FHIRException {
742      switch (hash) {
743      case 1391591896:
744        return getLockedDateElement();
745      case 24665195:
746        return getInactiveElement();
747      case 1942574248:
748        return addInclude();
749      case -1321148966:
750        return addExclude();
751      default:
752        return super.makeProperty(hash, name);
753      }
754
755    }
756
757    @Override
758    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
759      switch (hash) {
760      case 1391591896:
761        /* lockedDate */ return new String[] { "date" };
762      case 24665195:
763        /* inactive */ return new String[] { "boolean" };
764      case 1942574248:
765        /* include */ return new String[] {};
766      case -1321148966:
767        /* exclude */ return new String[] { "@ValueSet.compose.include" };
768      default:
769        return super.getTypesForProperty(hash, name);
770      }
771
772    }
773
774    @Override
775    public Base addChild(String name) throws FHIRException {
776      if (name.equals("lockedDate")) {
777        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.lockedDate");
778      } else if (name.equals("inactive")) {
779        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.inactive");
780      } else if (name.equals("include")) {
781        return addInclude();
782      } else if (name.equals("exclude")) {
783        return addExclude();
784      } else
785        return super.addChild(name);
786    }
787
788    public ValueSetComposeComponent copy() {
789      ValueSetComposeComponent dst = new ValueSetComposeComponent();
790      copyValues(dst);
791      return dst;
792    }
793
794    public void copyValues(ValueSetComposeComponent dst) {
795      super.copyValues(dst);
796      dst.lockedDate = lockedDate == null ? null : lockedDate.copy();
797      dst.inactive = inactive == null ? null : inactive.copy();
798      if (include != null) {
799        dst.include = new ArrayList<ConceptSetComponent>();
800        for (ConceptSetComponent i : include)
801          dst.include.add(i.copy());
802      }
803      ;
804      if (exclude != null) {
805        dst.exclude = new ArrayList<ConceptSetComponent>();
806        for (ConceptSetComponent i : exclude)
807          dst.exclude.add(i.copy());
808      }
809      ;
810    }
811
812    @Override
813    public boolean equalsDeep(Base other_) {
814      if (!super.equalsDeep(other_))
815        return false;
816      if (!(other_ instanceof ValueSetComposeComponent))
817        return false;
818      ValueSetComposeComponent o = (ValueSetComposeComponent) other_;
819      return compareDeep(lockedDate, o.lockedDate, true) && compareDeep(inactive, o.inactive, true)
820          && compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true);
821    }
822
823    @Override
824    public boolean equalsShallow(Base other_) {
825      if (!super.equalsShallow(other_))
826        return false;
827      if (!(other_ instanceof ValueSetComposeComponent))
828        return false;
829      ValueSetComposeComponent o = (ValueSetComposeComponent) other_;
830      return compareValues(lockedDate, o.lockedDate, true) && compareValues(inactive, o.inactive, true);
831    }
832
833    public boolean isEmpty() {
834      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(lockedDate, inactive, include, exclude);
835    }
836
837    public String fhirType() {
838      return "ValueSet.compose";
839
840    }
841
842  }
843
844  @Block()
845  public static class ConceptSetComponent extends BackboneElement implements IBaseBackboneElement {
846    /**
847     * An absolute URI which is the code system from which the selected codes come
848     * from.
849     */
850    @Child(name = "system", type = { UriType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
851    @Description(shortDefinition = "The system the codes come from", formalDefinition = "An absolute URI which is the code system from which the selected codes come from.")
852    protected UriType system;
853
854    /**
855     * The version of the code system that the codes are selected from, or the
856     * special version '*' for all versions.
857     */
858    @Child(name = "version", type = { StringType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
859    @Description(shortDefinition = "Specific version of the code system referred to", formalDefinition = "The version of the code system that the codes are selected from, or the special version '*' for all versions.")
860    protected StringType version;
861
862    /**
863     * Specifies a concept to be included or excluded.
864     */
865    @Child(name = "concept", type = {}, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
866    @Description(shortDefinition = "A concept defined in the system", formalDefinition = "Specifies a concept to be included or excluded.")
867    protected List<ConceptReferenceComponent> concept;
868
869    /**
870     * Select concepts by specify a matching criterion based on the properties
871     * (including relationships) defined by the system, or on filters defined by the
872     * system. If multiple filters are specified, they SHALL all be true.
873     */
874    @Child(name = "filter", type = {}, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
875    @Description(shortDefinition = "Select codes/concepts by their properties (including relationships)", formalDefinition = "Select concepts by specify a matching criterion based on the properties (including relationships) defined by the system, or on filters defined by the system. If multiple filters are specified, they SHALL all be true.")
876    protected List<ConceptSetFilterComponent> filter;
877
878    /**
879     * Selects the concepts found in this value set (based on its value set
880     * definition). This is an absolute URI that is a reference to ValueSet.url. If
881     * multiple value sets are specified this includes the union of the contents of
882     * all of the referenced value sets.
883     */
884    @Child(name = "valueSet", type = {
885        CanonicalType.class }, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
886    @Description(shortDefinition = "Select the contents included in this value set", formalDefinition = "Selects the concepts found in this value set (based on its value set definition). This is an absolute URI that is a reference to ValueSet.url.  If multiple value sets are specified this includes the union of the contents of all of the referenced value sets.")
887    protected List<CanonicalType> valueSet;
888
889    private static final long serialVersionUID = 969391146L;
890
891    /**
892     * Constructor
893     */
894    public ConceptSetComponent() {
895      super();
896    }
897
898    /**
899     * @return {@link #system} (An absolute URI which is the code system from which
900     *         the selected codes come from.). This is the underlying object with
901     *         id, value and extensions. The accessor "getSystem" gives direct
902     *         access to the value
903     */
904    public UriType getSystemElement() {
905      if (this.system == null)
906        if (Configuration.errorOnAutoCreate())
907          throw new Error("Attempt to auto-create ConceptSetComponent.system");
908        else if (Configuration.doAutoCreate())
909          this.system = new UriType(); // bb
910      return this.system;
911    }
912
913    public boolean hasSystemElement() {
914      return this.system != null && !this.system.isEmpty();
915    }
916
917    public boolean hasSystem() {
918      return this.system != null && !this.system.isEmpty();
919    }
920
921    /**
922     * @param value {@link #system} (An absolute URI which is the code system from
923     *              which the selected codes come from.). This is the underlying
924     *              object with id, value and extensions. The accessor "getSystem"
925     *              gives direct access to the value
926     */
927    public ConceptSetComponent setSystemElement(UriType value) {
928      this.system = value;
929      return this;
930    }
931
932    /**
933     * @return An absolute URI which is the code system from which the selected
934     *         codes come from.
935     */
936    public String getSystem() {
937      return this.system == null ? null : this.system.getValue();
938    }
939
940    /**
941     * @param value An absolute URI which is the code system from which the selected
942     *              codes come from.
943     */
944    public ConceptSetComponent setSystem(String value) {
945      if (Utilities.noString(value))
946        this.system = null;
947      else {
948        if (this.system == null)
949          this.system = new UriType();
950        this.system.setValue(value);
951      }
952      return this;
953    }
954
955    /**
956     * @return {@link #version} (The version of the code system that the codes are
957     *         selected from, or the special version '*' for all versions.). This is
958     *         the underlying object with id, value and extensions. The accessor
959     *         "getVersion" gives direct access to the value
960     */
961    public StringType getVersionElement() {
962      if (this.version == null)
963        if (Configuration.errorOnAutoCreate())
964          throw new Error("Attempt to auto-create ConceptSetComponent.version");
965        else if (Configuration.doAutoCreate())
966          this.version = new StringType(); // bb
967      return this.version;
968    }
969
970    public boolean hasVersionElement() {
971      return this.version != null && !this.version.isEmpty();
972    }
973
974    public boolean hasVersion() {
975      return this.version != null && !this.version.isEmpty();
976    }
977
978    /**
979     * @param value {@link #version} (The version of the code system that the codes
980     *              are selected from, or the special version '*' for all
981     *              versions.). This is the underlying object with id, value and
982     *              extensions. The accessor "getVersion" gives direct access to the
983     *              value
984     */
985    public ConceptSetComponent setVersionElement(StringType value) {
986      this.version = value;
987      return this;
988    }
989
990    /**
991     * @return The version of the code system that the codes are selected from, or
992     *         the special version '*' for all versions.
993     */
994    public String getVersion() {
995      return this.version == null ? null : this.version.getValue();
996    }
997
998    /**
999     * @param value The version of the code system that the codes are selected from,
1000     *              or the special version '*' for all versions.
1001     */
1002    public ConceptSetComponent setVersion(String value) {
1003      if (Utilities.noString(value))
1004        this.version = null;
1005      else {
1006        if (this.version == null)
1007          this.version = new StringType();
1008        this.version.setValue(value);
1009      }
1010      return this;
1011    }
1012
1013    /**
1014     * @return {@link #concept} (Specifies a concept to be included or excluded.)
1015     */
1016    public List<ConceptReferenceComponent> getConcept() {
1017      if (this.concept == null)
1018        this.concept = new ArrayList<ConceptReferenceComponent>();
1019      return this.concept;
1020    }
1021
1022    /**
1023     * @return Returns a reference to <code>this</code> for easy method chaining
1024     */
1025    public ConceptSetComponent setConcept(List<ConceptReferenceComponent> theConcept) {
1026      this.concept = theConcept;
1027      return this;
1028    }
1029
1030    public boolean hasConcept() {
1031      if (this.concept == null)
1032        return false;
1033      for (ConceptReferenceComponent item : this.concept)
1034        if (!item.isEmpty())
1035          return true;
1036      return false;
1037    }
1038
1039    public ConceptReferenceComponent addConcept() { // 3
1040      ConceptReferenceComponent t = new ConceptReferenceComponent();
1041      if (this.concept == null)
1042        this.concept = new ArrayList<ConceptReferenceComponent>();
1043      this.concept.add(t);
1044      return t;
1045    }
1046
1047    public ConceptSetComponent addConcept(ConceptReferenceComponent t) { // 3
1048      if (t == null)
1049        return this;
1050      if (this.concept == null)
1051        this.concept = new ArrayList<ConceptReferenceComponent>();
1052      this.concept.add(t);
1053      return this;
1054    }
1055
1056    /**
1057     * @return The first repetition of repeating field {@link #concept}, creating it
1058     *         if it does not already exist
1059     */
1060    public ConceptReferenceComponent getConceptFirstRep() {
1061      if (getConcept().isEmpty()) {
1062        addConcept();
1063      }
1064      return getConcept().get(0);
1065    }
1066
1067    /**
1068     * @return {@link #filter} (Select concepts by specify a matching criterion
1069     *         based on the properties (including relationships) defined by the
1070     *         system, or on filters defined by the system. If multiple filters are
1071     *         specified, they SHALL all be true.)
1072     */
1073    public List<ConceptSetFilterComponent> getFilter() {
1074      if (this.filter == null)
1075        this.filter = new ArrayList<ConceptSetFilterComponent>();
1076      return this.filter;
1077    }
1078
1079    /**
1080     * @return Returns a reference to <code>this</code> for easy method chaining
1081     */
1082    public ConceptSetComponent setFilter(List<ConceptSetFilterComponent> theFilter) {
1083      this.filter = theFilter;
1084      return this;
1085    }
1086
1087    public boolean hasFilter() {
1088      if (this.filter == null)
1089        return false;
1090      for (ConceptSetFilterComponent item : this.filter)
1091        if (!item.isEmpty())
1092          return true;
1093      return false;
1094    }
1095
1096    public ConceptSetFilterComponent addFilter() { // 3
1097      ConceptSetFilterComponent t = new ConceptSetFilterComponent();
1098      if (this.filter == null)
1099        this.filter = new ArrayList<ConceptSetFilterComponent>();
1100      this.filter.add(t);
1101      return t;
1102    }
1103
1104    public ConceptSetComponent addFilter(ConceptSetFilterComponent t) { // 3
1105      if (t == null)
1106        return this;
1107      if (this.filter == null)
1108        this.filter = new ArrayList<ConceptSetFilterComponent>();
1109      this.filter.add(t);
1110      return this;
1111    }
1112
1113    /**
1114     * @return The first repetition of repeating field {@link #filter}, creating it
1115     *         if it does not already exist
1116     */
1117    public ConceptSetFilterComponent getFilterFirstRep() {
1118      if (getFilter().isEmpty()) {
1119        addFilter();
1120      }
1121      return getFilter().get(0);
1122    }
1123
1124    /**
1125     * @return {@link #valueSet} (Selects the concepts found in this value set
1126     *         (based on its value set definition). This is an absolute URI that is
1127     *         a reference to ValueSet.url. If multiple value sets are specified
1128     *         this includes the union of the contents of all of the referenced
1129     *         value sets.)
1130     */
1131    public List<CanonicalType> getValueSet() {
1132      if (this.valueSet == null)
1133        this.valueSet = new ArrayList<CanonicalType>();
1134      return this.valueSet;
1135    }
1136
1137    /**
1138     * @return Returns a reference to <code>this</code> for easy method chaining
1139     */
1140    public ConceptSetComponent setValueSet(List<CanonicalType> theValueSet) {
1141      this.valueSet = theValueSet;
1142      return this;
1143    }
1144
1145    public boolean hasValueSet() {
1146      if (this.valueSet == null)
1147        return false;
1148      for (CanonicalType item : this.valueSet)
1149        if (!item.isEmpty())
1150          return true;
1151      return false;
1152    }
1153
1154    /**
1155     * @return {@link #valueSet} (Selects the concepts found in this value set
1156     *         (based on its value set definition). This is an absolute URI that is
1157     *         a reference to ValueSet.url. If multiple value sets are specified
1158     *         this includes the union of the contents of all of the referenced
1159     *         value sets.)
1160     */
1161    public CanonicalType addValueSetElement() {// 2
1162      CanonicalType t = new CanonicalType();
1163      if (this.valueSet == null)
1164        this.valueSet = new ArrayList<CanonicalType>();
1165      this.valueSet.add(t);
1166      return t;
1167    }
1168
1169    /**
1170     * @param value {@link #valueSet} (Selects the concepts found in this value set
1171     *              (based on its value set definition). This is an absolute URI
1172     *              that is a reference to ValueSet.url. If multiple value sets are
1173     *              specified this includes the union of the contents of all of the
1174     *              referenced value sets.)
1175     */
1176    public ConceptSetComponent addValueSet(String value) { // 1
1177      CanonicalType t = new CanonicalType();
1178      t.setValue(value);
1179      if (this.valueSet == null)
1180        this.valueSet = new ArrayList<CanonicalType>();
1181      this.valueSet.add(t);
1182      return this;
1183    }
1184
1185    /**
1186     * @param value {@link #valueSet} (Selects the concepts found in this value set
1187     *              (based on its value set definition). This is an absolute URI
1188     *              that is a reference to ValueSet.url. If multiple value sets are
1189     *              specified this includes the union of the contents of all of the
1190     *              referenced value sets.)
1191     */
1192    public boolean hasValueSet(String value) {
1193      if (this.valueSet == null)
1194        return false;
1195      for (CanonicalType v : this.valueSet)
1196        if (v.getValue().equals(value)) // canonical(ValueSet)
1197          return true;
1198      return false;
1199    }
1200
1201    protected void listChildren(List<Property> children) {
1202      super.listChildren(children);
1203      children.add(new Property("system", "uri",
1204          "An absolute URI which is the code system from which the selected codes come from.", 0, 1, system));
1205      children.add(new Property("version", "string",
1206          "The version of the code system that the codes are selected from, or the special version '*' for all versions.",
1207          0, 1, version));
1208      children.add(new Property("concept", "", "Specifies a concept to be included or excluded.", 0,
1209          java.lang.Integer.MAX_VALUE, concept));
1210      children.add(new Property("filter", "",
1211          "Select concepts by specify a matching criterion based on the properties (including relationships) defined by the system, or on filters defined by the system. If multiple filters are specified, they SHALL all be true.",
1212          0, java.lang.Integer.MAX_VALUE, filter));
1213      children.add(new Property("valueSet", "canonical(ValueSet)",
1214          "Selects the concepts found in this value set (based on its value set definition). This is an absolute URI that is a reference to ValueSet.url.  If multiple value sets are specified this includes the union of the contents of all of the referenced value sets.",
1215          0, java.lang.Integer.MAX_VALUE, valueSet));
1216    }
1217
1218    @Override
1219    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1220      switch (_hash) {
1221      case -887328209:
1222        /* system */ return new Property("system", "uri",
1223            "An absolute URI which is the code system from which the selected codes come from.", 0, 1, system);
1224      case 351608024:
1225        /* version */ return new Property("version", "string",
1226            "The version of the code system that the codes are selected from, or the special version '*' for all versions.",
1227            0, 1, version);
1228      case 951024232:
1229        /* concept */ return new Property("concept", "", "Specifies a concept to be included or excluded.", 0,
1230            java.lang.Integer.MAX_VALUE, concept);
1231      case -1274492040:
1232        /* filter */ return new Property("filter", "",
1233            "Select concepts by specify a matching criterion based on the properties (including relationships) defined by the system, or on filters defined by the system. If multiple filters are specified, they SHALL all be true.",
1234            0, java.lang.Integer.MAX_VALUE, filter);
1235      case -1410174671:
1236        /* valueSet */ return new Property("valueSet", "canonical(ValueSet)",
1237            "Selects the concepts found in this value set (based on its value set definition). This is an absolute URI that is a reference to ValueSet.url.  If multiple value sets are specified this includes the union of the contents of all of the referenced value sets.",
1238            0, java.lang.Integer.MAX_VALUE, valueSet);
1239      default:
1240        return super.getNamedProperty(_hash, _name, _checkValid);
1241      }
1242
1243    }
1244
1245    @Override
1246    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1247      switch (hash) {
1248      case -887328209:
1249        /* system */ return this.system == null ? new Base[0] : new Base[] { this.system }; // UriType
1250      case 351608024:
1251        /* version */ return this.version == null ? new Base[0] : new Base[] { this.version }; // StringType
1252      case 951024232:
1253        /* concept */ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptReferenceComponent
1254      case -1274492040:
1255        /* filter */ return this.filter == null ? new Base[0] : this.filter.toArray(new Base[this.filter.size()]); // ConceptSetFilterComponent
1256      case -1410174671:
1257        /* valueSet */ return this.valueSet == null ? new Base[0]
1258            : this.valueSet.toArray(new Base[this.valueSet.size()]); // CanonicalType
1259      default:
1260        return super.getProperty(hash, name, checkValid);
1261      }
1262
1263    }
1264
1265    @Override
1266    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1267      switch (hash) {
1268      case -887328209: // system
1269        this.system = castToUri(value); // UriType
1270        return value;
1271      case 351608024: // version
1272        this.version = castToString(value); // StringType
1273        return value;
1274      case 951024232: // concept
1275        this.getConcept().add((ConceptReferenceComponent) value); // ConceptReferenceComponent
1276        return value;
1277      case -1274492040: // filter
1278        this.getFilter().add((ConceptSetFilterComponent) value); // ConceptSetFilterComponent
1279        return value;
1280      case -1410174671: // valueSet
1281        this.getValueSet().add(castToCanonical(value)); // CanonicalType
1282        return value;
1283      default:
1284        return super.setProperty(hash, name, value);
1285      }
1286
1287    }
1288
1289    @Override
1290    public Base setProperty(String name, Base value) throws FHIRException {
1291      if (name.equals("system")) {
1292        this.system = castToUri(value); // UriType
1293      } else if (name.equals("version")) {
1294        this.version = castToString(value); // StringType
1295      } else if (name.equals("concept")) {
1296        this.getConcept().add((ConceptReferenceComponent) value);
1297      } else if (name.equals("filter")) {
1298        this.getFilter().add((ConceptSetFilterComponent) value);
1299      } else if (name.equals("valueSet")) {
1300        this.getValueSet().add(castToCanonical(value));
1301      } else
1302        return super.setProperty(name, value);
1303      return value;
1304    }
1305
1306  @Override
1307  public void removeChild(String name, Base value) throws FHIRException {
1308      if (name.equals("system")) {
1309        this.system = null;
1310      } else if (name.equals("version")) {
1311        this.version = null;
1312      } else if (name.equals("concept")) {
1313        this.getConcept().remove((ConceptReferenceComponent) value);
1314      } else if (name.equals("filter")) {
1315        this.getFilter().remove((ConceptSetFilterComponent) value);
1316      } else if (name.equals("valueSet")) {
1317        this.getValueSet().remove(castToCanonical(value));
1318      } else
1319        super.removeChild(name, value);
1320      
1321    }
1322
1323    @Override
1324    public Base makeProperty(int hash, String name) throws FHIRException {
1325      switch (hash) {
1326      case -887328209:
1327        return getSystemElement();
1328      case 351608024:
1329        return getVersionElement();
1330      case 951024232:
1331        return addConcept();
1332      case -1274492040:
1333        return addFilter();
1334      case -1410174671:
1335        return addValueSetElement();
1336      default:
1337        return super.makeProperty(hash, name);
1338      }
1339
1340    }
1341
1342    @Override
1343    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1344      switch (hash) {
1345      case -887328209:
1346        /* system */ return new String[] { "uri" };
1347      case 351608024:
1348        /* version */ return new String[] { "string" };
1349      case 951024232:
1350        /* concept */ return new String[] {};
1351      case -1274492040:
1352        /* filter */ return new String[] {};
1353      case -1410174671:
1354        /* valueSet */ return new String[] { "canonical" };
1355      default:
1356        return super.getTypesForProperty(hash, name);
1357      }
1358
1359    }
1360
1361    @Override
1362    public Base addChild(String name) throws FHIRException {
1363      if (name.equals("system")) {
1364        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.system");
1365      } else if (name.equals("version")) {
1366        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.version");
1367      } else if (name.equals("concept")) {
1368        return addConcept();
1369      } else if (name.equals("filter")) {
1370        return addFilter();
1371      } else if (name.equals("valueSet")) {
1372        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.valueSet");
1373      } else
1374        return super.addChild(name);
1375    }
1376
1377    public ConceptSetComponent copy() {
1378      ConceptSetComponent dst = new ConceptSetComponent();
1379      copyValues(dst);
1380      return dst;
1381    }
1382
1383    public void copyValues(ConceptSetComponent dst) {
1384      super.copyValues(dst);
1385      dst.system = system == null ? null : system.copy();
1386      dst.version = version == null ? null : version.copy();
1387      if (concept != null) {
1388        dst.concept = new ArrayList<ConceptReferenceComponent>();
1389        for (ConceptReferenceComponent i : concept)
1390          dst.concept.add(i.copy());
1391      }
1392      ;
1393      if (filter != null) {
1394        dst.filter = new ArrayList<ConceptSetFilterComponent>();
1395        for (ConceptSetFilterComponent i : filter)
1396          dst.filter.add(i.copy());
1397      }
1398      ;
1399      if (valueSet != null) {
1400        dst.valueSet = new ArrayList<CanonicalType>();
1401        for (CanonicalType i : valueSet)
1402          dst.valueSet.add(i.copy());
1403      }
1404      ;
1405    }
1406
1407    @Override
1408    public boolean equalsDeep(Base other_) {
1409      if (!super.equalsDeep(other_))
1410        return false;
1411      if (!(other_ instanceof ConceptSetComponent))
1412        return false;
1413      ConceptSetComponent o = (ConceptSetComponent) other_;
1414      return compareDeep(system, o.system, true) && compareDeep(version, o.version, true)
1415          && compareDeep(concept, o.concept, true) && compareDeep(filter, o.filter, true)
1416          && compareDeep(valueSet, o.valueSet, true);
1417    }
1418
1419    @Override
1420    public boolean equalsShallow(Base other_) {
1421      if (!super.equalsShallow(other_))
1422        return false;
1423      if (!(other_ instanceof ConceptSetComponent))
1424        return false;
1425      ConceptSetComponent o = (ConceptSetComponent) other_;
1426      return compareValues(system, o.system, true) && compareValues(version, o.version, true);
1427    }
1428
1429    public boolean isEmpty() {
1430      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(system, version, concept, filter, valueSet);
1431    }
1432
1433    public String fhirType() {
1434      return "ValueSet.compose.include";
1435
1436    }
1437
1438  }
1439
1440  @Block()
1441  public static class ConceptReferenceComponent extends BackboneElement implements IBaseBackboneElement {
1442    /**
1443     * Specifies a code for the concept to be included or excluded.
1444     */
1445    @Child(name = "code", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
1446    @Description(shortDefinition = "Code or expression from system", formalDefinition = "Specifies a code for the concept to be included or excluded.")
1447    protected CodeType code;
1448
1449    /**
1450     * The text to display to the user for this concept in the context of this
1451     * valueset. If no display is provided, then applications using the value set
1452     * use the display specified for the code by the system.
1453     */
1454    @Child(name = "display", type = {
1455        StringType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
1456    @Description(shortDefinition = "Text to display for this code for this value set in this valueset", formalDefinition = "The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.")
1457    protected StringType display;
1458
1459    /**
1460     * Additional representations for this concept when used in this value set -
1461     * other languages, aliases, specialized purposes, used for particular purposes,
1462     * etc.
1463     */
1464    @Child(name = "designation", type = {}, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1465    @Description(shortDefinition = "Additional representations for this concept", formalDefinition = "Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.")
1466    protected List<ConceptReferenceDesignationComponent> designation;
1467
1468    private static final long serialVersionUID = 260579971L;
1469
1470    /**
1471     * Constructor
1472     */
1473    public ConceptReferenceComponent() {
1474      super();
1475    }
1476
1477    /**
1478     * Constructor
1479     */
1480    public ConceptReferenceComponent(CodeType code) {
1481      super();
1482      this.code = code;
1483    }
1484
1485    /**
1486     * @return {@link #code} (Specifies a code for the concept to be included or
1487     *         excluded.). This is the underlying object with id, value and
1488     *         extensions. The accessor "getCode" gives direct access to the value
1489     */
1490    public CodeType getCodeElement() {
1491      if (this.code == null)
1492        if (Configuration.errorOnAutoCreate())
1493          throw new Error("Attempt to auto-create ConceptReferenceComponent.code");
1494        else if (Configuration.doAutoCreate())
1495          this.code = new CodeType(); // bb
1496      return this.code;
1497    }
1498
1499    public boolean hasCodeElement() {
1500      return this.code != null && !this.code.isEmpty();
1501    }
1502
1503    public boolean hasCode() {
1504      return this.code != null && !this.code.isEmpty();
1505    }
1506
1507    /**
1508     * @param value {@link #code} (Specifies a code for the concept to be included
1509     *              or excluded.). This is the underlying object with id, value and
1510     *              extensions. The accessor "getCode" gives direct access to the
1511     *              value
1512     */
1513    public ConceptReferenceComponent setCodeElement(CodeType value) {
1514      this.code = value;
1515      return this;
1516    }
1517
1518    /**
1519     * @return Specifies a code for the concept to be included or excluded.
1520     */
1521    public String getCode() {
1522      return this.code == null ? null : this.code.getValue();
1523    }
1524
1525    /**
1526     * @param value Specifies a code for the concept to be included or excluded.
1527     */
1528    public ConceptReferenceComponent setCode(String value) {
1529      if (this.code == null)
1530        this.code = new CodeType();
1531      this.code.setValue(value);
1532      return this;
1533    }
1534
1535    /**
1536     * @return {@link #display} (The text to display to the user for this concept in
1537     *         the context of this valueset. If no display is provided, then
1538     *         applications using the value set use the display specified for the
1539     *         code by the system.). This is the underlying object with id, value
1540     *         and extensions. The accessor "getDisplay" gives direct access to the
1541     *         value
1542     */
1543    public StringType getDisplayElement() {
1544      if (this.display == null)
1545        if (Configuration.errorOnAutoCreate())
1546          throw new Error("Attempt to auto-create ConceptReferenceComponent.display");
1547        else if (Configuration.doAutoCreate())
1548          this.display = new StringType(); // bb
1549      return this.display;
1550    }
1551
1552    public boolean hasDisplayElement() {
1553      return this.display != null && !this.display.isEmpty();
1554    }
1555
1556    public boolean hasDisplay() {
1557      return this.display != null && !this.display.isEmpty();
1558    }
1559
1560    /**
1561     * @param value {@link #display} (The text to display to the user for this
1562     *              concept in the context of this valueset. If no display is
1563     *              provided, then applications using the value set use the display
1564     *              specified for the code by the system.). This is the underlying
1565     *              object with id, value and extensions. The accessor "getDisplay"
1566     *              gives direct access to the value
1567     */
1568    public ConceptReferenceComponent setDisplayElement(StringType value) {
1569      this.display = value;
1570      return this;
1571    }
1572
1573    /**
1574     * @return The text to display to the user for this concept in the context of
1575     *         this valueset. If no display is provided, then applications using the
1576     *         value set use the display specified for the code by the system.
1577     */
1578    public String getDisplay() {
1579      return this.display == null ? null : this.display.getValue();
1580    }
1581
1582    /**
1583     * @param value The text to display to the user for this concept in the context
1584     *              of this valueset. If no display is provided, then applications
1585     *              using the value set use the display specified for the code by
1586     *              the system.
1587     */
1588    public ConceptReferenceComponent setDisplay(String value) {
1589      if (Utilities.noString(value))
1590        this.display = null;
1591      else {
1592        if (this.display == null)
1593          this.display = new StringType();
1594        this.display.setValue(value);
1595      }
1596      return this;
1597    }
1598
1599    /**
1600     * @return {@link #designation} (Additional representations for this concept
1601     *         when used in this value set - other languages, aliases, specialized
1602     *         purposes, used for particular purposes, etc.)
1603     */
1604    public List<ConceptReferenceDesignationComponent> getDesignation() {
1605      if (this.designation == null)
1606        this.designation = new ArrayList<ConceptReferenceDesignationComponent>();
1607      return this.designation;
1608    }
1609
1610    /**
1611     * @return Returns a reference to <code>this</code> for easy method chaining
1612     */
1613    public ConceptReferenceComponent setDesignation(List<ConceptReferenceDesignationComponent> theDesignation) {
1614      this.designation = theDesignation;
1615      return this;
1616    }
1617
1618    public boolean hasDesignation() {
1619      if (this.designation == null)
1620        return false;
1621      for (ConceptReferenceDesignationComponent item : this.designation)
1622        if (!item.isEmpty())
1623          return true;
1624      return false;
1625    }
1626
1627    public ConceptReferenceDesignationComponent addDesignation() { // 3
1628      ConceptReferenceDesignationComponent t = new ConceptReferenceDesignationComponent();
1629      if (this.designation == null)
1630        this.designation = new ArrayList<ConceptReferenceDesignationComponent>();
1631      this.designation.add(t);
1632      return t;
1633    }
1634
1635    public ConceptReferenceComponent addDesignation(ConceptReferenceDesignationComponent t) { // 3
1636      if (t == null)
1637        return this;
1638      if (this.designation == null)
1639        this.designation = new ArrayList<ConceptReferenceDesignationComponent>();
1640      this.designation.add(t);
1641      return this;
1642    }
1643
1644    /**
1645     * @return The first repetition of repeating field {@link #designation},
1646     *         creating it if it does not already exist
1647     */
1648    public ConceptReferenceDesignationComponent getDesignationFirstRep() {
1649      if (getDesignation().isEmpty()) {
1650        addDesignation();
1651      }
1652      return getDesignation().get(0);
1653    }
1654
1655    protected void listChildren(List<Property> children) {
1656      super.listChildren(children);
1657      children.add(
1658          new Property("code", "code", "Specifies a code for the concept to be included or excluded.", 0, 1, code));
1659      children.add(new Property("display", "string",
1660          "The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.",
1661          0, 1, display));
1662      children.add(new Property("designation", "",
1663          "Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.",
1664          0, java.lang.Integer.MAX_VALUE, designation));
1665    }
1666
1667    @Override
1668    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1669      switch (_hash) {
1670      case 3059181:
1671        /* code */ return new Property("code", "code", "Specifies a code for the concept to be included or excluded.",
1672            0, 1, code);
1673      case 1671764162:
1674        /* display */ return new Property("display", "string",
1675            "The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.",
1676            0, 1, display);
1677      case -900931593:
1678        /* designation */ return new Property("designation", "",
1679            "Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.",
1680            0, java.lang.Integer.MAX_VALUE, designation);
1681      default:
1682        return super.getNamedProperty(_hash, _name, _checkValid);
1683      }
1684
1685    }
1686
1687    @Override
1688    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1689      switch (hash) {
1690      case 3059181:
1691        /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeType
1692      case 1671764162:
1693        /* display */ return this.display == null ? new Base[0] : new Base[] { this.display }; // StringType
1694      case -900931593:
1695        /* designation */ return this.designation == null ? new Base[0]
1696            : this.designation.toArray(new Base[this.designation.size()]); // ConceptReferenceDesignationComponent
1697      default:
1698        return super.getProperty(hash, name, checkValid);
1699      }
1700
1701    }
1702
1703    @Override
1704    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1705      switch (hash) {
1706      case 3059181: // code
1707        this.code = castToCode(value); // CodeType
1708        return value;
1709      case 1671764162: // display
1710        this.display = castToString(value); // StringType
1711        return value;
1712      case -900931593: // designation
1713        this.getDesignation().add((ConceptReferenceDesignationComponent) value); // ConceptReferenceDesignationComponent
1714        return value;
1715      default:
1716        return super.setProperty(hash, name, value);
1717      }
1718
1719    }
1720
1721    @Override
1722    public Base setProperty(String name, Base value) throws FHIRException {
1723      if (name.equals("code")) {
1724        this.code = castToCode(value); // CodeType
1725      } else if (name.equals("display")) {
1726        this.display = castToString(value); // StringType
1727      } else if (name.equals("designation")) {
1728        this.getDesignation().add((ConceptReferenceDesignationComponent) value);
1729      } else
1730        return super.setProperty(name, value);
1731      return value;
1732    }
1733
1734  @Override
1735  public void removeChild(String name, Base value) throws FHIRException {
1736      if (name.equals("code")) {
1737        this.code = null;
1738      } else if (name.equals("display")) {
1739        this.display = null;
1740      } else if (name.equals("designation")) {
1741        this.getDesignation().remove((ConceptReferenceDesignationComponent) value);
1742      } else
1743        super.removeChild(name, value);
1744      
1745    }
1746
1747    @Override
1748    public Base makeProperty(int hash, String name) throws FHIRException {
1749      switch (hash) {
1750      case 3059181:
1751        return getCodeElement();
1752      case 1671764162:
1753        return getDisplayElement();
1754      case -900931593:
1755        return addDesignation();
1756      default:
1757        return super.makeProperty(hash, name);
1758      }
1759
1760    }
1761
1762    @Override
1763    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1764      switch (hash) {
1765      case 3059181:
1766        /* code */ return new String[] { "code" };
1767      case 1671764162:
1768        /* display */ return new String[] { "string" };
1769      case -900931593:
1770        /* designation */ return new String[] {};
1771      default:
1772        return super.getTypesForProperty(hash, name);
1773      }
1774
1775    }
1776
1777    @Override
1778    public Base addChild(String name) throws FHIRException {
1779      if (name.equals("code")) {
1780        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.code");
1781      } else if (name.equals("display")) {
1782        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.display");
1783      } else if (name.equals("designation")) {
1784        return addDesignation();
1785      } else
1786        return super.addChild(name);
1787    }
1788
1789    public ConceptReferenceComponent copy() {
1790      ConceptReferenceComponent dst = new ConceptReferenceComponent();
1791      copyValues(dst);
1792      return dst;
1793    }
1794
1795    public void copyValues(ConceptReferenceComponent dst) {
1796      super.copyValues(dst);
1797      dst.code = code == null ? null : code.copy();
1798      dst.display = display == null ? null : display.copy();
1799      if (designation != null) {
1800        dst.designation = new ArrayList<ConceptReferenceDesignationComponent>();
1801        for (ConceptReferenceDesignationComponent i : designation)
1802          dst.designation.add(i.copy());
1803      }
1804      ;
1805    }
1806
1807    @Override
1808    public boolean equalsDeep(Base other_) {
1809      if (!super.equalsDeep(other_))
1810        return false;
1811      if (!(other_ instanceof ConceptReferenceComponent))
1812        return false;
1813      ConceptReferenceComponent o = (ConceptReferenceComponent) other_;
1814      return compareDeep(code, o.code, true) && compareDeep(display, o.display, true)
1815          && compareDeep(designation, o.designation, true);
1816    }
1817
1818    @Override
1819    public boolean equalsShallow(Base other_) {
1820      if (!super.equalsShallow(other_))
1821        return false;
1822      if (!(other_ instanceof ConceptReferenceComponent))
1823        return false;
1824      ConceptReferenceComponent o = (ConceptReferenceComponent) other_;
1825      return compareValues(code, o.code, true) && compareValues(display, o.display, true);
1826    }
1827
1828    public boolean isEmpty() {
1829      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, display, designation);
1830    }
1831
1832    public String fhirType() {
1833      return "ValueSet.compose.include.concept";
1834
1835    }
1836
1837  }
1838
1839  @Block()
1840  public static class ConceptReferenceDesignationComponent extends BackboneElement implements IBaseBackboneElement {
1841    /**
1842     * The language this designation is defined for.
1843     */
1844    @Child(name = "language", type = { CodeType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
1845    @Description(shortDefinition = "Human language of the designation", formalDefinition = "The language this designation is defined for.")
1846    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/languages")
1847    protected CodeType language;
1848
1849    /**
1850     * A code that represents types of uses of designations.
1851     */
1852    @Child(name = "use", type = { Coding.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
1853    @Description(shortDefinition = "Types of uses of designations", formalDefinition = "A code that represents types of uses of designations.")
1854    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/designation-use")
1855    protected Coding use;
1856
1857    /**
1858     * The text value for this designation.
1859     */
1860    @Child(name = "value", type = { StringType.class }, order = 3, min = 1, max = 1, modifier = false, summary = false)
1861    @Description(shortDefinition = "The text value for this designation", formalDefinition = "The text value for this designation.")
1862    protected StringType value;
1863
1864    private static final long serialVersionUID = 1515662414L;
1865
1866    /**
1867     * Constructor
1868     */
1869    public ConceptReferenceDesignationComponent() {
1870      super();
1871    }
1872
1873    /**
1874     * Constructor
1875     */
1876    public ConceptReferenceDesignationComponent(StringType value) {
1877      super();
1878      this.value = value;
1879    }
1880
1881    /**
1882     * @return {@link #language} (The language this designation is defined for.).
1883     *         This is the underlying object with id, value and extensions. The
1884     *         accessor "getLanguage" gives direct access to the value
1885     */
1886    public CodeType getLanguageElement() {
1887      if (this.language == null)
1888        if (Configuration.errorOnAutoCreate())
1889          throw new Error("Attempt to auto-create ConceptReferenceDesignationComponent.language");
1890        else if (Configuration.doAutoCreate())
1891          this.language = new CodeType(); // bb
1892      return this.language;
1893    }
1894
1895    public boolean hasLanguageElement() {
1896      return this.language != null && !this.language.isEmpty();
1897    }
1898
1899    public boolean hasLanguage() {
1900      return this.language != null && !this.language.isEmpty();
1901    }
1902
1903    /**
1904     * @param value {@link #language} (The language this designation is defined
1905     *              for.). This is the underlying object with id, value and
1906     *              extensions. The accessor "getLanguage" gives direct access to
1907     *              the value
1908     */
1909    public ConceptReferenceDesignationComponent setLanguageElement(CodeType value) {
1910      this.language = value;
1911      return this;
1912    }
1913
1914    /**
1915     * @return The language this designation is defined for.
1916     */
1917    public String getLanguage() {
1918      return this.language == null ? null : this.language.getValue();
1919    }
1920
1921    /**
1922     * @param value The language this designation is defined for.
1923     */
1924    public ConceptReferenceDesignationComponent setLanguage(String value) {
1925      if (Utilities.noString(value))
1926        this.language = null;
1927      else {
1928        if (this.language == null)
1929          this.language = new CodeType();
1930        this.language.setValue(value);
1931      }
1932      return this;
1933    }
1934
1935    /**
1936     * @return {@link #use} (A code that represents types of uses of designations.)
1937     */
1938    public Coding getUse() {
1939      if (this.use == null)
1940        if (Configuration.errorOnAutoCreate())
1941          throw new Error("Attempt to auto-create ConceptReferenceDesignationComponent.use");
1942        else if (Configuration.doAutoCreate())
1943          this.use = new Coding(); // cc
1944      return this.use;
1945    }
1946
1947    public boolean hasUse() {
1948      return this.use != null && !this.use.isEmpty();
1949    }
1950
1951    /**
1952     * @param value {@link #use} (A code that represents types of uses of
1953     *              designations.)
1954     */
1955    public ConceptReferenceDesignationComponent setUse(Coding value) {
1956      this.use = value;
1957      return this;
1958    }
1959
1960    /**
1961     * @return {@link #value} (The text value for this designation.). This is the
1962     *         underlying object with id, value and extensions. The accessor
1963     *         "getValue" gives direct access to the value
1964     */
1965    public StringType getValueElement() {
1966      if (this.value == null)
1967        if (Configuration.errorOnAutoCreate())
1968          throw new Error("Attempt to auto-create ConceptReferenceDesignationComponent.value");
1969        else if (Configuration.doAutoCreate())
1970          this.value = new StringType(); // bb
1971      return this.value;
1972    }
1973
1974    public boolean hasValueElement() {
1975      return this.value != null && !this.value.isEmpty();
1976    }
1977
1978    public boolean hasValue() {
1979      return this.value != null && !this.value.isEmpty();
1980    }
1981
1982    /**
1983     * @param value {@link #value} (The text value for this designation.). This is
1984     *              the underlying object with id, value and extensions. The
1985     *              accessor "getValue" gives direct access to the value
1986     */
1987    public ConceptReferenceDesignationComponent setValueElement(StringType value) {
1988      this.value = value;
1989      return this;
1990    }
1991
1992    /**
1993     * @return The text value for this designation.
1994     */
1995    public String getValue() {
1996      return this.value == null ? null : this.value.getValue();
1997    }
1998
1999    /**
2000     * @param value The text value for this designation.
2001     */
2002    public ConceptReferenceDesignationComponent setValue(String value) {
2003      if (this.value == null)
2004        this.value = new StringType();
2005      this.value.setValue(value);
2006      return this;
2007    }
2008
2009    protected void listChildren(List<Property> children) {
2010      super.listChildren(children);
2011      children.add(new Property("language", "code", "The language this designation is defined for.", 0, 1, language));
2012      children.add(new Property("use", "Coding", "A code that represents types of uses of designations.", 0, 1, use));
2013      children.add(new Property("value", "string", "The text value for this designation.", 0, 1, value));
2014    }
2015
2016    @Override
2017    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2018      switch (_hash) {
2019      case -1613589672:
2020        /* language */ return new Property("language", "code", "The language this designation is defined for.", 0, 1,
2021            language);
2022      case 116103:
2023        /* use */ return new Property("use", "Coding", "A code that represents types of uses of designations.", 0, 1,
2024            use);
2025      case 111972721:
2026        /* value */ return new Property("value", "string", "The text value for this designation.", 0, 1, value);
2027      default:
2028        return super.getNamedProperty(_hash, _name, _checkValid);
2029      }
2030
2031    }
2032
2033    @Override
2034    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2035      switch (hash) {
2036      case -1613589672:
2037        /* language */ return this.language == null ? new Base[0] : new Base[] { this.language }; // CodeType
2038      case 116103:
2039        /* use */ return this.use == null ? new Base[0] : new Base[] { this.use }; // Coding
2040      case 111972721:
2041        /* value */ return this.value == null ? new Base[0] : new Base[] { this.value }; // StringType
2042      default:
2043        return super.getProperty(hash, name, checkValid);
2044      }
2045
2046    }
2047
2048    @Override
2049    public Base setProperty(int hash, String name, Base value) throws FHIRException {
2050      switch (hash) {
2051      case -1613589672: // language
2052        this.language = castToCode(value); // CodeType
2053        return value;
2054      case 116103: // use
2055        this.use = castToCoding(value); // Coding
2056        return value;
2057      case 111972721: // value
2058        this.value = castToString(value); // StringType
2059        return value;
2060      default:
2061        return super.setProperty(hash, name, value);
2062      }
2063
2064    }
2065
2066    @Override
2067    public Base setProperty(String name, Base value) throws FHIRException {
2068      if (name.equals("language")) {
2069        this.language = castToCode(value); // CodeType
2070      } else if (name.equals("use")) {
2071        this.use = castToCoding(value); // Coding
2072      } else if (name.equals("value")) {
2073        this.value = castToString(value); // StringType
2074      } else
2075        return super.setProperty(name, value);
2076      return value;
2077    }
2078
2079  @Override
2080  public void removeChild(String name, Base value) throws FHIRException {
2081      if (name.equals("language")) {
2082        this.language = null;
2083      } else if (name.equals("use")) {
2084        this.use = null;
2085      } else if (name.equals("value")) {
2086        this.value = null;
2087      } else
2088        super.removeChild(name, value);
2089      
2090    }
2091
2092    @Override
2093    public Base makeProperty(int hash, String name) throws FHIRException {
2094      switch (hash) {
2095      case -1613589672:
2096        return getLanguageElement();
2097      case 116103:
2098        return getUse();
2099      case 111972721:
2100        return getValueElement();
2101      default:
2102        return super.makeProperty(hash, name);
2103      }
2104
2105    }
2106
2107    @Override
2108    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2109      switch (hash) {
2110      case -1613589672:
2111        /* language */ return new String[] { "code" };
2112      case 116103:
2113        /* use */ return new String[] { "Coding" };
2114      case 111972721:
2115        /* value */ return new String[] { "string" };
2116      default:
2117        return super.getTypesForProperty(hash, name);
2118      }
2119
2120    }
2121
2122    @Override
2123    public Base addChild(String name) throws FHIRException {
2124      if (name.equals("language")) {
2125        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.language");
2126      } else if (name.equals("use")) {
2127        this.use = new Coding();
2128        return this.use;
2129      } else if (name.equals("value")) {
2130        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.value");
2131      } else
2132        return super.addChild(name);
2133    }
2134
2135    public ConceptReferenceDesignationComponent copy() {
2136      ConceptReferenceDesignationComponent dst = new ConceptReferenceDesignationComponent();
2137      copyValues(dst);
2138      return dst;
2139    }
2140
2141    public void copyValues(ConceptReferenceDesignationComponent dst) {
2142      super.copyValues(dst);
2143      dst.language = language == null ? null : language.copy();
2144      dst.use = use == null ? null : use.copy();
2145      dst.value = value == null ? null : value.copy();
2146    }
2147
2148    @Override
2149    public boolean equalsDeep(Base other_) {
2150      if (!super.equalsDeep(other_))
2151        return false;
2152      if (!(other_ instanceof ConceptReferenceDesignationComponent))
2153        return false;
2154      ConceptReferenceDesignationComponent o = (ConceptReferenceDesignationComponent) other_;
2155      return compareDeep(language, o.language, true) && compareDeep(use, o.use, true)
2156          && compareDeep(value, o.value, true);
2157    }
2158
2159    @Override
2160    public boolean equalsShallow(Base other_) {
2161      if (!super.equalsShallow(other_))
2162        return false;
2163      if (!(other_ instanceof ConceptReferenceDesignationComponent))
2164        return false;
2165      ConceptReferenceDesignationComponent o = (ConceptReferenceDesignationComponent) other_;
2166      return compareValues(language, o.language, true) && compareValues(value, o.value, true);
2167    }
2168
2169    public boolean isEmpty() {
2170      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(language, use, value);
2171    }
2172
2173    public String fhirType() {
2174      return "ValueSet.compose.include.concept.designation";
2175
2176    }
2177
2178  }
2179
2180  @Block()
2181  public static class ConceptSetFilterComponent extends BackboneElement implements IBaseBackboneElement {
2182    /**
2183     * A code that identifies a property or a filter defined in the code system.
2184     */
2185    @Child(name = "property", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
2186    @Description(shortDefinition = "A property/filter defined by the code system", formalDefinition = "A code that identifies a property or a filter defined in the code system.")
2187    protected CodeType property;
2188
2189    /**
2190     * The kind of operation to perform as a part of the filter criteria.
2191     */
2192    @Child(name = "op", type = { CodeType.class }, order = 2, min = 1, max = 1, modifier = false, summary = true)
2193    @Description(shortDefinition = "= | is-a | descendent-of | is-not-a | regex | in | not-in | generalizes | exists", formalDefinition = "The kind of operation to perform as a part of the filter criteria.")
2194    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/filter-operator")
2195    protected Enumeration<FilterOperator> op;
2196
2197    /**
2198     * The match value may be either a code defined by the system, or a string
2199     * value, which is a regex match on the literal string of the property value (if
2200     * the filter represents a property defined in CodeSystem) or of the system
2201     * filter value (if the filter represents a filter defined in CodeSystem) when
2202     * the operation is 'regex', or one of the values (true and false), when the
2203     * operation is 'exists'.
2204     */
2205    @Child(name = "value", type = { StringType.class }, order = 3, min = 1, max = 1, modifier = false, summary = true)
2206    @Description(shortDefinition = "Code from the system, or regex criteria, or boolean value for exists", formalDefinition = "The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value  (if the filter represents a property defined in CodeSystem) or of the system filter value (if the filter represents a filter defined in CodeSystem) when the operation is 'regex', or one of the values (true and false), when the operation is 'exists'.")
2207    protected StringType value;
2208
2209    private static final long serialVersionUID = 1259153492L;
2210
2211    /**
2212     * Constructor
2213     */
2214    public ConceptSetFilterComponent() {
2215      super();
2216    }
2217
2218    /**
2219     * Constructor
2220     */
2221    public ConceptSetFilterComponent(CodeType property, Enumeration<FilterOperator> op, StringType value) {
2222      super();
2223      this.property = property;
2224      this.op = op;
2225      this.value = value;
2226    }
2227
2228    /**
2229     * @return {@link #property} (A code that identifies a property or a filter
2230     *         defined in the code system.). This is the underlying object with id,
2231     *         value and extensions. The accessor "getProperty" gives direct access
2232     *         to the value
2233     */
2234    public CodeType getPropertyElement() {
2235      if (this.property == null)
2236        if (Configuration.errorOnAutoCreate())
2237          throw new Error("Attempt to auto-create ConceptSetFilterComponent.property");
2238        else if (Configuration.doAutoCreate())
2239          this.property = new CodeType(); // bb
2240      return this.property;
2241    }
2242
2243    public boolean hasPropertyElement() {
2244      return this.property != null && !this.property.isEmpty();
2245    }
2246
2247    public boolean hasProperty() {
2248      return this.property != null && !this.property.isEmpty();
2249    }
2250
2251    /**
2252     * @param value {@link #property} (A code that identifies a property or a filter
2253     *              defined in the code system.). This is the underlying object with
2254     *              id, value and extensions. The accessor "getProperty" gives
2255     *              direct access to the value
2256     */
2257    public ConceptSetFilterComponent setPropertyElement(CodeType value) {
2258      this.property = value;
2259      return this;
2260    }
2261
2262    /**
2263     * @return A code that identifies a property or a filter defined in the code
2264     *         system.
2265     */
2266    public String getProperty() {
2267      return this.property == null ? null : this.property.getValue();
2268    }
2269
2270    /**
2271     * @param value A code that identifies a property or a filter defined in the
2272     *              code system.
2273     */
2274    public ConceptSetFilterComponent setProperty(String value) {
2275      if (this.property == null)
2276        this.property = new CodeType();
2277      this.property.setValue(value);
2278      return this;
2279    }
2280
2281    /**
2282     * @return {@link #op} (The kind of operation to perform as a part of the filter
2283     *         criteria.). This is the underlying object with id, value and
2284     *         extensions. The accessor "getOp" gives direct access to the value
2285     */
2286    public Enumeration<FilterOperator> getOpElement() {
2287      if (this.op == null)
2288        if (Configuration.errorOnAutoCreate())
2289          throw new Error("Attempt to auto-create ConceptSetFilterComponent.op");
2290        else if (Configuration.doAutoCreate())
2291          this.op = new Enumeration<FilterOperator>(new FilterOperatorEnumFactory()); // bb
2292      return this.op;
2293    }
2294
2295    public boolean hasOpElement() {
2296      return this.op != null && !this.op.isEmpty();
2297    }
2298
2299    public boolean hasOp() {
2300      return this.op != null && !this.op.isEmpty();
2301    }
2302
2303    /**
2304     * @param value {@link #op} (The kind of operation to perform as a part of the
2305     *              filter criteria.). This is the underlying object with id, value
2306     *              and extensions. The accessor "getOp" gives direct access to the
2307     *              value
2308     */
2309    public ConceptSetFilterComponent setOpElement(Enumeration<FilterOperator> value) {
2310      this.op = value;
2311      return this;
2312    }
2313
2314    /**
2315     * @return The kind of operation to perform as a part of the filter criteria.
2316     */
2317    public FilterOperator getOp() {
2318      return this.op == null ? null : this.op.getValue();
2319    }
2320
2321    /**
2322     * @param value The kind of operation to perform as a part of the filter
2323     *              criteria.
2324     */
2325    public ConceptSetFilterComponent setOp(FilterOperator value) {
2326      if (this.op == null)
2327        this.op = new Enumeration<FilterOperator>(new FilterOperatorEnumFactory());
2328      this.op.setValue(value);
2329      return this;
2330    }
2331
2332    /**
2333     * @return {@link #value} (The match value may be either a code defined by the
2334     *         system, or a string value, which is a regex match on the literal
2335     *         string of the property value (if the filter represents a property
2336     *         defined in CodeSystem) or of the system filter value (if the filter
2337     *         represents a filter defined in CodeSystem) when the operation is
2338     *         'regex', or one of the values (true and false), when the operation is
2339     *         'exists'.). This is the underlying object with id, value and
2340     *         extensions. The accessor "getValue" gives direct access to the value
2341     */
2342    public StringType getValueElement() {
2343      if (this.value == null)
2344        if (Configuration.errorOnAutoCreate())
2345          throw new Error("Attempt to auto-create ConceptSetFilterComponent.value");
2346        else if (Configuration.doAutoCreate())
2347          this.value = new StringType(); // bb
2348      return this.value;
2349    }
2350
2351    public boolean hasValueElement() {
2352      return this.value != null && !this.value.isEmpty();
2353    }
2354
2355    public boolean hasValue() {
2356      return this.value != null && !this.value.isEmpty();
2357    }
2358
2359    /**
2360     * @param value {@link #value} (The match value may be either a code defined by
2361     *              the system, or a string value, which is a regex match on the
2362     *              literal string of the property value (if the filter represents a
2363     *              property defined in CodeSystem) or of the system filter value
2364     *              (if the filter represents a filter defined in CodeSystem) when
2365     *              the operation is 'regex', or one of the values (true and false),
2366     *              when the operation is 'exists'.). This is the underlying object
2367     *              with id, value and extensions. The accessor "getValue" gives
2368     *              direct access to the value
2369     */
2370    public ConceptSetFilterComponent setValueElement(StringType value) {
2371      this.value = value;
2372      return this;
2373    }
2374
2375    /**
2376     * @return The match value may be either a code defined by the system, or a
2377     *         string value, which is a regex match on the literal string of the
2378     *         property value (if the filter represents a property defined in
2379     *         CodeSystem) or of the system filter value (if the filter represents a
2380     *         filter defined in CodeSystem) when the operation is 'regex', or one
2381     *         of the values (true and false), when the operation is 'exists'.
2382     */
2383    public String getValue() {
2384      return this.value == null ? null : this.value.getValue();
2385    }
2386
2387    /**
2388     * @param value The match value may be either a code defined by the system, or a
2389     *              string value, which is a regex match on the literal string of
2390     *              the property value (if the filter represents a property defined
2391     *              in CodeSystem) or of the system filter value (if the filter
2392     *              represents a filter defined in CodeSystem) when the operation is
2393     *              'regex', or one of the values (true and false), when the
2394     *              operation is 'exists'.
2395     */
2396    public ConceptSetFilterComponent setValue(String value) {
2397      if (this.value == null)
2398        this.value = new StringType();
2399      this.value.setValue(value);
2400      return this;
2401    }
2402
2403    protected void listChildren(List<Property> children) {
2404      super.listChildren(children);
2405      children.add(new Property("property", "code",
2406          "A code that identifies a property or a filter defined in the code system.", 0, 1, property));
2407      children.add(
2408          new Property("op", "code", "The kind of operation to perform as a part of the filter criteria.", 0, 1, op));
2409      children.add(new Property("value", "string",
2410          "The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value  (if the filter represents a property defined in CodeSystem) or of the system filter value (if the filter represents a filter defined in CodeSystem) when the operation is 'regex', or one of the values (true and false), when the operation is 'exists'.",
2411          0, 1, value));
2412    }
2413
2414    @Override
2415    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2416      switch (_hash) {
2417      case -993141291:
2418        /* property */ return new Property("property", "code",
2419            "A code that identifies a property or a filter defined in the code system.", 0, 1, property);
2420      case 3553:
2421        /* op */ return new Property("op", "code", "The kind of operation to perform as a part of the filter criteria.",
2422            0, 1, op);
2423      case 111972721:
2424        /* value */ return new Property("value", "string",
2425            "The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value  (if the filter represents a property defined in CodeSystem) or of the system filter value (if the filter represents a filter defined in CodeSystem) when the operation is 'regex', or one of the values (true and false), when the operation is 'exists'.",
2426            0, 1, value);
2427      default:
2428        return super.getNamedProperty(_hash, _name, _checkValid);
2429      }
2430
2431    }
2432
2433    @Override
2434    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2435      switch (hash) {
2436      case -993141291:
2437        /* property */ return this.property == null ? new Base[0] : new Base[] { this.property }; // CodeType
2438      case 3553:
2439        /* op */ return this.op == null ? new Base[0] : new Base[] { this.op }; // Enumeration<FilterOperator>
2440      case 111972721:
2441        /* value */ return this.value == null ? new Base[0] : new Base[] { this.value }; // StringType
2442      default:
2443        return super.getProperty(hash, name, checkValid);
2444      }
2445
2446    }
2447
2448    @Override
2449    public Base setProperty(int hash, String name, Base value) throws FHIRException {
2450      switch (hash) {
2451      case -993141291: // property
2452        this.property = castToCode(value); // CodeType
2453        return value;
2454      case 3553: // op
2455        value = new FilterOperatorEnumFactory().fromType(castToCode(value));
2456        this.op = (Enumeration) value; // Enumeration<FilterOperator>
2457        return value;
2458      case 111972721: // value
2459        this.value = castToString(value); // StringType
2460        return value;
2461      default:
2462        return super.setProperty(hash, name, value);
2463      }
2464
2465    }
2466
2467    @Override
2468    public Base setProperty(String name, Base value) throws FHIRException {
2469      if (name.equals("property")) {
2470        this.property = castToCode(value); // CodeType
2471      } else if (name.equals("op")) {
2472        value = new FilterOperatorEnumFactory().fromType(castToCode(value));
2473        this.op = (Enumeration) value; // Enumeration<FilterOperator>
2474      } else if (name.equals("value")) {
2475        this.value = castToString(value); // StringType
2476      } else
2477        return super.setProperty(name, value);
2478      return value;
2479    }
2480
2481  @Override
2482  public void removeChild(String name, Base value) throws FHIRException {
2483      if (name.equals("property")) {
2484        this.property = null;
2485      } else if (name.equals("op")) {
2486        this.op = null;
2487      } else if (name.equals("value")) {
2488        this.value = null;
2489      } else
2490        super.removeChild(name, value);
2491      
2492    }
2493
2494    @Override
2495    public Base makeProperty(int hash, String name) throws FHIRException {
2496      switch (hash) {
2497      case -993141291:
2498        return getPropertyElement();
2499      case 3553:
2500        return getOpElement();
2501      case 111972721:
2502        return getValueElement();
2503      default:
2504        return super.makeProperty(hash, name);
2505      }
2506
2507    }
2508
2509    @Override
2510    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2511      switch (hash) {
2512      case -993141291:
2513        /* property */ return new String[] { "code" };
2514      case 3553:
2515        /* op */ return new String[] { "code" };
2516      case 111972721:
2517        /* value */ return new String[] { "string" };
2518      default:
2519        return super.getTypesForProperty(hash, name);
2520      }
2521
2522    }
2523
2524    @Override
2525    public Base addChild(String name) throws FHIRException {
2526      if (name.equals("property")) {
2527        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.property");
2528      } else if (name.equals("op")) {
2529        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.op");
2530      } else if (name.equals("value")) {
2531        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.value");
2532      } else
2533        return super.addChild(name);
2534    }
2535
2536    public ConceptSetFilterComponent copy() {
2537      ConceptSetFilterComponent dst = new ConceptSetFilterComponent();
2538      copyValues(dst);
2539      return dst;
2540    }
2541
2542    public void copyValues(ConceptSetFilterComponent dst) {
2543      super.copyValues(dst);
2544      dst.property = property == null ? null : property.copy();
2545      dst.op = op == null ? null : op.copy();
2546      dst.value = value == null ? null : value.copy();
2547    }
2548
2549    @Override
2550    public boolean equalsDeep(Base other_) {
2551      if (!super.equalsDeep(other_))
2552        return false;
2553      if (!(other_ instanceof ConceptSetFilterComponent))
2554        return false;
2555      ConceptSetFilterComponent o = (ConceptSetFilterComponent) other_;
2556      return compareDeep(property, o.property, true) && compareDeep(op, o.op, true)
2557          && compareDeep(value, o.value, true);
2558    }
2559
2560    @Override
2561    public boolean equalsShallow(Base other_) {
2562      if (!super.equalsShallow(other_))
2563        return false;
2564      if (!(other_ instanceof ConceptSetFilterComponent))
2565        return false;
2566      ConceptSetFilterComponent o = (ConceptSetFilterComponent) other_;
2567      return compareValues(property, o.property, true) && compareValues(op, o.op, true)
2568          && compareValues(value, o.value, true);
2569    }
2570
2571    public boolean isEmpty() {
2572      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(property, op, value);
2573    }
2574
2575    public String fhirType() {
2576      return "ValueSet.compose.include.filter";
2577
2578    }
2579
2580  }
2581
2582  @Block()
2583  public static class ValueSetExpansionComponent extends BackboneElement implements IBaseBackboneElement {
2584    /**
2585     * An identifier that uniquely identifies this expansion of the valueset, based
2586     * on a unique combination of the provided parameters, the system default
2587     * parameters, and the underlying system code system versions etc. Systems may
2588     * re-use the same identifier as long as those factors remain the same, and the
2589     * expansion is the same, but are not required to do so. This is a business
2590     * identifier.
2591     */
2592    @Child(name = "identifier", type = {
2593        UriType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
2594    @Description(shortDefinition = "Identifies the value set expansion (business identifier)", formalDefinition = "An identifier that uniquely identifies this expansion of the valueset, based on a unique combination of the provided parameters, the system default parameters, and the underlying system code system versions etc. Systems may re-use the same identifier as long as those factors remain the same, and the expansion is the same, but are not required to do so. This is a business identifier.")
2595    protected UriType identifier;
2596
2597    /**
2598     * The time at which the expansion was produced by the expanding system.
2599     */
2600    @Child(name = "timestamp", type = {
2601        DateTimeType.class }, order = 2, min = 1, max = 1, modifier = false, summary = false)
2602    @Description(shortDefinition = "Time ValueSet expansion happened", formalDefinition = "The time at which the expansion was produced by the expanding system.")
2603    protected DateTimeType timestamp;
2604
2605    /**
2606     * The total number of concepts in the expansion. If the number of concept nodes
2607     * in this resource is less than the stated number, then the server can return
2608     * more using the offset parameter.
2609     */
2610    @Child(name = "total", type = { IntegerType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
2611    @Description(shortDefinition = "Total number of codes in the expansion", formalDefinition = "The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.")
2612    protected IntegerType total;
2613
2614    /**
2615     * If paging is being used, the offset at which this resource starts. I.e. this
2616     * resource is a partial view into the expansion. If paging is not being used,
2617     * this element SHALL NOT be present.
2618     */
2619    @Child(name = "offset", type = {
2620        IntegerType.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
2621    @Description(shortDefinition = "Offset at which this resource starts", formalDefinition = "If paging is being used, the offset at which this resource starts.  I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL NOT be present.")
2622    protected IntegerType offset;
2623
2624    /**
2625     * A parameter that controlled the expansion process. These parameters may be
2626     * used by users of expanded value sets to check whether the expansion is
2627     * suitable for a particular purpose, or to pick the correct expansion.
2628     */
2629    @Child(name = "parameter", type = {}, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
2630    @Description(shortDefinition = "Parameter that controlled the expansion process", formalDefinition = "A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.")
2631    protected List<ValueSetExpansionParameterComponent> parameter;
2632
2633    /**
2634     * The codes that are contained in the value set expansion.
2635     */
2636    @Child(name = "contains", type = {}, order = 6, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
2637    @Description(shortDefinition = "Codes in the value set", formalDefinition = "The codes that are contained in the value set expansion.")
2638    protected List<ValueSetExpansionContainsComponent> contains;
2639
2640    private static final long serialVersionUID = -43471993L;
2641
2642    /**
2643     * Constructor
2644     */
2645    public ValueSetExpansionComponent() {
2646      super();
2647    }
2648
2649    /**
2650     * Constructor
2651     */
2652    public ValueSetExpansionComponent(DateTimeType timestamp) {
2653      super();
2654      this.timestamp = timestamp;
2655    }
2656
2657    /**
2658     * @return {@link #identifier} (An identifier that uniquely identifies this
2659     *         expansion of the valueset, based on a unique combination of the
2660     *         provided parameters, the system default parameters, and the
2661     *         underlying system code system versions etc. Systems may re-use the
2662     *         same identifier as long as those factors remain the same, and the
2663     *         expansion is the same, but are not required to do so. This is a
2664     *         business identifier.). This is the underlying object with id, value
2665     *         and extensions. The accessor "getIdentifier" gives direct access to
2666     *         the value
2667     */
2668    public UriType getIdentifierElement() {
2669      if (this.identifier == null)
2670        if (Configuration.errorOnAutoCreate())
2671          throw new Error("Attempt to auto-create ValueSetExpansionComponent.identifier");
2672        else if (Configuration.doAutoCreate())
2673          this.identifier = new UriType(); // bb
2674      return this.identifier;
2675    }
2676
2677    public boolean hasIdentifierElement() {
2678      return this.identifier != null && !this.identifier.isEmpty();
2679    }
2680
2681    public boolean hasIdentifier() {
2682      return this.identifier != null && !this.identifier.isEmpty();
2683    }
2684
2685    /**
2686     * @param value {@link #identifier} (An identifier that uniquely identifies this
2687     *              expansion of the valueset, based on a unique combination of the
2688     *              provided parameters, the system default parameters, and the
2689     *              underlying system code system versions etc. Systems may re-use
2690     *              the same identifier as long as those factors remain the same,
2691     *              and the expansion is the same, but are not required to do so.
2692     *              This is a business identifier.). This is the underlying object
2693     *              with id, value and extensions. The accessor "getIdentifier"
2694     *              gives direct access to the value
2695     */
2696    public ValueSetExpansionComponent setIdentifierElement(UriType value) {
2697      this.identifier = value;
2698      return this;
2699    }
2700
2701    /**
2702     * @return An identifier that uniquely identifies this expansion of the
2703     *         valueset, based on a unique combination of the provided parameters,
2704     *         the system default parameters, and the underlying system code system
2705     *         versions etc. Systems may re-use the same identifier as long as those
2706     *         factors remain the same, and the expansion is the same, but are not
2707     *         required to do so. This is a business identifier.
2708     */
2709    public String getIdentifier() {
2710      return this.identifier == null ? null : this.identifier.getValue();
2711    }
2712
2713    /**
2714     * @param value An identifier that uniquely identifies this expansion of the
2715     *              valueset, based on a unique combination of the provided
2716     *              parameters, the system default parameters, and the underlying
2717     *              system code system versions etc. Systems may re-use the same
2718     *              identifier as long as those factors remain the same, and the
2719     *              expansion is the same, but are not required to do so. This is a
2720     *              business identifier.
2721     */
2722    public ValueSetExpansionComponent setIdentifier(String value) {
2723      if (Utilities.noString(value))
2724        this.identifier = null;
2725      else {
2726        if (this.identifier == null)
2727          this.identifier = new UriType();
2728        this.identifier.setValue(value);
2729      }
2730      return this;
2731    }
2732
2733    /**
2734     * @return {@link #timestamp} (The time at which the expansion was produced by
2735     *         the expanding system.). This is the underlying object with id, value
2736     *         and extensions. The accessor "getTimestamp" gives direct access to
2737     *         the value
2738     */
2739    public DateTimeType getTimestampElement() {
2740      if (this.timestamp == null)
2741        if (Configuration.errorOnAutoCreate())
2742          throw new Error("Attempt to auto-create ValueSetExpansionComponent.timestamp");
2743        else if (Configuration.doAutoCreate())
2744          this.timestamp = new DateTimeType(); // bb
2745      return this.timestamp;
2746    }
2747
2748    public boolean hasTimestampElement() {
2749      return this.timestamp != null && !this.timestamp.isEmpty();
2750    }
2751
2752    public boolean hasTimestamp() {
2753      return this.timestamp != null && !this.timestamp.isEmpty();
2754    }
2755
2756    /**
2757     * @param value {@link #timestamp} (The time at which the expansion was produced
2758     *              by the expanding system.). This is the underlying object with
2759     *              id, value and extensions. The accessor "getTimestamp" gives
2760     *              direct access to the value
2761     */
2762    public ValueSetExpansionComponent setTimestampElement(DateTimeType value) {
2763      this.timestamp = value;
2764      return this;
2765    }
2766
2767    /**
2768     * @return The time at which the expansion was produced by the expanding system.
2769     */
2770    public Date getTimestamp() {
2771      return this.timestamp == null ? null : this.timestamp.getValue();
2772    }
2773
2774    /**
2775     * @param value The time at which the expansion was produced by the expanding
2776     *              system.
2777     */
2778    public ValueSetExpansionComponent setTimestamp(Date value) {
2779      if (this.timestamp == null)
2780        this.timestamp = new DateTimeType();
2781      this.timestamp.setValue(value);
2782      return this;
2783    }
2784
2785    /**
2786     * @return {@link #total} (The total number of concepts in the expansion. If the
2787     *         number of concept nodes in this resource is less than the stated
2788     *         number, then the server can return more using the offset parameter.).
2789     *         This is the underlying object with id, value and extensions. The
2790     *         accessor "getTotal" gives direct access to the value
2791     */
2792    public IntegerType getTotalElement() {
2793      if (this.total == null)
2794        if (Configuration.errorOnAutoCreate())
2795          throw new Error("Attempt to auto-create ValueSetExpansionComponent.total");
2796        else if (Configuration.doAutoCreate())
2797          this.total = new IntegerType(); // bb
2798      return this.total;
2799    }
2800
2801    public boolean hasTotalElement() {
2802      return this.total != null && !this.total.isEmpty();
2803    }
2804
2805    public boolean hasTotal() {
2806      return this.total != null && !this.total.isEmpty();
2807    }
2808
2809    /**
2810     * @param value {@link #total} (The total number of concepts in the expansion.
2811     *              If the number of concept nodes in this resource is less than the
2812     *              stated number, then the server can return more using the offset
2813     *              parameter.). This is the underlying object with id, value and
2814     *              extensions. The accessor "getTotal" gives direct access to the
2815     *              value
2816     */
2817    public ValueSetExpansionComponent setTotalElement(IntegerType value) {
2818      this.total = value;
2819      return this;
2820    }
2821
2822    /**
2823     * @return The total number of concepts in the expansion. If the number of
2824     *         concept nodes in this resource is less than the stated number, then
2825     *         the server can return more using the offset parameter.
2826     */
2827    public int getTotal() {
2828      return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue();
2829    }
2830
2831    /**
2832     * @param value The total number of concepts in the expansion. If the number of
2833     *              concept nodes in this resource is less than the stated number,
2834     *              then the server can return more using the offset parameter.
2835     */
2836    public ValueSetExpansionComponent setTotal(int value) {
2837      if (this.total == null)
2838        this.total = new IntegerType();
2839      this.total.setValue(value);
2840      return this;
2841    }
2842
2843    /**
2844     * @return {@link #offset} (If paging is being used, the offset at which this
2845     *         resource starts. I.e. this resource is a partial view into the
2846     *         expansion. If paging is not being used, this element SHALL NOT be
2847     *         present.). This is the underlying object with id, value and
2848     *         extensions. The accessor "getOffset" gives direct access to the value
2849     */
2850    public IntegerType getOffsetElement() {
2851      if (this.offset == null)
2852        if (Configuration.errorOnAutoCreate())
2853          throw new Error("Attempt to auto-create ValueSetExpansionComponent.offset");
2854        else if (Configuration.doAutoCreate())
2855          this.offset = new IntegerType(); // bb
2856      return this.offset;
2857    }
2858
2859    public boolean hasOffsetElement() {
2860      return this.offset != null && !this.offset.isEmpty();
2861    }
2862
2863    public boolean hasOffset() {
2864      return this.offset != null && !this.offset.isEmpty();
2865    }
2866
2867    /**
2868     * @param value {@link #offset} (If paging is being used, the offset at which
2869     *              this resource starts. I.e. this resource is a partial view into
2870     *              the expansion. If paging is not being used, this element SHALL
2871     *              NOT be present.). This is the underlying object with id, value
2872     *              and extensions. The accessor "getOffset" gives direct access to
2873     *              the value
2874     */
2875    public ValueSetExpansionComponent setOffsetElement(IntegerType value) {
2876      this.offset = value;
2877      return this;
2878    }
2879
2880    /**
2881     * @return If paging is being used, the offset at which this resource starts.
2882     *         I.e. this resource is a partial view into the expansion. If paging is
2883     *         not being used, this element SHALL NOT be present.
2884     */
2885    public int getOffset() {
2886      return this.offset == null || this.offset.isEmpty() ? 0 : this.offset.getValue();
2887    }
2888
2889    /**
2890     * @param value If paging is being used, the offset at which this resource
2891     *              starts. I.e. this resource is a partial view into the expansion.
2892     *              If paging is not being used, this element SHALL NOT be present.
2893     */
2894    public ValueSetExpansionComponent setOffset(int value) {
2895      if (this.offset == null)
2896        this.offset = new IntegerType();
2897      this.offset.setValue(value);
2898      return this;
2899    }
2900
2901    /**
2902     * @return {@link #parameter} (A parameter that controlled the expansion
2903     *         process. These parameters may be used by users of expanded value sets
2904     *         to check whether the expansion is suitable for a particular purpose,
2905     *         or to pick the correct expansion.)
2906     */
2907    public List<ValueSetExpansionParameterComponent> getParameter() {
2908      if (this.parameter == null)
2909        this.parameter = new ArrayList<ValueSetExpansionParameterComponent>();
2910      return this.parameter;
2911    }
2912
2913    /**
2914     * @return Returns a reference to <code>this</code> for easy method chaining
2915     */
2916    public ValueSetExpansionComponent setParameter(List<ValueSetExpansionParameterComponent> theParameter) {
2917      this.parameter = theParameter;
2918      return this;
2919    }
2920
2921    public boolean hasParameter() {
2922      if (this.parameter == null)
2923        return false;
2924      for (ValueSetExpansionParameterComponent item : this.parameter)
2925        if (!item.isEmpty())
2926          return true;
2927      return false;
2928    }
2929
2930    public ValueSetExpansionParameterComponent addParameter() { // 3
2931      ValueSetExpansionParameterComponent t = new ValueSetExpansionParameterComponent();
2932      if (this.parameter == null)
2933        this.parameter = new ArrayList<ValueSetExpansionParameterComponent>();
2934      this.parameter.add(t);
2935      return t;
2936    }
2937
2938    public ValueSetExpansionComponent addParameter(ValueSetExpansionParameterComponent t) { // 3
2939      if (t == null)
2940        return this;
2941      if (this.parameter == null)
2942        this.parameter = new ArrayList<ValueSetExpansionParameterComponent>();
2943      this.parameter.add(t);
2944      return this;
2945    }
2946
2947    /**
2948     * @return The first repetition of repeating field {@link #parameter}, creating
2949     *         it if it does not already exist
2950     */
2951    public ValueSetExpansionParameterComponent getParameterFirstRep() {
2952      if (getParameter().isEmpty()) {
2953        addParameter();
2954      }
2955      return getParameter().get(0);
2956    }
2957
2958    /**
2959     * @return {@link #contains} (The codes that are contained in the value set
2960     *         expansion.)
2961     */
2962    public List<ValueSetExpansionContainsComponent> getContains() {
2963      if (this.contains == null)
2964        this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
2965      return this.contains;
2966    }
2967
2968    /**
2969     * @return Returns a reference to <code>this</code> for easy method chaining
2970     */
2971    public ValueSetExpansionComponent setContains(List<ValueSetExpansionContainsComponent> theContains) {
2972      this.contains = theContains;
2973      return this;
2974    }
2975
2976    public boolean hasContains() {
2977      if (this.contains == null)
2978        return false;
2979      for (ValueSetExpansionContainsComponent item : this.contains)
2980        if (!item.isEmpty())
2981          return true;
2982      return false;
2983    }
2984
2985    public ValueSetExpansionContainsComponent addContains() { // 3
2986      ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent();
2987      if (this.contains == null)
2988        this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
2989      this.contains.add(t);
2990      return t;
2991    }
2992
2993    public ValueSetExpansionComponent addContains(ValueSetExpansionContainsComponent t) { // 3
2994      if (t == null)
2995        return this;
2996      if (this.contains == null)
2997        this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
2998      this.contains.add(t);
2999      return this;
3000    }
3001
3002    /**
3003     * @return The first repetition of repeating field {@link #contains}, creating
3004     *         it if it does not already exist
3005     */
3006    public ValueSetExpansionContainsComponent getContainsFirstRep() {
3007      if (getContains().isEmpty()) {
3008        addContains();
3009      }
3010      return getContains().get(0);
3011    }
3012
3013    protected void listChildren(List<Property> children) {
3014      super.listChildren(children);
3015      children.add(new Property("identifier", "uri",
3016          "An identifier that uniquely identifies this expansion of the valueset, based on a unique combination of the provided parameters, the system default parameters, and the underlying system code system versions etc. Systems may re-use the same identifier as long as those factors remain the same, and the expansion is the same, but are not required to do so. This is a business identifier.",
3017          0, 1, identifier));
3018      children.add(new Property("timestamp", "dateTime",
3019          "The time at which the expansion was produced by the expanding system.", 0, 1, timestamp));
3020      children.add(new Property("total", "integer",
3021          "The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.",
3022          0, 1, total));
3023      children.add(new Property("offset", "integer",
3024          "If paging is being used, the offset at which this resource starts.  I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL NOT be present.",
3025          0, 1, offset));
3026      children.add(new Property("parameter", "",
3027          "A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.",
3028          0, java.lang.Integer.MAX_VALUE, parameter));
3029      children.add(new Property("contains", "", "The codes that are contained in the value set expansion.", 0,
3030          java.lang.Integer.MAX_VALUE, contains));
3031    }
3032
3033    @Override
3034    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3035      switch (_hash) {
3036      case -1618432855:
3037        /* identifier */ return new Property("identifier", "uri",
3038            "An identifier that uniquely identifies this expansion of the valueset, based on a unique combination of the provided parameters, the system default parameters, and the underlying system code system versions etc. Systems may re-use the same identifier as long as those factors remain the same, and the expansion is the same, but are not required to do so. This is a business identifier.",
3039            0, 1, identifier);
3040      case 55126294:
3041        /* timestamp */ return new Property("timestamp", "dateTime",
3042            "The time at which the expansion was produced by the expanding system.", 0, 1, timestamp);
3043      case 110549828:
3044        /* total */ return new Property("total", "integer",
3045            "The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.",
3046            0, 1, total);
3047      case -1019779949:
3048        /* offset */ return new Property("offset", "integer",
3049            "If paging is being used, the offset at which this resource starts.  I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL NOT be present.",
3050            0, 1, offset);
3051      case 1954460585:
3052        /* parameter */ return new Property("parameter", "",
3053            "A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.",
3054            0, java.lang.Integer.MAX_VALUE, parameter);
3055      case -567445985:
3056        /* contains */ return new Property("contains", "", "The codes that are contained in the value set expansion.",
3057            0, java.lang.Integer.MAX_VALUE, contains);
3058      default:
3059        return super.getNamedProperty(_hash, _name, _checkValid);
3060      }
3061
3062    }
3063
3064    @Override
3065    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3066      switch (hash) {
3067      case -1618432855:
3068        /* identifier */ return this.identifier == null ? new Base[0] : new Base[] { this.identifier }; // UriType
3069      case 55126294:
3070        /* timestamp */ return this.timestamp == null ? new Base[0] : new Base[] { this.timestamp }; // DateTimeType
3071      case 110549828:
3072        /* total */ return this.total == null ? new Base[0] : new Base[] { this.total }; // IntegerType
3073      case -1019779949:
3074        /* offset */ return this.offset == null ? new Base[0] : new Base[] { this.offset }; // IntegerType
3075      case 1954460585:
3076        /* parameter */ return this.parameter == null ? new Base[0]
3077            : this.parameter.toArray(new Base[this.parameter.size()]); // ValueSetExpansionParameterComponent
3078      case -567445985:
3079        /* contains */ return this.contains == null ? new Base[0]
3080            : this.contains.toArray(new Base[this.contains.size()]); // ValueSetExpansionContainsComponent
3081      default:
3082        return super.getProperty(hash, name, checkValid);
3083      }
3084
3085    }
3086
3087    @Override
3088    public Base setProperty(int hash, String name, Base value) throws FHIRException {
3089      switch (hash) {
3090      case -1618432855: // identifier
3091        this.identifier = castToUri(value); // UriType
3092        return value;
3093      case 55126294: // timestamp
3094        this.timestamp = castToDateTime(value); // DateTimeType
3095        return value;
3096      case 110549828: // total
3097        this.total = castToInteger(value); // IntegerType
3098        return value;
3099      case -1019779949: // offset
3100        this.offset = castToInteger(value); // IntegerType
3101        return value;
3102      case 1954460585: // parameter
3103        this.getParameter().add((ValueSetExpansionParameterComponent) value); // ValueSetExpansionParameterComponent
3104        return value;
3105      case -567445985: // contains
3106        this.getContains().add((ValueSetExpansionContainsComponent) value); // ValueSetExpansionContainsComponent
3107        return value;
3108      default:
3109        return super.setProperty(hash, name, value);
3110      }
3111
3112    }
3113
3114    @Override
3115    public Base setProperty(String name, Base value) throws FHIRException {
3116      if (name.equals("identifier")) {
3117        this.identifier = castToUri(value); // UriType
3118      } else if (name.equals("timestamp")) {
3119        this.timestamp = castToDateTime(value); // DateTimeType
3120      } else if (name.equals("total")) {
3121        this.total = castToInteger(value); // IntegerType
3122      } else if (name.equals("offset")) {
3123        this.offset = castToInteger(value); // IntegerType
3124      } else if (name.equals("parameter")) {
3125        this.getParameter().add((ValueSetExpansionParameterComponent) value);
3126      } else if (name.equals("contains")) {
3127        this.getContains().add((ValueSetExpansionContainsComponent) value);
3128      } else
3129        return super.setProperty(name, value);
3130      return value;
3131    }
3132
3133  @Override
3134  public void removeChild(String name, Base value) throws FHIRException {
3135      if (name.equals("identifier")) {
3136        this.identifier = null;
3137      } else if (name.equals("timestamp")) {
3138        this.timestamp = null;
3139      } else if (name.equals("total")) {
3140        this.total = null;
3141      } else if (name.equals("offset")) {
3142        this.offset = null;
3143      } else if (name.equals("parameter")) {
3144        this.getParameter().remove((ValueSetExpansionParameterComponent) value);
3145      } else if (name.equals("contains")) {
3146        this.getContains().remove((ValueSetExpansionContainsComponent) value);
3147      } else
3148        super.removeChild(name, value);
3149      
3150    }
3151
3152    @Override
3153    public Base makeProperty(int hash, String name) throws FHIRException {
3154      switch (hash) {
3155      case -1618432855:
3156        return getIdentifierElement();
3157      case 55126294:
3158        return getTimestampElement();
3159      case 110549828:
3160        return getTotalElement();
3161      case -1019779949:
3162        return getOffsetElement();
3163      case 1954460585:
3164        return addParameter();
3165      case -567445985:
3166        return addContains();
3167      default:
3168        return super.makeProperty(hash, name);
3169      }
3170
3171    }
3172
3173    @Override
3174    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3175      switch (hash) {
3176      case -1618432855:
3177        /* identifier */ return new String[] { "uri" };
3178      case 55126294:
3179        /* timestamp */ return new String[] { "dateTime" };
3180      case 110549828:
3181        /* total */ return new String[] { "integer" };
3182      case -1019779949:
3183        /* offset */ return new String[] { "integer" };
3184      case 1954460585:
3185        /* parameter */ return new String[] {};
3186      case -567445985:
3187        /* contains */ return new String[] {};
3188      default:
3189        return super.getTypesForProperty(hash, name);
3190      }
3191
3192    }
3193
3194    @Override
3195    public Base addChild(String name) throws FHIRException {
3196      if (name.equals("identifier")) {
3197        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.identifier");
3198      } else if (name.equals("timestamp")) {
3199        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.timestamp");
3200      } else if (name.equals("total")) {
3201        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.total");
3202      } else if (name.equals("offset")) {
3203        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.offset");
3204      } else if (name.equals("parameter")) {
3205        return addParameter();
3206      } else if (name.equals("contains")) {
3207        return addContains();
3208      } else
3209        return super.addChild(name);
3210    }
3211
3212    public ValueSetExpansionComponent copy() {
3213      ValueSetExpansionComponent dst = new ValueSetExpansionComponent();
3214      copyValues(dst);
3215      return dst;
3216    }
3217
3218    public void copyValues(ValueSetExpansionComponent dst) {
3219      super.copyValues(dst);
3220      dst.identifier = identifier == null ? null : identifier.copy();
3221      dst.timestamp = timestamp == null ? null : timestamp.copy();
3222      dst.total = total == null ? null : total.copy();
3223      dst.offset = offset == null ? null : offset.copy();
3224      if (parameter != null) {
3225        dst.parameter = new ArrayList<ValueSetExpansionParameterComponent>();
3226        for (ValueSetExpansionParameterComponent i : parameter)
3227          dst.parameter.add(i.copy());
3228      }
3229      ;
3230      if (contains != null) {
3231        dst.contains = new ArrayList<ValueSetExpansionContainsComponent>();
3232        for (ValueSetExpansionContainsComponent i : contains)
3233          dst.contains.add(i.copy());
3234      }
3235      ;
3236    }
3237
3238    @Override
3239    public boolean equalsDeep(Base other_) {
3240      if (!super.equalsDeep(other_))
3241        return false;
3242      if (!(other_ instanceof ValueSetExpansionComponent))
3243        return false;
3244      ValueSetExpansionComponent o = (ValueSetExpansionComponent) other_;
3245      return compareDeep(identifier, o.identifier, true) && compareDeep(timestamp, o.timestamp, true)
3246          && compareDeep(total, o.total, true) && compareDeep(offset, o.offset, true)
3247          && compareDeep(parameter, o.parameter, true) && compareDeep(contains, o.contains, true);
3248    }
3249
3250    @Override
3251    public boolean equalsShallow(Base other_) {
3252      if (!super.equalsShallow(other_))
3253        return false;
3254      if (!(other_ instanceof ValueSetExpansionComponent))
3255        return false;
3256      ValueSetExpansionComponent o = (ValueSetExpansionComponent) other_;
3257      return compareValues(identifier, o.identifier, true) && compareValues(timestamp, o.timestamp, true)
3258          && compareValues(total, o.total, true) && compareValues(offset, o.offset, true);
3259    }
3260
3261    public boolean isEmpty() {
3262      return super.isEmpty()
3263          && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, timestamp, total, offset, parameter, contains);
3264    }
3265
3266    public String fhirType() {
3267      return "ValueSet.expansion";
3268
3269    }
3270
3271    public ValueSetExpansionParameterComponent getParameter(String name) {
3272      for (ValueSetExpansionParameterComponent t : getParameter()) {
3273        if (name.equals(t.getName())) {
3274          return t;
3275        }
3276      }
3277      return null;
3278    }
3279  }
3280
3281  @Block()
3282  public static class ValueSetExpansionParameterComponent extends BackboneElement implements IBaseBackboneElement {
3283    /**
3284     * Name of the input parameter to the $expand operation; may be a
3285     * server-assigned name for additional default or other server-supplied
3286     * parameters used to control the expansion process.
3287     */
3288    @Child(name = "name", type = { StringType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
3289    @Description(shortDefinition = "Name as assigned by the client or server", formalDefinition = "Name of the input parameter to the $expand operation; may be a server-assigned name for additional default or other server-supplied parameters used to control the expansion process.")
3290    protected StringType name;
3291
3292    /**
3293     * The value of the parameter.
3294     */
3295    @Child(name = "value", type = { StringType.class, BooleanType.class, IntegerType.class, DecimalType.class,
3296        UriType.class, CodeType.class,
3297        DateTimeType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
3298    @Description(shortDefinition = "Value of the named parameter", formalDefinition = "The value of the parameter.")
3299    protected Type value;
3300
3301    private static final long serialVersionUID = 1172641169L;
3302
3303    /**
3304     * Constructor
3305     */
3306    public ValueSetExpansionParameterComponent() {
3307      super();
3308    }
3309
3310    /**
3311     * Constructor
3312     */
3313    public ValueSetExpansionParameterComponent(StringType name) {
3314      super();
3315      this.name = name;
3316    }
3317
3318    /**
3319     * @return {@link #name} (Name of the input parameter to the $expand operation;
3320     *         may be a server-assigned name for additional default or other
3321     *         server-supplied parameters used to control the expansion process.).
3322     *         This is the underlying object with id, value and extensions. The
3323     *         accessor "getName" gives direct access to the value
3324     */
3325    public StringType getNameElement() {
3326      if (this.name == null)
3327        if (Configuration.errorOnAutoCreate())
3328          throw new Error("Attempt to auto-create ValueSetExpansionParameterComponent.name");
3329        else if (Configuration.doAutoCreate())
3330          this.name = new StringType(); // bb
3331      return this.name;
3332    }
3333
3334    public boolean hasNameElement() {
3335      return this.name != null && !this.name.isEmpty();
3336    }
3337
3338    public boolean hasName() {
3339      return this.name != null && !this.name.isEmpty();
3340    }
3341
3342    /**
3343     * @param value {@link #name} (Name of the input parameter to the $expand
3344     *              operation; may be a server-assigned name for additional default
3345     *              or other server-supplied parameters used to control the
3346     *              expansion process.). This is the underlying object with id,
3347     *              value and extensions. The accessor "getName" gives direct access
3348     *              to the value
3349     */
3350    public ValueSetExpansionParameterComponent setNameElement(StringType value) {
3351      this.name = value;
3352      return this;
3353    }
3354
3355    /**
3356     * @return Name of the input parameter to the $expand operation; may be a
3357     *         server-assigned name for additional default or other server-supplied
3358     *         parameters used to control the expansion process.
3359     */
3360    public String getName() {
3361      return this.name == null ? null : this.name.getValue();
3362    }
3363
3364    /**
3365     * @param value Name of the input parameter to the $expand operation; may be a
3366     *              server-assigned name for additional default or other
3367     *              server-supplied parameters used to control the expansion
3368     *              process.
3369     */
3370    public ValueSetExpansionParameterComponent setName(String value) {
3371      if (this.name == null)
3372        this.name = new StringType();
3373      this.name.setValue(value);
3374      return this;
3375    }
3376
3377    /**
3378     * @return {@link #value} (The value of the parameter.)
3379     */
3380    public Type getValue() {
3381      return this.value;
3382    }
3383
3384    /**
3385     * @return {@link #value} (The value of the parameter.)
3386     */
3387    public StringType getValueStringType() throws FHIRException {
3388      if (this.value == null)
3389        this.value = new StringType();
3390      if (!(this.value instanceof StringType))
3391        throw new FHIRException("Type mismatch: the type StringType was expected, but "
3392            + this.value.getClass().getName() + " was encountered");
3393      return (StringType) this.value;
3394    }
3395
3396    public boolean hasValueStringType() {
3397      return this != null && this.value instanceof StringType;
3398    }
3399
3400    /**
3401     * @return {@link #value} (The value of the parameter.)
3402     */
3403    public BooleanType getValueBooleanType() throws FHIRException {
3404      if (this.value == null)
3405        this.value = new BooleanType();
3406      if (!(this.value instanceof BooleanType))
3407        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "
3408            + this.value.getClass().getName() + " was encountered");
3409      return (BooleanType) this.value;
3410    }
3411
3412    public boolean hasValueBooleanType() {
3413      return this != null && this.value instanceof BooleanType;
3414    }
3415
3416    /**
3417     * @return {@link #value} (The value of the parameter.)
3418     */
3419    public IntegerType getValueIntegerType() throws FHIRException {
3420      if (this.value == null)
3421        this.value = new IntegerType();
3422      if (!(this.value instanceof IntegerType))
3423        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "
3424            + this.value.getClass().getName() + " was encountered");
3425      return (IntegerType) this.value;
3426    }
3427
3428    public boolean hasValueIntegerType() {
3429      return this != null && this.value instanceof IntegerType;
3430    }
3431
3432    /**
3433     * @return {@link #value} (The value of the parameter.)
3434     */
3435    public DecimalType getValueDecimalType() throws FHIRException {
3436      if (this.value == null)
3437        this.value = new DecimalType();
3438      if (!(this.value instanceof DecimalType))
3439        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "
3440            + this.value.getClass().getName() + " was encountered");
3441      return (DecimalType) this.value;
3442    }
3443
3444    public boolean hasValueDecimalType() {
3445      return this != null && this.value instanceof DecimalType;
3446    }
3447
3448    /**
3449     * @return {@link #value} (The value of the parameter.)
3450     */
3451    public UriType getValueUriType() throws FHIRException {
3452      if (this.value == null)
3453        this.value = new UriType();
3454      if (!(this.value instanceof UriType))
3455        throw new FHIRException("Type mismatch: the type UriType was expected, but " + this.value.getClass().getName()
3456            + " was encountered");
3457      return (UriType) this.value;
3458    }
3459
3460    public boolean hasValueUriType() {
3461      return this != null && this.value instanceof UriType;
3462    }
3463
3464    /**
3465     * @return {@link #value} (The value of the parameter.)
3466     */
3467    public CodeType getValueCodeType() throws FHIRException {
3468      if (this.value == null)
3469        this.value = new CodeType();
3470      if (!(this.value instanceof CodeType))
3471        throw new FHIRException("Type mismatch: the type CodeType was expected, but " + this.value.getClass().getName()
3472            + " was encountered");
3473      return (CodeType) this.value;
3474    }
3475
3476    public boolean hasValueCodeType() {
3477      return this != null && this.value instanceof CodeType;
3478    }
3479
3480    /**
3481     * @return {@link #value} (The value of the parameter.)
3482     */
3483    public DateTimeType getValueDateTimeType() throws FHIRException {
3484      if (this.value == null)
3485        this.value = new DateTimeType();
3486      if (!(this.value instanceof DateTimeType))
3487        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "
3488            + this.value.getClass().getName() + " was encountered");
3489      return (DateTimeType) this.value;
3490    }
3491
3492    public boolean hasValueDateTimeType() {
3493      return this != null && this.value instanceof DateTimeType;
3494    }
3495
3496    public boolean hasValue() {
3497      return this.value != null && !this.value.isEmpty();
3498    }
3499
3500    /**
3501     * @param value {@link #value} (The value of the parameter.)
3502     */
3503    public ValueSetExpansionParameterComponent setValue(Type value) {
3504      if (value != null && !(value instanceof StringType || value instanceof BooleanType || value instanceof IntegerType
3505          || value instanceof DecimalType || value instanceof UriType || value instanceof CodeType
3506          || value instanceof DateTimeType))
3507        throw new Error("Not the right type for ValueSet.expansion.parameter.value[x]: " + value.fhirType());
3508      this.value = value;
3509      return this;
3510    }
3511
3512    protected void listChildren(List<Property> children) {
3513      super.listChildren(children);
3514      children.add(new Property("name", "string",
3515          "Name of the input parameter to the $expand operation; may be a server-assigned name for additional default or other server-supplied parameters used to control the expansion process.",
3516          0, 1, name));
3517      children.add(new Property("value[x]", "string|boolean|integer|decimal|uri|code|dateTime",
3518          "The value of the parameter.", 0, 1, value));
3519    }
3520
3521    @Override
3522    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3523      switch (_hash) {
3524      case 3373707:
3525        /* name */ return new Property("name", "string",
3526            "Name of the input parameter to the $expand operation; may be a server-assigned name for additional default or other server-supplied parameters used to control the expansion process.",
3527            0, 1, name);
3528      case -1410166417:
3529        /* value[x] */ return new Property("value[x]", "string|boolean|integer|decimal|uri|code|dateTime",
3530            "The value of the parameter.", 0, 1, value);
3531      case 111972721:
3532        /* value */ return new Property("value[x]", "string|boolean|integer|decimal|uri|code|dateTime",
3533            "The value of the parameter.", 0, 1, value);
3534      case -1424603934:
3535        /* valueString */ return new Property("value[x]", "string|boolean|integer|decimal|uri|code|dateTime",
3536            "The value of the parameter.", 0, 1, value);
3537      case 733421943:
3538        /* valueBoolean */ return new Property("value[x]", "string|boolean|integer|decimal|uri|code|dateTime",
3539            "The value of the parameter.", 0, 1, value);
3540      case -1668204915:
3541        /* valueInteger */ return new Property("value[x]", "string|boolean|integer|decimal|uri|code|dateTime",
3542            "The value of the parameter.", 0, 1, value);
3543      case -2083993440:
3544        /* valueDecimal */ return new Property("value[x]", "string|boolean|integer|decimal|uri|code|dateTime",
3545            "The value of the parameter.", 0, 1, value);
3546      case -1410172357:
3547        /* valueUri */ return new Property("value[x]", "string|boolean|integer|decimal|uri|code|dateTime",
3548            "The value of the parameter.", 0, 1, value);
3549      case -766209282:
3550        /* valueCode */ return new Property("value[x]", "string|boolean|integer|decimal|uri|code|dateTime",
3551            "The value of the parameter.", 0, 1, value);
3552      case 1047929900:
3553        /* valueDateTime */ return new Property("value[x]", "string|boolean|integer|decimal|uri|code|dateTime",
3554            "The value of the parameter.", 0, 1, value);
3555      default:
3556        return super.getNamedProperty(_hash, _name, _checkValid);
3557      }
3558
3559    }
3560
3561    @Override
3562    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3563      switch (hash) {
3564      case 3373707:
3565        /* name */ return this.name == null ? new Base[0] : new Base[] { this.name }; // StringType
3566      case 111972721:
3567        /* value */ return this.value == null ? new Base[0] : new Base[] { this.value }; // Type
3568      default:
3569        return super.getProperty(hash, name, checkValid);
3570      }
3571
3572    }
3573
3574    @Override
3575    public Base setProperty(int hash, String name, Base value) throws FHIRException {
3576      switch (hash) {
3577      case 3373707: // name
3578        this.name = castToString(value); // StringType
3579        return value;
3580      case 111972721: // value
3581        this.value = castToType(value); // Type
3582        return value;
3583      default:
3584        return super.setProperty(hash, name, value);
3585      }
3586
3587    }
3588
3589    @Override
3590    public Base setProperty(String name, Base value) throws FHIRException {
3591      if (name.equals("name")) {
3592        this.name = castToString(value); // StringType
3593      } else if (name.equals("value[x]")) {
3594        this.value = castToType(value); // Type
3595      } else
3596        return super.setProperty(name, value);
3597      return value;
3598    }
3599
3600  @Override
3601  public void removeChild(String name, Base value) throws FHIRException {
3602      if (name.equals("name")) {
3603        this.name = null;
3604      } else if (name.equals("value[x]")) {
3605        this.value = null;
3606      } else
3607        super.removeChild(name, value);
3608      
3609    }
3610
3611    @Override
3612    public Base makeProperty(int hash, String name) throws FHIRException {
3613      switch (hash) {
3614      case 3373707:
3615        return getNameElement();
3616      case -1410166417:
3617        return getValue();
3618      case 111972721:
3619        return getValue();
3620      default:
3621        return super.makeProperty(hash, name);
3622      }
3623
3624    }
3625
3626    @Override
3627    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3628      switch (hash) {
3629      case 3373707:
3630        /* name */ return new String[] { "string" };
3631      case 111972721:
3632        /* value */ return new String[] { "string", "boolean", "integer", "decimal", "uri", "code", "dateTime" };
3633      default:
3634        return super.getTypesForProperty(hash, name);
3635      }
3636
3637    }
3638
3639    @Override
3640    public Base addChild(String name) throws FHIRException {
3641      if (name.equals("name")) {
3642        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.name");
3643      } else if (name.equals("valueString")) {
3644        this.value = new StringType();
3645        return this.value;
3646      } else if (name.equals("valueBoolean")) {
3647        this.value = new BooleanType();
3648        return this.value;
3649      } else if (name.equals("valueInteger")) {
3650        this.value = new IntegerType();
3651        return this.value;
3652      } else if (name.equals("valueDecimal")) {
3653        this.value = new DecimalType();
3654        return this.value;
3655      } else if (name.equals("valueUri")) {
3656        this.value = new UriType();
3657        return this.value;
3658      } else if (name.equals("valueCode")) {
3659        this.value = new CodeType();
3660        return this.value;
3661      } else if (name.equals("valueDateTime")) {
3662        this.value = new DateTimeType();
3663        return this.value;
3664      } else
3665        return super.addChild(name);
3666    }
3667
3668    public ValueSetExpansionParameterComponent copy() {
3669      ValueSetExpansionParameterComponent dst = new ValueSetExpansionParameterComponent();
3670      copyValues(dst);
3671      return dst;
3672    }
3673
3674    public void copyValues(ValueSetExpansionParameterComponent dst) {
3675      super.copyValues(dst);
3676      dst.name = name == null ? null : name.copy();
3677      dst.value = value == null ? null : value.copy();
3678    }
3679
3680    @Override
3681    public boolean equalsDeep(Base other_) {
3682      if (!super.equalsDeep(other_))
3683        return false;
3684      if (!(other_ instanceof ValueSetExpansionParameterComponent))
3685        return false;
3686      ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other_;
3687      return compareDeep(name, o.name, true) && compareDeep(value, o.value, true);
3688    }
3689
3690    @Override
3691    public boolean equalsShallow(Base other_) {
3692      if (!super.equalsShallow(other_))
3693        return false;
3694      if (!(other_ instanceof ValueSetExpansionParameterComponent))
3695        return false;
3696      ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other_;
3697      return compareValues(name, o.name, true);
3698    }
3699
3700    public boolean isEmpty() {
3701      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value);
3702    }
3703
3704    public String fhirType() {
3705      return "ValueSet.expansion.parameter";
3706
3707    }
3708
3709  }
3710
3711  @Block()
3712  public static class ValueSetExpansionContainsComponent extends BackboneElement implements IBaseBackboneElement {
3713    /**
3714     * An absolute URI which is the code system in which the code for this item in
3715     * the expansion is defined.
3716     */
3717    @Child(name = "system", type = { UriType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
3718    @Description(shortDefinition = "System value for the code", formalDefinition = "An absolute URI which is the code system in which the code for this item in the expansion is defined.")
3719    protected UriType system;
3720
3721    /**
3722     * If true, this entry is included in the expansion for navigational purposes,
3723     * and the user cannot select the code directly as a proper value.
3724     */
3725    @Child(name = "abstract", type = {
3726        BooleanType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
3727    @Description(shortDefinition = "If user cannot select this entry", formalDefinition = "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.")
3728    protected BooleanType abstract_;
3729
3730    /**
3731     * If the concept is inactive in the code system that defines it. Inactive codes
3732     * are those that are no longer to be used, but are maintained by the code
3733     * system for understanding legacy data. It might not be known or specified
3734     * whether an concept is inactive (and it may depend on the context of use).
3735     */
3736    @Child(name = "inactive", type = {
3737        BooleanType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
3738    @Description(shortDefinition = "If concept is inactive in the code system", formalDefinition = "If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understanding legacy data. It might not be known or specified whether an concept is inactive (and it may depend on the context of use).")
3739    protected BooleanType inactive;
3740
3741    /**
3742     * The version of the code system from this code was taken. Note that a
3743     * well-maintained code system does not need the version reported, because the
3744     * meaning of codes is consistent across versions. However this cannot
3745     * consistently be assured, and when the meaning is not guaranteed to be
3746     * consistent, the version SHOULD be exchanged.
3747     */
3748    @Child(name = "version", type = {
3749        StringType.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
3750    @Description(shortDefinition = "Version in which this code/display is defined", formalDefinition = "The version of the code system from this code was taken. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.")
3751    protected StringType version;
3752
3753    /**
3754     * The code for this item in the expansion hierarchy. If this code is missing
3755     * the entry in the hierarchy is a place holder (abstract) and does not
3756     * represent a valid code in the value set.
3757     */
3758    @Child(name = "code", type = { CodeType.class }, order = 5, min = 0, max = 1, modifier = false, summary = false)
3759    @Description(shortDefinition = "Code - if blank, this is not a selectable code", formalDefinition = "The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.")
3760    protected CodeType code;
3761
3762    /**
3763     * The recommended display for this item in the expansion.
3764     */
3765    @Child(name = "display", type = {
3766        StringType.class }, order = 6, min = 0, max = 1, modifier = false, summary = false)
3767    @Description(shortDefinition = "User display for the concept", formalDefinition = "The recommended display for this item in the expansion.")
3768    protected StringType display;
3769
3770    /**
3771     * Additional representations for this item - other languages, aliases,
3772     * specialized purposes, used for particular purposes, etc. These are relevant
3773     * when the conditions of the expansion do not fix to a single correct
3774     * representation.
3775     */
3776    @Child(name = "designation", type = {
3777        ConceptReferenceDesignationComponent.class }, order = 7, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
3778    @Description(shortDefinition = "Additional representations for this item", formalDefinition = "Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation.")
3779    protected List<ConceptReferenceDesignationComponent> designation;
3780
3781    /**
3782     * Other codes and entries contained under this entry in the hierarchy.
3783     */
3784    @Child(name = "contains", type = {
3785        ValueSetExpansionContainsComponent.class }, order = 8, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
3786    @Description(shortDefinition = "Codes contained under this entry", formalDefinition = "Other codes and entries contained under this entry in the hierarchy.")
3787    protected List<ValueSetExpansionContainsComponent> contains;
3788
3789    private static final long serialVersionUID = 719458860L;
3790
3791    /**
3792     * Constructor
3793     */
3794    public ValueSetExpansionContainsComponent() {
3795      super();
3796    }
3797
3798    /**
3799     * @return {@link #system} (An absolute URI which is the code system in which
3800     *         the code for this item in the expansion is defined.). This is the
3801     *         underlying object with id, value and extensions. The accessor
3802     *         "getSystem" gives direct access to the value
3803     */
3804    public UriType getSystemElement() {
3805      if (this.system == null)
3806        if (Configuration.errorOnAutoCreate())
3807          throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.system");
3808        else if (Configuration.doAutoCreate())
3809          this.system = new UriType(); // bb
3810      return this.system;
3811    }
3812
3813    public boolean hasSystemElement() {
3814      return this.system != null && !this.system.isEmpty();
3815    }
3816
3817    public boolean hasSystem() {
3818      return this.system != null && !this.system.isEmpty();
3819    }
3820
3821    /**
3822     * @param value {@link #system} (An absolute URI which is the code system in
3823     *              which the code for this item in the expansion is defined.). This
3824     *              is the underlying object with id, value and extensions. The
3825     *              accessor "getSystem" gives direct access to the value
3826     */
3827    public ValueSetExpansionContainsComponent setSystemElement(UriType value) {
3828      this.system = value;
3829      return this;
3830    }
3831
3832    /**
3833     * @return An absolute URI which is the code system in which the code for this
3834     *         item in the expansion is defined.
3835     */
3836    public String getSystem() {
3837      return this.system == null ? null : this.system.getValue();
3838    }
3839
3840    /**
3841     * @param value An absolute URI which is the code system in which the code for
3842     *              this item in the expansion is defined.
3843     */
3844    public ValueSetExpansionContainsComponent setSystem(String value) {
3845      if (Utilities.noString(value))
3846        this.system = null;
3847      else {
3848        if (this.system == null)
3849          this.system = new UriType();
3850        this.system.setValue(value);
3851      }
3852      return this;
3853    }
3854
3855    /**
3856     * @return {@link #abstract_} (If true, this entry is included in the expansion
3857     *         for navigational purposes, and the user cannot select the code
3858     *         directly as a proper value.). This is the underlying object with id,
3859     *         value and extensions. The accessor "getAbstract" gives direct access
3860     *         to the value
3861     */
3862    public BooleanType getAbstractElement() {
3863      if (this.abstract_ == null)
3864        if (Configuration.errorOnAutoCreate())
3865          throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.abstract_");
3866        else if (Configuration.doAutoCreate())
3867          this.abstract_ = new BooleanType(); // bb
3868      return this.abstract_;
3869    }
3870
3871    public boolean hasAbstractElement() {
3872      return this.abstract_ != null && !this.abstract_.isEmpty();
3873    }
3874
3875    public boolean hasAbstract() {
3876      return this.abstract_ != null && !this.abstract_.isEmpty();
3877    }
3878
3879    /**
3880     * @param value {@link #abstract_} (If true, this entry is included in the
3881     *              expansion for navigational purposes, and the user cannot select
3882     *              the code directly as a proper value.). This is the underlying
3883     *              object with id, value and extensions. The accessor "getAbstract"
3884     *              gives direct access to the value
3885     */
3886    public ValueSetExpansionContainsComponent setAbstractElement(BooleanType value) {
3887      this.abstract_ = value;
3888      return this;
3889    }
3890
3891    /**
3892     * @return If true, this entry is included in the expansion for navigational
3893     *         purposes, and the user cannot select the code directly as a proper
3894     *         value.
3895     */
3896    public boolean getAbstract() {
3897      return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue();
3898    }
3899
3900    /**
3901     * @param value If true, this entry is included in the expansion for
3902     *              navigational purposes, and the user cannot select the code
3903     *              directly as a proper value.
3904     */
3905    public ValueSetExpansionContainsComponent setAbstract(boolean value) {
3906      if (this.abstract_ == null)
3907        this.abstract_ = new BooleanType();
3908      this.abstract_.setValue(value);
3909      return this;
3910    }
3911
3912    /**
3913     * @return {@link #inactive} (If the concept is inactive in the code system that
3914     *         defines it. Inactive codes are those that are no longer to be used,
3915     *         but are maintained by the code system for understanding legacy data.
3916     *         It might not be known or specified whether an concept is inactive
3917     *         (and it may depend on the context of use).). This is the underlying
3918     *         object with id, value and extensions. The accessor "getInactive"
3919     *         gives direct access to the value
3920     */
3921    public BooleanType getInactiveElement() {
3922      if (this.inactive == null)
3923        if (Configuration.errorOnAutoCreate())
3924          throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.inactive");
3925        else if (Configuration.doAutoCreate())
3926          this.inactive = new BooleanType(); // bb
3927      return this.inactive;
3928    }
3929
3930    public boolean hasInactiveElement() {
3931      return this.inactive != null && !this.inactive.isEmpty();
3932    }
3933
3934    public boolean hasInactive() {
3935      return this.inactive != null && !this.inactive.isEmpty();
3936    }
3937
3938    /**
3939     * @param value {@link #inactive} (If the concept is inactive in the code system
3940     *              that defines it. Inactive codes are those that are no longer to
3941     *              be used, but are maintained by the code system for understanding
3942     *              legacy data. It might not be known or specified whether an
3943     *              concept is inactive (and it may depend on the context of use).).
3944     *              This is the underlying object with id, value and extensions. The
3945     *              accessor "getInactive" gives direct access to the value
3946     */
3947    public ValueSetExpansionContainsComponent setInactiveElement(BooleanType value) {
3948      this.inactive = value;
3949      return this;
3950    }
3951
3952    /**
3953     * @return If the concept is inactive in the code system that defines it.
3954     *         Inactive codes are those that are no longer to be used, but are
3955     *         maintained by the code system for understanding legacy data. It might
3956     *         not be known or specified whether an concept is inactive (and it may
3957     *         depend on the context of use).
3958     */
3959    public boolean getInactive() {
3960      return this.inactive == null || this.inactive.isEmpty() ? false : this.inactive.getValue();
3961    }
3962
3963    /**
3964     * @param value If the concept is inactive in the code system that defines it.
3965     *              Inactive codes are those that are no longer to be used, but are
3966     *              maintained by the code system for understanding legacy data. It
3967     *              might not be known or specified whether an concept is inactive
3968     *              (and it may depend on the context of use).
3969     */
3970    public ValueSetExpansionContainsComponent setInactive(boolean value) {
3971      if (this.inactive == null)
3972        this.inactive = new BooleanType();
3973      this.inactive.setValue(value);
3974      return this;
3975    }
3976
3977    /**
3978     * @return {@link #version} (The version of the code system from this code was
3979     *         taken. Note that a well-maintained code system does not need the
3980     *         version reported, because the meaning of codes is consistent across
3981     *         versions. However this cannot consistently be assured, and when the
3982     *         meaning is not guaranteed to be consistent, the version SHOULD be
3983     *         exchanged.). This is the underlying object with id, value and
3984     *         extensions. The accessor "getVersion" gives direct access to the
3985     *         value
3986     */
3987    public StringType getVersionElement() {
3988      if (this.version == null)
3989        if (Configuration.errorOnAutoCreate())
3990          throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.version");
3991        else if (Configuration.doAutoCreate())
3992          this.version = new StringType(); // bb
3993      return this.version;
3994    }
3995
3996    public boolean hasVersionElement() {
3997      return this.version != null && !this.version.isEmpty();
3998    }
3999
4000    public boolean hasVersion() {
4001      return this.version != null && !this.version.isEmpty();
4002    }
4003
4004    /**
4005     * @param value {@link #version} (The version of the code system from this code
4006     *              was taken. Note that a well-maintained code system does not need
4007     *              the version reported, because the meaning of codes is consistent
4008     *              across versions. However this cannot consistently be assured,
4009     *              and when the meaning is not guaranteed to be consistent, the
4010     *              version SHOULD be exchanged.). This is the underlying object
4011     *              with id, value and extensions. The accessor "getVersion" gives
4012     *              direct access to the value
4013     */
4014    public ValueSetExpansionContainsComponent setVersionElement(StringType value) {
4015      this.version = value;
4016      return this;
4017    }
4018
4019    /**
4020     * @return The version of the code system from this code was taken. Note that a
4021     *         well-maintained code system does not need the version reported,
4022     *         because the meaning of codes is consistent across versions. However
4023     *         this cannot consistently be assured, and when the meaning is not
4024     *         guaranteed to be consistent, the version SHOULD be exchanged.
4025     */
4026    public String getVersion() {
4027      return this.version == null ? null : this.version.getValue();
4028    }
4029
4030    /**
4031     * @param value The version of the code system from this code was taken. Note
4032     *              that a well-maintained code system does not need the version
4033     *              reported, because the meaning of codes is consistent across
4034     *              versions. However this cannot consistently be assured, and when
4035     *              the meaning is not guaranteed to be consistent, the version
4036     *              SHOULD be exchanged.
4037     */
4038    public ValueSetExpansionContainsComponent setVersion(String value) {
4039      if (Utilities.noString(value))
4040        this.version = null;
4041      else {
4042        if (this.version == null)
4043          this.version = new StringType();
4044        this.version.setValue(value);
4045      }
4046      return this;
4047    }
4048
4049    /**
4050     * @return {@link #code} (The code for this item in the expansion hierarchy. If
4051     *         this code is missing the entry in the hierarchy is a place holder
4052     *         (abstract) and does not represent a valid code in the value set.).
4053     *         This is the underlying object with id, value and extensions. The
4054     *         accessor "getCode" gives direct access to the value
4055     */
4056    public CodeType getCodeElement() {
4057      if (this.code == null)
4058        if (Configuration.errorOnAutoCreate())
4059          throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.code");
4060        else if (Configuration.doAutoCreate())
4061          this.code = new CodeType(); // bb
4062      return this.code;
4063    }
4064
4065    public boolean hasCodeElement() {
4066      return this.code != null && !this.code.isEmpty();
4067    }
4068
4069    public boolean hasCode() {
4070      return this.code != null && !this.code.isEmpty();
4071    }
4072
4073    /**
4074     * @param value {@link #code} (The code for this item in the expansion
4075     *              hierarchy. If this code is missing the entry in the hierarchy is
4076     *              a place holder (abstract) and does not represent a valid code in
4077     *              the value set.). This is the underlying object with id, value
4078     *              and extensions. The accessor "getCode" gives direct access to
4079     *              the value
4080     */
4081    public ValueSetExpansionContainsComponent setCodeElement(CodeType value) {
4082      this.code = value;
4083      return this;
4084    }
4085
4086    /**
4087     * @return The code for this item in the expansion hierarchy. If this code is
4088     *         missing the entry in the hierarchy is a place holder (abstract) and
4089     *         does not represent a valid code in the value set.
4090     */
4091    public String getCode() {
4092      return this.code == null ? null : this.code.getValue();
4093    }
4094
4095    /**
4096     * @param value The code for this item in the expansion hierarchy. If this code
4097     *              is missing the entry in the hierarchy is a place holder
4098     *              (abstract) and does not represent a valid code in the value set.
4099     */
4100    public ValueSetExpansionContainsComponent setCode(String value) {
4101      if (Utilities.noString(value))
4102        this.code = null;
4103      else {
4104        if (this.code == null)
4105          this.code = new CodeType();
4106        this.code.setValue(value);
4107      }
4108      return this;
4109    }
4110
4111    /**
4112     * @return {@link #display} (The recommended display for this item in the
4113     *         expansion.). This is the underlying object with id, value and
4114     *         extensions. The accessor "getDisplay" gives direct access to the
4115     *         value
4116     */
4117    public StringType getDisplayElement() {
4118      if (this.display == null)
4119        if (Configuration.errorOnAutoCreate())
4120          throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.display");
4121        else if (Configuration.doAutoCreate())
4122          this.display = new StringType(); // bb
4123      return this.display;
4124    }
4125
4126    public boolean hasDisplayElement() {
4127      return this.display != null && !this.display.isEmpty();
4128    }
4129
4130    public boolean hasDisplay() {
4131      return this.display != null && !this.display.isEmpty();
4132    }
4133
4134    /**
4135     * @param value {@link #display} (The recommended display for this item in the
4136     *              expansion.). This is the underlying object with id, value and
4137     *              extensions. The accessor "getDisplay" gives direct access to the
4138     *              value
4139     */
4140    public ValueSetExpansionContainsComponent setDisplayElement(StringType value) {
4141      this.display = value;
4142      return this;
4143    }
4144
4145    /**
4146     * @return The recommended display for this item in the expansion.
4147     */
4148    public String getDisplay() {
4149      return this.display == null ? null : this.display.getValue();
4150    }
4151
4152    /**
4153     * @param value The recommended display for this item in the expansion.
4154     */
4155    public ValueSetExpansionContainsComponent setDisplay(String value) {
4156      if (Utilities.noString(value))
4157        this.display = null;
4158      else {
4159        if (this.display == null)
4160          this.display = new StringType();
4161        this.display.setValue(value);
4162      }
4163      return this;
4164    }
4165
4166    /**
4167     * @return {@link #designation} (Additional representations for this item -
4168     *         other languages, aliases, specialized purposes, used for particular
4169     *         purposes, etc. These are relevant when the conditions of the
4170     *         expansion do not fix to a single correct representation.)
4171     */
4172    public List<ConceptReferenceDesignationComponent> getDesignation() {
4173      if (this.designation == null)
4174        this.designation = new ArrayList<ConceptReferenceDesignationComponent>();
4175      return this.designation;
4176    }
4177
4178    /**
4179     * @return Returns a reference to <code>this</code> for easy method chaining
4180     */
4181    public ValueSetExpansionContainsComponent setDesignation(
4182        List<ConceptReferenceDesignationComponent> theDesignation) {
4183      this.designation = theDesignation;
4184      return this;
4185    }
4186
4187    public boolean hasDesignation() {
4188      if (this.designation == null)
4189        return false;
4190      for (ConceptReferenceDesignationComponent item : this.designation)
4191        if (!item.isEmpty())
4192          return true;
4193      return false;
4194    }
4195
4196    public ConceptReferenceDesignationComponent addDesignation() { // 3
4197      ConceptReferenceDesignationComponent t = new ConceptReferenceDesignationComponent();
4198      if (this.designation == null)
4199        this.designation = new ArrayList<ConceptReferenceDesignationComponent>();
4200      this.designation.add(t);
4201      return t;
4202    }
4203
4204    public ValueSetExpansionContainsComponent addDesignation(ConceptReferenceDesignationComponent t) { // 3
4205      if (t == null)
4206        return this;
4207      if (this.designation == null)
4208        this.designation = new ArrayList<ConceptReferenceDesignationComponent>();
4209      this.designation.add(t);
4210      return this;
4211    }
4212
4213    /**
4214     * @return The first repetition of repeating field {@link #designation},
4215     *         creating it if it does not already exist
4216     */
4217    public ConceptReferenceDesignationComponent getDesignationFirstRep() {
4218      if (getDesignation().isEmpty()) {
4219        addDesignation();
4220      }
4221      return getDesignation().get(0);
4222    }
4223
4224    /**
4225     * @return {@link #contains} (Other codes and entries contained under this entry
4226     *         in the hierarchy.)
4227     */
4228    public List<ValueSetExpansionContainsComponent> getContains() {
4229      if (this.contains == null)
4230        this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
4231      return this.contains;
4232    }
4233
4234    /**
4235     * @return Returns a reference to <code>this</code> for easy method chaining
4236     */
4237    public ValueSetExpansionContainsComponent setContains(List<ValueSetExpansionContainsComponent> theContains) {
4238      this.contains = theContains;
4239      return this;
4240    }
4241
4242    public boolean hasContains() {
4243      if (this.contains == null)
4244        return false;
4245      for (ValueSetExpansionContainsComponent item : this.contains)
4246        if (!item.isEmpty())
4247          return true;
4248      return false;
4249    }
4250
4251    public ValueSetExpansionContainsComponent addContains() { // 3
4252      ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent();
4253      if (this.contains == null)
4254        this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
4255      this.contains.add(t);
4256      return t;
4257    }
4258
4259    public ValueSetExpansionContainsComponent addContains(ValueSetExpansionContainsComponent t) { // 3
4260      if (t == null)
4261        return this;
4262      if (this.contains == null)
4263        this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
4264      this.contains.add(t);
4265      return this;
4266    }
4267
4268    /**
4269     * @return The first repetition of repeating field {@link #contains}, creating
4270     *         it if it does not already exist
4271     */
4272    public ValueSetExpansionContainsComponent getContainsFirstRep() {
4273      if (getContains().isEmpty()) {
4274        addContains();
4275      }
4276      return getContains().get(0);
4277    }
4278
4279    protected void listChildren(List<Property> children) {
4280      super.listChildren(children);
4281      children.add(new Property("system", "uri",
4282          "An absolute URI which is the code system in which the code for this item in the expansion is defined.", 0, 1,
4283          system));
4284      children.add(new Property("abstract", "boolean",
4285          "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.",
4286          0, 1, abstract_));
4287      children.add(new Property("inactive", "boolean",
4288          "If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understanding legacy data. It might not be known or specified whether an concept is inactive (and it may depend on the context of use).",
4289          0, 1, inactive));
4290      children.add(new Property("version", "string",
4291          "The version of the code system from this code was taken. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.",
4292          0, 1, version));
4293      children.add(new Property("code", "code",
4294          "The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.",
4295          0, 1, code));
4296      children.add(
4297          new Property("display", "string", "The recommended display for this item in the expansion.", 0, 1, display));
4298      children.add(new Property("designation", "@ValueSet.compose.include.concept.designation",
4299          "Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation.",
4300          0, java.lang.Integer.MAX_VALUE, designation));
4301      children.add(new Property("contains", "@ValueSet.expansion.contains",
4302          "Other codes and entries contained under this entry in the hierarchy.", 0, java.lang.Integer.MAX_VALUE,
4303          contains));
4304    }
4305
4306    @Override
4307    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4308      switch (_hash) {
4309      case -887328209:
4310        /* system */ return new Property("system", "uri",
4311            "An absolute URI which is the code system in which the code for this item in the expansion is defined.", 0,
4312            1, system);
4313      case 1732898850:
4314        /* abstract */ return new Property("abstract", "boolean",
4315            "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.",
4316            0, 1, abstract_);
4317      case 24665195:
4318        /* inactive */ return new Property("inactive", "boolean",
4319            "If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understanding legacy data. It might not be known or specified whether an concept is inactive (and it may depend on the context of use).",
4320            0, 1, inactive);
4321      case 351608024:
4322        /* version */ return new Property("version", "string",
4323            "The version of the code system from this code was taken. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.",
4324            0, 1, version);
4325      case 3059181:
4326        /* code */ return new Property("code", "code",
4327            "The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.",
4328            0, 1, code);
4329      case 1671764162:
4330        /* display */ return new Property("display", "string",
4331            "The recommended display for this item in the expansion.", 0, 1, display);
4332      case -900931593:
4333        /* designation */ return new Property("designation", "@ValueSet.compose.include.concept.designation",
4334            "Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation.",
4335            0, java.lang.Integer.MAX_VALUE, designation);
4336      case -567445985:
4337        /* contains */ return new Property("contains", "@ValueSet.expansion.contains",
4338            "Other codes and entries contained under this entry in the hierarchy.", 0, java.lang.Integer.MAX_VALUE,
4339            contains);
4340      default:
4341        return super.getNamedProperty(_hash, _name, _checkValid);
4342      }
4343
4344    }
4345
4346    @Override
4347    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4348      switch (hash) {
4349      case -887328209:
4350        /* system */ return this.system == null ? new Base[0] : new Base[] { this.system }; // UriType
4351      case 1732898850:
4352        /* abstract */ return this.abstract_ == null ? new Base[0] : new Base[] { this.abstract_ }; // BooleanType
4353      case 24665195:
4354        /* inactive */ return this.inactive == null ? new Base[0] : new Base[] { this.inactive }; // BooleanType
4355      case 351608024:
4356        /* version */ return this.version == null ? new Base[0] : new Base[] { this.version }; // StringType
4357      case 3059181:
4358        /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeType
4359      case 1671764162:
4360        /* display */ return this.display == null ? new Base[0] : new Base[] { this.display }; // StringType
4361      case -900931593:
4362        /* designation */ return this.designation == null ? new Base[0]
4363            : this.designation.toArray(new Base[this.designation.size()]); // ConceptReferenceDesignationComponent
4364      case -567445985:
4365        /* contains */ return this.contains == null ? new Base[0]
4366            : this.contains.toArray(new Base[this.contains.size()]); // ValueSetExpansionContainsComponent
4367      default:
4368        return super.getProperty(hash, name, checkValid);
4369      }
4370
4371    }
4372
4373    @Override
4374    public Base setProperty(int hash, String name, Base value) throws FHIRException {
4375      switch (hash) {
4376      case -887328209: // system
4377        this.system = castToUri(value); // UriType
4378        return value;
4379      case 1732898850: // abstract
4380        this.abstract_ = castToBoolean(value); // BooleanType
4381        return value;
4382      case 24665195: // inactive
4383        this.inactive = castToBoolean(value); // BooleanType
4384        return value;
4385      case 351608024: // version
4386        this.version = castToString(value); // StringType
4387        return value;
4388      case 3059181: // code
4389        this.code = castToCode(value); // CodeType
4390        return value;
4391      case 1671764162: // display
4392        this.display = castToString(value); // StringType
4393        return value;
4394      case -900931593: // designation
4395        this.getDesignation().add((ConceptReferenceDesignationComponent) value); // ConceptReferenceDesignationComponent
4396        return value;
4397      case -567445985: // contains
4398        this.getContains().add((ValueSetExpansionContainsComponent) value); // ValueSetExpansionContainsComponent
4399        return value;
4400      default:
4401        return super.setProperty(hash, name, value);
4402      }
4403
4404    }
4405
4406    @Override
4407    public Base setProperty(String name, Base value) throws FHIRException {
4408      if (name.equals("system")) {
4409        this.system = castToUri(value); // UriType
4410      } else if (name.equals("abstract")) {
4411        this.abstract_ = castToBoolean(value); // BooleanType
4412      } else if (name.equals("inactive")) {
4413        this.inactive = castToBoolean(value); // BooleanType
4414      } else if (name.equals("version")) {
4415        this.version = castToString(value); // StringType
4416      } else if (name.equals("code")) {
4417        this.code = castToCode(value); // CodeType
4418      } else if (name.equals("display")) {
4419        this.display = castToString(value); // StringType
4420      } else if (name.equals("designation")) {
4421        this.getDesignation().add((ConceptReferenceDesignationComponent) value);
4422      } else if (name.equals("contains")) {
4423        this.getContains().add((ValueSetExpansionContainsComponent) value);
4424      } else
4425        return super.setProperty(name, value);
4426      return value;
4427    }
4428
4429  @Override
4430  public void removeChild(String name, Base value) throws FHIRException {
4431      if (name.equals("system")) {
4432        this.system = null;
4433      } else if (name.equals("abstract")) {
4434        this.abstract_ = null;
4435      } else if (name.equals("inactive")) {
4436        this.inactive = null;
4437      } else if (name.equals("version")) {
4438        this.version = null;
4439      } else if (name.equals("code")) {
4440        this.code = null;
4441      } else if (name.equals("display")) {
4442        this.display = null;
4443      } else if (name.equals("designation")) {
4444        this.getDesignation().remove((ConceptReferenceDesignationComponent) value);
4445      } else if (name.equals("contains")) {
4446        this.getContains().remove((ValueSetExpansionContainsComponent) value);
4447      } else
4448        super.removeChild(name, value);
4449      
4450    }
4451
4452    @Override
4453    public Base makeProperty(int hash, String name) throws FHIRException {
4454      switch (hash) {
4455      case -887328209:
4456        return getSystemElement();
4457      case 1732898850:
4458        return getAbstractElement();
4459      case 24665195:
4460        return getInactiveElement();
4461      case 351608024:
4462        return getVersionElement();
4463      case 3059181:
4464        return getCodeElement();
4465      case 1671764162:
4466        return getDisplayElement();
4467      case -900931593:
4468        return addDesignation();
4469      case -567445985:
4470        return addContains();
4471      default:
4472        return super.makeProperty(hash, name);
4473      }
4474
4475    }
4476
4477    @Override
4478    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4479      switch (hash) {
4480      case -887328209:
4481        /* system */ return new String[] { "uri" };
4482      case 1732898850:
4483        /* abstract */ return new String[] { "boolean" };
4484      case 24665195:
4485        /* inactive */ return new String[] { "boolean" };
4486      case 351608024:
4487        /* version */ return new String[] { "string" };
4488      case 3059181:
4489        /* code */ return new String[] { "code" };
4490      case 1671764162:
4491        /* display */ return new String[] { "string" };
4492      case -900931593:
4493        /* designation */ return new String[] { "@ValueSet.compose.include.concept.designation" };
4494      case -567445985:
4495        /* contains */ return new String[] { "@ValueSet.expansion.contains" };
4496      default:
4497        return super.getTypesForProperty(hash, name);
4498      }
4499
4500    }
4501
4502    @Override
4503    public Base addChild(String name) throws FHIRException {
4504      if (name.equals("system")) {
4505        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.system");
4506      } else if (name.equals("abstract")) {
4507        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.abstract");
4508      } else if (name.equals("inactive")) {
4509        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.inactive");
4510      } else if (name.equals("version")) {
4511        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.version");
4512      } else if (name.equals("code")) {
4513        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.code");
4514      } else if (name.equals("display")) {
4515        throw new FHIRException("Cannot call addChild on a singleton property ValueSet.display");
4516      } else if (name.equals("designation")) {
4517        return addDesignation();
4518      } else if (name.equals("contains")) {
4519        return addContains();
4520      } else
4521        return super.addChild(name);
4522    }
4523
4524    public ValueSetExpansionContainsComponent copy() {
4525      ValueSetExpansionContainsComponent dst = new ValueSetExpansionContainsComponent();
4526      copyValues(dst);
4527      return dst;
4528    }
4529
4530    public void copyValues(ValueSetExpansionContainsComponent dst) {
4531      super.copyValues(dst);
4532      dst.system = system == null ? null : system.copy();
4533      dst.abstract_ = abstract_ == null ? null : abstract_.copy();
4534      dst.inactive = inactive == null ? null : inactive.copy();
4535      dst.version = version == null ? null : version.copy();
4536      dst.code = code == null ? null : code.copy();
4537      dst.display = display == null ? null : display.copy();
4538      if (designation != null) {
4539        dst.designation = new ArrayList<ConceptReferenceDesignationComponent>();
4540        for (ConceptReferenceDesignationComponent i : designation)
4541          dst.designation.add(i.copy());
4542      }
4543      ;
4544      if (contains != null) {
4545        dst.contains = new ArrayList<ValueSetExpansionContainsComponent>();
4546        for (ValueSetExpansionContainsComponent i : contains)
4547          dst.contains.add(i.copy());
4548      }
4549      ;
4550    }
4551
4552    @Override
4553    public boolean equalsDeep(Base other_) {
4554      if (!super.equalsDeep(other_))
4555        return false;
4556      if (!(other_ instanceof ValueSetExpansionContainsComponent))
4557        return false;
4558      ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other_;
4559      return compareDeep(system, o.system, true) && compareDeep(abstract_, o.abstract_, true)
4560          && compareDeep(inactive, o.inactive, true) && compareDeep(version, o.version, true)
4561          && compareDeep(code, o.code, true) && compareDeep(display, o.display, true)
4562          && compareDeep(designation, o.designation, true) && compareDeep(contains, o.contains, true);
4563    }
4564
4565    @Override
4566    public boolean equalsShallow(Base other_) {
4567      if (!super.equalsShallow(other_))
4568        return false;
4569      if (!(other_ instanceof ValueSetExpansionContainsComponent))
4570        return false;
4571      ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other_;
4572      return compareValues(system, o.system, true) && compareValues(abstract_, o.abstract_, true)
4573          && compareValues(inactive, o.inactive, true) && compareValues(version, o.version, true)
4574          && compareValues(code, o.code, true) && compareValues(display, o.display, true);
4575    }
4576
4577    public boolean isEmpty() {
4578      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(system, abstract_, inactive, version, code,
4579          display, designation, contains);
4580    }
4581
4582    public String fhirType() {
4583      return "ValueSet.expansion.contains";
4584
4585    }
4586
4587  }
4588
4589  /**
4590   * A formal identifier that is used to identify this value set when it is
4591   * represented in other formats, or referenced in a specification, model, design
4592   * or an instance.
4593   */
4594  @Child(name = "identifier", type = {
4595      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
4596  @Description(shortDefinition = "Additional identifier for the value set (business identifier)", formalDefinition = "A formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.")
4597  protected List<Identifier> identifier;
4598
4599  /**
4600   * If this is set to 'true', then no new versions of the content logical
4601   * definition can be created. Note: Other metadata might still change.
4602   */
4603  @Child(name = "immutable", type = {
4604      BooleanType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
4605  @Description(shortDefinition = "Indicates whether or not any change to the content logical definition may occur", formalDefinition = "If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.")
4606  protected BooleanType immutable;
4607
4608  /**
4609   * Explanation of why this value set is needed and why it has been designed as
4610   * it has.
4611   */
4612  @Child(name = "purpose", type = {
4613      MarkdownType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
4614  @Description(shortDefinition = "Why this value set is defined", formalDefinition = "Explanation of why this value set is needed and why it has been designed as it has.")
4615  protected MarkdownType purpose;
4616
4617  /**
4618   * A copyright statement relating to the value set and/or its contents.
4619   * Copyright statements are generally legal restrictions on the use and
4620   * publishing of the value set.
4621   */
4622  @Child(name = "copyright", type = {
4623      MarkdownType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
4624  @Description(shortDefinition = "Use and/or publishing restrictions", formalDefinition = "A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.")
4625  protected MarkdownType copyright;
4626
4627  /**
4628   * A set of criteria that define the contents of the value set by including or
4629   * excluding codes selected from the specified code system(s) that the value set
4630   * draws from. This is also known as the Content Logical Definition (CLD).
4631   */
4632  @Child(name = "compose", type = {}, order = 4, min = 0, max = 1, modifier = false, summary = false)
4633  @Description(shortDefinition = "Content logical definition of the value set (CLD)", formalDefinition = "A set of criteria that define the contents of the value set by including or excluding codes selected from the specified code system(s) that the value set draws from. This is also known as the Content Logical Definition (CLD).")
4634  protected ValueSetComposeComponent compose;
4635
4636  /**
4637   * A value set can also be "expanded", where the value set is turned into a
4638   * simple collection of enumerated codes. This element holds the expansion, if
4639   * it has been performed.
4640   */
4641  @Child(name = "expansion", type = {}, order = 5, min = 0, max = 1, modifier = false, summary = false)
4642  @Description(shortDefinition = "Used when the value set is \"expanded\"", formalDefinition = "A value set can also be \"expanded\", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.")
4643  protected ValueSetExpansionComponent expansion;
4644
4645  private static final long serialVersionUID = 786712949L;
4646
4647  /**
4648   * Constructor
4649   */
4650  public ValueSet() {
4651    super();
4652  }
4653
4654  /**
4655   * Constructor
4656   */
4657  public ValueSet(Enumeration<PublicationStatus> status) {
4658    super();
4659    this.status = status;
4660  }
4661
4662  /**
4663   * @return {@link #url} (An absolute URI that is used to identify this value set
4664   *         when it is referenced in a specification, model, design or an
4665   *         instance; also called its canonical identifier. This SHOULD be
4666   *         globally unique and SHOULD be a literal address at which at which an
4667   *         authoritative instance of this value set is (or will be) published.
4668   *         This URL can be the target of a canonical reference. It SHALL remain
4669   *         the same when the value set is stored on different servers.). This is
4670   *         the underlying object with id, value and extensions. The accessor
4671   *         "getUrl" gives direct access to the value
4672   */
4673  public UriType getUrlElement() {
4674    if (this.url == null)
4675      if (Configuration.errorOnAutoCreate())
4676        throw new Error("Attempt to auto-create ValueSet.url");
4677      else if (Configuration.doAutoCreate())
4678        this.url = new UriType(); // bb
4679    return this.url;
4680  }
4681
4682  public boolean hasUrlElement() {
4683    return this.url != null && !this.url.isEmpty();
4684  }
4685
4686  public boolean hasUrl() {
4687    return this.url != null && !this.url.isEmpty();
4688  }
4689
4690  /**
4691   * @param value {@link #url} (An absolute URI that is used to identify this
4692   *              value set when it is referenced in a specification, model,
4693   *              design or an instance; also called its canonical identifier.
4694   *              This SHOULD be globally unique and SHOULD be a literal address
4695   *              at which at which an authoritative instance of this value set is
4696   *              (or will be) published. This URL can be the target of a
4697   *              canonical reference. It SHALL remain the same when the value set
4698   *              is stored on different servers.). This is the underlying object
4699   *              with id, value and extensions. The accessor "getUrl" gives
4700   *              direct access to the value
4701   */
4702  public ValueSet setUrlElement(UriType value) {
4703    this.url = value;
4704    return this;
4705  }
4706
4707  /**
4708   * @return An absolute URI that is used to identify this value set when it is
4709   *         referenced in a specification, model, design or an instance; also
4710   *         called its canonical identifier. This SHOULD be globally unique and
4711   *         SHOULD be a literal address at which at which an authoritative
4712   *         instance of this value set is (or will be) published. This URL can be
4713   *         the target of a canonical reference. It SHALL remain the same when
4714   *         the value set is stored on different servers.
4715   */
4716  public String getUrl() {
4717    return this.url == null ? null : this.url.getValue();
4718  }
4719
4720  /**
4721   * @param value An absolute URI that is used to identify this value set when it
4722   *              is referenced in a specification, model, design or an instance;
4723   *              also called its canonical identifier. This SHOULD be globally
4724   *              unique and SHOULD be a literal address at which at which an
4725   *              authoritative instance of this value set is (or will be)
4726   *              published. This URL can be the target of a canonical reference.
4727   *              It SHALL remain the same when the value set is stored on
4728   *              different servers.
4729   */
4730  public ValueSet setUrl(String value) {
4731    if (Utilities.noString(value))
4732      this.url = null;
4733    else {
4734      if (this.url == null)
4735        this.url = new UriType();
4736      this.url.setValue(value);
4737    }
4738    return this;
4739  }
4740
4741  /**
4742   * @return {@link #identifier} (A formal identifier that is used to identify
4743   *         this value set when it is represented in other formats, or referenced
4744   *         in a specification, model, design or an instance.)
4745   */
4746  public List<Identifier> getIdentifier() {
4747    if (this.identifier == null)
4748      this.identifier = new ArrayList<Identifier>();
4749    return this.identifier;
4750  }
4751
4752  /**
4753   * @return Returns a reference to <code>this</code> for easy method chaining
4754   */
4755  public ValueSet setIdentifier(List<Identifier> theIdentifier) {
4756    this.identifier = theIdentifier;
4757    return this;
4758  }
4759
4760  public boolean hasIdentifier() {
4761    if (this.identifier == null)
4762      return false;
4763    for (Identifier item : this.identifier)
4764      if (!item.isEmpty())
4765        return true;
4766    return false;
4767  }
4768
4769  public Identifier addIdentifier() { // 3
4770    Identifier t = new Identifier();
4771    if (this.identifier == null)
4772      this.identifier = new ArrayList<Identifier>();
4773    this.identifier.add(t);
4774    return t;
4775  }
4776
4777  public ValueSet addIdentifier(Identifier t) { // 3
4778    if (t == null)
4779      return this;
4780    if (this.identifier == null)
4781      this.identifier = new ArrayList<Identifier>();
4782    this.identifier.add(t);
4783    return this;
4784  }
4785
4786  /**
4787   * @return The first repetition of repeating field {@link #identifier}, creating
4788   *         it if it does not already exist
4789   */
4790  public Identifier getIdentifierFirstRep() {
4791    if (getIdentifier().isEmpty()) {
4792      addIdentifier();
4793    }
4794    return getIdentifier().get(0);
4795  }
4796
4797  /**
4798   * @return {@link #version} (The identifier that is used to identify this
4799   *         version of the value set when it is referenced in a specification,
4800   *         model, design or instance. This is an arbitrary value managed by the
4801   *         value set author and is not expected to be globally unique. For
4802   *         example, it might be a timestamp (e.g. yyyymmdd) if a managed version
4803   *         is not available. There is also no expectation that versions can be
4804   *         placed in a lexicographical sequence.). This is the underlying object
4805   *         with id, value and extensions. The accessor "getVersion" gives direct
4806   *         access to the value
4807   */
4808  public StringType getVersionElement() {
4809    if (this.version == null)
4810      if (Configuration.errorOnAutoCreate())
4811        throw new Error("Attempt to auto-create ValueSet.version");
4812      else if (Configuration.doAutoCreate())
4813        this.version = new StringType(); // bb
4814    return this.version;
4815  }
4816
4817  public boolean hasVersionElement() {
4818    return this.version != null && !this.version.isEmpty();
4819  }
4820
4821  public boolean hasVersion() {
4822    return this.version != null && !this.version.isEmpty();
4823  }
4824
4825  /**
4826   * @param value {@link #version} (The identifier that is used to identify this
4827   *              version of the value set when it is referenced in a
4828   *              specification, model, design or instance. This is an arbitrary
4829   *              value managed by the value set author and is not expected to be
4830   *              globally unique. For example, it might be a timestamp (e.g.
4831   *              yyyymmdd) if a managed version is not available. There is also
4832   *              no expectation that versions can be placed in a lexicographical
4833   *              sequence.). This is the underlying object with id, value and
4834   *              extensions. The accessor "getVersion" gives direct access to the
4835   *              value
4836   */
4837  public ValueSet setVersionElement(StringType value) {
4838    this.version = value;
4839    return this;
4840  }
4841
4842  /**
4843   * @return The identifier that is used to identify this version of the value set
4844   *         when it is referenced in a specification, model, design or instance.
4845   *         This is an arbitrary value managed by the value set author and is not
4846   *         expected to be globally unique. For example, it might be a timestamp
4847   *         (e.g. yyyymmdd) if a managed version is not available. There is also
4848   *         no expectation that versions can be placed in a lexicographical
4849   *         sequence.
4850   */
4851  public String getVersion() {
4852    return this.version == null ? null : this.version.getValue();
4853  }
4854
4855  /**
4856   * @param value The identifier that is used to identify this version of the
4857   *              value set when it is referenced in a specification, model,
4858   *              design or instance. This is an arbitrary value managed by the
4859   *              value set author and is not expected to be globally unique. For
4860   *              example, it might be a timestamp (e.g. yyyymmdd) if a managed
4861   *              version is not available. There is also no expectation that
4862   *              versions can be placed in a lexicographical sequence.
4863   */
4864  public ValueSet setVersion(String value) {
4865    if (Utilities.noString(value))
4866      this.version = null;
4867    else {
4868      if (this.version == null)
4869        this.version = new StringType();
4870      this.version.setValue(value);
4871    }
4872    return this;
4873  }
4874
4875  /**
4876   * @return {@link #name} (A natural language name identifying the value set.
4877   *         This name should be usable as an identifier for the module by machine
4878   *         processing applications such as code generation.). This is the
4879   *         underlying object with id, value and extensions. The accessor
4880   *         "getName" gives direct access to the value
4881   */
4882  public StringType getNameElement() {
4883    if (this.name == null)
4884      if (Configuration.errorOnAutoCreate())
4885        throw new Error("Attempt to auto-create ValueSet.name");
4886      else if (Configuration.doAutoCreate())
4887        this.name = new StringType(); // bb
4888    return this.name;
4889  }
4890
4891  public boolean hasNameElement() {
4892    return this.name != null && !this.name.isEmpty();
4893  }
4894
4895  public boolean hasName() {
4896    return this.name != null && !this.name.isEmpty();
4897  }
4898
4899  /**
4900   * @param value {@link #name} (A natural language name identifying the value
4901   *              set. This name should be usable as an identifier for the module
4902   *              by machine processing applications such as code generation.).
4903   *              This is the underlying object with id, value and extensions. The
4904   *              accessor "getName" gives direct access to the value
4905   */
4906  public ValueSet setNameElement(StringType value) {
4907    this.name = value;
4908    return this;
4909  }
4910
4911  /**
4912   * @return A natural language name identifying the value set. This name should
4913   *         be usable as an identifier for the module by machine processing
4914   *         applications such as code generation.
4915   */
4916  public String getName() {
4917    return this.name == null ? null : this.name.getValue();
4918  }
4919
4920  /**
4921   * @param value A natural language name identifying the value set. This name
4922   *              should be usable as an identifier for the module by machine
4923   *              processing applications such as code generation.
4924   */
4925  public ValueSet setName(String value) {
4926    if (Utilities.noString(value))
4927      this.name = null;
4928    else {
4929      if (this.name == null)
4930        this.name = new StringType();
4931      this.name.setValue(value);
4932    }
4933    return this;
4934  }
4935
4936  /**
4937   * @return {@link #title} (A short, descriptive, user-friendly title for the
4938   *         value set.). This is the underlying object with id, value and
4939   *         extensions. The accessor "getTitle" gives direct access to the value
4940   */
4941  public StringType getTitleElement() {
4942    if (this.title == null)
4943      if (Configuration.errorOnAutoCreate())
4944        throw new Error("Attempt to auto-create ValueSet.title");
4945      else if (Configuration.doAutoCreate())
4946        this.title = new StringType(); // bb
4947    return this.title;
4948  }
4949
4950  public boolean hasTitleElement() {
4951    return this.title != null && !this.title.isEmpty();
4952  }
4953
4954  public boolean hasTitle() {
4955    return this.title != null && !this.title.isEmpty();
4956  }
4957
4958  /**
4959   * @param value {@link #title} (A short, descriptive, user-friendly title for
4960   *              the value set.). This is the underlying object with id, value
4961   *              and extensions. The accessor "getTitle" gives direct access to
4962   *              the value
4963   */
4964  public ValueSet setTitleElement(StringType value) {
4965    this.title = value;
4966    return this;
4967  }
4968
4969  /**
4970   * @return A short, descriptive, user-friendly title for the value set.
4971   */
4972  public String getTitle() {
4973    return this.title == null ? null : this.title.getValue();
4974  }
4975
4976  /**
4977   * @param value A short, descriptive, user-friendly title for the value set.
4978   */
4979  public ValueSet setTitle(String value) {
4980    if (Utilities.noString(value))
4981      this.title = null;
4982    else {
4983      if (this.title == null)
4984        this.title = new StringType();
4985      this.title.setValue(value);
4986    }
4987    return this;
4988  }
4989
4990  /**
4991   * @return {@link #status} (The status of this value set. Enables tracking the
4992   *         life-cycle of the content. The status of the value set applies to the
4993   *         value set definition (ValueSet.compose) and the associated ValueSet
4994   *         metadata. Expansions do not have a state.). This is the underlying
4995   *         object with id, value and extensions. The accessor "getStatus" gives
4996   *         direct access to the value
4997   */
4998  public Enumeration<PublicationStatus> getStatusElement() {
4999    if (this.status == null)
5000      if (Configuration.errorOnAutoCreate())
5001        throw new Error("Attempt to auto-create ValueSet.status");
5002      else if (Configuration.doAutoCreate())
5003        this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
5004    return this.status;
5005  }
5006
5007  public boolean hasStatusElement() {
5008    return this.status != null && !this.status.isEmpty();
5009  }
5010
5011  public boolean hasStatus() {
5012    return this.status != null && !this.status.isEmpty();
5013  }
5014
5015  /**
5016   * @param value {@link #status} (The status of this value set. Enables tracking
5017   *              the life-cycle of the content. The status of the value set
5018   *              applies to the value set definition (ValueSet.compose) and the
5019   *              associated ValueSet metadata. Expansions do not have a state.).
5020   *              This is the underlying object with id, value and extensions. The
5021   *              accessor "getStatus" gives direct access to the value
5022   */
5023  public ValueSet setStatusElement(Enumeration<PublicationStatus> value) {
5024    this.status = value;
5025    return this;
5026  }
5027
5028  /**
5029   * @return The status of this value set. Enables tracking the life-cycle of the
5030   *         content. The status of the value set applies to the value set
5031   *         definition (ValueSet.compose) and the associated ValueSet metadata.
5032   *         Expansions do not have a state.
5033   */
5034  public PublicationStatus getStatus() {
5035    return this.status == null ? null : this.status.getValue();
5036  }
5037
5038  /**
5039   * @param value The status of this value set. Enables tracking the life-cycle of
5040   *              the content. The status of the value set applies to the value
5041   *              set definition (ValueSet.compose) and the associated ValueSet
5042   *              metadata. Expansions do not have a state.
5043   */
5044  public ValueSet setStatus(PublicationStatus value) {
5045    if (this.status == null)
5046      this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
5047    this.status.setValue(value);
5048    return this;
5049  }
5050
5051  /**
5052   * @return {@link #experimental} (A Boolean value to indicate that this value
5053   *         set is authored for testing purposes (or
5054   *         education/evaluation/marketing) and is not intended to be used for
5055   *         genuine usage.). This is the underlying object with id, value and
5056   *         extensions. The accessor "getExperimental" gives direct access to the
5057   *         value
5058   */
5059  public BooleanType getExperimentalElement() {
5060    if (this.experimental == null)
5061      if (Configuration.errorOnAutoCreate())
5062        throw new Error("Attempt to auto-create ValueSet.experimental");
5063      else if (Configuration.doAutoCreate())
5064        this.experimental = new BooleanType(); // bb
5065    return this.experimental;
5066  }
5067
5068  public boolean hasExperimentalElement() {
5069    return this.experimental != null && !this.experimental.isEmpty();
5070  }
5071
5072  public boolean hasExperimental() {
5073    return this.experimental != null && !this.experimental.isEmpty();
5074  }
5075
5076  /**
5077   * @param value {@link #experimental} (A Boolean value to indicate that this
5078   *              value set is authored for testing purposes (or
5079   *              education/evaluation/marketing) and is not intended to be used
5080   *              for genuine usage.). This is the underlying object with id,
5081   *              value and extensions. The accessor "getExperimental" gives
5082   *              direct access to the value
5083   */
5084  public ValueSet setExperimentalElement(BooleanType value) {
5085    this.experimental = value;
5086    return this;
5087  }
5088
5089  /**
5090   * @return A Boolean value to indicate that this value set is authored for
5091   *         testing purposes (or education/evaluation/marketing) and is not
5092   *         intended to be used for genuine usage.
5093   */
5094  public boolean getExperimental() {
5095    return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
5096  }
5097
5098  /**
5099   * @param value A Boolean value to indicate that this value set is authored for
5100   *              testing purposes (or education/evaluation/marketing) and is not
5101   *              intended to be used for genuine usage.
5102   */
5103  public ValueSet setExperimental(boolean value) {
5104    if (this.experimental == null)
5105      this.experimental = new BooleanType();
5106    this.experimental.setValue(value);
5107    return this;
5108  }
5109
5110  /**
5111   * @return {@link #date} (The date (and optionally time) when the value set was
5112   *         created or revised (e.g. the 'content logical definition').). This is
5113   *         the underlying object with id, value and extensions. The accessor
5114   *         "getDate" gives direct access to the value
5115   */
5116  public DateTimeType getDateElement() {
5117    if (this.date == null)
5118      if (Configuration.errorOnAutoCreate())
5119        throw new Error("Attempt to auto-create ValueSet.date");
5120      else if (Configuration.doAutoCreate())
5121        this.date = new DateTimeType(); // bb
5122    return this.date;
5123  }
5124
5125  public boolean hasDateElement() {
5126    return this.date != null && !this.date.isEmpty();
5127  }
5128
5129  public boolean hasDate() {
5130    return this.date != null && !this.date.isEmpty();
5131  }
5132
5133  /**
5134   * @param value {@link #date} (The date (and optionally time) when the value set
5135   *              was created or revised (e.g. the 'content logical
5136   *              definition').). This is the underlying object with id, value and
5137   *              extensions. The accessor "getDate" gives direct access to the
5138   *              value
5139   */
5140  public ValueSet setDateElement(DateTimeType value) {
5141    this.date = value;
5142    return this;
5143  }
5144
5145  /**
5146   * @return The date (and optionally time) when the value set was created or
5147   *         revised (e.g. the 'content logical definition').
5148   */
5149  public Date getDate() {
5150    return this.date == null ? null : this.date.getValue();
5151  }
5152
5153  /**
5154   * @param value The date (and optionally time) when the value set was created or
5155   *              revised (e.g. the 'content logical definition').
5156   */
5157  public ValueSet setDate(Date value) {
5158    if (value == null)
5159      this.date = null;
5160    else {
5161      if (this.date == null)
5162        this.date = new DateTimeType();
5163      this.date.setValue(value);
5164    }
5165    return this;
5166  }
5167
5168  /**
5169   * @return {@link #publisher} (The name of the organization or individual that
5170   *         published the value set.). This is the underlying object with id,
5171   *         value and extensions. The accessor "getPublisher" gives direct access
5172   *         to the value
5173   */
5174  public StringType getPublisherElement() {
5175    if (this.publisher == null)
5176      if (Configuration.errorOnAutoCreate())
5177        throw new Error("Attempt to auto-create ValueSet.publisher");
5178      else if (Configuration.doAutoCreate())
5179        this.publisher = new StringType(); // bb
5180    return this.publisher;
5181  }
5182
5183  public boolean hasPublisherElement() {
5184    return this.publisher != null && !this.publisher.isEmpty();
5185  }
5186
5187  public boolean hasPublisher() {
5188    return this.publisher != null && !this.publisher.isEmpty();
5189  }
5190
5191  /**
5192   * @param value {@link #publisher} (The name of the organization or individual
5193   *              that published the value set.). This is the underlying object
5194   *              with id, value and extensions. The accessor "getPublisher" gives
5195   *              direct access to the value
5196   */
5197  public ValueSet setPublisherElement(StringType value) {
5198    this.publisher = value;
5199    return this;
5200  }
5201
5202  /**
5203   * @return The name of the organization or individual that published the value
5204   *         set.
5205   */
5206  public String getPublisher() {
5207    return this.publisher == null ? null : this.publisher.getValue();
5208  }
5209
5210  /**
5211   * @param value The name of the organization or individual that published the
5212   *              value set.
5213   */
5214  public ValueSet setPublisher(String value) {
5215    if (Utilities.noString(value))
5216      this.publisher = null;
5217    else {
5218      if (this.publisher == null)
5219        this.publisher = new StringType();
5220      this.publisher.setValue(value);
5221    }
5222    return this;
5223  }
5224
5225  /**
5226   * @return {@link #contact} (Contact details to assist a user in finding and
5227   *         communicating with the publisher.)
5228   */
5229  public List<ContactDetail> getContact() {
5230    if (this.contact == null)
5231      this.contact = new ArrayList<ContactDetail>();
5232    return this.contact;
5233  }
5234
5235  /**
5236   * @return Returns a reference to <code>this</code> for easy method chaining
5237   */
5238  public ValueSet setContact(List<ContactDetail> theContact) {
5239    this.contact = theContact;
5240    return this;
5241  }
5242
5243  public boolean hasContact() {
5244    if (this.contact == null)
5245      return false;
5246    for (ContactDetail item : this.contact)
5247      if (!item.isEmpty())
5248        return true;
5249    return false;
5250  }
5251
5252  public ContactDetail addContact() { // 3
5253    ContactDetail t = new ContactDetail();
5254    if (this.contact == null)
5255      this.contact = new ArrayList<ContactDetail>();
5256    this.contact.add(t);
5257    return t;
5258  }
5259
5260  public ValueSet addContact(ContactDetail t) { // 3
5261    if (t == null)
5262      return this;
5263    if (this.contact == null)
5264      this.contact = new ArrayList<ContactDetail>();
5265    this.contact.add(t);
5266    return this;
5267  }
5268
5269  /**
5270   * @return The first repetition of repeating field {@link #contact}, creating it
5271   *         if it does not already exist
5272   */
5273  public ContactDetail getContactFirstRep() {
5274    if (getContact().isEmpty()) {
5275      addContact();
5276    }
5277    return getContact().get(0);
5278  }
5279
5280  /**
5281   * @return {@link #description} (A free text natural language description of the
5282   *         value set from a consumer's perspective. The textual description
5283   *         specifies the span of meanings for concepts to be included within the
5284   *         Value Set Expansion, and also may specify the intended use and
5285   *         limitations of the Value Set.). This is the underlying object with
5286   *         id, value and extensions. The accessor "getDescription" gives direct
5287   *         access to the value
5288   */
5289  public MarkdownType getDescriptionElement() {
5290    if (this.description == null)
5291      if (Configuration.errorOnAutoCreate())
5292        throw new Error("Attempt to auto-create ValueSet.description");
5293      else if (Configuration.doAutoCreate())
5294        this.description = new MarkdownType(); // bb
5295    return this.description;
5296  }
5297
5298  public boolean hasDescriptionElement() {
5299    return this.description != null && !this.description.isEmpty();
5300  }
5301
5302  public boolean hasDescription() {
5303    return this.description != null && !this.description.isEmpty();
5304  }
5305
5306  /**
5307   * @param value {@link #description} (A free text natural language description
5308   *              of the value set from a consumer's perspective. The textual
5309   *              description specifies the span of meanings for concepts to be
5310   *              included within the Value Set Expansion, and also may specify
5311   *              the intended use and limitations of the Value Set.). This is the
5312   *              underlying object with id, value and extensions. The accessor
5313   *              "getDescription" gives direct access to the value
5314   */
5315  public ValueSet setDescriptionElement(MarkdownType value) {
5316    this.description = value;
5317    return this;
5318  }
5319
5320  /**
5321   * @return A free text natural language description of the value set from a
5322   *         consumer's perspective. The textual description specifies the span of
5323   *         meanings for concepts to be included within the Value Set Expansion,
5324   *         and also may specify the intended use and limitations of the Value
5325   *         Set.
5326   */
5327  public String getDescription() {
5328    return this.description == null ? null : this.description.getValue();
5329  }
5330
5331  /**
5332   * @param value A free text natural language description of the value set from a
5333   *              consumer's perspective. The textual description specifies the
5334   *              span of meanings for concepts to be included within the Value
5335   *              Set Expansion, and also may specify the intended use and
5336   *              limitations of the Value Set.
5337   */
5338  public ValueSet setDescription(String value) {
5339    if (value == null)
5340      this.description = null;
5341    else {
5342      if (this.description == null)
5343        this.description = new MarkdownType();
5344      this.description.setValue(value);
5345    }
5346    return this;
5347  }
5348
5349  /**
5350   * @return {@link #useContext} (The content was developed with a focus and
5351   *         intent of supporting the contexts that are listed. These contexts may
5352   *         be general categories (gender, age, ...) or may be references to
5353   *         specific programs (insurance plans, studies, ...) and may be used to
5354   *         assist with indexing and searching for appropriate value set
5355   *         instances.)
5356   */
5357  public List<UsageContext> getUseContext() {
5358    if (this.useContext == null)
5359      this.useContext = new ArrayList<UsageContext>();
5360    return this.useContext;
5361  }
5362
5363  /**
5364   * @return Returns a reference to <code>this</code> for easy method chaining
5365   */
5366  public ValueSet setUseContext(List<UsageContext> theUseContext) {
5367    this.useContext = theUseContext;
5368    return this;
5369  }
5370
5371  public boolean hasUseContext() {
5372    if (this.useContext == null)
5373      return false;
5374    for (UsageContext item : this.useContext)
5375      if (!item.isEmpty())
5376        return true;
5377    return false;
5378  }
5379
5380  public UsageContext addUseContext() { // 3
5381    UsageContext t = new UsageContext();
5382    if (this.useContext == null)
5383      this.useContext = new ArrayList<UsageContext>();
5384    this.useContext.add(t);
5385    return t;
5386  }
5387
5388  public ValueSet addUseContext(UsageContext t) { // 3
5389    if (t == null)
5390      return this;
5391    if (this.useContext == null)
5392      this.useContext = new ArrayList<UsageContext>();
5393    this.useContext.add(t);
5394    return this;
5395  }
5396
5397  /**
5398   * @return The first repetition of repeating field {@link #useContext}, creating
5399   *         it if it does not already exist
5400   */
5401  public UsageContext getUseContextFirstRep() {
5402    if (getUseContext().isEmpty()) {
5403      addUseContext();
5404    }
5405    return getUseContext().get(0);
5406  }
5407
5408  /**
5409   * @return {@link #jurisdiction} (A legal or geographic region in which the
5410   *         value set is intended to be used.)
5411   */
5412  public List<CodeableConcept> getJurisdiction() {
5413    if (this.jurisdiction == null)
5414      this.jurisdiction = new ArrayList<CodeableConcept>();
5415    return this.jurisdiction;
5416  }
5417
5418  /**
5419   * @return Returns a reference to <code>this</code> for easy method chaining
5420   */
5421  public ValueSet setJurisdiction(List<CodeableConcept> theJurisdiction) {
5422    this.jurisdiction = theJurisdiction;
5423    return this;
5424  }
5425
5426  public boolean hasJurisdiction() {
5427    if (this.jurisdiction == null)
5428      return false;
5429    for (CodeableConcept item : this.jurisdiction)
5430      if (!item.isEmpty())
5431        return true;
5432    return false;
5433  }
5434
5435  public CodeableConcept addJurisdiction() { // 3
5436    CodeableConcept t = new CodeableConcept();
5437    if (this.jurisdiction == null)
5438      this.jurisdiction = new ArrayList<CodeableConcept>();
5439    this.jurisdiction.add(t);
5440    return t;
5441  }
5442
5443  public ValueSet addJurisdiction(CodeableConcept t) { // 3
5444    if (t == null)
5445      return this;
5446    if (this.jurisdiction == null)
5447      this.jurisdiction = new ArrayList<CodeableConcept>();
5448    this.jurisdiction.add(t);
5449    return this;
5450  }
5451
5452  /**
5453   * @return The first repetition of repeating field {@link #jurisdiction},
5454   *         creating it if it does not already exist
5455   */
5456  public CodeableConcept getJurisdictionFirstRep() {
5457    if (getJurisdiction().isEmpty()) {
5458      addJurisdiction();
5459    }
5460    return getJurisdiction().get(0);
5461  }
5462
5463  /**
5464   * @return {@link #immutable} (If this is set to 'true', then no new versions of
5465   *         the content logical definition can be created. Note: Other metadata
5466   *         might still change.). This is the underlying object with id, value
5467   *         and extensions. The accessor "getImmutable" gives direct access to
5468   *         the value
5469   */
5470  public BooleanType getImmutableElement() {
5471    if (this.immutable == null)
5472      if (Configuration.errorOnAutoCreate())
5473        throw new Error("Attempt to auto-create ValueSet.immutable");
5474      else if (Configuration.doAutoCreate())
5475        this.immutable = new BooleanType(); // bb
5476    return this.immutable;
5477  }
5478
5479  public boolean hasImmutableElement() {
5480    return this.immutable != null && !this.immutable.isEmpty();
5481  }
5482
5483  public boolean hasImmutable() {
5484    return this.immutable != null && !this.immutable.isEmpty();
5485  }
5486
5487  /**
5488   * @param value {@link #immutable} (If this is set to 'true', then no new
5489   *              versions of the content logical definition can be created. Note:
5490   *              Other metadata might still change.). This is the underlying
5491   *              object with id, value and extensions. The accessor
5492   *              "getImmutable" gives direct access to the value
5493   */
5494  public ValueSet setImmutableElement(BooleanType value) {
5495    this.immutable = value;
5496    return this;
5497  }
5498
5499  /**
5500   * @return If this is set to 'true', then no new versions of the content logical
5501   *         definition can be created. Note: Other metadata might still change.
5502   */
5503  public boolean getImmutable() {
5504    return this.immutable == null || this.immutable.isEmpty() ? false : this.immutable.getValue();
5505  }
5506
5507  /**
5508   * @param value If this is set to 'true', then no new versions of the content
5509   *              logical definition can be created. Note: Other metadata might
5510   *              still change.
5511   */
5512  public ValueSet setImmutable(boolean value) {
5513    if (this.immutable == null)
5514      this.immutable = new BooleanType();
5515    this.immutable.setValue(value);
5516    return this;
5517  }
5518
5519  /**
5520   * @return {@link #purpose} (Explanation of why this value set is needed and why
5521   *         it has been designed as it has.). This is the underlying object with
5522   *         id, value and extensions. The accessor "getPurpose" gives direct
5523   *         access to the value
5524   */
5525  public MarkdownType getPurposeElement() {
5526    if (this.purpose == null)
5527      if (Configuration.errorOnAutoCreate())
5528        throw new Error("Attempt to auto-create ValueSet.purpose");
5529      else if (Configuration.doAutoCreate())
5530        this.purpose = new MarkdownType(); // bb
5531    return this.purpose;
5532  }
5533
5534  public boolean hasPurposeElement() {
5535    return this.purpose != null && !this.purpose.isEmpty();
5536  }
5537
5538  public boolean hasPurpose() {
5539    return this.purpose != null && !this.purpose.isEmpty();
5540  }
5541
5542  /**
5543   * @param value {@link #purpose} (Explanation of why this value set is needed
5544   *              and why it has been designed as it has.). This is the underlying
5545   *              object with id, value and extensions. The accessor "getPurpose"
5546   *              gives direct access to the value
5547   */
5548  public ValueSet setPurposeElement(MarkdownType value) {
5549    this.purpose = value;
5550    return this;
5551  }
5552
5553  /**
5554   * @return Explanation of why this value set is needed and why it has been
5555   *         designed as it has.
5556   */
5557  public String getPurpose() {
5558    return this.purpose == null ? null : this.purpose.getValue();
5559  }
5560
5561  /**
5562   * @param value Explanation of why this value set is needed and why it has been
5563   *              designed as it has.
5564   */
5565  public ValueSet setPurpose(String value) {
5566    if (value == null)
5567      this.purpose = null;
5568    else {
5569      if (this.purpose == null)
5570        this.purpose = new MarkdownType();
5571      this.purpose.setValue(value);
5572    }
5573    return this;
5574  }
5575
5576  /**
5577   * @return {@link #copyright} (A copyright statement relating to the value set
5578   *         and/or its contents. Copyright statements are generally legal
5579   *         restrictions on the use and publishing of the value set.). This is
5580   *         the underlying object with id, value and extensions. The accessor
5581   *         "getCopyright" gives direct access to the value
5582   */
5583  public MarkdownType getCopyrightElement() {
5584    if (this.copyright == null)
5585      if (Configuration.errorOnAutoCreate())
5586        throw new Error("Attempt to auto-create ValueSet.copyright");
5587      else if (Configuration.doAutoCreate())
5588        this.copyright = new MarkdownType(); // bb
5589    return this.copyright;
5590  }
5591
5592  public boolean hasCopyrightElement() {
5593    return this.copyright != null && !this.copyright.isEmpty();
5594  }
5595
5596  public boolean hasCopyright() {
5597    return this.copyright != null && !this.copyright.isEmpty();
5598  }
5599
5600  /**
5601   * @param value {@link #copyright} (A copyright statement relating to the value
5602   *              set and/or its contents. Copyright statements are generally
5603   *              legal restrictions on the use and publishing of the value set.).
5604   *              This is the underlying object with id, value and extensions. The
5605   *              accessor "getCopyright" gives direct access to the value
5606   */
5607  public ValueSet setCopyrightElement(MarkdownType value) {
5608    this.copyright = value;
5609    return this;
5610  }
5611
5612  /**
5613   * @return A copyright statement relating to the value set and/or its contents.
5614   *         Copyright statements are generally legal restrictions on the use and
5615   *         publishing of the value set.
5616   */
5617  public String getCopyright() {
5618    return this.copyright == null ? null : this.copyright.getValue();
5619  }
5620
5621  /**
5622   * @param value A copyright statement relating to the value set and/or its
5623   *              contents. Copyright statements are generally legal restrictions
5624   *              on the use and publishing of the value set.
5625   */
5626  public ValueSet setCopyright(String value) {
5627    if (value == null)
5628      this.copyright = null;
5629    else {
5630      if (this.copyright == null)
5631        this.copyright = new MarkdownType();
5632      this.copyright.setValue(value);
5633    }
5634    return this;
5635  }
5636
5637  /**
5638   * @return {@link #compose} (A set of criteria that define the contents of the
5639   *         value set by including or excluding codes selected from the specified
5640   *         code system(s) that the value set draws from. This is also known as
5641   *         the Content Logical Definition (CLD).)
5642   */
5643  public ValueSetComposeComponent getCompose() {
5644    if (this.compose == null)
5645      if (Configuration.errorOnAutoCreate())
5646        throw new Error("Attempt to auto-create ValueSet.compose");
5647      else if (Configuration.doAutoCreate())
5648        this.compose = new ValueSetComposeComponent(); // cc
5649    return this.compose;
5650  }
5651
5652  public boolean hasCompose() {
5653    return this.compose != null && !this.compose.isEmpty();
5654  }
5655
5656  /**
5657   * @param value {@link #compose} (A set of criteria that define the contents of
5658   *              the value set by including or excluding codes selected from the
5659   *              specified code system(s) that the value set draws from. This is
5660   *              also known as the Content Logical Definition (CLD).)
5661   */
5662  public ValueSet setCompose(ValueSetComposeComponent value) {
5663    this.compose = value;
5664    return this;
5665  }
5666
5667  /**
5668   * @return {@link #expansion} (A value set can also be "expanded", where the
5669   *         value set is turned into a simple collection of enumerated codes.
5670   *         This element holds the expansion, if it has been performed.)
5671   */
5672  public ValueSetExpansionComponent getExpansion() {
5673    if (this.expansion == null)
5674      if (Configuration.errorOnAutoCreate())
5675        throw new Error("Attempt to auto-create ValueSet.expansion");
5676      else if (Configuration.doAutoCreate())
5677        this.expansion = new ValueSetExpansionComponent(); // cc
5678    return this.expansion;
5679  }
5680
5681  public boolean hasExpansion() {
5682    return this.expansion != null && !this.expansion.isEmpty();
5683  }
5684
5685  /**
5686   * @param value {@link #expansion} (A value set can also be "expanded", where
5687   *              the value set is turned into a simple collection of enumerated
5688   *              codes. This element holds the expansion, if it has been
5689   *              performed.)
5690   */
5691  public ValueSet setExpansion(ValueSetExpansionComponent value) {
5692    this.expansion = value;
5693    return this;
5694  }
5695
5696  protected void listChildren(List<Property> children) {
5697    super.listChildren(children);
5698    children.add(new Property("url", "uri",
5699        "An absolute URI that is used to identify this value set 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 value set is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the value set is stored on different servers.",
5700        0, 1, url));
5701    children.add(new Property("identifier", "Identifier",
5702        "A formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.",
5703        0, java.lang.Integer.MAX_VALUE, identifier));
5704    children.add(new Property("version", "string",
5705        "The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the value set 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.",
5706        0, 1, version));
5707    children.add(new Property("name", "string",
5708        "A natural language name identifying the value set. This name should be usable as an identifier for the module by machine processing applications such as code generation.",
5709        0, 1, name));
5710    children.add(
5711        new Property("title", "string", "A short, descriptive, user-friendly title for the value set.", 0, 1, title));
5712    children.add(new Property("status", "code",
5713        "The status of this value set. Enables tracking the life-cycle of the content. The status of the value set applies to the value set definition (ValueSet.compose) and the associated ValueSet metadata. Expansions do not have a state.",
5714        0, 1, status));
5715    children.add(new Property("experimental", "boolean",
5716        "A Boolean value to indicate that this value set is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.",
5717        0, 1, experimental));
5718    children.add(new Property("date", "dateTime",
5719        "The date (and optionally time) when the value set was created or revised (e.g. the 'content logical definition').",
5720        0, 1, date));
5721    children.add(new Property("publisher", "string",
5722        "The name of the organization or individual that published the value set.", 0, 1, publisher));
5723    children.add(new Property("contact", "ContactDetail",
5724        "Contact details to assist a user in finding and communicating with the publisher.", 0,
5725        java.lang.Integer.MAX_VALUE, contact));
5726    children.add(new Property("description", "markdown",
5727        "A free text natural language description of the value set from a consumer's perspective. The textual description specifies the span of meanings for concepts to be included within the Value Set Expansion, and also may specify the intended use and limitations of the Value Set.",
5728        0, 1, description));
5729    children.add(new Property("useContext", "UsageContext",
5730        "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 value set instances.",
5731        0, java.lang.Integer.MAX_VALUE, useContext));
5732    children.add(new Property("jurisdiction", "CodeableConcept",
5733        "A legal or geographic region in which the value set is intended to be used.", 0, java.lang.Integer.MAX_VALUE,
5734        jurisdiction));
5735    children.add(new Property("immutable", "boolean",
5736        "If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.",
5737        0, 1, immutable));
5738    children.add(new Property("purpose", "markdown",
5739        "Explanation of why this value set is needed and why it has been designed as it has.", 0, 1, purpose));
5740    children.add(new Property("copyright", "markdown",
5741        "A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.",
5742        0, 1, copyright));
5743    children.add(new Property("compose", "",
5744        "A set of criteria that define the contents of the value set by including or excluding codes selected from the specified code system(s) that the value set draws from. This is also known as the Content Logical Definition (CLD).",
5745        0, 1, compose));
5746    children.add(new Property("expansion", "",
5747        "A value set can also be \"expanded\", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.",
5748        0, 1, expansion));
5749  }
5750
5751  @Override
5752  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5753    switch (_hash) {
5754    case 116079:
5755      /* url */ return new Property("url", "uri",
5756          "An absolute URI that is used to identify this value set 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 value set is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the value set is stored on different servers.",
5757          0, 1, url);
5758    case -1618432855:
5759      /* identifier */ return new Property("identifier", "Identifier",
5760          "A formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.",
5761          0, java.lang.Integer.MAX_VALUE, identifier);
5762    case 351608024:
5763      /* version */ return new Property("version", "string",
5764          "The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the value set 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.",
5765          0, 1, version);
5766    case 3373707:
5767      /* name */ return new Property("name", "string",
5768          "A natural language name identifying the value set. This name should be usable as an identifier for the module by machine processing applications such as code generation.",
5769          0, 1, name);
5770    case 110371416:
5771      /* title */ return new Property("title", "string", "A short, descriptive, user-friendly title for the value set.",
5772          0, 1, title);
5773    case -892481550:
5774      /* status */ return new Property("status", "code",
5775          "The status of this value set. Enables tracking the life-cycle of the content. The status of the value set applies to the value set definition (ValueSet.compose) and the associated ValueSet metadata. Expansions do not have a state.",
5776          0, 1, status);
5777    case -404562712:
5778      /* experimental */ return new Property("experimental", "boolean",
5779          "A Boolean value to indicate that this value set is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.",
5780          0, 1, experimental);
5781    case 3076014:
5782      /* date */ return new Property("date", "dateTime",
5783          "The date (and optionally time) when the value set was created or revised (e.g. the 'content logical definition').",
5784          0, 1, date);
5785    case 1447404028:
5786      /* publisher */ return new Property("publisher", "string",
5787          "The name of the organization or individual that published the value set.", 0, 1, publisher);
5788    case 951526432:
5789      /* contact */ return new Property("contact", "ContactDetail",
5790          "Contact details to assist a user in finding and communicating with the publisher.", 0,
5791          java.lang.Integer.MAX_VALUE, contact);
5792    case -1724546052:
5793      /* description */ return new Property("description", "markdown",
5794          "A free text natural language description of the value set from a consumer's perspective. The textual description specifies the span of meanings for concepts to be included within the Value Set Expansion, and also may specify the intended use and limitations of the Value Set.",
5795          0, 1, description);
5796    case -669707736:
5797      /* useContext */ return new Property("useContext", "UsageContext",
5798          "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 value set instances.",
5799          0, java.lang.Integer.MAX_VALUE, useContext);
5800    case -507075711:
5801      /* jurisdiction */ return new Property("jurisdiction", "CodeableConcept",
5802          "A legal or geographic region in which the value set is intended to be used.", 0, java.lang.Integer.MAX_VALUE,
5803          jurisdiction);
5804    case 1596987778:
5805      /* immutable */ return new Property("immutable", "boolean",
5806          "If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.",
5807          0, 1, immutable);
5808    case -220463842:
5809      /* purpose */ return new Property("purpose", "markdown",
5810          "Explanation of why this value set is needed and why it has been designed as it has.", 0, 1, purpose);
5811    case 1522889671:
5812      /* copyright */ return new Property("copyright", "markdown",
5813          "A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.",
5814          0, 1, copyright);
5815    case 950497682:
5816      /* compose */ return new Property("compose", "",
5817          "A set of criteria that define the contents of the value set by including or excluding codes selected from the specified code system(s) that the value set draws from. This is also known as the Content Logical Definition (CLD).",
5818          0, 1, compose);
5819    case 17878207:
5820      /* expansion */ return new Property("expansion", "",
5821          "A value set can also be \"expanded\", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.",
5822          0, 1, expansion);
5823    default:
5824      return super.getNamedProperty(_hash, _name, _checkValid);
5825    }
5826
5827  }
5828
5829  @Override
5830  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5831    switch (hash) {
5832    case 116079:
5833      /* url */ return this.url == null ? new Base[0] : new Base[] { this.url }; // UriType
5834    case -1618432855:
5835      /* identifier */ return this.identifier == null ? new Base[0]
5836          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
5837    case 351608024:
5838      /* version */ return this.version == null ? new Base[0] : new Base[] { this.version }; // StringType
5839    case 3373707:
5840      /* name */ return this.name == null ? new Base[0] : new Base[] { this.name }; // StringType
5841    case 110371416:
5842      /* title */ return this.title == null ? new Base[0] : new Base[] { this.title }; // StringType
5843    case -892481550:
5844      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<PublicationStatus>
5845    case -404562712:
5846      /* experimental */ return this.experimental == null ? new Base[0] : new Base[] { this.experimental }; // BooleanType
5847    case 3076014:
5848      /* date */ return this.date == null ? new Base[0] : new Base[] { this.date }; // DateTimeType
5849    case 1447404028:
5850      /* publisher */ return this.publisher == null ? new Base[0] : new Base[] { this.publisher }; // StringType
5851    case 951526432:
5852      /* contact */ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
5853    case -1724546052:
5854      /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // MarkdownType
5855    case -669707736:
5856      /* useContext */ return this.useContext == null ? new Base[0]
5857          : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
5858    case -507075711:
5859      /* jurisdiction */ return this.jurisdiction == null ? new Base[0]
5860          : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
5861    case 1596987778:
5862      /* immutable */ return this.immutable == null ? new Base[0] : new Base[] { this.immutable }; // BooleanType
5863    case -220463842:
5864      /* purpose */ return this.purpose == null ? new Base[0] : new Base[] { this.purpose }; // MarkdownType
5865    case 1522889671:
5866      /* copyright */ return this.copyright == null ? new Base[0] : new Base[] { this.copyright }; // MarkdownType
5867    case 950497682:
5868      /* compose */ return this.compose == null ? new Base[0] : new Base[] { this.compose }; // ValueSetComposeComponent
5869    case 17878207:
5870      /* expansion */ return this.expansion == null ? new Base[0] : new Base[] { this.expansion }; // ValueSetExpansionComponent
5871    default:
5872      return super.getProperty(hash, name, checkValid);
5873    }
5874
5875  }
5876
5877  @Override
5878  public Base setProperty(int hash, String name, Base value) throws FHIRException {
5879    switch (hash) {
5880    case 116079: // url
5881      this.url = castToUri(value); // UriType
5882      return value;
5883    case -1618432855: // identifier
5884      this.getIdentifier().add(castToIdentifier(value)); // Identifier
5885      return value;
5886    case 351608024: // version
5887      this.version = castToString(value); // StringType
5888      return value;
5889    case 3373707: // name
5890      this.name = castToString(value); // StringType
5891      return value;
5892    case 110371416: // title
5893      this.title = castToString(value); // StringType
5894      return value;
5895    case -892481550: // status
5896      value = new PublicationStatusEnumFactory().fromType(castToCode(value));
5897      this.status = (Enumeration) value; // Enumeration<PublicationStatus>
5898      return value;
5899    case -404562712: // experimental
5900      this.experimental = castToBoolean(value); // BooleanType
5901      return value;
5902    case 3076014: // date
5903      this.date = castToDateTime(value); // DateTimeType
5904      return value;
5905    case 1447404028: // publisher
5906      this.publisher = castToString(value); // StringType
5907      return value;
5908    case 951526432: // contact
5909      this.getContact().add(castToContactDetail(value)); // ContactDetail
5910      return value;
5911    case -1724546052: // description
5912      this.description = castToMarkdown(value); // MarkdownType
5913      return value;
5914    case -669707736: // useContext
5915      this.getUseContext().add(castToUsageContext(value)); // UsageContext
5916      return value;
5917    case -507075711: // jurisdiction
5918      this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
5919      return value;
5920    case 1596987778: // immutable
5921      this.immutable = castToBoolean(value); // BooleanType
5922      return value;
5923    case -220463842: // purpose
5924      this.purpose = castToMarkdown(value); // MarkdownType
5925      return value;
5926    case 1522889671: // copyright
5927      this.copyright = castToMarkdown(value); // MarkdownType
5928      return value;
5929    case 950497682: // compose
5930      this.compose = (ValueSetComposeComponent) value; // ValueSetComposeComponent
5931      return value;
5932    case 17878207: // expansion
5933      this.expansion = (ValueSetExpansionComponent) value; // ValueSetExpansionComponent
5934      return value;
5935    default:
5936      return super.setProperty(hash, name, value);
5937    }
5938
5939  }
5940
5941  @Override
5942  public Base setProperty(String name, Base value) throws FHIRException {
5943    if (name.equals("url")) {
5944      this.url = castToUri(value); // UriType
5945    } else if (name.equals("identifier")) {
5946      this.getIdentifier().add(castToIdentifier(value));
5947    } else if (name.equals("version")) {
5948      this.version = castToString(value); // StringType
5949    } else if (name.equals("name")) {
5950      this.name = castToString(value); // StringType
5951    } else if (name.equals("title")) {
5952      this.title = castToString(value); // StringType
5953    } else if (name.equals("status")) {
5954      value = new PublicationStatusEnumFactory().fromType(castToCode(value));
5955      this.status = (Enumeration) value; // Enumeration<PublicationStatus>
5956    } else if (name.equals("experimental")) {
5957      this.experimental = castToBoolean(value); // BooleanType
5958    } else if (name.equals("date")) {
5959      this.date = castToDateTime(value); // DateTimeType
5960    } else if (name.equals("publisher")) {
5961      this.publisher = castToString(value); // StringType
5962    } else if (name.equals("contact")) {
5963      this.getContact().add(castToContactDetail(value));
5964    } else if (name.equals("description")) {
5965      this.description = castToMarkdown(value); // MarkdownType
5966    } else if (name.equals("useContext")) {
5967      this.getUseContext().add(castToUsageContext(value));
5968    } else if (name.equals("jurisdiction")) {
5969      this.getJurisdiction().add(castToCodeableConcept(value));
5970    } else if (name.equals("immutable")) {
5971      this.immutable = castToBoolean(value); // BooleanType
5972    } else if (name.equals("purpose")) {
5973      this.purpose = castToMarkdown(value); // MarkdownType
5974    } else if (name.equals("copyright")) {
5975      this.copyright = castToMarkdown(value); // MarkdownType
5976    } else if (name.equals("compose")) {
5977      this.compose = (ValueSetComposeComponent) value; // ValueSetComposeComponent
5978    } else if (name.equals("expansion")) {
5979      this.expansion = (ValueSetExpansionComponent) value; // ValueSetExpansionComponent
5980    } else
5981      return super.setProperty(name, value);
5982    return value;
5983  }
5984
5985  @Override
5986  public void removeChild(String name, Base value) throws FHIRException {
5987    if (name.equals("url")) {
5988      this.url = null;
5989    } else if (name.equals("identifier")) {
5990      this.getIdentifier().remove(castToIdentifier(value));
5991    } else if (name.equals("version")) {
5992      this.version = null;
5993    } else if (name.equals("name")) {
5994      this.name = null;
5995    } else if (name.equals("title")) {
5996      this.title = null;
5997    } else if (name.equals("status")) {
5998      this.status = null;
5999    } else if (name.equals("experimental")) {
6000      this.experimental = null;
6001    } else if (name.equals("date")) {
6002      this.date = null;
6003    } else if (name.equals("publisher")) {
6004      this.publisher = null;
6005    } else if (name.equals("contact")) {
6006      this.getContact().remove(castToContactDetail(value));
6007    } else if (name.equals("description")) {
6008      this.description = null;
6009    } else if (name.equals("useContext")) {
6010      this.getUseContext().remove(castToUsageContext(value));
6011    } else if (name.equals("jurisdiction")) {
6012      this.getJurisdiction().remove(castToCodeableConcept(value));
6013    } else if (name.equals("immutable")) {
6014      this.immutable = null;
6015    } else if (name.equals("purpose")) {
6016      this.purpose = null;
6017    } else if (name.equals("copyright")) {
6018      this.copyright = null;
6019    } else if (name.equals("compose")) {
6020      this.compose = (ValueSetComposeComponent) value; // ValueSetComposeComponent
6021    } else if (name.equals("expansion")) {
6022      this.expansion = (ValueSetExpansionComponent) value; // ValueSetExpansionComponent
6023    } else
6024      super.removeChild(name, value);
6025    
6026  }
6027
6028  @Override
6029  public Base makeProperty(int hash, String name) throws FHIRException {
6030    switch (hash) {
6031    case 116079:
6032      return getUrlElement();
6033    case -1618432855:
6034      return addIdentifier();
6035    case 351608024:
6036      return getVersionElement();
6037    case 3373707:
6038      return getNameElement();
6039    case 110371416:
6040      return getTitleElement();
6041    case -892481550:
6042      return getStatusElement();
6043    case -404562712:
6044      return getExperimentalElement();
6045    case 3076014:
6046      return getDateElement();
6047    case 1447404028:
6048      return getPublisherElement();
6049    case 951526432:
6050      return addContact();
6051    case -1724546052:
6052      return getDescriptionElement();
6053    case -669707736:
6054      return addUseContext();
6055    case -507075711:
6056      return addJurisdiction();
6057    case 1596987778:
6058      return getImmutableElement();
6059    case -220463842:
6060      return getPurposeElement();
6061    case 1522889671:
6062      return getCopyrightElement();
6063    case 950497682:
6064      return getCompose();
6065    case 17878207:
6066      return getExpansion();
6067    default:
6068      return super.makeProperty(hash, name);
6069    }
6070
6071  }
6072
6073  @Override
6074  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6075    switch (hash) {
6076    case 116079:
6077      /* url */ return new String[] { "uri" };
6078    case -1618432855:
6079      /* identifier */ return new String[] { "Identifier" };
6080    case 351608024:
6081      /* version */ return new String[] { "string" };
6082    case 3373707:
6083      /* name */ return new String[] { "string" };
6084    case 110371416:
6085      /* title */ return new String[] { "string" };
6086    case -892481550:
6087      /* status */ return new String[] { "code" };
6088    case -404562712:
6089      /* experimental */ return new String[] { "boolean" };
6090    case 3076014:
6091      /* date */ return new String[] { "dateTime" };
6092    case 1447404028:
6093      /* publisher */ return new String[] { "string" };
6094    case 951526432:
6095      /* contact */ return new String[] { "ContactDetail" };
6096    case -1724546052:
6097      /* description */ return new String[] { "markdown" };
6098    case -669707736:
6099      /* useContext */ return new String[] { "UsageContext" };
6100    case -507075711:
6101      /* jurisdiction */ return new String[] { "CodeableConcept" };
6102    case 1596987778:
6103      /* immutable */ return new String[] { "boolean" };
6104    case -220463842:
6105      /* purpose */ return new String[] { "markdown" };
6106    case 1522889671:
6107      /* copyright */ return new String[] { "markdown" };
6108    case 950497682:
6109      /* compose */ return new String[] {};
6110    case 17878207:
6111      /* expansion */ return new String[] {};
6112    default:
6113      return super.getTypesForProperty(hash, name);
6114    }
6115
6116  }
6117
6118  @Override
6119  public Base addChild(String name) throws FHIRException {
6120    if (name.equals("url")) {
6121      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.url");
6122    } else if (name.equals("identifier")) {
6123      return addIdentifier();
6124    } else if (name.equals("version")) {
6125      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.version");
6126    } else if (name.equals("name")) {
6127      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.name");
6128    } else if (name.equals("title")) {
6129      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.title");
6130    } else if (name.equals("status")) {
6131      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.status");
6132    } else if (name.equals("experimental")) {
6133      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.experimental");
6134    } else if (name.equals("date")) {
6135      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.date");
6136    } else if (name.equals("publisher")) {
6137      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.publisher");
6138    } else if (name.equals("contact")) {
6139      return addContact();
6140    } else if (name.equals("description")) {
6141      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.description");
6142    } else if (name.equals("useContext")) {
6143      return addUseContext();
6144    } else if (name.equals("jurisdiction")) {
6145      return addJurisdiction();
6146    } else if (name.equals("immutable")) {
6147      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.immutable");
6148    } else if (name.equals("purpose")) {
6149      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.purpose");
6150    } else if (name.equals("copyright")) {
6151      throw new FHIRException("Cannot call addChild on a singleton property ValueSet.copyright");
6152    } else if (name.equals("compose")) {
6153      this.compose = new ValueSetComposeComponent();
6154      return this.compose;
6155    } else if (name.equals("expansion")) {
6156      this.expansion = new ValueSetExpansionComponent();
6157      return this.expansion;
6158    } else
6159      return super.addChild(name);
6160  }
6161
6162  public String fhirType() {
6163    return "ValueSet";
6164
6165  }
6166
6167  public ValueSet copy() {
6168    ValueSet dst = new ValueSet();
6169    copyValues(dst);
6170    return dst;
6171  }
6172
6173  public void copyValues(ValueSet dst) {
6174    super.copyValues(dst);
6175    dst.url = url == null ? null : url.copy();
6176    if (identifier != null) {
6177      dst.identifier = new ArrayList<Identifier>();
6178      for (Identifier i : identifier)
6179        dst.identifier.add(i.copy());
6180    }
6181    ;
6182    dst.version = version == null ? null : version.copy();
6183    dst.name = name == null ? null : name.copy();
6184    dst.title = title == null ? null : title.copy();
6185    dst.status = status == null ? null : status.copy();
6186    dst.experimental = experimental == null ? null : experimental.copy();
6187    dst.date = date == null ? null : date.copy();
6188    dst.publisher = publisher == null ? null : publisher.copy();
6189    if (contact != null) {
6190      dst.contact = new ArrayList<ContactDetail>();
6191      for (ContactDetail i : contact)
6192        dst.contact.add(i.copy());
6193    }
6194    ;
6195    dst.description = description == null ? null : description.copy();
6196    if (useContext != null) {
6197      dst.useContext = new ArrayList<UsageContext>();
6198      for (UsageContext i : useContext)
6199        dst.useContext.add(i.copy());
6200    }
6201    ;
6202    if (jurisdiction != null) {
6203      dst.jurisdiction = new ArrayList<CodeableConcept>();
6204      for (CodeableConcept i : jurisdiction)
6205        dst.jurisdiction.add(i.copy());
6206    }
6207    ;
6208    dst.immutable = immutable == null ? null : immutable.copy();
6209    dst.purpose = purpose == null ? null : purpose.copy();
6210    dst.copyright = copyright == null ? null : copyright.copy();
6211    dst.compose = compose == null ? null : compose.copy();
6212    dst.expansion = expansion == null ? null : expansion.copy();
6213  }
6214
6215  protected ValueSet typedCopy() {
6216    return copy();
6217  }
6218
6219  @Override
6220  public boolean equalsDeep(Base other_) {
6221    if (!super.equalsDeep(other_))
6222      return false;
6223    if (!(other_ instanceof ValueSet))
6224      return false;
6225    ValueSet o = (ValueSet) other_;
6226    return compareDeep(identifier, o.identifier, true) && compareDeep(immutable, o.immutable, true)
6227        && compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true)
6228        && compareDeep(compose, o.compose, true) && compareDeep(expansion, o.expansion, true);
6229  }
6230
6231  @Override
6232  public boolean equalsShallow(Base other_) {
6233    if (!super.equalsShallow(other_))
6234      return false;
6235    if (!(other_ instanceof ValueSet))
6236      return false;
6237    ValueSet o = (ValueSet) other_;
6238    return compareValues(immutable, o.immutable, true) && compareValues(purpose, o.purpose, true)
6239        && compareValues(copyright, o.copyright, true);
6240  }
6241
6242  public boolean isEmpty() {
6243    return super.isEmpty()
6244        && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, immutable, purpose, copyright, compose, expansion);
6245  }
6246
6247  @Override
6248  public ResourceType getResourceType() {
6249    return ResourceType.ValueSet;
6250  }
6251
6252
6253  
6254  /**
6255   * Search parameter: <b>date</b>
6256   * <p>
6257   * Description: <b>The value set publication date</b><br>
6258   * Type: <b>date</b><br>
6259   * Path: <b>ValueSet.date</b><br>
6260   * </p>
6261   */
6262  @SearchParamDefinition(name = "date", path = "ValueSet.date", description = "The value set publication date", type = "date")
6263  public static final String SP_DATE = "date";
6264  /**
6265   * <b>Fluent Client</b> search parameter constant for <b>date</b>
6266   * <p>
6267   * Description: <b>The value set publication date</b><br>
6268   * Type: <b>date</b><br>
6269   * Path: <b>ValueSet.date</b><br>
6270   * </p>
6271   */
6272  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
6273      SP_DATE);
6274
6275  /**
6276   * Search parameter: <b>identifier</b>
6277   * <p>
6278   * Description: <b>External identifier for the value set</b><br>
6279   * Type: <b>token</b><br>
6280   * Path: <b>ValueSet.identifier</b><br>
6281   * </p>
6282   */
6283  @SearchParamDefinition(name = "identifier", path = "ValueSet.identifier", description = "External identifier for the value set", type = "token")
6284  public static final String SP_IDENTIFIER = "identifier";
6285  /**
6286   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
6287   * <p>
6288   * Description: <b>External identifier for the value set</b><br>
6289   * Type: <b>token</b><br>
6290   * Path: <b>ValueSet.identifier</b><br>
6291   * </p>
6292   */
6293  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6294      SP_IDENTIFIER);
6295
6296  /**
6297   * Search parameter: <b>code</b>
6298   * <p>
6299   * Description: <b>This special parameter searches for codes in the value set.
6300   * See additional notes on the ValueSet resource</b><br>
6301   * Type: <b>token</b><br>
6302   * Path: <b>ValueSet.expansion.contains.code,
6303   * ValueSet.compose.include.concept.code</b><br>
6304   * </p>
6305   */
6306  @SearchParamDefinition(name = "code", path = "ValueSet.expansion.contains.code | ValueSet.compose.include.concept.code", description = "This special parameter searches for codes in the value set. See additional notes on the ValueSet resource", type = "token")
6307  public static final String SP_CODE = "code";
6308  /**
6309   * <b>Fluent Client</b> search parameter constant for <b>code</b>
6310   * <p>
6311   * Description: <b>This special parameter searches for codes in the value set.
6312   * See additional notes on the ValueSet resource</b><br>
6313   * Type: <b>token</b><br>
6314   * Path: <b>ValueSet.expansion.contains.code,
6315   * ValueSet.compose.include.concept.code</b><br>
6316   * </p>
6317   */
6318  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6319      SP_CODE);
6320
6321  /**
6322   * Search parameter: <b>context-type-value</b>
6323   * <p>
6324   * Description: <b>A use context type and value assigned to the value
6325   * set</b><br>
6326   * Type: <b>composite</b><br>
6327   * Path: <b></b><br>
6328   * </p>
6329   */
6330  @SearchParamDefinition(name = "context-type-value", path = "ValueSet.useContext", description = "A use context type and value assigned to the value set", type = "composite", compositeOf = {
6331      "context-type", "context" })
6332  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
6333  /**
6334   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
6335   * <p>
6336   * Description: <b>A use context type and value assigned to the value
6337   * set</b><br>
6338   * Type: <b>composite</b><br>
6339   * Path: <b></b><br>
6340   * </p>
6341   */
6342  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>(
6343      SP_CONTEXT_TYPE_VALUE);
6344
6345  /**
6346   * Search parameter: <b>jurisdiction</b>
6347   * <p>
6348   * Description: <b>Intended jurisdiction for the value set</b><br>
6349   * Type: <b>token</b><br>
6350   * Path: <b>ValueSet.jurisdiction</b><br>
6351   * </p>
6352   */
6353  @SearchParamDefinition(name = "jurisdiction", path = "ValueSet.jurisdiction", description = "Intended jurisdiction for the value set", type = "token")
6354  public static final String SP_JURISDICTION = "jurisdiction";
6355  /**
6356   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
6357   * <p>
6358   * Description: <b>Intended jurisdiction for the value set</b><br>
6359   * Type: <b>token</b><br>
6360   * Path: <b>ValueSet.jurisdiction</b><br>
6361   * </p>
6362   */
6363  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6364      SP_JURISDICTION);
6365
6366  /**
6367   * Search parameter: <b>description</b>
6368   * <p>
6369   * Description: <b>The description of the value set</b><br>
6370   * Type: <b>string</b><br>
6371   * Path: <b>ValueSet.description</b><br>
6372   * </p>
6373   */
6374  @SearchParamDefinition(name = "description", path = "ValueSet.description", description = "The description of the value set", type = "string")
6375  public static final String SP_DESCRIPTION = "description";
6376  /**
6377   * <b>Fluent Client</b> search parameter constant for <b>description</b>
6378   * <p>
6379   * Description: <b>The description of the value set</b><br>
6380   * Type: <b>string</b><br>
6381   * Path: <b>ValueSet.description</b><br>
6382   * </p>
6383   */
6384  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(
6385      SP_DESCRIPTION);
6386
6387  /**
6388   * Search parameter: <b>context-type</b>
6389   * <p>
6390   * Description: <b>A type of use context assigned to the value set</b><br>
6391   * Type: <b>token</b><br>
6392   * Path: <b>ValueSet.useContext.code</b><br>
6393   * </p>
6394   */
6395  @SearchParamDefinition(name = "context-type", path = "ValueSet.useContext.code", description = "A type of use context assigned to the value set", type = "token")
6396  public static final String SP_CONTEXT_TYPE = "context-type";
6397  /**
6398   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
6399   * <p>
6400   * Description: <b>A type of use context assigned to the value set</b><br>
6401   * Type: <b>token</b><br>
6402   * Path: <b>ValueSet.useContext.code</b><br>
6403   * </p>
6404   */
6405  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6406      SP_CONTEXT_TYPE);
6407
6408  /**
6409   * Search parameter: <b>title</b>
6410   * <p>
6411   * Description: <b>The human-friendly name of the value set</b><br>
6412   * Type: <b>string</b><br>
6413   * Path: <b>ValueSet.title</b><br>
6414   * </p>
6415   */
6416  @SearchParamDefinition(name = "title", path = "ValueSet.title", description = "The human-friendly name of the value set", type = "string")
6417  public static final String SP_TITLE = "title";
6418  /**
6419   * <b>Fluent Client</b> search parameter constant for <b>title</b>
6420   * <p>
6421   * Description: <b>The human-friendly name of the value set</b><br>
6422   * Type: <b>string</b><br>
6423   * Path: <b>ValueSet.title</b><br>
6424   * </p>
6425   */
6426  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(
6427      SP_TITLE);
6428
6429  /**
6430   * Search parameter: <b>version</b>
6431   * <p>
6432   * Description: <b>The business version of the value set</b><br>
6433   * Type: <b>token</b><br>
6434   * Path: <b>ValueSet.version</b><br>
6435   * </p>
6436   */
6437  @SearchParamDefinition(name = "version", path = "ValueSet.version", description = "The business version of the value set", type = "token")
6438  public static final String SP_VERSION = "version";
6439  /**
6440   * <b>Fluent Client</b> search parameter constant for <b>version</b>
6441   * <p>
6442   * Description: <b>The business version of the value set</b><br>
6443   * Type: <b>token</b><br>
6444   * Path: <b>ValueSet.version</b><br>
6445   * </p>
6446   */
6447  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6448      SP_VERSION);
6449
6450  /**
6451   * Search parameter: <b>url</b>
6452   * <p>
6453   * Description: <b>The uri that identifies the value set</b><br>
6454   * Type: <b>uri</b><br>
6455   * Path: <b>ValueSet.url</b><br>
6456   * </p>
6457   */
6458  @SearchParamDefinition(name = "url", path = "ValueSet.url", description = "The uri that identifies the value set", type = "uri")
6459  public static final String SP_URL = "url";
6460  /**
6461   * <b>Fluent Client</b> search parameter constant for <b>url</b>
6462   * <p>
6463   * Description: <b>The uri that identifies the value set</b><br>
6464   * Type: <b>uri</b><br>
6465   * Path: <b>ValueSet.url</b><br>
6466   * </p>
6467   */
6468  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
6469
6470  /**
6471   * Search parameter: <b>expansion</b>
6472   * <p>
6473   * Description: <b>Identifies the value set expansion (business
6474   * identifier)</b><br>
6475   * Type: <b>uri</b><br>
6476   * Path: <b>ValueSet.expansion.identifier</b><br>
6477   * </p>
6478   */
6479  @SearchParamDefinition(name = "expansion", path = "ValueSet.expansion.identifier", description = "Identifies the value set expansion (business identifier)", type = "uri")
6480  public static final String SP_EXPANSION = "expansion";
6481  /**
6482   * <b>Fluent Client</b> search parameter constant for <b>expansion</b>
6483   * <p>
6484   * Description: <b>Identifies the value set expansion (business
6485   * identifier)</b><br>
6486   * Type: <b>uri</b><br>
6487   * Path: <b>ValueSet.expansion.identifier</b><br>
6488   * </p>
6489   */
6490  public static final ca.uhn.fhir.rest.gclient.UriClientParam EXPANSION = new ca.uhn.fhir.rest.gclient.UriClientParam(
6491      SP_EXPANSION);
6492
6493  /**
6494   * Search parameter: <b>reference</b>
6495   * <p>
6496   * Description: <b>A code system included or excluded in the value set or an
6497   * imported value set</b><br>
6498   * Type: <b>uri</b><br>
6499   * Path: <b>ValueSet.compose.include.system</b><br>
6500   * </p>
6501   */
6502  @SearchParamDefinition(name = "reference", path = "ValueSet.compose.include.system", description = "A code system included or excluded in the value set or an imported value set", type = "uri")
6503  public static final String SP_REFERENCE = "reference";
6504  /**
6505   * <b>Fluent Client</b> search parameter constant for <b>reference</b>
6506   * <p>
6507   * Description: <b>A code system included or excluded in the value set or an
6508   * imported value set</b><br>
6509   * Type: <b>uri</b><br>
6510   * Path: <b>ValueSet.compose.include.system</b><br>
6511   * </p>
6512   */
6513  public static final ca.uhn.fhir.rest.gclient.UriClientParam REFERENCE = new ca.uhn.fhir.rest.gclient.UriClientParam(
6514      SP_REFERENCE);
6515
6516  /**
6517   * Search parameter: <b>context-quantity</b>
6518   * <p>
6519   * Description: <b>A quantity- or range-valued use context assigned to the value
6520   * set</b><br>
6521   * Type: <b>quantity</b><br>
6522   * Path: <b>ValueSet.useContext.valueQuantity,
6523   * ValueSet.useContext.valueRange</b><br>
6524   * </p>
6525   */
6526  @SearchParamDefinition(name = "context-quantity", path = "(ValueSet.useContext.value as Quantity) | (ValueSet.useContext.value as Range)", description = "A quantity- or range-valued use context assigned to the value set", type = "quantity")
6527  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
6528  /**
6529   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
6530   * <p>
6531   * Description: <b>A quantity- or range-valued use context assigned to the value
6532   * set</b><br>
6533   * Type: <b>quantity</b><br>
6534   * Path: <b>ValueSet.useContext.valueQuantity,
6535   * ValueSet.useContext.valueRange</b><br>
6536   * </p>
6537   */
6538  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(
6539      SP_CONTEXT_QUANTITY);
6540
6541  /**
6542   * Search parameter: <b>name</b>
6543   * <p>
6544   * Description: <b>Computationally friendly name of the value set</b><br>
6545   * Type: <b>string</b><br>
6546   * Path: <b>ValueSet.name</b><br>
6547   * </p>
6548   */
6549  @SearchParamDefinition(name = "name", path = "ValueSet.name", description = "Computationally friendly name of the value set", type = "string")
6550  public static final String SP_NAME = "name";
6551  /**
6552   * <b>Fluent Client</b> search parameter constant for <b>name</b>
6553   * <p>
6554   * Description: <b>Computationally friendly name of the value set</b><br>
6555   * Type: <b>string</b><br>
6556   * Path: <b>ValueSet.name</b><br>
6557   * </p>
6558   */
6559  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(
6560      SP_NAME);
6561
6562  /**
6563   * Search parameter: <b>context</b>
6564   * <p>
6565   * Description: <b>A use context assigned to the value set</b><br>
6566   * Type: <b>token</b><br>
6567   * Path: <b>ValueSet.useContext.valueCodeableConcept</b><br>
6568   * </p>
6569   */
6570  @SearchParamDefinition(name = "context", path = "(ValueSet.useContext.value as CodeableConcept)", description = "A use context assigned to the value set", type = "token")
6571  public static final String SP_CONTEXT = "context";
6572  /**
6573   * <b>Fluent Client</b> search parameter constant for <b>context</b>
6574   * <p>
6575   * Description: <b>A use context assigned to the value set</b><br>
6576   * Type: <b>token</b><br>
6577   * Path: <b>ValueSet.useContext.valueCodeableConcept</b><br>
6578   * </p>
6579   */
6580  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6581      SP_CONTEXT);
6582
6583  /**
6584   * Search parameter: <b>publisher</b>
6585   * <p>
6586   * Description: <b>Name of the publisher of the value set</b><br>
6587   * Type: <b>string</b><br>
6588   * Path: <b>ValueSet.publisher</b><br>
6589   * </p>
6590   */
6591  @SearchParamDefinition(name = "publisher", path = "ValueSet.publisher", description = "Name of the publisher of the value set", type = "string")
6592  public static final String SP_PUBLISHER = "publisher";
6593  /**
6594   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
6595   * <p>
6596   * Description: <b>Name of the publisher of the value set</b><br>
6597   * Type: <b>string</b><br>
6598   * Path: <b>ValueSet.publisher</b><br>
6599   * </p>
6600   */
6601  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(
6602      SP_PUBLISHER);
6603
6604  /**
6605   * Search parameter: <b>context-type-quantity</b>
6606   * <p>
6607   * Description: <b>A use context type and quantity- or range-based value
6608   * assigned to the value set</b><br>
6609   * Type: <b>composite</b><br>
6610   * Path: <b></b><br>
6611   * </p>
6612   */
6613  @SearchParamDefinition(name = "context-type-quantity", path = "ValueSet.useContext", description = "A use context type and quantity- or range-based value assigned to the value set", type = "composite", compositeOf = {
6614      "context-type", "context-quantity" })
6615  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
6616  /**
6617   * <b>Fluent Client</b> search parameter constant for
6618   * <b>context-type-quantity</b>
6619   * <p>
6620   * Description: <b>A use context type and quantity- or range-based value
6621   * assigned to the value set</b><br>
6622   * Type: <b>composite</b><br>
6623   * Path: <b></b><br>
6624   * </p>
6625   */
6626  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>(
6627      SP_CONTEXT_TYPE_QUANTITY);
6628
6629  /**
6630   * Search parameter: <b>status</b>
6631   * <p>
6632   * Description: <b>The current status of the value set</b><br>
6633   * Type: <b>token</b><br>
6634   * Path: <b>ValueSet.status</b><br>
6635   * </p>
6636   */
6637  @SearchParamDefinition(name = "status", path = "ValueSet.status", description = "The current status of the value set", type = "token")
6638  public static final String SP_STATUS = "status";
6639  /**
6640   * <b>Fluent Client</b> search parameter constant for <b>status</b>
6641   * <p>
6642   * Description: <b>The current status of the value set</b><br>
6643   * Type: <b>token</b><br>
6644   * Path: <b>ValueSet.status</b><br>
6645   * </p>
6646   */
6647  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6648      SP_STATUS);
6649
6650}