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