001package org.hl7.fhir.dstu2.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus;
041import org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatusEnumFactory;
042import ca.uhn.fhir.model.api.annotation.Block;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.ResourceDef;
046import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
047import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
048import org.hl7.fhir.exceptions.FHIRException;
049import org.hl7.fhir.utilities.Utilities;
050/**
051 * A value set specifies a set of codes drawn from one or more code systems.
052 */
053@ResourceDef(name="ValueSet", profile="http://hl7.org/fhir/Profile/ValueSet")
054public class ValueSet extends DomainResource {
055
056    public enum FilterOperator {
057        /**
058         * The specified property of the code equals the provided value.
059         */
060        EQUAL, 
061        /**
062         * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself.
063         */
064        ISA, 
065        /**
066         * The specified property of the code does not have an is-a relationship with the provided value.
067         */
068        ISNOTA, 
069        /**
070         * The specified property of the code  matches the regex specified in the provided value.
071         */
072        REGEX, 
073        /**
074         * The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).
075         */
076        IN, 
077        /**
078         * The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).
079         */
080        NOTIN, 
081        /**
082         * added to help the parsers
083         */
084        NULL;
085        public static FilterOperator fromCode(String codeString) throws FHIRException {
086            if (codeString == null || "".equals(codeString))
087                return null;
088        if ("=".equals(codeString))
089          return EQUAL;
090        if ("is-a".equals(codeString))
091          return ISA;
092        if ("is-not-a".equals(codeString))
093          return ISNOTA;
094        if ("regex".equals(codeString))
095          return REGEX;
096        if ("in".equals(codeString))
097          return IN;
098        if ("not-in".equals(codeString))
099          return NOTIN;
100        throw new FHIRException("Unknown FilterOperator code '"+codeString+"'");
101        }
102        public String toCode() {
103          switch (this) {
104            case EQUAL: return "=";
105            case ISA: return "is-a";
106            case ISNOTA: return "is-not-a";
107            case REGEX: return "regex";
108            case IN: return "in";
109            case NOTIN: return "not-in";
110            default: return "?";
111          }
112        }
113        public String getSystem() {
114          switch (this) {
115            case EQUAL: return "http://hl7.org/fhir/filter-operator";
116            case ISA: return "http://hl7.org/fhir/filter-operator";
117            case ISNOTA: return "http://hl7.org/fhir/filter-operator";
118            case REGEX: return "http://hl7.org/fhir/filter-operator";
119            case IN: return "http://hl7.org/fhir/filter-operator";
120            case NOTIN: return "http://hl7.org/fhir/filter-operator";
121            default: return "?";
122          }
123        }
124        public String getDefinition() {
125          switch (this) {
126            case EQUAL: return "The specified property of the code equals the provided value.";
127            case ISA: 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.";
128            case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value.";
129            case REGEX: return "The specified property of the code  matches the regex specified in the provided value.";
130            case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).";
131            case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).";
132            default: return "?";
133          }
134        }
135        public String getDisplay() {
136          switch (this) {
137            case EQUAL: return "Equals";
138            case ISA: return "Is A (by subsumption)";
139            case ISNOTA: return "Not (Is A) (by subsumption)";
140            case REGEX: return "Regular Expression";
141            case IN: return "In Set";
142            case NOTIN: return "Not in Set";
143            default: return "?";
144          }
145        }
146    }
147
148  public static class FilterOperatorEnumFactory implements EnumFactory<FilterOperator> {
149    public FilterOperator fromCode(String codeString) throws IllegalArgumentException {
150      if (codeString == null || "".equals(codeString))
151            if (codeString == null || "".equals(codeString))
152                return null;
153        if ("=".equals(codeString))
154          return FilterOperator.EQUAL;
155        if ("is-a".equals(codeString))
156          return FilterOperator.ISA;
157        if ("is-not-a".equals(codeString))
158          return FilterOperator.ISNOTA;
159        if ("regex".equals(codeString))
160          return FilterOperator.REGEX;
161        if ("in".equals(codeString))
162          return FilterOperator.IN;
163        if ("not-in".equals(codeString))
164          return FilterOperator.NOTIN;
165        throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'");
166        }
167        public Enumeration<FilterOperator> fromType(Base code) throws FHIRException {
168          if (code == null || code.isEmpty())
169            return null;
170          String codeString = ((PrimitiveType) code).asStringValue();
171          if (codeString == null || "".equals(codeString))
172            return null;
173        if ("=".equals(codeString))
174          return new Enumeration<FilterOperator>(this, FilterOperator.EQUAL);
175        if ("is-a".equals(codeString))
176          return new Enumeration<FilterOperator>(this, FilterOperator.ISA);
177        if ("is-not-a".equals(codeString))
178          return new Enumeration<FilterOperator>(this, FilterOperator.ISNOTA);
179        if ("regex".equals(codeString))
180          return new Enumeration<FilterOperator>(this, FilterOperator.REGEX);
181        if ("in".equals(codeString))
182          return new Enumeration<FilterOperator>(this, FilterOperator.IN);
183        if ("not-in".equals(codeString))
184          return new Enumeration<FilterOperator>(this, FilterOperator.NOTIN);
185        throw new FHIRException("Unknown FilterOperator code '"+codeString+"'");
186        }
187    public String toCode(FilterOperator code) {
188      if (code == FilterOperator.EQUAL)
189        return "=";
190      if (code == FilterOperator.ISA)
191        return "is-a";
192      if (code == FilterOperator.ISNOTA)
193        return "is-not-a";
194      if (code == FilterOperator.REGEX)
195        return "regex";
196      if (code == FilterOperator.IN)
197        return "in";
198      if (code == FilterOperator.NOTIN)
199        return "not-in";
200      return "?";
201      }
202    }
203
204    @Block()
205    public static class ValueSetContactComponent extends BackboneElement implements IBaseBackboneElement {
206        /**
207         * The name of an individual to contact regarding the value set.
208         */
209        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
210        @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the value set." )
211        protected StringType name;
212
213        /**
214         * Contact details for individual (if a name was provided) or the publisher.
215         */
216        @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
217        @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." )
218        protected List<ContactPoint> telecom;
219
220        private static final long serialVersionUID = -1179697803L;
221
222    /*
223     * Constructor
224     */
225      public ValueSetContactComponent() {
226        super();
227      }
228
229        /**
230         * @return {@link #name} (The name of an individual to contact regarding the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
231         */
232        public StringType getNameElement() { 
233          if (this.name == null)
234            if (Configuration.errorOnAutoCreate())
235              throw new Error("Attempt to auto-create ValueSetContactComponent.name");
236            else if (Configuration.doAutoCreate())
237              this.name = new StringType(); // bb
238          return this.name;
239        }
240
241        public boolean hasNameElement() { 
242          return this.name != null && !this.name.isEmpty();
243        }
244
245        public boolean hasName() { 
246          return this.name != null && !this.name.isEmpty();
247        }
248
249        /**
250         * @param value {@link #name} (The name of an individual to contact regarding the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
251         */
252        public ValueSetContactComponent setNameElement(StringType value) { 
253          this.name = value;
254          return this;
255        }
256
257        /**
258         * @return The name of an individual to contact regarding the value set.
259         */
260        public String getName() { 
261          return this.name == null ? null : this.name.getValue();
262        }
263
264        /**
265         * @param value The name of an individual to contact regarding the value set.
266         */
267        public ValueSetContactComponent setName(String value) { 
268          if (Utilities.noString(value))
269            this.name = null;
270          else {
271            if (this.name == null)
272              this.name = new StringType();
273            this.name.setValue(value);
274          }
275          return this;
276        }
277
278        /**
279         * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.)
280         */
281        public List<ContactPoint> getTelecom() { 
282          if (this.telecom == null)
283            this.telecom = new ArrayList<ContactPoint>();
284          return this.telecom;
285        }
286
287        public boolean hasTelecom() { 
288          if (this.telecom == null)
289            return false;
290          for (ContactPoint item : this.telecom)
291            if (!item.isEmpty())
292              return true;
293          return false;
294        }
295
296        /**
297         * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.)
298         */
299    // syntactic sugar
300        public ContactPoint addTelecom() { //3
301          ContactPoint t = new ContactPoint();
302          if (this.telecom == null)
303            this.telecom = new ArrayList<ContactPoint>();
304          this.telecom.add(t);
305          return t;
306        }
307
308    // syntactic sugar
309        public ValueSetContactComponent addTelecom(ContactPoint t) { //3
310          if (t == null)
311            return this;
312          if (this.telecom == null)
313            this.telecom = new ArrayList<ContactPoint>();
314          this.telecom.add(t);
315          return this;
316        }
317
318        protected void listChildren(List<Property> childrenList) {
319          super.listChildren(childrenList);
320          childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the value set.", 0, java.lang.Integer.MAX_VALUE, name));
321          childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom));
322        }
323
324      @Override
325      public void setProperty(String name, Base value) throws FHIRException {
326        if (name.equals("name"))
327          this.name = castToString(value); // StringType
328        else if (name.equals("telecom"))
329          this.getTelecom().add(castToContactPoint(value));
330        else
331          super.setProperty(name, value);
332      }
333
334      @Override
335      public Base addChild(String name) throws FHIRException {
336        if (name.equals("name")) {
337          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.name");
338        }
339        else if (name.equals("telecom")) {
340          return addTelecom();
341        }
342        else
343          return super.addChild(name);
344      }
345
346      public ValueSetContactComponent copy() {
347        ValueSetContactComponent dst = new ValueSetContactComponent();
348        copyValues(dst);
349        dst.name = name == null ? null : name.copy();
350        if (telecom != null) {
351          dst.telecom = new ArrayList<ContactPoint>();
352          for (ContactPoint i : telecom)
353            dst.telecom.add(i.copy());
354        };
355        return dst;
356      }
357
358      @Override
359      public boolean equalsDeep(Base other) {
360        if (!super.equalsDeep(other))
361          return false;
362        if (!(other instanceof ValueSetContactComponent))
363          return false;
364        ValueSetContactComponent o = (ValueSetContactComponent) other;
365        return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true);
366      }
367
368      @Override
369      public boolean equalsShallow(Base other) {
370        if (!super.equalsShallow(other))
371          return false;
372        if (!(other instanceof ValueSetContactComponent))
373          return false;
374        ValueSetContactComponent o = (ValueSetContactComponent) other;
375        return compareValues(name, o.name, true);
376      }
377
378      public boolean isEmpty() {
379        return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty())
380          ;
381      }
382
383  public String fhirType() {
384    return "ValueSet.contact";
385
386  }
387
388  }
389
390    @Block()
391    public static class ValueSetCodeSystemComponent extends BackboneElement implements IBaseBackboneElement {
392        /**
393         * An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.
394         */
395        @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true)
396        @Description(shortDefinition="URI to identify the code system (e.g. in Coding.system)", formalDefinition="An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system." )
397        protected UriType system;
398
399        /**
400         * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.
401         */
402        @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
403        @Description(shortDefinition="Version (for use in Coding.version)", formalDefinition="The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked." )
404        protected StringType version;
405
406        /**
407         * If code comparison is case sensitive when codes within this system are compared to each other.
408         */
409        @Child(name = "caseSensitive", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true)
410        @Description(shortDefinition="If code comparison is case sensitive", formalDefinition="If code comparison is case sensitive when codes within this system are compared to each other." )
411        protected BooleanType caseSensitive;
412
413        /**
414         * Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.
415         */
416        @Child(name = "concept", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
417        @Description(shortDefinition="Concepts in the code system", formalDefinition="Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are." )
418        protected List<ConceptDefinitionComponent> concept;
419
420        private static final long serialVersionUID = -1109401192L;
421
422    /*
423     * Constructor
424     */
425      public ValueSetCodeSystemComponent() {
426        super();
427      }
428
429    /*
430     * Constructor
431     */
432      public ValueSetCodeSystemComponent(UriType system) {
433        super();
434        this.system = system;
435      }
436
437        /**
438         * @return {@link #system} (An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value
439         */
440        public UriType getSystemElement() { 
441          if (this.system == null)
442            if (Configuration.errorOnAutoCreate())
443              throw new Error("Attempt to auto-create ValueSetCodeSystemComponent.system");
444            else if (Configuration.doAutoCreate())
445              this.system = new UriType(); // bb
446          return this.system;
447        }
448
449        public boolean hasSystemElement() { 
450          return this.system != null && !this.system.isEmpty();
451        }
452
453        public boolean hasSystem() { 
454          return this.system != null && !this.system.isEmpty();
455        }
456
457        /**
458         * @param value {@link #system} (An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value
459         */
460        public ValueSetCodeSystemComponent setSystemElement(UriType value) { 
461          this.system = value;
462          return this;
463        }
464
465        /**
466         * @return An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.
467         */
468        public String getSystem() { 
469          return this.system == null ? null : this.system.getValue();
470        }
471
472        /**
473         * @param value An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.
474         */
475        public ValueSetCodeSystemComponent setSystem(String value) { 
476            if (this.system == null)
477              this.system = new UriType();
478            this.system.setValue(value);
479          return this;
480        }
481
482        /**
483         * @return {@link #version} (The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
484         */
485        public StringType getVersionElement() { 
486          if (this.version == null)
487            if (Configuration.errorOnAutoCreate())
488              throw new Error("Attempt to auto-create ValueSetCodeSystemComponent.version");
489            else if (Configuration.doAutoCreate())
490              this.version = new StringType(); // bb
491          return this.version;
492        }
493
494        public boolean hasVersionElement() { 
495          return this.version != null && !this.version.isEmpty();
496        }
497
498        public boolean hasVersion() { 
499          return this.version != null && !this.version.isEmpty();
500        }
501
502        /**
503         * @param value {@link #version} (The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
504         */
505        public ValueSetCodeSystemComponent setVersionElement(StringType value) { 
506          this.version = value;
507          return this;
508        }
509
510        /**
511         * @return The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.
512         */
513        public String getVersion() { 
514          return this.version == null ? null : this.version.getValue();
515        }
516
517        /**
518         * @param value The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.
519         */
520        public ValueSetCodeSystemComponent setVersion(String value) { 
521          if (Utilities.noString(value))
522            this.version = null;
523          else {
524            if (this.version == null)
525              this.version = new StringType();
526            this.version.setValue(value);
527          }
528          return this;
529        }
530
531        /**
532         * @return {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value
533         */
534        public BooleanType getCaseSensitiveElement() { 
535          if (this.caseSensitive == null)
536            if (Configuration.errorOnAutoCreate())
537              throw new Error("Attempt to auto-create ValueSetCodeSystemComponent.caseSensitive");
538            else if (Configuration.doAutoCreate())
539              this.caseSensitive = new BooleanType(); // bb
540          return this.caseSensitive;
541        }
542
543        public boolean hasCaseSensitiveElement() { 
544          return this.caseSensitive != null && !this.caseSensitive.isEmpty();
545        }
546
547        public boolean hasCaseSensitive() { 
548          return this.caseSensitive != null && !this.caseSensitive.isEmpty();
549        }
550
551        /**
552         * @param value {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value
553         */
554        public ValueSetCodeSystemComponent setCaseSensitiveElement(BooleanType value) { 
555          this.caseSensitive = value;
556          return this;
557        }
558
559        /**
560         * @return If code comparison is case sensitive when codes within this system are compared to each other.
561         */
562        public boolean getCaseSensitive() { 
563          return this.caseSensitive == null || this.caseSensitive.isEmpty() ? false : this.caseSensitive.getValue();
564        }
565
566        /**
567         * @param value If code comparison is case sensitive when codes within this system are compared to each other.
568         */
569        public ValueSetCodeSystemComponent setCaseSensitive(boolean value) { 
570            if (this.caseSensitive == null)
571              this.caseSensitive = new BooleanType();
572            this.caseSensitive.setValue(value);
573          return this;
574        }
575
576        /**
577         * @return {@link #concept} (Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.)
578         */
579        public List<ConceptDefinitionComponent> getConcept() { 
580          if (this.concept == null)
581            this.concept = new ArrayList<ConceptDefinitionComponent>();
582          return this.concept;
583        }
584
585        public boolean hasConcept() { 
586          if (this.concept == null)
587            return false;
588          for (ConceptDefinitionComponent item : this.concept)
589            if (!item.isEmpty())
590              return true;
591          return false;
592        }
593
594        /**
595         * @return {@link #concept} (Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.)
596         */
597    // syntactic sugar
598        public ConceptDefinitionComponent addConcept() { //3
599          ConceptDefinitionComponent t = new ConceptDefinitionComponent();
600          if (this.concept == null)
601            this.concept = new ArrayList<ConceptDefinitionComponent>();
602          this.concept.add(t);
603          return t;
604        }
605
606    // syntactic sugar
607        public ValueSetCodeSystemComponent addConcept(ConceptDefinitionComponent t) { //3
608          if (t == null)
609            return this;
610          if (this.concept == null)
611            this.concept = new ArrayList<ConceptDefinitionComponent>();
612          this.concept.add(t);
613          return this;
614        }
615
616        protected void listChildren(List<Property> childrenList) {
617          super.listChildren(childrenList);
618          childrenList.add(new Property("system", "uri", "An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system.", 0, java.lang.Integer.MAX_VALUE, system));
619          childrenList.add(new Property("version", "string", "The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked.", 0, java.lang.Integer.MAX_VALUE, version));
620          childrenList.add(new Property("caseSensitive", "boolean", "If code comparison is case sensitive when codes within this system are compared to each other.", 0, java.lang.Integer.MAX_VALUE, caseSensitive));
621          childrenList.add(new Property("concept", "", "Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.", 0, java.lang.Integer.MAX_VALUE, concept));
622        }
623
624      @Override
625      public void setProperty(String name, Base value) throws FHIRException {
626        if (name.equals("system"))
627          this.system = castToUri(value); // UriType
628        else if (name.equals("version"))
629          this.version = castToString(value); // StringType
630        else if (name.equals("caseSensitive"))
631          this.caseSensitive = castToBoolean(value); // BooleanType
632        else if (name.equals("concept"))
633          this.getConcept().add((ConceptDefinitionComponent) value);
634        else
635          super.setProperty(name, value);
636      }
637
638      @Override
639      public Base addChild(String name) throws FHIRException {
640        if (name.equals("system")) {
641          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.system");
642        }
643        else if (name.equals("version")) {
644          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version");
645        }
646        else if (name.equals("caseSensitive")) {
647          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.caseSensitive");
648        }
649        else if (name.equals("concept")) {
650          return addConcept();
651        }
652        else
653          return super.addChild(name);
654      }
655
656      public ValueSetCodeSystemComponent copy() {
657        ValueSetCodeSystemComponent dst = new ValueSetCodeSystemComponent();
658        copyValues(dst);
659        dst.system = system == null ? null : system.copy();
660        dst.version = version == null ? null : version.copy();
661        dst.caseSensitive = caseSensitive == null ? null : caseSensitive.copy();
662        if (concept != null) {
663          dst.concept = new ArrayList<ConceptDefinitionComponent>();
664          for (ConceptDefinitionComponent i : concept)
665            dst.concept.add(i.copy());
666        };
667        return dst;
668      }
669
670      @Override
671      public boolean equalsDeep(Base other) {
672        if (!super.equalsDeep(other))
673          return false;
674        if (!(other instanceof ValueSetCodeSystemComponent))
675          return false;
676        ValueSetCodeSystemComponent o = (ValueSetCodeSystemComponent) other;
677        return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(caseSensitive, o.caseSensitive, true)
678           && compareDeep(concept, o.concept, true);
679      }
680
681      @Override
682      public boolean equalsShallow(Base other) {
683        if (!super.equalsShallow(other))
684          return false;
685        if (!(other instanceof ValueSetCodeSystemComponent))
686          return false;
687        ValueSetCodeSystemComponent o = (ValueSetCodeSystemComponent) other;
688        return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(caseSensitive, o.caseSensitive, true)
689          ;
690      }
691
692      public boolean isEmpty() {
693        return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty())
694           && (caseSensitive == null || caseSensitive.isEmpty()) && (concept == null || concept.isEmpty())
695          ;
696      }
697
698  public String fhirType() {
699    return "ValueSet.codeSystem";
700
701  }
702
703  }
704
705    @Block()
706    public static class ConceptDefinitionComponent extends BackboneElement implements IBaseBackboneElement {
707        /**
708         * A code - a text symbol - that uniquely identifies the concept within the code system.
709         */
710        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
711        @Description(shortDefinition="Code that identifies concept", formalDefinition="A code - a text symbol - that uniquely identifies the concept within the code system." )
712        protected CodeType code;
713
714        /**
715         * If this code is not for use as a real concept.
716         */
717        @Child(name = "abstract", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
718        @Description(shortDefinition="If this code is not for use as a real concept", formalDefinition="If this code is not for use as a real concept." )
719        protected BooleanType abstract_;
720
721        /**
722         * A human readable string that is the recommended default way to present this concept to a user.
723         */
724        @Child(name = "display", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
725        @Description(shortDefinition="Text to display to the user", formalDefinition="A human readable string that is the recommended default way to present this concept to a user." )
726        protected StringType display;
727
728        /**
729         * The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.
730         */
731        @Child(name = "definition", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
732        @Description(shortDefinition="Formal definition", formalDefinition="The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept." )
733        protected StringType definition;
734
735        /**
736         * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.
737         */
738        @Child(name = "designation", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
739        @Description(shortDefinition="Additional representations for the concept", formalDefinition="Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc." )
740        protected List<ConceptDefinitionDesignationComponent> designation;
741
742        /**
743         * Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.
744         */
745        @Child(name = "concept", type = {ConceptDefinitionComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
746        @Description(shortDefinition="Child Concepts (is-a/contains/categorizes)", formalDefinition="Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts." )
747        protected List<ConceptDefinitionComponent> concept;
748
749        private static final long serialVersionUID = -318560292L;
750
751    /*
752     * Constructor
753     */
754      public ConceptDefinitionComponent() {
755        super();
756      }
757
758    /*
759     * Constructor
760     */
761      public ConceptDefinitionComponent(CodeType code) {
762        super();
763        this.code = code;
764      }
765
766        /**
767         * @return {@link #code} (A code - a text symbol - that uniquely identifies the concept within the code system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
768         */
769        public CodeType getCodeElement() { 
770          if (this.code == null)
771            if (Configuration.errorOnAutoCreate())
772              throw new Error("Attempt to auto-create ConceptDefinitionComponent.code");
773            else if (Configuration.doAutoCreate())
774              this.code = new CodeType(); // bb
775          return this.code;
776        }
777
778        public boolean hasCodeElement() { 
779          return this.code != null && !this.code.isEmpty();
780        }
781
782        public boolean hasCode() { 
783          return this.code != null && !this.code.isEmpty();
784        }
785
786        /**
787         * @param value {@link #code} (A code - a text symbol - that uniquely identifies the concept within the code system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
788         */
789        public ConceptDefinitionComponent setCodeElement(CodeType value) { 
790          this.code = value;
791          return this;
792        }
793
794        /**
795         * @return A code - a text symbol - that uniquely identifies the concept within the code system.
796         */
797        public String getCode() { 
798          return this.code == null ? null : this.code.getValue();
799        }
800
801        /**
802         * @param value A code - a text symbol - that uniquely identifies the concept within the code system.
803         */
804        public ConceptDefinitionComponent setCode(String value) { 
805            if (this.code == null)
806              this.code = new CodeType();
807            this.code.setValue(value);
808          return this;
809        }
810
811        /**
812         * @return {@link #abstract_} (If this code is not for use as a real concept.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value
813         */
814        public BooleanType getAbstractElement() { 
815          if (this.abstract_ == null)
816            if (Configuration.errorOnAutoCreate())
817              throw new Error("Attempt to auto-create ConceptDefinitionComponent.abstract_");
818            else if (Configuration.doAutoCreate())
819              this.abstract_ = new BooleanType(); // bb
820          return this.abstract_;
821        }
822
823        public boolean hasAbstractElement() { 
824          return this.abstract_ != null && !this.abstract_.isEmpty();
825        }
826
827        public boolean hasAbstract() { 
828          return this.abstract_ != null && !this.abstract_.isEmpty();
829        }
830
831        /**
832         * @param value {@link #abstract_} (If this code is not for use as a real concept.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value
833         */
834        public ConceptDefinitionComponent setAbstractElement(BooleanType value) { 
835          this.abstract_ = value;
836          return this;
837        }
838
839        /**
840         * @return If this code is not for use as a real concept.
841         */
842        public boolean getAbstract() { 
843          return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue();
844        }
845
846        /**
847         * @param value If this code is not for use as a real concept.
848         */
849        public ConceptDefinitionComponent setAbstract(boolean value) { 
850            if (this.abstract_ == null)
851              this.abstract_ = new BooleanType();
852            this.abstract_.setValue(value);
853          return this;
854        }
855
856        /**
857         * @return {@link #display} (A human readable string that is the recommended default way to present this concept to a user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
858         */
859        public StringType getDisplayElement() { 
860          if (this.display == null)
861            if (Configuration.errorOnAutoCreate())
862              throw new Error("Attempt to auto-create ConceptDefinitionComponent.display");
863            else if (Configuration.doAutoCreate())
864              this.display = new StringType(); // bb
865          return this.display;
866        }
867
868        public boolean hasDisplayElement() { 
869          return this.display != null && !this.display.isEmpty();
870        }
871
872        public boolean hasDisplay() { 
873          return this.display != null && !this.display.isEmpty();
874        }
875
876        /**
877         * @param value {@link #display} (A human readable string that is the recommended default way to present this concept to a user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
878         */
879        public ConceptDefinitionComponent setDisplayElement(StringType value) { 
880          this.display = value;
881          return this;
882        }
883
884        /**
885         * @return A human readable string that is the recommended default way to present this concept to a user.
886         */
887        public String getDisplay() { 
888          return this.display == null ? null : this.display.getValue();
889        }
890
891        /**
892         * @param value A human readable string that is the recommended default way to present this concept to a user.
893         */
894        public ConceptDefinitionComponent setDisplay(String value) { 
895          if (Utilities.noString(value))
896            this.display = null;
897          else {
898            if (this.display == null)
899              this.display = new StringType();
900            this.display.setValue(value);
901          }
902          return this;
903        }
904
905        /**
906         * @return {@link #definition} (The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
907         */
908        public StringType getDefinitionElement() { 
909          if (this.definition == null)
910            if (Configuration.errorOnAutoCreate())
911              throw new Error("Attempt to auto-create ConceptDefinitionComponent.definition");
912            else if (Configuration.doAutoCreate())
913              this.definition = new StringType(); // bb
914          return this.definition;
915        }
916
917        public boolean hasDefinitionElement() { 
918          return this.definition != null && !this.definition.isEmpty();
919        }
920
921        public boolean hasDefinition() { 
922          return this.definition != null && !this.definition.isEmpty();
923        }
924
925        /**
926         * @param value {@link #definition} (The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
927         */
928        public ConceptDefinitionComponent setDefinitionElement(StringType value) { 
929          this.definition = value;
930          return this;
931        }
932
933        /**
934         * @return The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.
935         */
936        public String getDefinition() { 
937          return this.definition == null ? null : this.definition.getValue();
938        }
939
940        /**
941         * @param value The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.
942         */
943        public ConceptDefinitionComponent setDefinition(String value) { 
944          if (Utilities.noString(value))
945            this.definition = null;
946          else {
947            if (this.definition == null)
948              this.definition = new StringType();
949            this.definition.setValue(value);
950          }
951          return this;
952        }
953
954        /**
955         * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.)
956         */
957        public List<ConceptDefinitionDesignationComponent> getDesignation() { 
958          if (this.designation == null)
959            this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
960          return this.designation;
961        }
962
963        public boolean hasDesignation() { 
964          if (this.designation == null)
965            return false;
966          for (ConceptDefinitionDesignationComponent item : this.designation)
967            if (!item.isEmpty())
968              return true;
969          return false;
970        }
971
972        /**
973         * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.)
974         */
975    // syntactic sugar
976        public ConceptDefinitionDesignationComponent addDesignation() { //3
977          ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent();
978          if (this.designation == null)
979            this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
980          this.designation.add(t);
981          return t;
982        }
983
984    // syntactic sugar
985        public ConceptDefinitionComponent addDesignation(ConceptDefinitionDesignationComponent t) { //3
986          if (t == null)
987            return this;
988          if (this.designation == null)
989            this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
990          this.designation.add(t);
991          return this;
992        }
993
994        /**
995         * @return {@link #concept} (Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.)
996         */
997        public List<ConceptDefinitionComponent> getConcept() { 
998          if (this.concept == null)
999            this.concept = new ArrayList<ConceptDefinitionComponent>();
1000          return this.concept;
1001        }
1002
1003        public boolean hasConcept() { 
1004          if (this.concept == null)
1005            return false;
1006          for (ConceptDefinitionComponent item : this.concept)
1007            if (!item.isEmpty())
1008              return true;
1009          return false;
1010        }
1011
1012        /**
1013         * @return {@link #concept} (Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.)
1014         */
1015    // syntactic sugar
1016        public ConceptDefinitionComponent addConcept() { //3
1017          ConceptDefinitionComponent t = new ConceptDefinitionComponent();
1018          if (this.concept == null)
1019            this.concept = new ArrayList<ConceptDefinitionComponent>();
1020          this.concept.add(t);
1021          return t;
1022        }
1023
1024    // syntactic sugar
1025        public ConceptDefinitionComponent addConcept(ConceptDefinitionComponent t) { //3
1026          if (t == null)
1027            return this;
1028          if (this.concept == null)
1029            this.concept = new ArrayList<ConceptDefinitionComponent>();
1030          this.concept.add(t);
1031          return this;
1032        }
1033
1034        protected void listChildren(List<Property> childrenList) {
1035          super.listChildren(childrenList);
1036          childrenList.add(new Property("code", "code", "A code - a text symbol - that uniquely identifies the concept within the code system.", 0, java.lang.Integer.MAX_VALUE, code));
1037          childrenList.add(new Property("abstract", "boolean", "If this code is not for use as a real concept.", 0, java.lang.Integer.MAX_VALUE, abstract_));
1038          childrenList.add(new Property("display", "string", "A human readable string that is the recommended default way to present this concept to a user.", 0, java.lang.Integer.MAX_VALUE, display));
1039          childrenList.add(new Property("definition", "string", "The formal definition of the concept. The value set resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.", 0, java.lang.Integer.MAX_VALUE, definition));
1040          childrenList.add(new Property("designation", "", "Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation));
1041          childrenList.add(new Property("concept", "@ValueSet.codeSystem.concept", "Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.", 0, java.lang.Integer.MAX_VALUE, concept));
1042        }
1043
1044      @Override
1045      public void setProperty(String name, Base value) throws FHIRException {
1046        if (name.equals("code"))
1047          this.code = castToCode(value); // CodeType
1048        else if (name.equals("abstract"))
1049          this.abstract_ = castToBoolean(value); // BooleanType
1050        else if (name.equals("display"))
1051          this.display = castToString(value); // StringType
1052        else if (name.equals("definition"))
1053          this.definition = castToString(value); // StringType
1054        else if (name.equals("designation"))
1055          this.getDesignation().add((ConceptDefinitionDesignationComponent) value);
1056        else if (name.equals("concept"))
1057          this.getConcept().add((ConceptDefinitionComponent) value);
1058        else
1059          super.setProperty(name, value);
1060      }
1061
1062      @Override
1063      public Base addChild(String name) throws FHIRException {
1064        if (name.equals("code")) {
1065          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.code");
1066        }
1067        else if (name.equals("abstract")) {
1068          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.abstract");
1069        }
1070        else if (name.equals("display")) {
1071          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.display");
1072        }
1073        else if (name.equals("definition")) {
1074          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.definition");
1075        }
1076        else if (name.equals("designation")) {
1077          return addDesignation();
1078        }
1079        else if (name.equals("concept")) {
1080          return addConcept();
1081        }
1082        else
1083          return super.addChild(name);
1084      }
1085
1086      public ConceptDefinitionComponent copy() {
1087        ConceptDefinitionComponent dst = new ConceptDefinitionComponent();
1088        copyValues(dst);
1089        dst.code = code == null ? null : code.copy();
1090        dst.abstract_ = abstract_ == null ? null : abstract_.copy();
1091        dst.display = display == null ? null : display.copy();
1092        dst.definition = definition == null ? null : definition.copy();
1093        if (designation != null) {
1094          dst.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
1095          for (ConceptDefinitionDesignationComponent i : designation)
1096            dst.designation.add(i.copy());
1097        };
1098        if (concept != null) {
1099          dst.concept = new ArrayList<ConceptDefinitionComponent>();
1100          for (ConceptDefinitionComponent i : concept)
1101            dst.concept.add(i.copy());
1102        };
1103        return dst;
1104      }
1105
1106      @Override
1107      public boolean equalsDeep(Base other) {
1108        if (!super.equalsDeep(other))
1109          return false;
1110        if (!(other instanceof ConceptDefinitionComponent))
1111          return false;
1112        ConceptDefinitionComponent o = (ConceptDefinitionComponent) other;
1113        return compareDeep(code, o.code, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(display, o.display, true)
1114           && compareDeep(definition, o.definition, true) && compareDeep(designation, o.designation, true)
1115           && compareDeep(concept, o.concept, true);
1116      }
1117
1118      @Override
1119      public boolean equalsShallow(Base other) {
1120        if (!super.equalsShallow(other))
1121          return false;
1122        if (!(other instanceof ConceptDefinitionComponent))
1123          return false;
1124        ConceptDefinitionComponent o = (ConceptDefinitionComponent) other;
1125        return compareValues(code, o.code, true) && compareValues(abstract_, o.abstract_, true) && compareValues(display, o.display, true)
1126           && compareValues(definition, o.definition, true);
1127      }
1128
1129      public boolean isEmpty() {
1130        return super.isEmpty() && (code == null || code.isEmpty()) && (abstract_ == null || abstract_.isEmpty())
1131           && (display == null || display.isEmpty()) && (definition == null || definition.isEmpty())
1132           && (designation == null || designation.isEmpty()) && (concept == null || concept.isEmpty())
1133          ;
1134      }
1135
1136  public String fhirType() {
1137    return "ValueSet.codeSystem.concept";
1138
1139  }
1140
1141  }
1142
1143    @Block()
1144    public static class ConceptDefinitionDesignationComponent extends BackboneElement implements IBaseBackboneElement {
1145        /**
1146         * The language this designation is defined for.
1147         */
1148        @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1149        @Description(shortDefinition="Human language of the designation", formalDefinition="The language this designation is defined for." )
1150        protected CodeType language;
1151
1152        /**
1153         * A code that details how this designation would be used.
1154         */
1155        @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false)
1156        @Description(shortDefinition="Details how this designation would be used", formalDefinition="A code that details how this designation would be used." )
1157        protected Coding use;
1158
1159        /**
1160         * The text value for this designation.
1161         */
1162        @Child(name = "value", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false)
1163        @Description(shortDefinition="The text value for this designation", formalDefinition="The text value for this designation." )
1164        protected StringType value;
1165
1166        private static final long serialVersionUID = 1515662414L;
1167
1168    /*
1169     * Constructor
1170     */
1171      public ConceptDefinitionDesignationComponent() {
1172        super();
1173      }
1174
1175    /*
1176     * Constructor
1177     */
1178      public ConceptDefinitionDesignationComponent(StringType value) {
1179        super();
1180        this.value = value;
1181      }
1182
1183        /**
1184         * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
1185         */
1186        public CodeType getLanguageElement() { 
1187          if (this.language == null)
1188            if (Configuration.errorOnAutoCreate())
1189              throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.language");
1190            else if (Configuration.doAutoCreate())
1191              this.language = new CodeType(); // bb
1192          return this.language;
1193        }
1194
1195        public boolean hasLanguageElement() { 
1196          return this.language != null && !this.language.isEmpty();
1197        }
1198
1199        public boolean hasLanguage() { 
1200          return this.language != null && !this.language.isEmpty();
1201        }
1202
1203        /**
1204         * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
1205         */
1206        public ConceptDefinitionDesignationComponent setLanguageElement(CodeType value) { 
1207          this.language = value;
1208          return this;
1209        }
1210
1211        /**
1212         * @return The language this designation is defined for.
1213         */
1214        public String getLanguage() { 
1215          return this.language == null ? null : this.language.getValue();
1216        }
1217
1218        /**
1219         * @param value The language this designation is defined for.
1220         */
1221        public ConceptDefinitionDesignationComponent setLanguage(String value) { 
1222          if (Utilities.noString(value))
1223            this.language = null;
1224          else {
1225            if (this.language == null)
1226              this.language = new CodeType();
1227            this.language.setValue(value);
1228          }
1229          return this;
1230        }
1231
1232        /**
1233         * @return {@link #use} (A code that details how this designation would be used.)
1234         */
1235        public Coding getUse() { 
1236          if (this.use == null)
1237            if (Configuration.errorOnAutoCreate())
1238              throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.use");
1239            else if (Configuration.doAutoCreate())
1240              this.use = new Coding(); // cc
1241          return this.use;
1242        }
1243
1244        public boolean hasUse() { 
1245          return this.use != null && !this.use.isEmpty();
1246        }
1247
1248        /**
1249         * @param value {@link #use} (A code that details how this designation would be used.)
1250         */
1251        public ConceptDefinitionDesignationComponent setUse(Coding value) { 
1252          this.use = value;
1253          return this;
1254        }
1255
1256        /**
1257         * @return {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
1258         */
1259        public StringType getValueElement() { 
1260          if (this.value == null)
1261            if (Configuration.errorOnAutoCreate())
1262              throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.value");
1263            else if (Configuration.doAutoCreate())
1264              this.value = new StringType(); // bb
1265          return this.value;
1266        }
1267
1268        public boolean hasValueElement() { 
1269          return this.value != null && !this.value.isEmpty();
1270        }
1271
1272        public boolean hasValue() { 
1273          return this.value != null && !this.value.isEmpty();
1274        }
1275
1276        /**
1277         * @param value {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
1278         */
1279        public ConceptDefinitionDesignationComponent setValueElement(StringType value) { 
1280          this.value = value;
1281          return this;
1282        }
1283
1284        /**
1285         * @return The text value for this designation.
1286         */
1287        public String getValue() { 
1288          return this.value == null ? null : this.value.getValue();
1289        }
1290
1291        /**
1292         * @param value The text value for this designation.
1293         */
1294        public ConceptDefinitionDesignationComponent setValue(String value) { 
1295            if (this.value == null)
1296              this.value = new StringType();
1297            this.value.setValue(value);
1298          return this;
1299        }
1300
1301        protected void listChildren(List<Property> childrenList) {
1302          super.listChildren(childrenList);
1303          childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language));
1304          childrenList.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, java.lang.Integer.MAX_VALUE, use));
1305          childrenList.add(new Property("value", "string", "The text value for this designation.", 0, java.lang.Integer.MAX_VALUE, value));
1306        }
1307
1308      @Override
1309      public void setProperty(String name, Base value) throws FHIRException {
1310        if (name.equals("language"))
1311          this.language = castToCode(value); // CodeType
1312        else if (name.equals("use"))
1313          this.use = castToCoding(value); // Coding
1314        else if (name.equals("value"))
1315          this.value = castToString(value); // StringType
1316        else
1317          super.setProperty(name, value);
1318      }
1319
1320      @Override
1321      public Base addChild(String name) throws FHIRException {
1322        if (name.equals("language")) {
1323          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.language");
1324        }
1325        else if (name.equals("use")) {
1326          this.use = new Coding();
1327          return this.use;
1328        }
1329        else if (name.equals("value")) {
1330          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.value");
1331        }
1332        else
1333          return super.addChild(name);
1334      }
1335
1336      public ConceptDefinitionDesignationComponent copy() {
1337        ConceptDefinitionDesignationComponent dst = new ConceptDefinitionDesignationComponent();
1338        copyValues(dst);
1339        dst.language = language == null ? null : language.copy();
1340        dst.use = use == null ? null : use.copy();
1341        dst.value = value == null ? null : value.copy();
1342        return dst;
1343      }
1344
1345      @Override
1346      public boolean equalsDeep(Base other) {
1347        if (!super.equalsDeep(other))
1348          return false;
1349        if (!(other instanceof ConceptDefinitionDesignationComponent))
1350          return false;
1351        ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other;
1352        return compareDeep(language, o.language, true) && compareDeep(use, o.use, true) && compareDeep(value, o.value, true)
1353          ;
1354      }
1355
1356      @Override
1357      public boolean equalsShallow(Base other) {
1358        if (!super.equalsShallow(other))
1359          return false;
1360        if (!(other instanceof ConceptDefinitionDesignationComponent))
1361          return false;
1362        ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other;
1363        return compareValues(language, o.language, true) && compareValues(value, o.value, true);
1364      }
1365
1366      public boolean isEmpty() {
1367        return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty())
1368           && (value == null || value.isEmpty());
1369      }
1370
1371  public String fhirType() {
1372    return "ValueSet.codeSystem.concept.designation";
1373
1374  }
1375
1376  }
1377
1378    @Block()
1379    public static class ValueSetComposeComponent extends BackboneElement implements IBaseBackboneElement {
1380        /**
1381         * Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.
1382         */
1383        @Child(name = "import", type = {UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1384        @Description(shortDefinition="Import the contents of another value set", formalDefinition="Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri." )
1385        protected List<UriType> import_;
1386
1387        /**
1388         * Include one or more codes from a code system.
1389         */
1390        @Child(name = "include", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1391        @Description(shortDefinition="Include one or more codes from a code system", formalDefinition="Include one or more codes from a code system." )
1392        protected List<ConceptSetComponent> include;
1393
1394        /**
1395         * Exclude one or more codes from the value set.
1396         */
1397        @Child(name = "exclude", type = {ConceptSetComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1398        @Description(shortDefinition="Explicitly exclude codes", formalDefinition="Exclude one or more codes from the value set." )
1399        protected List<ConceptSetComponent> exclude;
1400
1401        private static final long serialVersionUID = -703166694L;
1402
1403    /*
1404     * Constructor
1405     */
1406      public ValueSetComposeComponent() {
1407        super();
1408      }
1409
1410        /**
1411         * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.)
1412         */
1413        public List<UriType> getImport() { 
1414          if (this.import_ == null)
1415            this.import_ = new ArrayList<UriType>();
1416          return this.import_;
1417        }
1418
1419        public boolean hasImport() { 
1420          if (this.import_ == null)
1421            return false;
1422          for (UriType item : this.import_)
1423            if (!item.isEmpty())
1424              return true;
1425          return false;
1426        }
1427
1428        /**
1429         * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.)
1430         */
1431    // syntactic sugar
1432        public UriType addImportElement() {//2 
1433          UriType t = new UriType();
1434          if (this.import_ == null)
1435            this.import_ = new ArrayList<UriType>();
1436          this.import_.add(t);
1437          return t;
1438        }
1439
1440        /**
1441         * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.)
1442         */
1443        public ValueSetComposeComponent addImport(String value) { //1
1444          UriType t = new UriType();
1445          t.setValue(value);
1446          if (this.import_ == null)
1447            this.import_ = new ArrayList<UriType>();
1448          this.import_.add(t);
1449          return this;
1450        }
1451
1452        /**
1453         * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.)
1454         */
1455        public boolean hasImport(String value) { 
1456          if (this.import_ == null)
1457            return false;
1458          for (UriType v : this.import_)
1459            if (v.equals(value)) // uri
1460              return true;
1461          return false;
1462        }
1463
1464        /**
1465         * @return {@link #include} (Include one or more codes from a code system.)
1466         */
1467        public List<ConceptSetComponent> getInclude() { 
1468          if (this.include == null)
1469            this.include = new ArrayList<ConceptSetComponent>();
1470          return this.include;
1471        }
1472
1473        public boolean hasInclude() { 
1474          if (this.include == null)
1475            return false;
1476          for (ConceptSetComponent item : this.include)
1477            if (!item.isEmpty())
1478              return true;
1479          return false;
1480        }
1481
1482        /**
1483         * @return {@link #include} (Include one or more codes from a code system.)
1484         */
1485    // syntactic sugar
1486        public ConceptSetComponent addInclude() { //3
1487          ConceptSetComponent t = new ConceptSetComponent();
1488          if (this.include == null)
1489            this.include = new ArrayList<ConceptSetComponent>();
1490          this.include.add(t);
1491          return t;
1492        }
1493
1494    // syntactic sugar
1495        public ValueSetComposeComponent addInclude(ConceptSetComponent t) { //3
1496          if (t == null)
1497            return this;
1498          if (this.include == null)
1499            this.include = new ArrayList<ConceptSetComponent>();
1500          this.include.add(t);
1501          return this;
1502        }
1503
1504        /**
1505         * @return {@link #exclude} (Exclude one or more codes from the value set.)
1506         */
1507        public List<ConceptSetComponent> getExclude() { 
1508          if (this.exclude == null)
1509            this.exclude = new ArrayList<ConceptSetComponent>();
1510          return this.exclude;
1511        }
1512
1513        public boolean hasExclude() { 
1514          if (this.exclude == null)
1515            return false;
1516          for (ConceptSetComponent item : this.exclude)
1517            if (!item.isEmpty())
1518              return true;
1519          return false;
1520        }
1521
1522        /**
1523         * @return {@link #exclude} (Exclude one or more codes from the value set.)
1524         */
1525    // syntactic sugar
1526        public ConceptSetComponent addExclude() { //3
1527          ConceptSetComponent t = new ConceptSetComponent();
1528          if (this.exclude == null)
1529            this.exclude = new ArrayList<ConceptSetComponent>();
1530          this.exclude.add(t);
1531          return t;
1532        }
1533
1534    // syntactic sugar
1535        public ValueSetComposeComponent addExclude(ConceptSetComponent t) { //3
1536          if (t == null)
1537            return this;
1538          if (this.exclude == null)
1539            this.exclude = new ArrayList<ConceptSetComponent>();
1540          this.exclude.add(t);
1541          return this;
1542        }
1543
1544        protected void listChildren(List<Property> childrenList) {
1545          super.listChildren(childrenList);
1546          childrenList.add(new Property("import", "uri", "Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.", 0, java.lang.Integer.MAX_VALUE, import_));
1547          childrenList.add(new Property("include", "", "Include one or more codes from a code system.", 0, java.lang.Integer.MAX_VALUE, include));
1548          childrenList.add(new Property("exclude", "@ValueSet.compose.include", "Exclude one or more codes from the value set.", 0, java.lang.Integer.MAX_VALUE, exclude));
1549        }
1550
1551      @Override
1552      public void setProperty(String name, Base value) throws FHIRException {
1553        if (name.equals("import"))
1554          this.getImport().add(castToUri(value));
1555        else if (name.equals("include"))
1556          this.getInclude().add((ConceptSetComponent) value);
1557        else if (name.equals("exclude"))
1558          this.getExclude().add((ConceptSetComponent) value);
1559        else
1560          super.setProperty(name, value);
1561      }
1562
1563      @Override
1564      public Base addChild(String name) throws FHIRException {
1565        if (name.equals("import")) {
1566          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.import");
1567        }
1568        else if (name.equals("include")) {
1569          return addInclude();
1570        }
1571        else if (name.equals("exclude")) {
1572          return addExclude();
1573        }
1574        else
1575          return super.addChild(name);
1576      }
1577
1578      public ValueSetComposeComponent copy() {
1579        ValueSetComposeComponent dst = new ValueSetComposeComponent();
1580        copyValues(dst);
1581        if (import_ != null) {
1582          dst.import_ = new ArrayList<UriType>();
1583          for (UriType i : import_)
1584            dst.import_.add(i.copy());
1585        };
1586        if (include != null) {
1587          dst.include = new ArrayList<ConceptSetComponent>();
1588          for (ConceptSetComponent i : include)
1589            dst.include.add(i.copy());
1590        };
1591        if (exclude != null) {
1592          dst.exclude = new ArrayList<ConceptSetComponent>();
1593          for (ConceptSetComponent i : exclude)
1594            dst.exclude.add(i.copy());
1595        };
1596        return dst;
1597      }
1598
1599      @Override
1600      public boolean equalsDeep(Base other) {
1601        if (!super.equalsDeep(other))
1602          return false;
1603        if (!(other instanceof ValueSetComposeComponent))
1604          return false;
1605        ValueSetComposeComponent o = (ValueSetComposeComponent) other;
1606        return compareDeep(import_, o.import_, true) && compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true)
1607          ;
1608      }
1609
1610      @Override
1611      public boolean equalsShallow(Base other) {
1612        if (!super.equalsShallow(other))
1613          return false;
1614        if (!(other instanceof ValueSetComposeComponent))
1615          return false;
1616        ValueSetComposeComponent o = (ValueSetComposeComponent) other;
1617        return compareValues(import_, o.import_, true);
1618      }
1619
1620      public boolean isEmpty() {
1621        return super.isEmpty() && (import_ == null || import_.isEmpty()) && (include == null || include.isEmpty())
1622           && (exclude == null || exclude.isEmpty());
1623      }
1624
1625  public String fhirType() {
1626    return "ValueSet.compose";
1627
1628  }
1629
1630  }
1631
1632    @Block()
1633    public static class ConceptSetComponent extends BackboneElement implements IBaseBackboneElement {
1634        /**
1635         * An absolute URI which is the code system from which the selected codes come from.
1636         */
1637        @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1638        @Description(shortDefinition="The system the codes come from", formalDefinition="An absolute URI which is the code system from which the selected codes come from." )
1639        protected UriType system;
1640
1641        /**
1642         * The version of the code system that the codes are selected from.
1643         */
1644        @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1645        @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system that the codes are selected from." )
1646        protected StringType version;
1647
1648        /**
1649         * Specifies a concept to be included or excluded.
1650         */
1651        @Child(name = "concept", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1652        @Description(shortDefinition="A concept defined in the system", formalDefinition="Specifies a concept to be included or excluded." )
1653        protected List<ConceptReferenceComponent> concept;
1654
1655        /**
1656         * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.
1657         */
1658        @Child(name = "filter", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1659        @Description(shortDefinition="Select codes/concepts by their properties (including relationships)", formalDefinition="Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true." )
1660        protected List<ConceptSetFilterComponent> filter;
1661
1662        private static final long serialVersionUID = -196054471L;
1663
1664    /*
1665     * Constructor
1666     */
1667      public ConceptSetComponent() {
1668        super();
1669      }
1670
1671    /*
1672     * Constructor
1673     */
1674      public ConceptSetComponent(UriType system) {
1675        super();
1676        this.system = system;
1677      }
1678
1679        /**
1680         * @return {@link #system} (An absolute URI which is the code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value
1681         */
1682        public UriType getSystemElement() { 
1683          if (this.system == null)
1684            if (Configuration.errorOnAutoCreate())
1685              throw new Error("Attempt to auto-create ConceptSetComponent.system");
1686            else if (Configuration.doAutoCreate())
1687              this.system = new UriType(); // bb
1688          return this.system;
1689        }
1690
1691        public boolean hasSystemElement() { 
1692          return this.system != null && !this.system.isEmpty();
1693        }
1694
1695        public boolean hasSystem() { 
1696          return this.system != null && !this.system.isEmpty();
1697        }
1698
1699        /**
1700         * @param value {@link #system} (An absolute URI which is the code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value
1701         */
1702        public ConceptSetComponent setSystemElement(UriType value) { 
1703          this.system = value;
1704          return this;
1705        }
1706
1707        /**
1708         * @return An absolute URI which is the code system from which the selected codes come from.
1709         */
1710        public String getSystem() { 
1711          return this.system == null ? null : this.system.getValue();
1712        }
1713
1714        /**
1715         * @param value An absolute URI which is the code system from which the selected codes come from.
1716         */
1717        public ConceptSetComponent setSystem(String value) { 
1718            if (this.system == null)
1719              this.system = new UriType();
1720            this.system.setValue(value);
1721          return this;
1722        }
1723
1724        /**
1725         * @return {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1726         */
1727        public StringType getVersionElement() { 
1728          if (this.version == null)
1729            if (Configuration.errorOnAutoCreate())
1730              throw new Error("Attempt to auto-create ConceptSetComponent.version");
1731            else if (Configuration.doAutoCreate())
1732              this.version = new StringType(); // bb
1733          return this.version;
1734        }
1735
1736        public boolean hasVersionElement() { 
1737          return this.version != null && !this.version.isEmpty();
1738        }
1739
1740        public boolean hasVersion() { 
1741          return this.version != null && !this.version.isEmpty();
1742        }
1743
1744        /**
1745         * @param value {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1746         */
1747        public ConceptSetComponent setVersionElement(StringType value) { 
1748          this.version = value;
1749          return this;
1750        }
1751
1752        /**
1753         * @return The version of the code system that the codes are selected from.
1754         */
1755        public String getVersion() { 
1756          return this.version == null ? null : this.version.getValue();
1757        }
1758
1759        /**
1760         * @param value The version of the code system that the codes are selected from.
1761         */
1762        public ConceptSetComponent setVersion(String value) { 
1763          if (Utilities.noString(value))
1764            this.version = null;
1765          else {
1766            if (this.version == null)
1767              this.version = new StringType();
1768            this.version.setValue(value);
1769          }
1770          return this;
1771        }
1772
1773        /**
1774         * @return {@link #concept} (Specifies a concept to be included or excluded.)
1775         */
1776        public List<ConceptReferenceComponent> getConcept() { 
1777          if (this.concept == null)
1778            this.concept = new ArrayList<ConceptReferenceComponent>();
1779          return this.concept;
1780        }
1781
1782        public boolean hasConcept() { 
1783          if (this.concept == null)
1784            return false;
1785          for (ConceptReferenceComponent item : this.concept)
1786            if (!item.isEmpty())
1787              return true;
1788          return false;
1789        }
1790
1791        /**
1792         * @return {@link #concept} (Specifies a concept to be included or excluded.)
1793         */
1794    // syntactic sugar
1795        public ConceptReferenceComponent addConcept() { //3
1796          ConceptReferenceComponent t = new ConceptReferenceComponent();
1797          if (this.concept == null)
1798            this.concept = new ArrayList<ConceptReferenceComponent>();
1799          this.concept.add(t);
1800          return t;
1801        }
1802
1803    // syntactic sugar
1804        public ConceptSetComponent addConcept(ConceptReferenceComponent t) { //3
1805          if (t == null)
1806            return this;
1807          if (this.concept == null)
1808            this.concept = new ArrayList<ConceptReferenceComponent>();
1809          this.concept.add(t);
1810          return this;
1811        }
1812
1813        /**
1814         * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.)
1815         */
1816        public List<ConceptSetFilterComponent> getFilter() { 
1817          if (this.filter == null)
1818            this.filter = new ArrayList<ConceptSetFilterComponent>();
1819          return this.filter;
1820        }
1821
1822        public boolean hasFilter() { 
1823          if (this.filter == null)
1824            return false;
1825          for (ConceptSetFilterComponent item : this.filter)
1826            if (!item.isEmpty())
1827              return true;
1828          return false;
1829        }
1830
1831        /**
1832         * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.)
1833         */
1834    // syntactic sugar
1835        public ConceptSetFilterComponent addFilter() { //3
1836          ConceptSetFilterComponent t = new ConceptSetFilterComponent();
1837          if (this.filter == null)
1838            this.filter = new ArrayList<ConceptSetFilterComponent>();
1839          this.filter.add(t);
1840          return t;
1841        }
1842
1843    // syntactic sugar
1844        public ConceptSetComponent addFilter(ConceptSetFilterComponent t) { //3
1845          if (t == null)
1846            return this;
1847          if (this.filter == null)
1848            this.filter = new ArrayList<ConceptSetFilterComponent>();
1849          this.filter.add(t);
1850          return this;
1851        }
1852
1853        protected void listChildren(List<Property> childrenList) {
1854          super.listChildren(childrenList);
1855          childrenList.add(new Property("system", "uri", "An absolute URI which is the code system from which the selected codes come from.", 0, java.lang.Integer.MAX_VALUE, system));
1856          childrenList.add(new Property("version", "string", "The version of the code system that the codes are selected from.", 0, java.lang.Integer.MAX_VALUE, version));
1857          childrenList.add(new Property("concept", "", "Specifies a concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, concept));
1858          childrenList.add(new Property("filter", "", "Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.", 0, java.lang.Integer.MAX_VALUE, filter));
1859        }
1860
1861      @Override
1862      public void setProperty(String name, Base value) throws FHIRException {
1863        if (name.equals("system"))
1864          this.system = castToUri(value); // UriType
1865        else if (name.equals("version"))
1866          this.version = castToString(value); // StringType
1867        else if (name.equals("concept"))
1868          this.getConcept().add((ConceptReferenceComponent) value);
1869        else if (name.equals("filter"))
1870          this.getFilter().add((ConceptSetFilterComponent) value);
1871        else
1872          super.setProperty(name, value);
1873      }
1874
1875      @Override
1876      public Base addChild(String name) throws FHIRException {
1877        if (name.equals("system")) {
1878          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.system");
1879        }
1880        else if (name.equals("version")) {
1881          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version");
1882        }
1883        else if (name.equals("concept")) {
1884          return addConcept();
1885        }
1886        else if (name.equals("filter")) {
1887          return addFilter();
1888        }
1889        else
1890          return super.addChild(name);
1891      }
1892
1893      public ConceptSetComponent copy() {
1894        ConceptSetComponent dst = new ConceptSetComponent();
1895        copyValues(dst);
1896        dst.system = system == null ? null : system.copy();
1897        dst.version = version == null ? null : version.copy();
1898        if (concept != null) {
1899          dst.concept = new ArrayList<ConceptReferenceComponent>();
1900          for (ConceptReferenceComponent i : concept)
1901            dst.concept.add(i.copy());
1902        };
1903        if (filter != null) {
1904          dst.filter = new ArrayList<ConceptSetFilterComponent>();
1905          for (ConceptSetFilterComponent i : filter)
1906            dst.filter.add(i.copy());
1907        };
1908        return dst;
1909      }
1910
1911      @Override
1912      public boolean equalsDeep(Base other) {
1913        if (!super.equalsDeep(other))
1914          return false;
1915        if (!(other instanceof ConceptSetComponent))
1916          return false;
1917        ConceptSetComponent o = (ConceptSetComponent) other;
1918        return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(concept, o.concept, true)
1919           && compareDeep(filter, o.filter, true);
1920      }
1921
1922      @Override
1923      public boolean equalsShallow(Base other) {
1924        if (!super.equalsShallow(other))
1925          return false;
1926        if (!(other instanceof ConceptSetComponent))
1927          return false;
1928        ConceptSetComponent o = (ConceptSetComponent) other;
1929        return compareValues(system, o.system, true) && compareValues(version, o.version, true);
1930      }
1931
1932      public boolean isEmpty() {
1933        return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty())
1934           && (concept == null || concept.isEmpty()) && (filter == null || filter.isEmpty());
1935      }
1936
1937  public String fhirType() {
1938    return "ValueSet.compose.include";
1939
1940  }
1941
1942  }
1943
1944    @Block()
1945    public static class ConceptReferenceComponent extends BackboneElement implements IBaseBackboneElement {
1946        /**
1947         * Specifies a code for the concept to be included or excluded.
1948         */
1949        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1950        @Description(shortDefinition="Code or expression from system", formalDefinition="Specifies a code for the concept to be included or excluded." )
1951        protected CodeType code;
1952
1953        /**
1954         * 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.
1955         */
1956        @Child(name = "display", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1957        @Description(shortDefinition="Test to display for this code for this value set", 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." )
1958        protected StringType display;
1959
1960        /**
1961         * Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.
1962         */
1963        @Child(name = "designation", type = {ConceptDefinitionDesignationComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1964        @Description(shortDefinition="Additional representations for this valueset", formalDefinition="Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc." )
1965        protected List<ConceptDefinitionDesignationComponent> designation;
1966
1967        private static final long serialVersionUID = -1513912691L;
1968
1969    /*
1970     * Constructor
1971     */
1972      public ConceptReferenceComponent() {
1973        super();
1974      }
1975
1976    /*
1977     * Constructor
1978     */
1979      public ConceptReferenceComponent(CodeType code) {
1980        super();
1981        this.code = code;
1982      }
1983
1984        /**
1985         * @return {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1986         */
1987        public CodeType getCodeElement() { 
1988          if (this.code == null)
1989            if (Configuration.errorOnAutoCreate())
1990              throw new Error("Attempt to auto-create ConceptReferenceComponent.code");
1991            else if (Configuration.doAutoCreate())
1992              this.code = new CodeType(); // bb
1993          return this.code;
1994        }
1995
1996        public boolean hasCodeElement() { 
1997          return this.code != null && !this.code.isEmpty();
1998        }
1999
2000        public boolean hasCode() { 
2001          return this.code != null && !this.code.isEmpty();
2002        }
2003
2004        /**
2005         * @param value {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
2006         */
2007        public ConceptReferenceComponent setCodeElement(CodeType value) { 
2008          this.code = value;
2009          return this;
2010        }
2011
2012        /**
2013         * @return Specifies a code for the concept to be included or excluded.
2014         */
2015        public String getCode() { 
2016          return this.code == null ? null : this.code.getValue();
2017        }
2018
2019        /**
2020         * @param value Specifies a code for the concept to be included or excluded.
2021         */
2022        public ConceptReferenceComponent setCode(String value) { 
2023            if (this.code == null)
2024              this.code = new CodeType();
2025            this.code.setValue(value);
2026          return this;
2027        }
2028
2029        /**
2030         * @return {@link #display} (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.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
2031         */
2032        public StringType getDisplayElement() { 
2033          if (this.display == null)
2034            if (Configuration.errorOnAutoCreate())
2035              throw new Error("Attempt to auto-create ConceptReferenceComponent.display");
2036            else if (Configuration.doAutoCreate())
2037              this.display = new StringType(); // bb
2038          return this.display;
2039        }
2040
2041        public boolean hasDisplayElement() { 
2042          return this.display != null && !this.display.isEmpty();
2043        }
2044
2045        public boolean hasDisplay() { 
2046          return this.display != null && !this.display.isEmpty();
2047        }
2048
2049        /**
2050         * @param value {@link #display} (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.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
2051         */
2052        public ConceptReferenceComponent setDisplayElement(StringType value) { 
2053          this.display = value;
2054          return this;
2055        }
2056
2057        /**
2058         * @return 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.
2059         */
2060        public String getDisplay() { 
2061          return this.display == null ? null : this.display.getValue();
2062        }
2063
2064        /**
2065         * @param value 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.
2066         */
2067        public ConceptReferenceComponent setDisplay(String value) { 
2068          if (Utilities.noString(value))
2069            this.display = null;
2070          else {
2071            if (this.display == null)
2072              this.display = new StringType();
2073            this.display.setValue(value);
2074          }
2075          return this;
2076        }
2077
2078        /**
2079         * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.)
2080         */
2081        public List<ConceptDefinitionDesignationComponent> getDesignation() { 
2082          if (this.designation == null)
2083            this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
2084          return this.designation;
2085        }
2086
2087        public boolean hasDesignation() { 
2088          if (this.designation == null)
2089            return false;
2090          for (ConceptDefinitionDesignationComponent item : this.designation)
2091            if (!item.isEmpty())
2092              return true;
2093          return false;
2094        }
2095
2096        /**
2097         * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.)
2098         */
2099    // syntactic sugar
2100        public ConceptDefinitionDesignationComponent addDesignation() { //3
2101          ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent();
2102          if (this.designation == null)
2103            this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
2104          this.designation.add(t);
2105          return t;
2106        }
2107
2108    // syntactic sugar
2109        public ConceptReferenceComponent addDesignation(ConceptDefinitionDesignationComponent t) { //3
2110          if (t == null)
2111            return this;
2112          if (this.designation == null)
2113            this.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
2114          this.designation.add(t);
2115          return this;
2116        }
2117
2118        protected void listChildren(List<Property> childrenList) {
2119          super.listChildren(childrenList);
2120          childrenList.add(new Property("code", "code", "Specifies a code for the concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, code));
2121          childrenList.add(new Property("display", "string", "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.", 0, java.lang.Integer.MAX_VALUE, display));
2122          childrenList.add(new Property("designation", "@ValueSet.codeSystem.concept.designation", "Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation));
2123        }
2124
2125      @Override
2126      public void setProperty(String name, Base value) throws FHIRException {
2127        if (name.equals("code"))
2128          this.code = castToCode(value); // CodeType
2129        else if (name.equals("display"))
2130          this.display = castToString(value); // StringType
2131        else if (name.equals("designation"))
2132          this.getDesignation().add((ConceptDefinitionDesignationComponent) value);
2133        else
2134          super.setProperty(name, value);
2135      }
2136
2137      @Override
2138      public Base addChild(String name) throws FHIRException {
2139        if (name.equals("code")) {
2140          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.code");
2141        }
2142        else if (name.equals("display")) {
2143          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.display");
2144        }
2145        else if (name.equals("designation")) {
2146          return addDesignation();
2147        }
2148        else
2149          return super.addChild(name);
2150      }
2151
2152      public ConceptReferenceComponent copy() {
2153        ConceptReferenceComponent dst = new ConceptReferenceComponent();
2154        copyValues(dst);
2155        dst.code = code == null ? null : code.copy();
2156        dst.display = display == null ? null : display.copy();
2157        if (designation != null) {
2158          dst.designation = new ArrayList<ConceptDefinitionDesignationComponent>();
2159          for (ConceptDefinitionDesignationComponent i : designation)
2160            dst.designation.add(i.copy());
2161        };
2162        return dst;
2163      }
2164
2165      @Override
2166      public boolean equalsDeep(Base other) {
2167        if (!super.equalsDeep(other))
2168          return false;
2169        if (!(other instanceof ConceptReferenceComponent))
2170          return false;
2171        ConceptReferenceComponent o = (ConceptReferenceComponent) other;
2172        return compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(designation, o.designation, true)
2173          ;
2174      }
2175
2176      @Override
2177      public boolean equalsShallow(Base other) {
2178        if (!super.equalsShallow(other))
2179          return false;
2180        if (!(other instanceof ConceptReferenceComponent))
2181          return false;
2182        ConceptReferenceComponent o = (ConceptReferenceComponent) other;
2183        return compareValues(code, o.code, true) && compareValues(display, o.display, true);
2184      }
2185
2186      public boolean isEmpty() {
2187        return super.isEmpty() && (code == null || code.isEmpty()) && (display == null || display.isEmpty())
2188           && (designation == null || designation.isEmpty());
2189      }
2190
2191  public String fhirType() {
2192    return "ValueSet.compose.include.concept";
2193
2194  }
2195
2196  }
2197
2198    @Block()
2199    public static class ConceptSetFilterComponent extends BackboneElement implements IBaseBackboneElement {
2200        /**
2201         * A code that identifies a property defined in the code system.
2202         */
2203        @Child(name = "property", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
2204        @Description(shortDefinition="A property defined by the code system", formalDefinition="A code that identifies a property defined in the code system." )
2205        protected CodeType property;
2206
2207        /**
2208         * The kind of operation to perform as a part of the filter criteria.
2209         */
2210        @Child(name = "op", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
2211        @Description(shortDefinition="= | is-a | is-not-a | regex | in | not-in", formalDefinition="The kind of operation to perform as a part of the filter criteria." )
2212        protected Enumeration<FilterOperator> op;
2213
2214        /**
2215         * 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.
2216         */
2217        @Child(name = "value", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false)
2218        @Description(shortDefinition="Code from the system, or regex criteria", 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." )
2219        protected CodeType value;
2220
2221        private static final long serialVersionUID = 1985515000L;
2222
2223    /*
2224     * Constructor
2225     */
2226      public ConceptSetFilterComponent() {
2227        super();
2228      }
2229
2230    /*
2231     * Constructor
2232     */
2233      public ConceptSetFilterComponent(CodeType property, Enumeration<FilterOperator> op, CodeType value) {
2234        super();
2235        this.property = property;
2236        this.op = op;
2237        this.value = value;
2238      }
2239
2240        /**
2241         * @return {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value
2242         */
2243        public CodeType getPropertyElement() { 
2244          if (this.property == null)
2245            if (Configuration.errorOnAutoCreate())
2246              throw new Error("Attempt to auto-create ConceptSetFilterComponent.property");
2247            else if (Configuration.doAutoCreate())
2248              this.property = new CodeType(); // bb
2249          return this.property;
2250        }
2251
2252        public boolean hasPropertyElement() { 
2253          return this.property != null && !this.property.isEmpty();
2254        }
2255
2256        public boolean hasProperty() { 
2257          return this.property != null && !this.property.isEmpty();
2258        }
2259
2260        /**
2261         * @param value {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value
2262         */
2263        public ConceptSetFilterComponent setPropertyElement(CodeType value) { 
2264          this.property = value;
2265          return this;
2266        }
2267
2268        /**
2269         * @return A code that identifies a property defined in the code system.
2270         */
2271        public String getProperty() { 
2272          return this.property == null ? null : this.property.getValue();
2273        }
2274
2275        /**
2276         * @param value A code that identifies a property defined in the code system.
2277         */
2278        public ConceptSetFilterComponent setProperty(String value) { 
2279            if (this.property == null)
2280              this.property = new CodeType();
2281            this.property.setValue(value);
2282          return this;
2283        }
2284
2285        /**
2286         * @return {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value
2287         */
2288        public Enumeration<FilterOperator> getOpElement() { 
2289          if (this.op == null)
2290            if (Configuration.errorOnAutoCreate())
2291              throw new Error("Attempt to auto-create ConceptSetFilterComponent.op");
2292            else if (Configuration.doAutoCreate())
2293              this.op = new Enumeration<FilterOperator>(new FilterOperatorEnumFactory()); // bb
2294          return this.op;
2295        }
2296
2297        public boolean hasOpElement() { 
2298          return this.op != null && !this.op.isEmpty();
2299        }
2300
2301        public boolean hasOp() { 
2302          return this.op != null && !this.op.isEmpty();
2303        }
2304
2305        /**
2306         * @param value {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value
2307         */
2308        public ConceptSetFilterComponent setOpElement(Enumeration<FilterOperator> value) { 
2309          this.op = value;
2310          return this;
2311        }
2312
2313        /**
2314         * @return The kind of operation to perform as a part of the filter criteria.
2315         */
2316        public FilterOperator getOp() { 
2317          return this.op == null ? null : this.op.getValue();
2318        }
2319
2320        /**
2321         * @param value The kind of operation to perform as a part of the filter criteria.
2322         */
2323        public ConceptSetFilterComponent setOp(FilterOperator value) { 
2324            if (this.op == null)
2325              this.op = new Enumeration<FilterOperator>(new FilterOperatorEnumFactory());
2326            this.op.setValue(value);
2327          return this;
2328        }
2329
2330        /**
2331         * @return {@link #value} (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.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
2332         */
2333        public CodeType getValueElement() { 
2334          if (this.value == null)
2335            if (Configuration.errorOnAutoCreate())
2336              throw new Error("Attempt to auto-create ConceptSetFilterComponent.value");
2337            else if (Configuration.doAutoCreate())
2338              this.value = new CodeType(); // bb
2339          return this.value;
2340        }
2341
2342        public boolean hasValueElement() { 
2343          return this.value != null && !this.value.isEmpty();
2344        }
2345
2346        public boolean hasValue() { 
2347          return this.value != null && !this.value.isEmpty();
2348        }
2349
2350        /**
2351         * @param value {@link #value} (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.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
2352         */
2353        public ConceptSetFilterComponent setValueElement(CodeType value) { 
2354          this.value = value;
2355          return this;
2356        }
2357
2358        /**
2359         * @return 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.
2360         */
2361        public String getValue() { 
2362          return this.value == null ? null : this.value.getValue();
2363        }
2364
2365        /**
2366         * @param value 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.
2367         */
2368        public ConceptSetFilterComponent setValue(String value) { 
2369            if (this.value == null)
2370              this.value = new CodeType();
2371            this.value.setValue(value);
2372          return this;
2373        }
2374
2375        protected void listChildren(List<Property> childrenList) {
2376          super.listChildren(childrenList);
2377          childrenList.add(new Property("property", "code", "A code that identifies a property defined in the code system.", 0, java.lang.Integer.MAX_VALUE, property));
2378          childrenList.add(new Property("op", "code", "The kind of operation to perform as a part of the filter criteria.", 0, java.lang.Integer.MAX_VALUE, op));
2379          childrenList.add(new Property("value", "code", "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.", 0, java.lang.Integer.MAX_VALUE, value));
2380        }
2381
2382      @Override
2383      public void setProperty(String name, Base value) throws FHIRException {
2384        if (name.equals("property"))
2385          this.property = castToCode(value); // CodeType
2386        else if (name.equals("op"))
2387          this.op = new FilterOperatorEnumFactory().fromType(value); // Enumeration<FilterOperator>
2388        else if (name.equals("value"))
2389          this.value = castToCode(value); // CodeType
2390        else
2391          super.setProperty(name, value);
2392      }
2393
2394      @Override
2395      public Base addChild(String name) throws FHIRException {
2396        if (name.equals("property")) {
2397          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.property");
2398        }
2399        else if (name.equals("op")) {
2400          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.op");
2401        }
2402        else if (name.equals("value")) {
2403          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.value");
2404        }
2405        else
2406          return super.addChild(name);
2407      }
2408
2409      public ConceptSetFilterComponent copy() {
2410        ConceptSetFilterComponent dst = new ConceptSetFilterComponent();
2411        copyValues(dst);
2412        dst.property = property == null ? null : property.copy();
2413        dst.op = op == null ? null : op.copy();
2414        dst.value = value == null ? null : value.copy();
2415        return dst;
2416      }
2417
2418      @Override
2419      public boolean equalsDeep(Base other) {
2420        if (!super.equalsDeep(other))
2421          return false;
2422        if (!(other instanceof ConceptSetFilterComponent))
2423          return false;
2424        ConceptSetFilterComponent o = (ConceptSetFilterComponent) other;
2425        return compareDeep(property, o.property, true) && compareDeep(op, o.op, true) && compareDeep(value, o.value, true)
2426          ;
2427      }
2428
2429      @Override
2430      public boolean equalsShallow(Base other) {
2431        if (!super.equalsShallow(other))
2432          return false;
2433        if (!(other instanceof ConceptSetFilterComponent))
2434          return false;
2435        ConceptSetFilterComponent o = (ConceptSetFilterComponent) other;
2436        return compareValues(property, o.property, true) && compareValues(op, o.op, true) && compareValues(value, o.value, true)
2437          ;
2438      }
2439
2440      public boolean isEmpty() {
2441        return super.isEmpty() && (property == null || property.isEmpty()) && (op == null || op.isEmpty())
2442           && (value == null || value.isEmpty());
2443      }
2444
2445  public String fhirType() {
2446    return "ValueSet.compose.include.filter";
2447
2448  }
2449
2450  }
2451
2452    @Block()
2453    public static class ValueSetExpansionComponent extends BackboneElement implements IBaseBackboneElement {
2454        /**
2455         * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.
2456         */
2457        @Child(name = "identifier", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=false)
2458        @Description(shortDefinition="Uniquely identifies this expansion", formalDefinition="An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so." )
2459        protected UriType identifier;
2460
2461        /**
2462         * The time at which the expansion was produced by the expanding system.
2463         */
2464        @Child(name = "timestamp", type = {DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
2465        @Description(shortDefinition="Time ValueSet expansion happened", formalDefinition="The time at which the expansion was produced by the expanding system." )
2466        protected DateTimeType timestamp;
2467
2468        /**
2469         * 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.
2470         */
2471        @Child(name = "total", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2472        @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." )
2473        protected IntegerType total;
2474
2475        /**
2476         * 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.
2477         */
2478        @Child(name = "offset", type = {IntegerType.class}, order=4, min=0, max=1, modifier=false, summary=false)
2479        @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." )
2480        protected IntegerType offset;
2481
2482        /**
2483         * 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.
2484         */
2485        @Child(name = "parameter", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2486        @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." )
2487        protected List<ValueSetExpansionParameterComponent> parameter;
2488
2489        /**
2490         * The codes that are contained in the value set expansion.
2491         */
2492        @Child(name = "contains", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2493        @Description(shortDefinition="Codes in the value set", formalDefinition="The codes that are contained in the value set expansion." )
2494        protected List<ValueSetExpansionContainsComponent> contains;
2495
2496        private static final long serialVersionUID = -43471993L;
2497
2498    /*
2499     * Constructor
2500     */
2501      public ValueSetExpansionComponent() {
2502        super();
2503      }
2504
2505    /*
2506     * Constructor
2507     */
2508      public ValueSetExpansionComponent(UriType identifier, DateTimeType timestamp) {
2509        super();
2510        this.identifier = identifier;
2511        this.timestamp = timestamp;
2512      }
2513
2514        /**
2515         * @return {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value
2516         */
2517        public UriType getIdentifierElement() { 
2518          if (this.identifier == null)
2519            if (Configuration.errorOnAutoCreate())
2520              throw new Error("Attempt to auto-create ValueSetExpansionComponent.identifier");
2521            else if (Configuration.doAutoCreate())
2522              this.identifier = new UriType(); // bb
2523          return this.identifier;
2524        }
2525
2526        public boolean hasIdentifierElement() { 
2527          return this.identifier != null && !this.identifier.isEmpty();
2528        }
2529
2530        public boolean hasIdentifier() { 
2531          return this.identifier != null && !this.identifier.isEmpty();
2532        }
2533
2534        /**
2535         * @param value {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value
2536         */
2537        public ValueSetExpansionComponent setIdentifierElement(UriType value) { 
2538          this.identifier = value;
2539          return this;
2540        }
2541
2542        /**
2543         * @return An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.
2544         */
2545        public String getIdentifier() { 
2546          return this.identifier == null ? null : this.identifier.getValue();
2547        }
2548
2549        /**
2550         * @param value An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.
2551         */
2552        public ValueSetExpansionComponent setIdentifier(String value) { 
2553            if (this.identifier == null)
2554              this.identifier = new UriType();
2555            this.identifier.setValue(value);
2556          return this;
2557        }
2558
2559        /**
2560         * @return {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value
2561         */
2562        public DateTimeType getTimestampElement() { 
2563          if (this.timestamp == null)
2564            if (Configuration.errorOnAutoCreate())
2565              throw new Error("Attempt to auto-create ValueSetExpansionComponent.timestamp");
2566            else if (Configuration.doAutoCreate())
2567              this.timestamp = new DateTimeType(); // bb
2568          return this.timestamp;
2569        }
2570
2571        public boolean hasTimestampElement() { 
2572          return this.timestamp != null && !this.timestamp.isEmpty();
2573        }
2574
2575        public boolean hasTimestamp() { 
2576          return this.timestamp != null && !this.timestamp.isEmpty();
2577        }
2578
2579        /**
2580         * @param value {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value
2581         */
2582        public ValueSetExpansionComponent setTimestampElement(DateTimeType value) { 
2583          this.timestamp = value;
2584          return this;
2585        }
2586
2587        /**
2588         * @return The time at which the expansion was produced by the expanding system.
2589         */
2590        public Date getTimestamp() { 
2591          return this.timestamp == null ? null : this.timestamp.getValue();
2592        }
2593
2594        /**
2595         * @param value The time at which the expansion was produced by the expanding system.
2596         */
2597        public ValueSetExpansionComponent setTimestamp(Date value) { 
2598            if (this.timestamp == null)
2599              this.timestamp = new DateTimeType();
2600            this.timestamp.setValue(value);
2601          return this;
2602        }
2603
2604        /**
2605         * @return {@link #total} (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.). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value
2606         */
2607        public IntegerType getTotalElement() { 
2608          if (this.total == null)
2609            if (Configuration.errorOnAutoCreate())
2610              throw new Error("Attempt to auto-create ValueSetExpansionComponent.total");
2611            else if (Configuration.doAutoCreate())
2612              this.total = new IntegerType(); // bb
2613          return this.total;
2614        }
2615
2616        public boolean hasTotalElement() { 
2617          return this.total != null && !this.total.isEmpty();
2618        }
2619
2620        public boolean hasTotal() { 
2621          return this.total != null && !this.total.isEmpty();
2622        }
2623
2624        /**
2625         * @param value {@link #total} (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.). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value
2626         */
2627        public ValueSetExpansionComponent setTotalElement(IntegerType value) { 
2628          this.total = value;
2629          return this;
2630        }
2631
2632        /**
2633         * @return 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.
2634         */
2635        public int getTotal() { 
2636          return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue();
2637        }
2638
2639        /**
2640         * @param value 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.
2641         */
2642        public ValueSetExpansionComponent setTotal(int value) { 
2643            if (this.total == null)
2644              this.total = new IntegerType();
2645            this.total.setValue(value);
2646          return this;
2647        }
2648
2649        /**
2650         * @return {@link #offset} (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.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value
2651         */
2652        public IntegerType getOffsetElement() { 
2653          if (this.offset == null)
2654            if (Configuration.errorOnAutoCreate())
2655              throw new Error("Attempt to auto-create ValueSetExpansionComponent.offset");
2656            else if (Configuration.doAutoCreate())
2657              this.offset = new IntegerType(); // bb
2658          return this.offset;
2659        }
2660
2661        public boolean hasOffsetElement() { 
2662          return this.offset != null && !this.offset.isEmpty();
2663        }
2664
2665        public boolean hasOffset() { 
2666          return this.offset != null && !this.offset.isEmpty();
2667        }
2668
2669        /**
2670         * @param value {@link #offset} (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.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value
2671         */
2672        public ValueSetExpansionComponent setOffsetElement(IntegerType value) { 
2673          this.offset = value;
2674          return this;
2675        }
2676
2677        /**
2678         * @return 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.
2679         */
2680        public int getOffset() { 
2681          return this.offset == null || this.offset.isEmpty() ? 0 : this.offset.getValue();
2682        }
2683
2684        /**
2685         * @param value 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.
2686         */
2687        public ValueSetExpansionComponent setOffset(int value) { 
2688            if (this.offset == null)
2689              this.offset = new IntegerType();
2690            this.offset.setValue(value);
2691          return this;
2692        }
2693
2694        /**
2695         * @return {@link #parameter} (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.)
2696         */
2697        public List<ValueSetExpansionParameterComponent> getParameter() { 
2698          if (this.parameter == null)
2699            this.parameter = new ArrayList<ValueSetExpansionParameterComponent>();
2700          return this.parameter;
2701        }
2702
2703        public boolean hasParameter() { 
2704          if (this.parameter == null)
2705            return false;
2706          for (ValueSetExpansionParameterComponent item : this.parameter)
2707            if (!item.isEmpty())
2708              return true;
2709          return false;
2710        }
2711
2712        /**
2713         * @return {@link #parameter} (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.)
2714         */
2715    // syntactic sugar
2716        public ValueSetExpansionParameterComponent addParameter() { //3
2717          ValueSetExpansionParameterComponent t = new ValueSetExpansionParameterComponent();
2718          if (this.parameter == null)
2719            this.parameter = new ArrayList<ValueSetExpansionParameterComponent>();
2720          this.parameter.add(t);
2721          return t;
2722        }
2723
2724    // syntactic sugar
2725        public ValueSetExpansionComponent addParameter(ValueSetExpansionParameterComponent t) { //3
2726          if (t == null)
2727            return this;
2728          if (this.parameter == null)
2729            this.parameter = new ArrayList<ValueSetExpansionParameterComponent>();
2730          this.parameter.add(t);
2731          return this;
2732        }
2733
2734        /**
2735         * @return {@link #contains} (The codes that are contained in the value set expansion.)
2736         */
2737        public List<ValueSetExpansionContainsComponent> getContains() { 
2738          if (this.contains == null)
2739            this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
2740          return this.contains;
2741        }
2742
2743        public boolean hasContains() { 
2744          if (this.contains == null)
2745            return false;
2746          for (ValueSetExpansionContainsComponent item : this.contains)
2747            if (!item.isEmpty())
2748              return true;
2749          return false;
2750        }
2751
2752        /**
2753         * @return {@link #contains} (The codes that are contained in the value set expansion.)
2754         */
2755    // syntactic sugar
2756        public ValueSetExpansionContainsComponent addContains() { //3
2757          ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent();
2758          if (this.contains == null)
2759            this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
2760          this.contains.add(t);
2761          return t;
2762        }
2763
2764    // syntactic sugar
2765        public ValueSetExpansionComponent addContains(ValueSetExpansionContainsComponent t) { //3
2766          if (t == null)
2767            return this;
2768          if (this.contains == null)
2769            this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
2770          this.contains.add(t);
2771          return this;
2772        }
2773
2774        protected void listChildren(List<Property> childrenList) {
2775          super.listChildren(childrenList);
2776          childrenList.add(new Property("identifier", "uri", "An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.", 0, java.lang.Integer.MAX_VALUE, identifier));
2777          childrenList.add(new Property("timestamp", "dateTime", "The time at which the expansion was produced by the expanding system.", 0, java.lang.Integer.MAX_VALUE, timestamp));
2778          childrenList.add(new Property("total", "integer", "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.", 0, java.lang.Integer.MAX_VALUE, total));
2779          childrenList.add(new Property("offset", "integer", "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.", 0, java.lang.Integer.MAX_VALUE, offset));
2780          childrenList.add(new Property("parameter", "", "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.", 0, java.lang.Integer.MAX_VALUE, parameter));
2781          childrenList.add(new Property("contains", "", "The codes that are contained in the value set expansion.", 0, java.lang.Integer.MAX_VALUE, contains));
2782        }
2783
2784      @Override
2785      public void setProperty(String name, Base value) throws FHIRException {
2786        if (name.equals("identifier"))
2787          this.identifier = castToUri(value); // UriType
2788        else if (name.equals("timestamp"))
2789          this.timestamp = castToDateTime(value); // DateTimeType
2790        else if (name.equals("total"))
2791          this.total = castToInteger(value); // IntegerType
2792        else if (name.equals("offset"))
2793          this.offset = castToInteger(value); // IntegerType
2794        else if (name.equals("parameter"))
2795          this.getParameter().add((ValueSetExpansionParameterComponent) value);
2796        else if (name.equals("contains"))
2797          this.getContains().add((ValueSetExpansionContainsComponent) value);
2798        else
2799          super.setProperty(name, value);
2800      }
2801
2802      @Override
2803      public Base addChild(String name) throws FHIRException {
2804        if (name.equals("identifier")) {
2805          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.identifier");
2806        }
2807        else if (name.equals("timestamp")) {
2808          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.timestamp");
2809        }
2810        else if (name.equals("total")) {
2811          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.total");
2812        }
2813        else if (name.equals("offset")) {
2814          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.offset");
2815        }
2816        else if (name.equals("parameter")) {
2817          return addParameter();
2818        }
2819        else if (name.equals("contains")) {
2820          return addContains();
2821        }
2822        else
2823          return super.addChild(name);
2824      }
2825
2826      public ValueSetExpansionComponent copy() {
2827        ValueSetExpansionComponent dst = new ValueSetExpansionComponent();
2828        copyValues(dst);
2829        dst.identifier = identifier == null ? null : identifier.copy();
2830        dst.timestamp = timestamp == null ? null : timestamp.copy();
2831        dst.total = total == null ? null : total.copy();
2832        dst.offset = offset == null ? null : offset.copy();
2833        if (parameter != null) {
2834          dst.parameter = new ArrayList<ValueSetExpansionParameterComponent>();
2835          for (ValueSetExpansionParameterComponent i : parameter)
2836            dst.parameter.add(i.copy());
2837        };
2838        if (contains != null) {
2839          dst.contains = new ArrayList<ValueSetExpansionContainsComponent>();
2840          for (ValueSetExpansionContainsComponent i : contains)
2841            dst.contains.add(i.copy());
2842        };
2843        return dst;
2844      }
2845
2846      @Override
2847      public boolean equalsDeep(Base other) {
2848        if (!super.equalsDeep(other))
2849          return false;
2850        if (!(other instanceof ValueSetExpansionComponent))
2851          return false;
2852        ValueSetExpansionComponent o = (ValueSetExpansionComponent) other;
2853        return compareDeep(identifier, o.identifier, true) && compareDeep(timestamp, o.timestamp, true)
2854           && compareDeep(total, o.total, true) && compareDeep(offset, o.offset, true) && compareDeep(parameter, o.parameter, true)
2855           && compareDeep(contains, o.contains, true);
2856      }
2857
2858      @Override
2859      public boolean equalsShallow(Base other) {
2860        if (!super.equalsShallow(other))
2861          return false;
2862        if (!(other instanceof ValueSetExpansionComponent))
2863          return false;
2864        ValueSetExpansionComponent o = (ValueSetExpansionComponent) other;
2865        return compareValues(identifier, o.identifier, true) && compareValues(timestamp, o.timestamp, true)
2866           && compareValues(total, o.total, true) && compareValues(offset, o.offset, true);
2867      }
2868
2869      public boolean isEmpty() {
2870        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty())
2871           && (total == null || total.isEmpty()) && (offset == null || offset.isEmpty()) && (parameter == null || parameter.isEmpty())
2872           && (contains == null || contains.isEmpty());
2873      }
2874
2875  public String fhirType() {
2876    return "ValueSet.expansion";
2877
2878  }
2879
2880  }
2881
2882    @Block()
2883    public static class ValueSetExpansionParameterComponent extends BackboneElement implements IBaseBackboneElement {
2884        /**
2885         * The name of the parameter.
2886         */
2887        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
2888        @Description(shortDefinition="Name as assigned by the server", formalDefinition="The name of the parameter." )
2889        protected StringType name;
2890
2891        /**
2892         * The value of the parameter.
2893         */
2894        @Child(name = "value", type = {StringType.class, BooleanType.class, IntegerType.class, DecimalType.class, UriType.class, CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2895        @Description(shortDefinition="Value of the named parameter", formalDefinition="The value of the parameter." )
2896        protected Type value;
2897
2898        private static final long serialVersionUID = 1172641169L;
2899
2900    /*
2901     * Constructor
2902     */
2903      public ValueSetExpansionParameterComponent() {
2904        super();
2905      }
2906
2907    /*
2908     * Constructor
2909     */
2910      public ValueSetExpansionParameterComponent(StringType name) {
2911        super();
2912        this.name = name;
2913      }
2914
2915        /**
2916         * @return {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2917         */
2918        public StringType getNameElement() { 
2919          if (this.name == null)
2920            if (Configuration.errorOnAutoCreate())
2921              throw new Error("Attempt to auto-create ValueSetExpansionParameterComponent.name");
2922            else if (Configuration.doAutoCreate())
2923              this.name = new StringType(); // bb
2924          return this.name;
2925        }
2926
2927        public boolean hasNameElement() { 
2928          return this.name != null && !this.name.isEmpty();
2929        }
2930
2931        public boolean hasName() { 
2932          return this.name != null && !this.name.isEmpty();
2933        }
2934
2935        /**
2936         * @param value {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2937         */
2938        public ValueSetExpansionParameterComponent setNameElement(StringType value) { 
2939          this.name = value;
2940          return this;
2941        }
2942
2943        /**
2944         * @return The name of the parameter.
2945         */
2946        public String getName() { 
2947          return this.name == null ? null : this.name.getValue();
2948        }
2949
2950        /**
2951         * @param value The name of the parameter.
2952         */
2953        public ValueSetExpansionParameterComponent setName(String value) { 
2954            if (this.name == null)
2955              this.name = new StringType();
2956            this.name.setValue(value);
2957          return this;
2958        }
2959
2960        /**
2961         * @return {@link #value} (The value of the parameter.)
2962         */
2963        public Type getValue() { 
2964          return this.value;
2965        }
2966
2967        /**
2968         * @return {@link #value} (The value of the parameter.)
2969         */
2970        public StringType getValueStringType() throws FHIRException { 
2971          if (!(this.value instanceof StringType))
2972            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
2973          return (StringType) this.value;
2974        }
2975
2976        public boolean hasValueStringType() { 
2977          return this.value instanceof StringType;
2978        }
2979
2980        /**
2981         * @return {@link #value} (The value of the parameter.)
2982         */
2983        public BooleanType getValueBooleanType() throws FHIRException { 
2984          if (!(this.value instanceof BooleanType))
2985            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
2986          return (BooleanType) this.value;
2987        }
2988
2989        public boolean hasValueBooleanType() { 
2990          return this.value instanceof BooleanType;
2991        }
2992
2993        /**
2994         * @return {@link #value} (The value of the parameter.)
2995         */
2996        public IntegerType getValueIntegerType() throws FHIRException { 
2997          if (!(this.value instanceof IntegerType))
2998            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
2999          return (IntegerType) this.value;
3000        }
3001
3002        public boolean hasValueIntegerType() { 
3003          return this.value instanceof IntegerType;
3004        }
3005
3006        /**
3007         * @return {@link #value} (The value of the parameter.)
3008         */
3009        public DecimalType getValueDecimalType() throws FHIRException { 
3010          if (!(this.value instanceof DecimalType))
3011            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered");
3012          return (DecimalType) this.value;
3013        }
3014
3015        public boolean hasValueDecimalType() { 
3016          return this.value instanceof DecimalType;
3017        }
3018
3019        /**
3020         * @return {@link #value} (The value of the parameter.)
3021         */
3022        public UriType getValueUriType() throws FHIRException { 
3023          if (!(this.value instanceof UriType))
3024            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered");
3025          return (UriType) this.value;
3026        }
3027
3028        public boolean hasValueUriType() { 
3029          return this.value instanceof UriType;
3030        }
3031
3032        /**
3033         * @return {@link #value} (The value of the parameter.)
3034         */
3035        public CodeType getValueCodeType() throws FHIRException { 
3036          if (!(this.value instanceof CodeType))
3037            throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered");
3038          return (CodeType) this.value;
3039        }
3040
3041        public boolean hasValueCodeType() { 
3042          return this.value instanceof CodeType;
3043        }
3044
3045        public boolean hasValue() { 
3046          return this.value != null && !this.value.isEmpty();
3047        }
3048
3049        /**
3050         * @param value {@link #value} (The value of the parameter.)
3051         */
3052        public ValueSetExpansionParameterComponent setValue(Type value) { 
3053          this.value = value;
3054          return this;
3055        }
3056
3057        protected void listChildren(List<Property> childrenList) {
3058          super.listChildren(childrenList);
3059          childrenList.add(new Property("name", "string", "The name of the parameter.", 0, java.lang.Integer.MAX_VALUE, name));
3060          childrenList.add(new Property("value[x]", "string|boolean|integer|decimal|uri|code", "The value of the parameter.", 0, java.lang.Integer.MAX_VALUE, value));
3061        }
3062
3063      @Override
3064      public void setProperty(String name, Base value) throws FHIRException {
3065        if (name.equals("name"))
3066          this.name = castToString(value); // StringType
3067        else if (name.equals("value[x]"))
3068          this.value = (Type) value; // Type
3069        else
3070          super.setProperty(name, value);
3071      }
3072
3073      @Override
3074      public Base addChild(String name) throws FHIRException {
3075        if (name.equals("name")) {
3076          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.name");
3077        }
3078        else if (name.equals("valueString")) {
3079          this.value = new StringType();
3080          return this.value;
3081        }
3082        else if (name.equals("valueBoolean")) {
3083          this.value = new BooleanType();
3084          return this.value;
3085        }
3086        else if (name.equals("valueInteger")) {
3087          this.value = new IntegerType();
3088          return this.value;
3089        }
3090        else if (name.equals("valueDecimal")) {
3091          this.value = new DecimalType();
3092          return this.value;
3093        }
3094        else if (name.equals("valueUri")) {
3095          this.value = new UriType();
3096          return this.value;
3097        }
3098        else if (name.equals("valueCode")) {
3099          this.value = new CodeType();
3100          return this.value;
3101        }
3102        else
3103          return super.addChild(name);
3104      }
3105
3106      public ValueSetExpansionParameterComponent copy() {
3107        ValueSetExpansionParameterComponent dst = new ValueSetExpansionParameterComponent();
3108        copyValues(dst);
3109        dst.name = name == null ? null : name.copy();
3110        dst.value = value == null ? null : value.copy();
3111        return dst;
3112      }
3113
3114      @Override
3115      public boolean equalsDeep(Base other) {
3116        if (!super.equalsDeep(other))
3117          return false;
3118        if (!(other instanceof ValueSetExpansionParameterComponent))
3119          return false;
3120        ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other;
3121        return compareDeep(name, o.name, true) && compareDeep(value, o.value, true);
3122      }
3123
3124      @Override
3125      public boolean equalsShallow(Base other) {
3126        if (!super.equalsShallow(other))
3127          return false;
3128        if (!(other instanceof ValueSetExpansionParameterComponent))
3129          return false;
3130        ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other;
3131        return compareValues(name, o.name, true);
3132      }
3133
3134      public boolean isEmpty() {
3135        return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty())
3136          ;
3137      }
3138
3139  public String fhirType() {
3140    return "ValueSet.expansion.parameter";
3141
3142  }
3143
3144  }
3145
3146    @Block()
3147    public static class ValueSetExpansionContainsComponent extends BackboneElement implements IBaseBackboneElement {
3148        /**
3149         * An absolute URI which is the code system in which the code for this item in the expansion is defined.
3150         */
3151        @Child(name = "system", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false)
3152        @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." )
3153        protected UriType system;
3154
3155        /**
3156         * If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.
3157         */
3158        @Child(name = "abstract", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
3159        @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." )
3160        protected BooleanType abstract_;
3161
3162        /**
3163         * The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.
3164         */
3165        @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
3166        @Description(shortDefinition="Version in which this code/display is defined", formalDefinition="The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence." )
3167        protected StringType version;
3168
3169        /**
3170         * 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.
3171         */
3172        @Child(name = "code", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
3173        @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." )
3174        protected CodeType code;
3175
3176        /**
3177         * The recommended display for this item in the expansion.
3178         */
3179        @Child(name = "display", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
3180        @Description(shortDefinition="User display for the concept", formalDefinition="The recommended display for this item in the expansion." )
3181        protected StringType display;
3182
3183        /**
3184         * Other codes and entries contained under this entry in the hierarchy.
3185         */
3186        @Child(name = "contains", type = {ValueSetExpansionContainsComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3187        @Description(shortDefinition="Codes contained under this entry", formalDefinition="Other codes and entries contained under this entry in the hierarchy." )
3188        protected List<ValueSetExpansionContainsComponent> contains;
3189
3190        private static final long serialVersionUID = -2038349483L;
3191
3192    /*
3193     * Constructor
3194     */
3195      public ValueSetExpansionContainsComponent() {
3196        super();
3197      }
3198
3199        /**
3200         * @return {@link #system} (An absolute URI which is the code system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value
3201         */
3202        public UriType getSystemElement() { 
3203          if (this.system == null)
3204            if (Configuration.errorOnAutoCreate())
3205              throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.system");
3206            else if (Configuration.doAutoCreate())
3207              this.system = new UriType(); // bb
3208          return this.system;
3209        }
3210
3211        public boolean hasSystemElement() { 
3212          return this.system != null && !this.system.isEmpty();
3213        }
3214
3215        public boolean hasSystem() { 
3216          return this.system != null && !this.system.isEmpty();
3217        }
3218
3219        /**
3220         * @param value {@link #system} (An absolute URI which is the code system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value
3221         */
3222        public ValueSetExpansionContainsComponent setSystemElement(UriType value) { 
3223          this.system = value;
3224          return this;
3225        }
3226
3227        /**
3228         * @return An absolute URI which is the code system in which the code for this item in the expansion is defined.
3229         */
3230        public String getSystem() { 
3231          return this.system == null ? null : this.system.getValue();
3232        }
3233
3234        /**
3235         * @param value An absolute URI which is the code system in which the code for this item in the expansion is defined.
3236         */
3237        public ValueSetExpansionContainsComponent setSystem(String value) { 
3238          if (Utilities.noString(value))
3239            this.system = null;
3240          else {
3241            if (this.system == null)
3242              this.system = new UriType();
3243            this.system.setValue(value);
3244          }
3245          return this;
3246        }
3247
3248        /**
3249         * @return {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value
3250         */
3251        public BooleanType getAbstractElement() { 
3252          if (this.abstract_ == null)
3253            if (Configuration.errorOnAutoCreate())
3254              throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.abstract_");
3255            else if (Configuration.doAutoCreate())
3256              this.abstract_ = new BooleanType(); // bb
3257          return this.abstract_;
3258        }
3259
3260        public boolean hasAbstractElement() { 
3261          return this.abstract_ != null && !this.abstract_.isEmpty();
3262        }
3263
3264        public boolean hasAbstract() { 
3265          return this.abstract_ != null && !this.abstract_.isEmpty();
3266        }
3267
3268        /**
3269         * @param value {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value
3270         */
3271        public ValueSetExpansionContainsComponent setAbstractElement(BooleanType value) { 
3272          this.abstract_ = value;
3273          return this;
3274        }
3275
3276        /**
3277         * @return If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.
3278         */
3279        public boolean getAbstract() { 
3280          return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue();
3281        }
3282
3283        /**
3284         * @param value If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.
3285         */
3286        public ValueSetExpansionContainsComponent setAbstract(boolean value) { 
3287            if (this.abstract_ == null)
3288              this.abstract_ = new BooleanType();
3289            this.abstract_.setValue(value);
3290          return this;
3291        }
3292
3293        /**
3294         * @return {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
3295         */
3296        public StringType getVersionElement() { 
3297          if (this.version == null)
3298            if (Configuration.errorOnAutoCreate())
3299              throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.version");
3300            else if (Configuration.doAutoCreate())
3301              this.version = new StringType(); // bb
3302          return this.version;
3303        }
3304
3305        public boolean hasVersionElement() { 
3306          return this.version != null && !this.version.isEmpty();
3307        }
3308
3309        public boolean hasVersion() { 
3310          return this.version != null && !this.version.isEmpty();
3311        }
3312
3313        /**
3314         * @param value {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
3315         */
3316        public ValueSetExpansionContainsComponent setVersionElement(StringType value) { 
3317          this.version = value;
3318          return this;
3319        }
3320
3321        /**
3322         * @return The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.
3323         */
3324        public String getVersion() { 
3325          return this.version == null ? null : this.version.getValue();
3326        }
3327
3328        /**
3329         * @param value The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.
3330         */
3331        public ValueSetExpansionContainsComponent setVersion(String value) { 
3332          if (Utilities.noString(value))
3333            this.version = null;
3334          else {
3335            if (this.version == null)
3336              this.version = new StringType();
3337            this.version.setValue(value);
3338          }
3339          return this;
3340        }
3341
3342        /**
3343         * @return {@link #code} (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.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
3344         */
3345        public CodeType getCodeElement() { 
3346          if (this.code == null)
3347            if (Configuration.errorOnAutoCreate())
3348              throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.code");
3349            else if (Configuration.doAutoCreate())
3350              this.code = new CodeType(); // bb
3351          return this.code;
3352        }
3353
3354        public boolean hasCodeElement() { 
3355          return this.code != null && !this.code.isEmpty();
3356        }
3357
3358        public boolean hasCode() { 
3359          return this.code != null && !this.code.isEmpty();
3360        }
3361
3362        /**
3363         * @param value {@link #code} (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.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
3364         */
3365        public ValueSetExpansionContainsComponent setCodeElement(CodeType value) { 
3366          this.code = value;
3367          return this;
3368        }
3369
3370        /**
3371         * @return 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.
3372         */
3373        public String getCode() { 
3374          return this.code == null ? null : this.code.getValue();
3375        }
3376
3377        /**
3378         * @param value 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.
3379         */
3380        public ValueSetExpansionContainsComponent setCode(String value) { 
3381          if (Utilities.noString(value))
3382            this.code = null;
3383          else {
3384            if (this.code == null)
3385              this.code = new CodeType();
3386            this.code.setValue(value);
3387          }
3388          return this;
3389        }
3390
3391        /**
3392         * @return {@link #display} (The recommended display for this item in the expansion.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
3393         */
3394        public StringType getDisplayElement() { 
3395          if (this.display == null)
3396            if (Configuration.errorOnAutoCreate())
3397              throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.display");
3398            else if (Configuration.doAutoCreate())
3399              this.display = new StringType(); // bb
3400          return this.display;
3401        }
3402
3403        public boolean hasDisplayElement() { 
3404          return this.display != null && !this.display.isEmpty();
3405        }
3406
3407        public boolean hasDisplay() { 
3408          return this.display != null && !this.display.isEmpty();
3409        }
3410
3411        /**
3412         * @param value {@link #display} (The recommended display for this item in the expansion.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
3413         */
3414        public ValueSetExpansionContainsComponent setDisplayElement(StringType value) { 
3415          this.display = value;
3416          return this;
3417        }
3418
3419        /**
3420         * @return The recommended display for this item in the expansion.
3421         */
3422        public String getDisplay() { 
3423          return this.display == null ? null : this.display.getValue();
3424        }
3425
3426        /**
3427         * @param value The recommended display for this item in the expansion.
3428         */
3429        public ValueSetExpansionContainsComponent setDisplay(String value) { 
3430          if (Utilities.noString(value))
3431            this.display = null;
3432          else {
3433            if (this.display == null)
3434              this.display = new StringType();
3435            this.display.setValue(value);
3436          }
3437          return this;
3438        }
3439
3440        /**
3441         * @return {@link #contains} (Other codes and entries contained under this entry in the hierarchy.)
3442         */
3443        public List<ValueSetExpansionContainsComponent> getContains() { 
3444          if (this.contains == null)
3445            this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
3446          return this.contains;
3447        }
3448
3449        public boolean hasContains() { 
3450          if (this.contains == null)
3451            return false;
3452          for (ValueSetExpansionContainsComponent item : this.contains)
3453            if (!item.isEmpty())
3454              return true;
3455          return false;
3456        }
3457
3458        /**
3459         * @return {@link #contains} (Other codes and entries contained under this entry in the hierarchy.)
3460         */
3461    // syntactic sugar
3462        public ValueSetExpansionContainsComponent addContains() { //3
3463          ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent();
3464          if (this.contains == null)
3465            this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
3466          this.contains.add(t);
3467          return t;
3468        }
3469
3470    // syntactic sugar
3471        public ValueSetExpansionContainsComponent addContains(ValueSetExpansionContainsComponent t) { //3
3472          if (t == null)
3473            return this;
3474          if (this.contains == null)
3475            this.contains = new ArrayList<ValueSetExpansionContainsComponent>();
3476          this.contains.add(t);
3477          return this;
3478        }
3479
3480        protected void listChildren(List<Property> childrenList) {
3481          super.listChildren(childrenList);
3482          childrenList.add(new Property("system", "uri", "An absolute URI which is the code system in which the code for this item in the expansion is defined.", 0, java.lang.Integer.MAX_VALUE, system));
3483          childrenList.add(new Property("abstract", "boolean", "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.", 0, java.lang.Integer.MAX_VALUE, abstract_));
3484          childrenList.add(new Property("version", "string", "The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.", 0, java.lang.Integer.MAX_VALUE, version));
3485          childrenList.add(new Property("code", "code", "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.", 0, java.lang.Integer.MAX_VALUE, code));
3486          childrenList.add(new Property("display", "string", "The recommended display for this item in the expansion.", 0, java.lang.Integer.MAX_VALUE, display));
3487          childrenList.add(new Property("contains", "@ValueSet.expansion.contains", "Other codes and entries contained under this entry in the hierarchy.", 0, java.lang.Integer.MAX_VALUE, contains));
3488        }
3489
3490      @Override
3491      public void setProperty(String name, Base value) throws FHIRException {
3492        if (name.equals("system"))
3493          this.system = castToUri(value); // UriType
3494        else if (name.equals("abstract"))
3495          this.abstract_ = castToBoolean(value); // BooleanType
3496        else if (name.equals("version"))
3497          this.version = castToString(value); // StringType
3498        else if (name.equals("code"))
3499          this.code = castToCode(value); // CodeType
3500        else if (name.equals("display"))
3501          this.display = castToString(value); // StringType
3502        else if (name.equals("contains"))
3503          this.getContains().add((ValueSetExpansionContainsComponent) value);
3504        else
3505          super.setProperty(name, value);
3506      }
3507
3508      @Override
3509      public Base addChild(String name) throws FHIRException {
3510        if (name.equals("system")) {
3511          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.system");
3512        }
3513        else if (name.equals("abstract")) {
3514          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.abstract");
3515        }
3516        else if (name.equals("version")) {
3517          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version");
3518        }
3519        else if (name.equals("code")) {
3520          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.code");
3521        }
3522        else if (name.equals("display")) {
3523          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.display");
3524        }
3525        else if (name.equals("contains")) {
3526          return addContains();
3527        }
3528        else
3529          return super.addChild(name);
3530      }
3531
3532      public ValueSetExpansionContainsComponent copy() {
3533        ValueSetExpansionContainsComponent dst = new ValueSetExpansionContainsComponent();
3534        copyValues(dst);
3535        dst.system = system == null ? null : system.copy();
3536        dst.abstract_ = abstract_ == null ? null : abstract_.copy();
3537        dst.version = version == null ? null : version.copy();
3538        dst.code = code == null ? null : code.copy();
3539        dst.display = display == null ? null : display.copy();
3540        if (contains != null) {
3541          dst.contains = new ArrayList<ValueSetExpansionContainsComponent>();
3542          for (ValueSetExpansionContainsComponent i : contains)
3543            dst.contains.add(i.copy());
3544        };
3545        return dst;
3546      }
3547
3548      @Override
3549      public boolean equalsDeep(Base other) {
3550        if (!super.equalsDeep(other))
3551          return false;
3552        if (!(other instanceof ValueSetExpansionContainsComponent))
3553          return false;
3554        ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other;
3555        return compareDeep(system, o.system, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(version, o.version, true)
3556           && compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(contains, o.contains, true)
3557          ;
3558      }
3559
3560      @Override
3561      public boolean equalsShallow(Base other) {
3562        if (!super.equalsShallow(other))
3563          return false;
3564        if (!(other instanceof ValueSetExpansionContainsComponent))
3565          return false;
3566        ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other;
3567        return compareValues(system, o.system, true) && compareValues(abstract_, o.abstract_, true) && compareValues(version, o.version, true)
3568           && compareValues(code, o.code, true) && compareValues(display, o.display, true);
3569      }
3570
3571      public boolean isEmpty() {
3572        return super.isEmpty() && (system == null || system.isEmpty()) && (abstract_ == null || abstract_.isEmpty())
3573           && (version == null || version.isEmpty()) && (code == null || code.isEmpty()) && (display == null || display.isEmpty())
3574           && (contains == null || contains.isEmpty());
3575      }
3576
3577  public String fhirType() {
3578    return "ValueSet.expansion.contains";
3579
3580  }
3581
3582  }
3583
3584    /**
3585     * An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.
3586     */
3587    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true)
3588    @Description(shortDefinition="Globally unique logical identifier for  value set", formalDefinition="An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published." )
3589    protected UriType url;
3590
3591    /**
3592     * 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.
3593     */
3594    @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true)
3595    @Description(shortDefinition="Additional identifier for the value set (e.g. HL7 v2 / CDA)", formalDefinition="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." )
3596    protected Identifier identifier;
3597
3598    /**
3599     * 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 profile author manually and the value should be a timestamp.
3600     */
3601    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
3602    @Description(shortDefinition="Logical identifier for this version of the value set", formalDefinition="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 profile author manually and the value should be a timestamp." )
3603    protected StringType version;
3604
3605    /**
3606     * A free text natural language name describing the value set.
3607     */
3608    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
3609    @Description(shortDefinition="Informal name for this value set", formalDefinition="A free text natural language name describing the value set." )
3610    protected StringType name;
3611
3612    /**
3613     * The status of the value set.
3614     */
3615    @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true)
3616    @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the value set." )
3617    protected Enumeration<ConformanceResourceStatus> status;
3618
3619    /**
3620     * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
3621     */
3622    @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true)
3623    @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." )
3624    protected BooleanType experimental;
3625
3626    /**
3627     * The name of the individual or organization that published the value set.
3628     */
3629    @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
3630    @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the individual or organization that published the value set." )
3631    protected StringType publisher;
3632
3633    /**
3634     * Contacts to assist a user in finding and communicating with the publisher.
3635     */
3636    @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3637    @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." )
3638    protected List<ValueSetContactComponent> contact;
3639
3640    /**
3641     * The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').
3642     */
3643    @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true)
3644    @Description(shortDefinition="Date for given status", formalDefinition="The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition')." )
3645    protected DateTimeType date;
3646
3647    /**
3648     * If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.
3649     */
3650    @Child(name = "lockedDate", type = {DateType.class}, order=9, min=0, max=1, modifier=false, summary=true)
3651    @Description(shortDefinition="Fixed date for all referenced code systems and value sets", formalDefinition="If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date." )
3652    protected DateType lockedDate;
3653
3654    /**
3655     * A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.
3656     */
3657    @Child(name = "description", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true)
3658    @Description(shortDefinition="Human language description of the value set", formalDefinition="A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set." )
3659    protected StringType description;
3660
3661    /**
3662     * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.
3663     */
3664    @Child(name = "useContext", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3665    @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions." )
3666    protected List<CodeableConcept> useContext;
3667
3668    /**
3669     * If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.
3670     */
3671    @Child(name = "immutable", type = {BooleanType.class}, order=12, min=0, max=1, modifier=false, summary=true)
3672    @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." )
3673    protected BooleanType immutable;
3674
3675    /**
3676     * Explains why this value set is needed and why it has been constrained as it has.
3677     */
3678    @Child(name = "requirements", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false)
3679    @Description(shortDefinition="Why needed", formalDefinition="Explains why this value set is needed and why it has been constrained as it has." )
3680    protected StringType requirements;
3681
3682    /**
3683     * 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.
3684     */
3685    @Child(name = "copyright", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false)
3686    @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." )
3687    protected StringType copyright;
3688
3689    /**
3690     * Whether this is intended to be used with an extensible binding or not.
3691     */
3692    @Child(name = "extensible", type = {BooleanType.class}, order=15, min=0, max=1, modifier=false, summary=true)
3693    @Description(shortDefinition="Whether this is intended to be used with an extensible binding", formalDefinition="Whether this is intended to be used with an extensible binding or not." )
3694    protected BooleanType extensible;
3695
3696    /**
3697     * A definition of a code system, inlined into the value set (as a packaging convenience). Note that the inline code system may be used from other value sets by referring to its (codeSystem.system) directly.
3698     */
3699    @Child(name = "codeSystem", type = {}, order=16, min=0, max=1, modifier=false, summary=true)
3700    @Description(shortDefinition="An inline code system, which is part of this value set", formalDefinition="A definition of a code system, inlined into the value set (as a packaging convenience). Note that the inline code system may be used from other value sets by referring to its (codeSystem.system) directly." )
3701    protected ValueSetCodeSystemComponent codeSystem;
3702
3703    /**
3704     * A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set.
3705     */
3706    @Child(name = "compose", type = {}, order=17, min=0, max=1, modifier=false, summary=false)
3707    @Description(shortDefinition="When value set includes codes from elsewhere", formalDefinition="A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set." )
3708    protected ValueSetComposeComponent compose;
3709
3710    /**
3711     * 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.
3712     */
3713    @Child(name = "expansion", type = {}, order=18, min=0, max=1, modifier=false, summary=false)
3714    @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." )
3715    protected ValueSetExpansionComponent expansion;
3716
3717    private static final long serialVersionUID = -467533312L;
3718
3719  /*
3720   * Constructor
3721   */
3722    public ValueSet() {
3723      super();
3724    }
3725
3726  /*
3727   * Constructor
3728   */
3729    public ValueSet(Enumeration<ConformanceResourceStatus> status) {
3730      super();
3731      this.status = status;
3732    }
3733
3734    /**
3735     * @return {@link #url} (An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
3736     */
3737    public UriType getUrlElement() { 
3738      if (this.url == null)
3739        if (Configuration.errorOnAutoCreate())
3740          throw new Error("Attempt to auto-create ValueSet.url");
3741        else if (Configuration.doAutoCreate())
3742          this.url = new UriType(); // bb
3743      return this.url;
3744    }
3745
3746    public boolean hasUrlElement() { 
3747      return this.url != null && !this.url.isEmpty();
3748    }
3749
3750    public boolean hasUrl() { 
3751      return this.url != null && !this.url.isEmpty();
3752    }
3753
3754    /**
3755     * @param value {@link #url} (An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
3756     */
3757    public ValueSet setUrlElement(UriType value) { 
3758      this.url = value;
3759      return this;
3760    }
3761
3762    /**
3763     * @return An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.
3764     */
3765    public String getUrl() { 
3766      return this.url == null ? null : this.url.getValue();
3767    }
3768
3769    /**
3770     * @param value An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.
3771     */
3772    public ValueSet setUrl(String value) { 
3773      if (Utilities.noString(value))
3774        this.url = null;
3775      else {
3776        if (this.url == null)
3777          this.url = new UriType();
3778        this.url.setValue(value);
3779      }
3780      return this;
3781    }
3782
3783    /**
3784     * @return {@link #identifier} (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.)
3785     */
3786    public Identifier getIdentifier() { 
3787      if (this.identifier == null)
3788        if (Configuration.errorOnAutoCreate())
3789          throw new Error("Attempt to auto-create ValueSet.identifier");
3790        else if (Configuration.doAutoCreate())
3791          this.identifier = new Identifier(); // cc
3792      return this.identifier;
3793    }
3794
3795    public boolean hasIdentifier() { 
3796      return this.identifier != null && !this.identifier.isEmpty();
3797    }
3798
3799    /**
3800     * @param value {@link #identifier} (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.)
3801     */
3802    public ValueSet setIdentifier(Identifier value) { 
3803      this.identifier = value;
3804      return this;
3805    }
3806
3807    /**
3808     * @return {@link #version} (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 profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
3809     */
3810    public StringType getVersionElement() { 
3811      if (this.version == null)
3812        if (Configuration.errorOnAutoCreate())
3813          throw new Error("Attempt to auto-create ValueSet.version");
3814        else if (Configuration.doAutoCreate())
3815          this.version = new StringType(); // bb
3816      return this.version;
3817    }
3818
3819    public boolean hasVersionElement() { 
3820      return this.version != null && !this.version.isEmpty();
3821    }
3822
3823    public boolean hasVersion() { 
3824      return this.version != null && !this.version.isEmpty();
3825    }
3826
3827    /**
3828     * @param value {@link #version} (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 profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
3829     */
3830    public ValueSet setVersionElement(StringType value) { 
3831      this.version = value;
3832      return this;
3833    }
3834
3835    /**
3836     * @return 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 profile author manually and the value should be a timestamp.
3837     */
3838    public String getVersion() { 
3839      return this.version == null ? null : this.version.getValue();
3840    }
3841
3842    /**
3843     * @param value 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 profile author manually and the value should be a timestamp.
3844     */
3845    public ValueSet setVersion(String value) { 
3846      if (Utilities.noString(value))
3847        this.version = null;
3848      else {
3849        if (this.version == null)
3850          this.version = new StringType();
3851        this.version.setValue(value);
3852      }
3853      return this;
3854    }
3855
3856    /**
3857     * @return {@link #name} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3858     */
3859    public StringType getNameElement() { 
3860      if (this.name == null)
3861        if (Configuration.errorOnAutoCreate())
3862          throw new Error("Attempt to auto-create ValueSet.name");
3863        else if (Configuration.doAutoCreate())
3864          this.name = new StringType(); // bb
3865      return this.name;
3866    }
3867
3868    public boolean hasNameElement() { 
3869      return this.name != null && !this.name.isEmpty();
3870    }
3871
3872    public boolean hasName() { 
3873      return this.name != null && !this.name.isEmpty();
3874    }
3875
3876    /**
3877     * @param value {@link #name} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3878     */
3879    public ValueSet setNameElement(StringType value) { 
3880      this.name = value;
3881      return this;
3882    }
3883
3884    /**
3885     * @return A free text natural language name describing the value set.
3886     */
3887    public String getName() { 
3888      return this.name == null ? null : this.name.getValue();
3889    }
3890
3891    /**
3892     * @param value A free text natural language name describing the value set.
3893     */
3894    public ValueSet setName(String value) { 
3895      if (Utilities.noString(value))
3896        this.name = null;
3897      else {
3898        if (this.name == null)
3899          this.name = new StringType();
3900        this.name.setValue(value);
3901      }
3902      return this;
3903    }
3904
3905    /**
3906     * @return {@link #status} (The status of the value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
3907     */
3908    public Enumeration<ConformanceResourceStatus> getStatusElement() { 
3909      if (this.status == null)
3910        if (Configuration.errorOnAutoCreate())
3911          throw new Error("Attempt to auto-create ValueSet.status");
3912        else if (Configuration.doAutoCreate())
3913          this.status = new Enumeration<ConformanceResourceStatus>(new ConformanceResourceStatusEnumFactory()); // bb
3914      return this.status;
3915    }
3916
3917    public boolean hasStatusElement() { 
3918      return this.status != null && !this.status.isEmpty();
3919    }
3920
3921    public boolean hasStatus() { 
3922      return this.status != null && !this.status.isEmpty();
3923    }
3924
3925    /**
3926     * @param value {@link #status} (The status of the value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
3927     */
3928    public ValueSet setStatusElement(Enumeration<ConformanceResourceStatus> value) { 
3929      this.status = value;
3930      return this;
3931    }
3932
3933    /**
3934     * @return The status of the value set.
3935     */
3936    public ConformanceResourceStatus getStatus() { 
3937      return this.status == null ? null : this.status.getValue();
3938    }
3939
3940    /**
3941     * @param value The status of the value set.
3942     */
3943    public ValueSet setStatus(ConformanceResourceStatus value) { 
3944        if (this.status == null)
3945          this.status = new Enumeration<ConformanceResourceStatus>(new ConformanceResourceStatusEnumFactory());
3946        this.status.setValue(value);
3947      return this;
3948    }
3949
3950    /**
3951     * @return {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
3952     */
3953    public BooleanType getExperimentalElement() { 
3954      if (this.experimental == null)
3955        if (Configuration.errorOnAutoCreate())
3956          throw new Error("Attempt to auto-create ValueSet.experimental");
3957        else if (Configuration.doAutoCreate())
3958          this.experimental = new BooleanType(); // bb
3959      return this.experimental;
3960    }
3961
3962    public boolean hasExperimentalElement() { 
3963      return this.experimental != null && !this.experimental.isEmpty();
3964    }
3965
3966    public boolean hasExperimental() { 
3967      return this.experimental != null && !this.experimental.isEmpty();
3968    }
3969
3970    /**
3971     * @param value {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
3972     */
3973    public ValueSet setExperimentalElement(BooleanType value) { 
3974      this.experimental = value;
3975      return this;
3976    }
3977
3978    /**
3979     * @return This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
3980     */
3981    public boolean getExperimental() { 
3982      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
3983    }
3984
3985    /**
3986     * @param value This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
3987     */
3988    public ValueSet setExperimental(boolean value) { 
3989        if (this.experimental == null)
3990          this.experimental = new BooleanType();
3991        this.experimental.setValue(value);
3992      return this;
3993    }
3994
3995    /**
3996     * @return {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
3997     */
3998    public StringType getPublisherElement() { 
3999      if (this.publisher == null)
4000        if (Configuration.errorOnAutoCreate())
4001          throw new Error("Attempt to auto-create ValueSet.publisher");
4002        else if (Configuration.doAutoCreate())
4003          this.publisher = new StringType(); // bb
4004      return this.publisher;
4005    }
4006
4007    public boolean hasPublisherElement() { 
4008      return this.publisher != null && !this.publisher.isEmpty();
4009    }
4010
4011    public boolean hasPublisher() { 
4012      return this.publisher != null && !this.publisher.isEmpty();
4013    }
4014
4015    /**
4016     * @param value {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
4017     */
4018    public ValueSet setPublisherElement(StringType value) { 
4019      this.publisher = value;
4020      return this;
4021    }
4022
4023    /**
4024     * @return The name of the individual or organization that published the value set.
4025     */
4026    public String getPublisher() { 
4027      return this.publisher == null ? null : this.publisher.getValue();
4028    }
4029
4030    /**
4031     * @param value The name of the individual or organization that published the value set.
4032     */
4033    public ValueSet setPublisher(String value) { 
4034      if (Utilities.noString(value))
4035        this.publisher = null;
4036      else {
4037        if (this.publisher == null)
4038          this.publisher = new StringType();
4039        this.publisher.setValue(value);
4040      }
4041      return this;
4042    }
4043
4044    /**
4045     * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.)
4046     */
4047    public List<ValueSetContactComponent> getContact() { 
4048      if (this.contact == null)
4049        this.contact = new ArrayList<ValueSetContactComponent>();
4050      return this.contact;
4051    }
4052
4053    public boolean hasContact() { 
4054      if (this.contact == null)
4055        return false;
4056      for (ValueSetContactComponent item : this.contact)
4057        if (!item.isEmpty())
4058          return true;
4059      return false;
4060    }
4061
4062    /**
4063     * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.)
4064     */
4065    // syntactic sugar
4066    public ValueSetContactComponent addContact() { //3
4067      ValueSetContactComponent t = new ValueSetContactComponent();
4068      if (this.contact == null)
4069        this.contact = new ArrayList<ValueSetContactComponent>();
4070      this.contact.add(t);
4071      return t;
4072    }
4073
4074    // syntactic sugar
4075    public ValueSet addContact(ValueSetContactComponent t) { //3
4076      if (t == null)
4077        return this;
4078      if (this.contact == null)
4079        this.contact = new ArrayList<ValueSetContactComponent>();
4080      this.contact.add(t);
4081      return this;
4082    }
4083
4084    /**
4085     * @return {@link #date} (The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
4086     */
4087    public DateTimeType getDateElement() { 
4088      if (this.date == null)
4089        if (Configuration.errorOnAutoCreate())
4090          throw new Error("Attempt to auto-create ValueSet.date");
4091        else if (Configuration.doAutoCreate())
4092          this.date = new DateTimeType(); // bb
4093      return this.date;
4094    }
4095
4096    public boolean hasDateElement() { 
4097      return this.date != null && !this.date.isEmpty();
4098    }
4099
4100    public boolean hasDate() { 
4101      return this.date != null && !this.date.isEmpty();
4102    }
4103
4104    /**
4105     * @param value {@link #date} (The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
4106     */
4107    public ValueSet setDateElement(DateTimeType value) { 
4108      this.date = value;
4109      return this;
4110    }
4111
4112    /**
4113     * @return The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').
4114     */
4115    public Date getDate() { 
4116      return this.date == null ? null : this.date.getValue();
4117    }
4118
4119    /**
4120     * @param value The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').
4121     */
4122    public ValueSet setDate(Date value) { 
4123      if (value == null)
4124        this.date = null;
4125      else {
4126        if (this.date == null)
4127          this.date = new DateTimeType();
4128        this.date.setValue(value);
4129      }
4130      return this;
4131    }
4132
4133    /**
4134     * @return {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value
4135     */
4136    public DateType getLockedDateElement() { 
4137      if (this.lockedDate == null)
4138        if (Configuration.errorOnAutoCreate())
4139          throw new Error("Attempt to auto-create ValueSet.lockedDate");
4140        else if (Configuration.doAutoCreate())
4141          this.lockedDate = new DateType(); // bb
4142      return this.lockedDate;
4143    }
4144
4145    public boolean hasLockedDateElement() { 
4146      return this.lockedDate != null && !this.lockedDate.isEmpty();
4147    }
4148
4149    public boolean hasLockedDate() { 
4150      return this.lockedDate != null && !this.lockedDate.isEmpty();
4151    }
4152
4153    /**
4154     * @param value {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value
4155     */
4156    public ValueSet setLockedDateElement(DateType value) { 
4157      this.lockedDate = value;
4158      return this;
4159    }
4160
4161    /**
4162     * @return If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.
4163     */
4164    public Date getLockedDate() { 
4165      return this.lockedDate == null ? null : this.lockedDate.getValue();
4166    }
4167
4168    /**
4169     * @param value If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.
4170     */
4171    public ValueSet setLockedDate(Date value) { 
4172      if (value == null)
4173        this.lockedDate = null;
4174      else {
4175        if (this.lockedDate == null)
4176          this.lockedDate = new DateType();
4177        this.lockedDate.setValue(value);
4178      }
4179      return this;
4180    }
4181
4182    /**
4183     * @return {@link #description} (A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
4184     */
4185    public StringType getDescriptionElement() { 
4186      if (this.description == null)
4187        if (Configuration.errorOnAutoCreate())
4188          throw new Error("Attempt to auto-create ValueSet.description");
4189        else if (Configuration.doAutoCreate())
4190          this.description = new StringType(); // bb
4191      return this.description;
4192    }
4193
4194    public boolean hasDescriptionElement() { 
4195      return this.description != null && !this.description.isEmpty();
4196    }
4197
4198    public boolean hasDescription() { 
4199      return this.description != null && !this.description.isEmpty();
4200    }
4201
4202    /**
4203     * @param value {@link #description} (A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
4204     */
4205    public ValueSet setDescriptionElement(StringType value) { 
4206      this.description = value;
4207      return this;
4208    }
4209
4210    /**
4211     * @return A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.
4212     */
4213    public String getDescription() { 
4214      return this.description == null ? null : this.description.getValue();
4215    }
4216
4217    /**
4218     * @param value A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.
4219     */
4220    public ValueSet setDescription(String value) { 
4221      if (Utilities.noString(value))
4222        this.description = null;
4223      else {
4224        if (this.description == null)
4225          this.description = new StringType();
4226        this.description.setValue(value);
4227      }
4228      return this;
4229    }
4230
4231    /**
4232     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.)
4233     */
4234    public List<CodeableConcept> getUseContext() { 
4235      if (this.useContext == null)
4236        this.useContext = new ArrayList<CodeableConcept>();
4237      return this.useContext;
4238    }
4239
4240    public boolean hasUseContext() { 
4241      if (this.useContext == null)
4242        return false;
4243      for (CodeableConcept item : this.useContext)
4244        if (!item.isEmpty())
4245          return true;
4246      return false;
4247    }
4248
4249    /**
4250     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.)
4251     */
4252    // syntactic sugar
4253    public CodeableConcept addUseContext() { //3
4254      CodeableConcept t = new CodeableConcept();
4255      if (this.useContext == null)
4256        this.useContext = new ArrayList<CodeableConcept>();
4257      this.useContext.add(t);
4258      return t;
4259    }
4260
4261    // syntactic sugar
4262    public ValueSet addUseContext(CodeableConcept t) { //3
4263      if (t == null)
4264        return this;
4265      if (this.useContext == null)
4266        this.useContext = new ArrayList<CodeableConcept>();
4267      this.useContext.add(t);
4268      return this;
4269    }
4270
4271    /**
4272     * @return {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value
4273     */
4274    public BooleanType getImmutableElement() { 
4275      if (this.immutable == null)
4276        if (Configuration.errorOnAutoCreate())
4277          throw new Error("Attempt to auto-create ValueSet.immutable");
4278        else if (Configuration.doAutoCreate())
4279          this.immutable = new BooleanType(); // bb
4280      return this.immutable;
4281    }
4282
4283    public boolean hasImmutableElement() { 
4284      return this.immutable != null && !this.immutable.isEmpty();
4285    }
4286
4287    public boolean hasImmutable() { 
4288      return this.immutable != null && !this.immutable.isEmpty();
4289    }
4290
4291    /**
4292     * @param value {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value
4293     */
4294    public ValueSet setImmutableElement(BooleanType value) { 
4295      this.immutable = value;
4296      return this;
4297    }
4298
4299    /**
4300     * @return If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.
4301     */
4302    public boolean getImmutable() { 
4303      return this.immutable == null || this.immutable.isEmpty() ? false : this.immutable.getValue();
4304    }
4305
4306    /**
4307     * @param value If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.
4308     */
4309    public ValueSet setImmutable(boolean value) { 
4310        if (this.immutable == null)
4311          this.immutable = new BooleanType();
4312        this.immutable.setValue(value);
4313      return this;
4314    }
4315
4316    /**
4317     * @return {@link #requirements} (Explains why this value set is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
4318     */
4319    public StringType getRequirementsElement() { 
4320      if (this.requirements == null)
4321        if (Configuration.errorOnAutoCreate())
4322          throw new Error("Attempt to auto-create ValueSet.requirements");
4323        else if (Configuration.doAutoCreate())
4324          this.requirements = new StringType(); // bb
4325      return this.requirements;
4326    }
4327
4328    public boolean hasRequirementsElement() { 
4329      return this.requirements != null && !this.requirements.isEmpty();
4330    }
4331
4332    public boolean hasRequirements() { 
4333      return this.requirements != null && !this.requirements.isEmpty();
4334    }
4335
4336    /**
4337     * @param value {@link #requirements} (Explains why this value set is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
4338     */
4339    public ValueSet setRequirementsElement(StringType value) { 
4340      this.requirements = value;
4341      return this;
4342    }
4343
4344    /**
4345     * @return Explains why this value set is needed and why it has been constrained as it has.
4346     */
4347    public String getRequirements() { 
4348      return this.requirements == null ? null : this.requirements.getValue();
4349    }
4350
4351    /**
4352     * @param value Explains why this value set is needed and why it has been constrained as it has.
4353     */
4354    public ValueSet setRequirements(String value) { 
4355      if (Utilities.noString(value))
4356        this.requirements = null;
4357      else {
4358        if (this.requirements == null)
4359          this.requirements = new StringType();
4360        this.requirements.setValue(value);
4361      }
4362      return this;
4363    }
4364
4365    /**
4366     * @return {@link #copyright} (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.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
4367     */
4368    public StringType getCopyrightElement() { 
4369      if (this.copyright == null)
4370        if (Configuration.errorOnAutoCreate())
4371          throw new Error("Attempt to auto-create ValueSet.copyright");
4372        else if (Configuration.doAutoCreate())
4373          this.copyright = new StringType(); // bb
4374      return this.copyright;
4375    }
4376
4377    public boolean hasCopyrightElement() { 
4378      return this.copyright != null && !this.copyright.isEmpty();
4379    }
4380
4381    public boolean hasCopyright() { 
4382      return this.copyright != null && !this.copyright.isEmpty();
4383    }
4384
4385    /**
4386     * @param value {@link #copyright} (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.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
4387     */
4388    public ValueSet setCopyrightElement(StringType value) { 
4389      this.copyright = value;
4390      return this;
4391    }
4392
4393    /**
4394     * @return 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.
4395     */
4396    public String getCopyright() { 
4397      return this.copyright == null ? null : this.copyright.getValue();
4398    }
4399
4400    /**
4401     * @param value 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.
4402     */
4403    public ValueSet setCopyright(String value) { 
4404      if (Utilities.noString(value))
4405        this.copyright = null;
4406      else {
4407        if (this.copyright == null)
4408          this.copyright = new StringType();
4409        this.copyright.setValue(value);
4410      }
4411      return this;
4412    }
4413
4414    /**
4415     * @return {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value
4416     */
4417    public BooleanType getExtensibleElement() { 
4418      if (this.extensible == null)
4419        if (Configuration.errorOnAutoCreate())
4420          throw new Error("Attempt to auto-create ValueSet.extensible");
4421        else if (Configuration.doAutoCreate())
4422          this.extensible = new BooleanType(); // bb
4423      return this.extensible;
4424    }
4425
4426    public boolean hasExtensibleElement() { 
4427      return this.extensible != null && !this.extensible.isEmpty();
4428    }
4429
4430    public boolean hasExtensible() { 
4431      return this.extensible != null && !this.extensible.isEmpty();
4432    }
4433
4434    /**
4435     * @param value {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value
4436     */
4437    public ValueSet setExtensibleElement(BooleanType value) { 
4438      this.extensible = value;
4439      return this;
4440    }
4441
4442    /**
4443     * @return Whether this is intended to be used with an extensible binding or not.
4444     */
4445    public boolean getExtensible() { 
4446      return this.extensible == null || this.extensible.isEmpty() ? false : this.extensible.getValue();
4447    }
4448
4449    /**
4450     * @param value Whether this is intended to be used with an extensible binding or not.
4451     */
4452    public ValueSet setExtensible(boolean value) { 
4453        if (this.extensible == null)
4454          this.extensible = new BooleanType();
4455        this.extensible.setValue(value);
4456      return this;
4457    }
4458
4459    /**
4460     * @return {@link #codeSystem} (A definition of a code system, inlined into the value set (as a packaging convenience). Note that the inline code system may be used from other value sets by referring to its (codeSystem.system) directly.)
4461     */
4462    public ValueSetCodeSystemComponent getCodeSystem() { 
4463      if (this.codeSystem == null)
4464        if (Configuration.errorOnAutoCreate())
4465          throw new Error("Attempt to auto-create ValueSet.codeSystem");
4466        else if (Configuration.doAutoCreate())
4467          this.codeSystem = new ValueSetCodeSystemComponent(); // cc
4468      return this.codeSystem;
4469    }
4470
4471    public boolean hasCodeSystem() { 
4472      return this.codeSystem != null && !this.codeSystem.isEmpty();
4473    }
4474
4475    /**
4476     * @param value {@link #codeSystem} (A definition of a code system, inlined into the value set (as a packaging convenience). Note that the inline code system may be used from other value sets by referring to its (codeSystem.system) directly.)
4477     */
4478    public ValueSet setCodeSystem(ValueSetCodeSystemComponent value) { 
4479      this.codeSystem = value;
4480      return this;
4481    }
4482
4483    /**
4484     * @return {@link #compose} (A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set.)
4485     */
4486    public ValueSetComposeComponent getCompose() { 
4487      if (this.compose == null)
4488        if (Configuration.errorOnAutoCreate())
4489          throw new Error("Attempt to auto-create ValueSet.compose");
4490        else if (Configuration.doAutoCreate())
4491          this.compose = new ValueSetComposeComponent(); // cc
4492      return this.compose;
4493    }
4494
4495    public boolean hasCompose() { 
4496      return this.compose != null && !this.compose.isEmpty();
4497    }
4498
4499    /**
4500     * @param value {@link #compose} (A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set.)
4501     */
4502    public ValueSet setCompose(ValueSetComposeComponent value) { 
4503      this.compose = value;
4504      return this;
4505    }
4506
4507    /**
4508     * @return {@link #expansion} (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.)
4509     */
4510    public ValueSetExpansionComponent getExpansion() { 
4511      if (this.expansion == null)
4512        if (Configuration.errorOnAutoCreate())
4513          throw new Error("Attempt to auto-create ValueSet.expansion");
4514        else if (Configuration.doAutoCreate())
4515          this.expansion = new ValueSetExpansionComponent(); // cc
4516      return this.expansion;
4517    }
4518
4519    public boolean hasExpansion() { 
4520      return this.expansion != null && !this.expansion.isEmpty();
4521    }
4522
4523    /**
4524     * @param value {@link #expansion} (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.)
4525     */
4526    public ValueSet setExpansion(ValueSetExpansionComponent value) { 
4527      this.expansion = value;
4528      return this;
4529    }
4530
4531      protected void listChildren(List<Property> childrenList) {
4532        super.listChildren(childrenList);
4533        childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url));
4534        childrenList.add(new Property("identifier", "Identifier", "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.", 0, java.lang.Integer.MAX_VALUE, identifier));
4535        childrenList.add(new Property("version", "string", "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 profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version));
4536        childrenList.add(new Property("name", "string", "A free text natural language name describing the value set.", 0, java.lang.Integer.MAX_VALUE, name));
4537        childrenList.add(new Property("status", "code", "The status of the value set.", 0, java.lang.Integer.MAX_VALUE, status));
4538        childrenList.add(new Property("experimental", "boolean", "This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental));
4539        childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the value set.", 0, java.lang.Integer.MAX_VALUE, publisher));
4540        childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
4541        childrenList.add(new Property("date", "dateTime", "The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').", 0, java.lang.Integer.MAX_VALUE, date));
4542        childrenList.add(new Property("lockedDate", "date", "If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.", 0, java.lang.Integer.MAX_VALUE, lockedDate));
4543        childrenList.add(new Property("description", "string", "A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.", 0, java.lang.Integer.MAX_VALUE, description));
4544        childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.", 0, java.lang.Integer.MAX_VALUE, useContext));
4545        childrenList.add(new Property("immutable", "boolean", "If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.", 0, java.lang.Integer.MAX_VALUE, immutable));
4546        childrenList.add(new Property("requirements", "string", "Explains why this value set is needed and why it has been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements));
4547        childrenList.add(new Property("copyright", "string", "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.", 0, java.lang.Integer.MAX_VALUE, copyright));
4548        childrenList.add(new Property("extensible", "boolean", "Whether this is intended to be used with an extensible binding or not.", 0, java.lang.Integer.MAX_VALUE, extensible));
4549        childrenList.add(new Property("codeSystem", "", "A definition of a code system, inlined into the value set (as a packaging convenience). Note that the inline code system may be used from other value sets by referring to its (codeSystem.system) directly.", 0, java.lang.Integer.MAX_VALUE, codeSystem));
4550        childrenList.add(new Property("compose", "", "A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set.", 0, java.lang.Integer.MAX_VALUE, compose));
4551        childrenList.add(new Property("expansion", "", "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.", 0, java.lang.Integer.MAX_VALUE, expansion));
4552      }
4553
4554      @Override
4555      public void setProperty(String name, Base value) throws FHIRException {
4556        if (name.equals("url"))
4557          this.url = castToUri(value); // UriType
4558        else if (name.equals("identifier"))
4559          this.identifier = castToIdentifier(value); // Identifier
4560        else if (name.equals("version"))
4561          this.version = castToString(value); // StringType
4562        else if (name.equals("name"))
4563          this.name = castToString(value); // StringType
4564        else if (name.equals("status"))
4565          this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration<ConformanceResourceStatus>
4566        else if (name.equals("experimental"))
4567          this.experimental = castToBoolean(value); // BooleanType
4568        else if (name.equals("publisher"))
4569          this.publisher = castToString(value); // StringType
4570        else if (name.equals("contact"))
4571          this.getContact().add((ValueSetContactComponent) value);
4572        else if (name.equals("date"))
4573          this.date = castToDateTime(value); // DateTimeType
4574        else if (name.equals("lockedDate"))
4575          this.lockedDate = castToDate(value); // DateType
4576        else if (name.equals("description"))
4577          this.description = castToString(value); // StringType
4578        else if (name.equals("useContext"))
4579          this.getUseContext().add(castToCodeableConcept(value));
4580        else if (name.equals("immutable"))
4581          this.immutable = castToBoolean(value); // BooleanType
4582        else if (name.equals("requirements"))
4583          this.requirements = castToString(value); // StringType
4584        else if (name.equals("copyright"))
4585          this.copyright = castToString(value); // StringType
4586        else if (name.equals("extensible"))
4587          this.extensible = castToBoolean(value); // BooleanType
4588        else if (name.equals("codeSystem"))
4589          this.codeSystem = (ValueSetCodeSystemComponent) value; // ValueSetCodeSystemComponent
4590        else if (name.equals("compose"))
4591          this.compose = (ValueSetComposeComponent) value; // ValueSetComposeComponent
4592        else if (name.equals("expansion"))
4593          this.expansion = (ValueSetExpansionComponent) value; // ValueSetExpansionComponent
4594        else
4595          super.setProperty(name, value);
4596      }
4597
4598      @Override
4599      public Base addChild(String name) throws FHIRException {
4600        if (name.equals("url")) {
4601          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.url");
4602        }
4603        else if (name.equals("identifier")) {
4604          this.identifier = new Identifier();
4605          return this.identifier;
4606        }
4607        else if (name.equals("version")) {
4608          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version");
4609        }
4610        else if (name.equals("name")) {
4611          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.name");
4612        }
4613        else if (name.equals("status")) {
4614          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.status");
4615        }
4616        else if (name.equals("experimental")) {
4617          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.experimental");
4618        }
4619        else if (name.equals("publisher")) {
4620          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.publisher");
4621        }
4622        else if (name.equals("contact")) {
4623          return addContact();
4624        }
4625        else if (name.equals("date")) {
4626          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.date");
4627        }
4628        else if (name.equals("lockedDate")) {
4629          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.lockedDate");
4630        }
4631        else if (name.equals("description")) {
4632          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.description");
4633        }
4634        else if (name.equals("useContext")) {
4635          return addUseContext();
4636        }
4637        else if (name.equals("immutable")) {
4638          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.immutable");
4639        }
4640        else if (name.equals("requirements")) {
4641          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.requirements");
4642        }
4643        else if (name.equals("copyright")) {
4644          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.copyright");
4645        }
4646        else if (name.equals("extensible")) {
4647          throw new FHIRException("Cannot call addChild on a primitive type ValueSet.extensible");
4648        }
4649        else if (name.equals("codeSystem")) {
4650          this.codeSystem = new ValueSetCodeSystemComponent();
4651          return this.codeSystem;
4652        }
4653        else if (name.equals("compose")) {
4654          this.compose = new ValueSetComposeComponent();
4655          return this.compose;
4656        }
4657        else if (name.equals("expansion")) {
4658          this.expansion = new ValueSetExpansionComponent();
4659          return this.expansion;
4660        }
4661        else
4662          return super.addChild(name);
4663      }
4664
4665  public String fhirType() {
4666    return "ValueSet";
4667
4668  }
4669
4670      public ValueSet copy() {
4671        ValueSet dst = new ValueSet();
4672        copyValues(dst);
4673        dst.url = url == null ? null : url.copy();
4674        dst.identifier = identifier == null ? null : identifier.copy();
4675        dst.version = version == null ? null : version.copy();
4676        dst.name = name == null ? null : name.copy();
4677        dst.status = status == null ? null : status.copy();
4678        dst.experimental = experimental == null ? null : experimental.copy();
4679        dst.publisher = publisher == null ? null : publisher.copy();
4680        if (contact != null) {
4681          dst.contact = new ArrayList<ValueSetContactComponent>();
4682          for (ValueSetContactComponent i : contact)
4683            dst.contact.add(i.copy());
4684        };
4685        dst.date = date == null ? null : date.copy();
4686        dst.lockedDate = lockedDate == null ? null : lockedDate.copy();
4687        dst.description = description == null ? null : description.copy();
4688        if (useContext != null) {
4689          dst.useContext = new ArrayList<CodeableConcept>();
4690          for (CodeableConcept i : useContext)
4691            dst.useContext.add(i.copy());
4692        };
4693        dst.immutable = immutable == null ? null : immutable.copy();
4694        dst.requirements = requirements == null ? null : requirements.copy();
4695        dst.copyright = copyright == null ? null : copyright.copy();
4696        dst.extensible = extensible == null ? null : extensible.copy();
4697        dst.codeSystem = codeSystem == null ? null : codeSystem.copy();
4698        dst.compose = compose == null ? null : compose.copy();
4699        dst.expansion = expansion == null ? null : expansion.copy();
4700        return dst;
4701      }
4702
4703      protected ValueSet typedCopy() {
4704        return copy();
4705      }
4706
4707      @Override
4708      public boolean equalsDeep(Base other) {
4709        if (!super.equalsDeep(other))
4710          return false;
4711        if (!(other instanceof ValueSet))
4712          return false;
4713        ValueSet o = (ValueSet) other;
4714        return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true)
4715           && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true)
4716           && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true)
4717           && compareDeep(lockedDate, o.lockedDate, true) && compareDeep(description, o.description, true)
4718           && compareDeep(useContext, o.useContext, true) && compareDeep(immutable, o.immutable, true) && compareDeep(requirements, o.requirements, true)
4719           && compareDeep(copyright, o.copyright, true) && compareDeep(extensible, o.extensible, true) && compareDeep(codeSystem, o.codeSystem, true)
4720           && compareDeep(compose, o.compose, true) && compareDeep(expansion, o.expansion, true);
4721      }
4722
4723      @Override
4724      public boolean equalsShallow(Base other) {
4725        if (!super.equalsShallow(other))
4726          return false;
4727        if (!(other instanceof ValueSet))
4728          return false;
4729        ValueSet o = (ValueSet) other;
4730        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true)
4731           && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true)
4732           && compareValues(date, o.date, true) && compareValues(lockedDate, o.lockedDate, true) && compareValues(description, o.description, true)
4733           && compareValues(immutable, o.immutable, true) && compareValues(requirements, o.requirements, true)
4734           && compareValues(copyright, o.copyright, true) && compareValues(extensible, o.extensible, true);
4735      }
4736
4737      public boolean isEmpty() {
4738        return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty())
4739           && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty())
4740           && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty())
4741           && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (lockedDate == null || lockedDate.isEmpty())
4742           && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty())
4743           && (immutable == null || immutable.isEmpty()) && (requirements == null || requirements.isEmpty())
4744           && (copyright == null || copyright.isEmpty()) && (extensible == null || extensible.isEmpty())
4745           && (codeSystem == null || codeSystem.isEmpty()) && (compose == null || compose.isEmpty())
4746           && (expansion == null || expansion.isEmpty());
4747      }
4748
4749  @Override
4750  public ResourceType getResourceType() {
4751    return ResourceType.ValueSet;
4752   }
4753
4754  @SearchParamDefinition(name="date", path="ValueSet.date", description="The value set publication date", type="date" )
4755  public static final String SP_DATE = "date";
4756  @SearchParamDefinition(name="identifier", path="ValueSet.identifier", description="The identifier for the value set", type="token" )
4757  public static final String SP_IDENTIFIER = "identifier";
4758  @SearchParamDefinition(name="code", path="ValueSet.codeSystem.concept.code", description="A code defined in the value set", type="token" )
4759  public static final String SP_CODE = "code";
4760  @SearchParamDefinition(name="description", path="ValueSet.description", description="Text search in the description of the value set", type="string" )
4761  public static final String SP_DESCRIPTION = "description";
4762  @SearchParamDefinition(name="version", path="ValueSet.version", description="The version identifier of the value set", type="token" )
4763  public static final String SP_VERSION = "version";
4764  @SearchParamDefinition(name="url", path="ValueSet.url", description="The logical URL for the value set", type="uri" )
4765  public static final String SP_URL = "url";
4766  @SearchParamDefinition(name="expansion", path="ValueSet.expansion.identifier", description="Uniquely identifies this expansion", type="uri" )
4767  public static final String SP_EXPANSION = "expansion";
4768  @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" )
4769  public static final String SP_REFERENCE = "reference";
4770  @SearchParamDefinition(name="system", path="ValueSet.codeSystem.system", description="The system for any codes defined by this value set", type="uri" )
4771  public static final String SP_SYSTEM = "system";
4772  @SearchParamDefinition(name="name", path="ValueSet.name", description="The name of the value set", type="string" )
4773  public static final String SP_NAME = "name";
4774  @SearchParamDefinition(name="context", path="ValueSet.useContext", description="A use context assigned to the value set", type="token" )
4775  public static final String SP_CONTEXT = "context";
4776  @SearchParamDefinition(name="publisher", path="ValueSet.publisher", description="Name of the publisher of the value set", type="string" )
4777  public static final String SP_PUBLISHER = "publisher";
4778  @SearchParamDefinition(name="status", path="ValueSet.status", description="The status of the value set", type="token" )
4779  public static final String SP_STATUS = "status";
4780
4781}