001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.r4.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046/**
047 * A Terminology Capabilities documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.
048 */
049@ResourceDef(name="TerminologyCapabilities", profile="http://hl7.org/fhir/Profile/TerminologyCapabilities")
050@ChildOrder(names={"url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "lockedDate", "codeSystem", "expansion", "codeSearch", "validateCode", "translation", "closure"})
051public class TerminologyCapabilities extends MetadataResource {
052
053    public enum CodeSearchSupport {
054        /**
055         * The search for code on ValueSet only includes codes explicitly detailed on includes or expansions
056         */
057        EXPLICIT, 
058        /**
059         * The search for code on ValueSet only includes all codes based on the expansion of the value set
060         */
061        ALL, 
062        /**
063         * added to help the parsers with the generic types
064         */
065        NULL;
066        public static CodeSearchSupport fromCode(String codeString) throws FHIRException {
067            if (codeString == null || "".equals(codeString))
068                return null;
069        if ("explicit".equals(codeString))
070          return EXPLICIT;
071        if ("all".equals(codeString))
072          return ALL;
073        if (Configuration.isAcceptInvalidEnums())
074          return null;
075        else
076          throw new FHIRException("Unknown CodeSearchSupport code '"+codeString+"'");
077        }
078        public String toCode() {
079          switch (this) {
080            case EXPLICIT: return "explicit";
081            case ALL: return "all";
082            default: return "?";
083          }
084        }
085        public String getSystem() {
086          switch (this) {
087            case EXPLICIT: return "http://hl7.org/fhir/code-search-support";
088            case ALL: return "http://hl7.org/fhir/code-search-support";
089            default: return "?";
090          }
091        }
092        public String getDefinition() {
093          switch (this) {
094            case EXPLICIT: return "The search for code on ValueSet only includes codes explicitly detailed on includes or expansions";
095            case ALL: return "The search for code on ValueSet only includes all codes based on the expansion of the value set";
096            default: return "?";
097          }
098        }
099        public String getDisplay() {
100          switch (this) {
101            case EXPLICIT: return "Explicit Codes";
102            case ALL: return "Implicit Codes";
103            default: return "?";
104          }
105        }
106    }
107
108  public static class CodeSearchSupportEnumFactory implements EnumFactory<CodeSearchSupport> {
109    public CodeSearchSupport fromCode(String codeString) throws IllegalArgumentException {
110      if (codeString == null || "".equals(codeString))
111            if (codeString == null || "".equals(codeString))
112                return null;
113        if ("explicit".equals(codeString))
114          return CodeSearchSupport.EXPLICIT;
115        if ("all".equals(codeString))
116          return CodeSearchSupport.ALL;
117        throw new IllegalArgumentException("Unknown CodeSearchSupport code '"+codeString+"'");
118        }
119        public Enumeration<CodeSearchSupport> fromType(Base code) throws FHIRException {
120          if (code == null)
121            return null;
122          if (code.isEmpty())
123            return new Enumeration<CodeSearchSupport>(this);
124          String codeString = ((PrimitiveType) code).asStringValue();
125          if (codeString == null || "".equals(codeString))
126            return null;
127        if ("explicit".equals(codeString))
128          return new Enumeration<CodeSearchSupport>(this, CodeSearchSupport.EXPLICIT);
129        if ("all".equals(codeString))
130          return new Enumeration<CodeSearchSupport>(this, CodeSearchSupport.ALL);
131        throw new FHIRException("Unknown CodeSearchSupport code '"+codeString+"'");
132        }
133    public String toCode(CodeSearchSupport code) {
134      if (code == CodeSearchSupport.EXPLICIT)
135        return "explicit";
136      if (code == CodeSearchSupport.ALL)
137        return "all";
138      return "?";
139      }
140    public String toSystem(CodeSearchSupport code) {
141      return code.getSystem();
142      }
143    }
144
145    @Block()
146    public static class TerminologyCapabilitiesCodeSystemComponent extends BackboneElement implements IBaseBackboneElement {
147        /**
148         * URI for the Code System.
149         */
150        @Child(name = "uri", type = {CanonicalType.class}, order=1, min=0, max=1, modifier=false, summary=false)
151        @Description(shortDefinition="URI for the Code System", formalDefinition="URI for the Code System." )
152        protected CanonicalType uri;
153
154        /**
155         * For the code system, a list of versions that are supported by the server.
156         */
157        @Child(name = "version", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
158        @Description(shortDefinition="Version of Code System supported", formalDefinition="For the code system, a list of versions that are supported by the server." )
159        protected List<TerminologyCapabilitiesCodeSystemVersionComponent> version;
160
161        private static final long serialVersionUID = 1023500432L;
162
163    /**
164     * Constructor
165     */
166      public TerminologyCapabilitiesCodeSystemComponent() {
167        super();
168      }
169
170        /**
171         * @return {@link #uri} (URI for the Code System.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
172         */
173        public CanonicalType getUriElement() { 
174          if (this.uri == null)
175            if (Configuration.errorOnAutoCreate())
176              throw new Error("Attempt to auto-create TerminologyCapabilitiesCodeSystemComponent.uri");
177            else if (Configuration.doAutoCreate())
178              this.uri = new CanonicalType(); // bb
179          return this.uri;
180        }
181
182        public boolean hasUriElement() { 
183          return this.uri != null && !this.uri.isEmpty();
184        }
185
186        public boolean hasUri() { 
187          return this.uri != null && !this.uri.isEmpty();
188        }
189
190        /**
191         * @param value {@link #uri} (URI for the Code System.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
192         */
193        public TerminologyCapabilitiesCodeSystemComponent setUriElement(CanonicalType value) { 
194          this.uri = value;
195          return this;
196        }
197
198        /**
199         * @return URI for the Code System.
200         */
201        public String getUri() { 
202          return this.uri == null ? null : this.uri.getValue();
203        }
204
205        /**
206         * @param value URI for the Code System.
207         */
208        public TerminologyCapabilitiesCodeSystemComponent setUri(String value) { 
209          if (Utilities.noString(value))
210            this.uri = null;
211          else {
212            if (this.uri == null)
213              this.uri = new CanonicalType();
214            this.uri.setValue(value);
215          }
216          return this;
217        }
218
219        /**
220         * @return {@link #version} (For the code system, a list of versions that are supported by the server.)
221         */
222        public List<TerminologyCapabilitiesCodeSystemVersionComponent> getVersion() { 
223          if (this.version == null)
224            this.version = new ArrayList<TerminologyCapabilitiesCodeSystemVersionComponent>();
225          return this.version;
226        }
227
228        /**
229         * @return Returns a reference to <code>this</code> for easy method chaining
230         */
231        public TerminologyCapabilitiesCodeSystemComponent setVersion(List<TerminologyCapabilitiesCodeSystemVersionComponent> theVersion) { 
232          this.version = theVersion;
233          return this;
234        }
235
236        public boolean hasVersion() { 
237          if (this.version == null)
238            return false;
239          for (TerminologyCapabilitiesCodeSystemVersionComponent item : this.version)
240            if (!item.isEmpty())
241              return true;
242          return false;
243        }
244
245        public TerminologyCapabilitiesCodeSystemVersionComponent addVersion() { //3
246          TerminologyCapabilitiesCodeSystemVersionComponent t = new TerminologyCapabilitiesCodeSystemVersionComponent();
247          if (this.version == null)
248            this.version = new ArrayList<TerminologyCapabilitiesCodeSystemVersionComponent>();
249          this.version.add(t);
250          return t;
251        }
252
253        public TerminologyCapabilitiesCodeSystemComponent addVersion(TerminologyCapabilitiesCodeSystemVersionComponent t) { //3
254          if (t == null)
255            return this;
256          if (this.version == null)
257            this.version = new ArrayList<TerminologyCapabilitiesCodeSystemVersionComponent>();
258          this.version.add(t);
259          return this;
260        }
261
262        /**
263         * @return The first repetition of repeating field {@link #version}, creating it if it does not already exist
264         */
265        public TerminologyCapabilitiesCodeSystemVersionComponent getVersionFirstRep() { 
266          if (getVersion().isEmpty()) {
267            addVersion();
268          }
269          return getVersion().get(0);
270        }
271
272        protected void listChildren(List<Property> children) {
273          super.listChildren(children);
274          children.add(new Property("uri", "canonical(CodeSystem)", "URI for the Code System.", 0, 1, uri));
275          children.add(new Property("version", "", "For the code system, a list of versions that are supported by the server.", 0, java.lang.Integer.MAX_VALUE, version));
276        }
277
278        @Override
279        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
280          switch (_hash) {
281          case 116076: /*uri*/  return new Property("uri", "canonical(CodeSystem)", "URI for the Code System.", 0, 1, uri);
282          case 351608024: /*version*/  return new Property("version", "", "For the code system, a list of versions that are supported by the server.", 0, java.lang.Integer.MAX_VALUE, version);
283          default: return super.getNamedProperty(_hash, _name, _checkValid);
284          }
285
286        }
287
288      @Override
289      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
290        switch (hash) {
291        case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // CanonicalType
292        case 351608024: /*version*/ return this.version == null ? new Base[0] : this.version.toArray(new Base[this.version.size()]); // TerminologyCapabilitiesCodeSystemVersionComponent
293        default: return super.getProperty(hash, name, checkValid);
294        }
295
296      }
297
298      @Override
299      public Base setProperty(int hash, String name, Base value) throws FHIRException {
300        switch (hash) {
301        case 116076: // uri
302          this.uri = castToCanonical(value); // CanonicalType
303          return value;
304        case 351608024: // version
305          this.getVersion().add((TerminologyCapabilitiesCodeSystemVersionComponent) value); // TerminologyCapabilitiesCodeSystemVersionComponent
306          return value;
307        default: return super.setProperty(hash, name, value);
308        }
309
310      }
311
312      @Override
313      public Base setProperty(String name, Base value) throws FHIRException {
314        if (name.equals("uri")) {
315          this.uri = castToCanonical(value); // CanonicalType
316        } else if (name.equals("version")) {
317          this.getVersion().add((TerminologyCapabilitiesCodeSystemVersionComponent) value);
318        } else
319          return super.setProperty(name, value);
320        return value;
321      }
322
323      @Override
324      public Base makeProperty(int hash, String name) throws FHIRException {
325        switch (hash) {
326        case 116076:  return getUriElement();
327        case 351608024:  return addVersion(); 
328        default: return super.makeProperty(hash, name);
329        }
330
331      }
332
333      @Override
334      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
335        switch (hash) {
336        case 116076: /*uri*/ return new String[] {"canonical"};
337        case 351608024: /*version*/ return new String[] {};
338        default: return super.getTypesForProperty(hash, name);
339        }
340
341      }
342
343      @Override
344      public Base addChild(String name) throws FHIRException {
345        if (name.equals("uri")) {
346          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.uri");
347        }
348        else if (name.equals("version")) {
349          return addVersion();
350        }
351        else
352          return super.addChild(name);
353      }
354
355      public TerminologyCapabilitiesCodeSystemComponent copy() {
356        TerminologyCapabilitiesCodeSystemComponent dst = new TerminologyCapabilitiesCodeSystemComponent();
357        copyValues(dst);
358        dst.uri = uri == null ? null : uri.copy();
359        if (version != null) {
360          dst.version = new ArrayList<TerminologyCapabilitiesCodeSystemVersionComponent>();
361          for (TerminologyCapabilitiesCodeSystemVersionComponent i : version)
362            dst.version.add(i.copy());
363        };
364        return dst;
365      }
366
367      @Override
368      public boolean equalsDeep(Base other_) {
369        if (!super.equalsDeep(other_))
370          return false;
371        if (!(other_ instanceof TerminologyCapabilitiesCodeSystemComponent))
372          return false;
373        TerminologyCapabilitiesCodeSystemComponent o = (TerminologyCapabilitiesCodeSystemComponent) other_;
374        return compareDeep(uri, o.uri, true) && compareDeep(version, o.version, true);
375      }
376
377      @Override
378      public boolean equalsShallow(Base other_) {
379        if (!super.equalsShallow(other_))
380          return false;
381        if (!(other_ instanceof TerminologyCapabilitiesCodeSystemComponent))
382          return false;
383        TerminologyCapabilitiesCodeSystemComponent o = (TerminologyCapabilitiesCodeSystemComponent) other_;
384        return true;
385      }
386
387      public boolean isEmpty() {
388        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(uri, version);
389      }
390
391  public String fhirType() {
392    return "TerminologyCapabilities.codeSystem";
393
394  }
395
396  }
397
398    @Block()
399    public static class TerminologyCapabilitiesCodeSystemVersionComponent extends BackboneElement implements IBaseBackboneElement {
400        /**
401         * For version-less code systems, there should be a single version with no identifier.
402         */
403        @Child(name = "code", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
404        @Description(shortDefinition="Version identifier for this version", formalDefinition="For version-less code systems, there should be a single version with no identifier." )
405        protected StringType code;
406
407        /**
408         * If this is the default version for this code system.
409         */
410        @Child(name = "isDefault", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=true)
411        @Description(shortDefinition="If this is the default version for this code system", formalDefinition="If this is the default version for this code system." )
412        protected BooleanType isDefault;
413
414        /**
415         * If the compositional grammar defined by the code system is supported.
416         */
417        @Child(name = "compositional", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
418        @Description(shortDefinition="If compositional grammar is supported", formalDefinition="If the compositional grammar defined by the code system is supported." )
419        protected BooleanType compositional;
420
421        /**
422         * Language Displays supported.
423         */
424        @Child(name = "language", type = {CodeType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
425        @Description(shortDefinition="Language Displays supported", formalDefinition="Language Displays supported." )
426        protected List<CodeType> language;
427
428        /**
429         * Filter Properties supported.
430         */
431        @Child(name = "filter", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
432        @Description(shortDefinition="Filter Properties supported", formalDefinition="Filter Properties supported." )
433        protected List<TerminologyCapabilitiesCodeSystemVersionFilterComponent> filter;
434
435        /**
436         * Properties supported for $lookup.
437         */
438        @Child(name = "property", type = {CodeType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
439        @Description(shortDefinition="Properties supported for $lookup", formalDefinition="Properties supported for $lookup." )
440        protected List<CodeType> property;
441
442        private static final long serialVersionUID = 1857571343L;
443
444    /**
445     * Constructor
446     */
447      public TerminologyCapabilitiesCodeSystemVersionComponent() {
448        super();
449      }
450
451        /**
452         * @return {@link #code} (For version-less code systems, there should be a single version with no identifier.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
453         */
454        public StringType getCodeElement() { 
455          if (this.code == null)
456            if (Configuration.errorOnAutoCreate())
457              throw new Error("Attempt to auto-create TerminologyCapabilitiesCodeSystemVersionComponent.code");
458            else if (Configuration.doAutoCreate())
459              this.code = new StringType(); // bb
460          return this.code;
461        }
462
463        public boolean hasCodeElement() { 
464          return this.code != null && !this.code.isEmpty();
465        }
466
467        public boolean hasCode() { 
468          return this.code != null && !this.code.isEmpty();
469        }
470
471        /**
472         * @param value {@link #code} (For version-less code systems, there should be a single version with no identifier.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
473         */
474        public TerminologyCapabilitiesCodeSystemVersionComponent setCodeElement(StringType value) { 
475          this.code = value;
476          return this;
477        }
478
479        /**
480         * @return For version-less code systems, there should be a single version with no identifier.
481         */
482        public String getCode() { 
483          return this.code == null ? null : this.code.getValue();
484        }
485
486        /**
487         * @param value For version-less code systems, there should be a single version with no identifier.
488         */
489        public TerminologyCapabilitiesCodeSystemVersionComponent setCode(String value) { 
490          if (Utilities.noString(value))
491            this.code = null;
492          else {
493            if (this.code == null)
494              this.code = new StringType();
495            this.code.setValue(value);
496          }
497          return this;
498        }
499
500        /**
501         * @return {@link #isDefault} (If this is the default version for this code system.). This is the underlying object with id, value and extensions. The accessor "getIsDefault" gives direct access to the value
502         */
503        public BooleanType getIsDefaultElement() { 
504          if (this.isDefault == null)
505            if (Configuration.errorOnAutoCreate())
506              throw new Error("Attempt to auto-create TerminologyCapabilitiesCodeSystemVersionComponent.isDefault");
507            else if (Configuration.doAutoCreate())
508              this.isDefault = new BooleanType(); // bb
509          return this.isDefault;
510        }
511
512        public boolean hasIsDefaultElement() { 
513          return this.isDefault != null && !this.isDefault.isEmpty();
514        }
515
516        public boolean hasIsDefault() { 
517          return this.isDefault != null && !this.isDefault.isEmpty();
518        }
519
520        /**
521         * @param value {@link #isDefault} (If this is the default version for this code system.). This is the underlying object with id, value and extensions. The accessor "getIsDefault" gives direct access to the value
522         */
523        public TerminologyCapabilitiesCodeSystemVersionComponent setIsDefaultElement(BooleanType value) { 
524          this.isDefault = value;
525          return this;
526        }
527
528        /**
529         * @return If this is the default version for this code system.
530         */
531        public boolean getIsDefault() { 
532          return this.isDefault == null || this.isDefault.isEmpty() ? false : this.isDefault.getValue();
533        }
534
535        /**
536         * @param value If this is the default version for this code system.
537         */
538        public TerminologyCapabilitiesCodeSystemVersionComponent setIsDefault(boolean value) { 
539            if (this.isDefault == null)
540              this.isDefault = new BooleanType();
541            this.isDefault.setValue(value);
542          return this;
543        }
544
545        /**
546         * @return {@link #compositional} (If the compositional grammar defined by the code system is supported.). This is the underlying object with id, value and extensions. The accessor "getCompositional" gives direct access to the value
547         */
548        public BooleanType getCompositionalElement() { 
549          if (this.compositional == null)
550            if (Configuration.errorOnAutoCreate())
551              throw new Error("Attempt to auto-create TerminologyCapabilitiesCodeSystemVersionComponent.compositional");
552            else if (Configuration.doAutoCreate())
553              this.compositional = new BooleanType(); // bb
554          return this.compositional;
555        }
556
557        public boolean hasCompositionalElement() { 
558          return this.compositional != null && !this.compositional.isEmpty();
559        }
560
561        public boolean hasCompositional() { 
562          return this.compositional != null && !this.compositional.isEmpty();
563        }
564
565        /**
566         * @param value {@link #compositional} (If the compositional grammar defined by the code system is supported.). This is the underlying object with id, value and extensions. The accessor "getCompositional" gives direct access to the value
567         */
568        public TerminologyCapabilitiesCodeSystemVersionComponent setCompositionalElement(BooleanType value) { 
569          this.compositional = value;
570          return this;
571        }
572
573        /**
574         * @return If the compositional grammar defined by the code system is supported.
575         */
576        public boolean getCompositional() { 
577          return this.compositional == null || this.compositional.isEmpty() ? false : this.compositional.getValue();
578        }
579
580        /**
581         * @param value If the compositional grammar defined by the code system is supported.
582         */
583        public TerminologyCapabilitiesCodeSystemVersionComponent setCompositional(boolean value) { 
584            if (this.compositional == null)
585              this.compositional = new BooleanType();
586            this.compositional.setValue(value);
587          return this;
588        }
589
590        /**
591         * @return {@link #language} (Language Displays supported.)
592         */
593        public List<CodeType> getLanguage() { 
594          if (this.language == null)
595            this.language = new ArrayList<CodeType>();
596          return this.language;
597        }
598
599        /**
600         * @return Returns a reference to <code>this</code> for easy method chaining
601         */
602        public TerminologyCapabilitiesCodeSystemVersionComponent setLanguage(List<CodeType> theLanguage) { 
603          this.language = theLanguage;
604          return this;
605        }
606
607        public boolean hasLanguage() { 
608          if (this.language == null)
609            return false;
610          for (CodeType item : this.language)
611            if (!item.isEmpty())
612              return true;
613          return false;
614        }
615
616        /**
617         * @return {@link #language} (Language Displays supported.)
618         */
619        public CodeType addLanguageElement() {//2 
620          CodeType t = new CodeType();
621          if (this.language == null)
622            this.language = new ArrayList<CodeType>();
623          this.language.add(t);
624          return t;
625        }
626
627        /**
628         * @param value {@link #language} (Language Displays supported.)
629         */
630        public TerminologyCapabilitiesCodeSystemVersionComponent addLanguage(String value) { //1
631          CodeType t = new CodeType();
632          t.setValue(value);
633          if (this.language == null)
634            this.language = new ArrayList<CodeType>();
635          this.language.add(t);
636          return this;
637        }
638
639        /**
640         * @param value {@link #language} (Language Displays supported.)
641         */
642        public boolean hasLanguage(String value) { 
643          if (this.language == null)
644            return false;
645          for (CodeType v : this.language)
646            if (v.getValue().equals(value)) // code
647              return true;
648          return false;
649        }
650
651        /**
652         * @return {@link #filter} (Filter Properties supported.)
653         */
654        public List<TerminologyCapabilitiesCodeSystemVersionFilterComponent> getFilter() { 
655          if (this.filter == null)
656            this.filter = new ArrayList<TerminologyCapabilitiesCodeSystemVersionFilterComponent>();
657          return this.filter;
658        }
659
660        /**
661         * @return Returns a reference to <code>this</code> for easy method chaining
662         */
663        public TerminologyCapabilitiesCodeSystemVersionComponent setFilter(List<TerminologyCapabilitiesCodeSystemVersionFilterComponent> theFilter) { 
664          this.filter = theFilter;
665          return this;
666        }
667
668        public boolean hasFilter() { 
669          if (this.filter == null)
670            return false;
671          for (TerminologyCapabilitiesCodeSystemVersionFilterComponent item : this.filter)
672            if (!item.isEmpty())
673              return true;
674          return false;
675        }
676
677        public TerminologyCapabilitiesCodeSystemVersionFilterComponent addFilter() { //3
678          TerminologyCapabilitiesCodeSystemVersionFilterComponent t = new TerminologyCapabilitiesCodeSystemVersionFilterComponent();
679          if (this.filter == null)
680            this.filter = new ArrayList<TerminologyCapabilitiesCodeSystemVersionFilterComponent>();
681          this.filter.add(t);
682          return t;
683        }
684
685        public TerminologyCapabilitiesCodeSystemVersionComponent addFilter(TerminologyCapabilitiesCodeSystemVersionFilterComponent t) { //3
686          if (t == null)
687            return this;
688          if (this.filter == null)
689            this.filter = new ArrayList<TerminologyCapabilitiesCodeSystemVersionFilterComponent>();
690          this.filter.add(t);
691          return this;
692        }
693
694        /**
695         * @return The first repetition of repeating field {@link #filter}, creating it if it does not already exist
696         */
697        public TerminologyCapabilitiesCodeSystemVersionFilterComponent getFilterFirstRep() { 
698          if (getFilter().isEmpty()) {
699            addFilter();
700          }
701          return getFilter().get(0);
702        }
703
704        /**
705         * @return {@link #property} (Properties supported for $lookup.)
706         */
707        public List<CodeType> getProperty() { 
708          if (this.property == null)
709            this.property = new ArrayList<CodeType>();
710          return this.property;
711        }
712
713        /**
714         * @return Returns a reference to <code>this</code> for easy method chaining
715         */
716        public TerminologyCapabilitiesCodeSystemVersionComponent setProperty(List<CodeType> theProperty) { 
717          this.property = theProperty;
718          return this;
719        }
720
721        public boolean hasProperty() { 
722          if (this.property == null)
723            return false;
724          for (CodeType item : this.property)
725            if (!item.isEmpty())
726              return true;
727          return false;
728        }
729
730        /**
731         * @return {@link #property} (Properties supported for $lookup.)
732         */
733        public CodeType addPropertyElement() {//2 
734          CodeType t = new CodeType();
735          if (this.property == null)
736            this.property = new ArrayList<CodeType>();
737          this.property.add(t);
738          return t;
739        }
740
741        /**
742         * @param value {@link #property} (Properties supported for $lookup.)
743         */
744        public TerminologyCapabilitiesCodeSystemVersionComponent addProperty(String value) { //1
745          CodeType t = new CodeType();
746          t.setValue(value);
747          if (this.property == null)
748            this.property = new ArrayList<CodeType>();
749          this.property.add(t);
750          return this;
751        }
752
753        /**
754         * @param value {@link #property} (Properties supported for $lookup.)
755         */
756        public boolean hasProperty(String value) { 
757          if (this.property == null)
758            return false;
759          for (CodeType v : this.property)
760            if (v.getValue().equals(value)) // code
761              return true;
762          return false;
763        }
764
765        protected void listChildren(List<Property> children) {
766          super.listChildren(children);
767          children.add(new Property("code", "string", "For version-less code systems, there should be a single version with no identifier.", 0, 1, code));
768          children.add(new Property("isDefault", "boolean", "If this is the default version for this code system.", 0, 1, isDefault));
769          children.add(new Property("compositional", "boolean", "If the compositional grammar defined by the code system is supported.", 0, 1, compositional));
770          children.add(new Property("language", "code", "Language Displays supported.", 0, java.lang.Integer.MAX_VALUE, language));
771          children.add(new Property("filter", "", "Filter Properties supported.", 0, java.lang.Integer.MAX_VALUE, filter));
772          children.add(new Property("property", "code", "Properties supported for $lookup.", 0, java.lang.Integer.MAX_VALUE, property));
773        }
774
775        @Override
776        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
777          switch (_hash) {
778          case 3059181: /*code*/  return new Property("code", "string", "For version-less code systems, there should be a single version with no identifier.", 0, 1, code);
779          case 965025207: /*isDefault*/  return new Property("isDefault", "boolean", "If this is the default version for this code system.", 0, 1, isDefault);
780          case 1248023381: /*compositional*/  return new Property("compositional", "boolean", "If the compositional grammar defined by the code system is supported.", 0, 1, compositional);
781          case -1613589672: /*language*/  return new Property("language", "code", "Language Displays supported.", 0, java.lang.Integer.MAX_VALUE, language);
782          case -1274492040: /*filter*/  return new Property("filter", "", "Filter Properties supported.", 0, java.lang.Integer.MAX_VALUE, filter);
783          case -993141291: /*property*/  return new Property("property", "code", "Properties supported for $lookup.", 0, java.lang.Integer.MAX_VALUE, property);
784          default: return super.getNamedProperty(_hash, _name, _checkValid);
785          }
786
787        }
788
789      @Override
790      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
791        switch (hash) {
792        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // StringType
793        case 965025207: /*isDefault*/ return this.isDefault == null ? new Base[0] : new Base[] {this.isDefault}; // BooleanType
794        case 1248023381: /*compositional*/ return this.compositional == null ? new Base[0] : new Base[] {this.compositional}; // BooleanType
795        case -1613589672: /*language*/ return this.language == null ? new Base[0] : this.language.toArray(new Base[this.language.size()]); // CodeType
796        case -1274492040: /*filter*/ return this.filter == null ? new Base[0] : this.filter.toArray(new Base[this.filter.size()]); // TerminologyCapabilitiesCodeSystemVersionFilterComponent
797        case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // CodeType
798        default: return super.getProperty(hash, name, checkValid);
799        }
800
801      }
802
803      @Override
804      public Base setProperty(int hash, String name, Base value) throws FHIRException {
805        switch (hash) {
806        case 3059181: // code
807          this.code = castToString(value); // StringType
808          return value;
809        case 965025207: // isDefault
810          this.isDefault = castToBoolean(value); // BooleanType
811          return value;
812        case 1248023381: // compositional
813          this.compositional = castToBoolean(value); // BooleanType
814          return value;
815        case -1613589672: // language
816          this.getLanguage().add(castToCode(value)); // CodeType
817          return value;
818        case -1274492040: // filter
819          this.getFilter().add((TerminologyCapabilitiesCodeSystemVersionFilterComponent) value); // TerminologyCapabilitiesCodeSystemVersionFilterComponent
820          return value;
821        case -993141291: // property
822          this.getProperty().add(castToCode(value)); // CodeType
823          return value;
824        default: return super.setProperty(hash, name, value);
825        }
826
827      }
828
829      @Override
830      public Base setProperty(String name, Base value) throws FHIRException {
831        if (name.equals("code")) {
832          this.code = castToString(value); // StringType
833        } else if (name.equals("isDefault")) {
834          this.isDefault = castToBoolean(value); // BooleanType
835        } else if (name.equals("compositional")) {
836          this.compositional = castToBoolean(value); // BooleanType
837        } else if (name.equals("language")) {
838          this.getLanguage().add(castToCode(value));
839        } else if (name.equals("filter")) {
840          this.getFilter().add((TerminologyCapabilitiesCodeSystemVersionFilterComponent) value);
841        } else if (name.equals("property")) {
842          this.getProperty().add(castToCode(value));
843        } else
844          return super.setProperty(name, value);
845        return value;
846      }
847
848      @Override
849      public Base makeProperty(int hash, String name) throws FHIRException {
850        switch (hash) {
851        case 3059181:  return getCodeElement();
852        case 965025207:  return getIsDefaultElement();
853        case 1248023381:  return getCompositionalElement();
854        case -1613589672:  return addLanguageElement();
855        case -1274492040:  return addFilter(); 
856        case -993141291:  return addPropertyElement();
857        default: return super.makeProperty(hash, name);
858        }
859
860      }
861
862      @Override
863      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
864        switch (hash) {
865        case 3059181: /*code*/ return new String[] {"string"};
866        case 965025207: /*isDefault*/ return new String[] {"boolean"};
867        case 1248023381: /*compositional*/ return new String[] {"boolean"};
868        case -1613589672: /*language*/ return new String[] {"code"};
869        case -1274492040: /*filter*/ return new String[] {};
870        case -993141291: /*property*/ return new String[] {"code"};
871        default: return super.getTypesForProperty(hash, name);
872        }
873
874      }
875
876      @Override
877      public Base addChild(String name) throws FHIRException {
878        if (name.equals("code")) {
879          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.code");
880        }
881        else if (name.equals("isDefault")) {
882          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.isDefault");
883        }
884        else if (name.equals("compositional")) {
885          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.compositional");
886        }
887        else if (name.equals("language")) {
888          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.language");
889        }
890        else if (name.equals("filter")) {
891          return addFilter();
892        }
893        else if (name.equals("property")) {
894          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.property");
895        }
896        else
897          return super.addChild(name);
898      }
899
900      public TerminologyCapabilitiesCodeSystemVersionComponent copy() {
901        TerminologyCapabilitiesCodeSystemVersionComponent dst = new TerminologyCapabilitiesCodeSystemVersionComponent();
902        copyValues(dst);
903        dst.code = code == null ? null : code.copy();
904        dst.isDefault = isDefault == null ? null : isDefault.copy();
905        dst.compositional = compositional == null ? null : compositional.copy();
906        if (language != null) {
907          dst.language = new ArrayList<CodeType>();
908          for (CodeType i : language)
909            dst.language.add(i.copy());
910        };
911        if (filter != null) {
912          dst.filter = new ArrayList<TerminologyCapabilitiesCodeSystemVersionFilterComponent>();
913          for (TerminologyCapabilitiesCodeSystemVersionFilterComponent i : filter)
914            dst.filter.add(i.copy());
915        };
916        if (property != null) {
917          dst.property = new ArrayList<CodeType>();
918          for (CodeType i : property)
919            dst.property.add(i.copy());
920        };
921        return dst;
922      }
923
924      @Override
925      public boolean equalsDeep(Base other_) {
926        if (!super.equalsDeep(other_))
927          return false;
928        if (!(other_ instanceof TerminologyCapabilitiesCodeSystemVersionComponent))
929          return false;
930        TerminologyCapabilitiesCodeSystemVersionComponent o = (TerminologyCapabilitiesCodeSystemVersionComponent) other_;
931        return compareDeep(code, o.code, true) && compareDeep(isDefault, o.isDefault, true) && compareDeep(compositional, o.compositional, true)
932           && compareDeep(language, o.language, true) && compareDeep(filter, o.filter, true) && compareDeep(property, o.property, true)
933          ;
934      }
935
936      @Override
937      public boolean equalsShallow(Base other_) {
938        if (!super.equalsShallow(other_))
939          return false;
940        if (!(other_ instanceof TerminologyCapabilitiesCodeSystemVersionComponent))
941          return false;
942        TerminologyCapabilitiesCodeSystemVersionComponent o = (TerminologyCapabilitiesCodeSystemVersionComponent) other_;
943        return compareValues(code, o.code, true) && compareValues(isDefault, o.isDefault, true) && compareValues(compositional, o.compositional, true)
944           && compareValues(language, o.language, true) && compareValues(property, o.property, true);
945      }
946
947      public boolean isEmpty() {
948        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, isDefault, compositional
949          , language, filter, property);
950      }
951
952  public String fhirType() {
953    return "TerminologyCapabilities.codeSystem.version";
954
955  }
956
957  }
958
959    @Block()
960    public static class TerminologyCapabilitiesCodeSystemVersionFilterComponent extends BackboneElement implements IBaseBackboneElement {
961        /**
962         * Code of the property supported.
963         */
964        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
965        @Description(shortDefinition="Code of the property supported", formalDefinition="Code of the property supported." )
966        protected CodeType code;
967
968        /**
969         * Operations supported for the property.
970         */
971        @Child(name = "op", type = {CodeType.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
972        @Description(shortDefinition="Operations supported for the property", formalDefinition="Operations supported for the property." )
973        protected List<CodeType> op;
974
975        private static final long serialVersionUID = -489160282L;
976
977    /**
978     * Constructor
979     */
980      public TerminologyCapabilitiesCodeSystemVersionFilterComponent() {
981        super();
982      }
983
984    /**
985     * Constructor
986     */
987      public TerminologyCapabilitiesCodeSystemVersionFilterComponent(CodeType code) {
988        super();
989        this.code = code;
990      }
991
992        /**
993         * @return {@link #code} (Code of the property supported.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
994         */
995        public CodeType getCodeElement() { 
996          if (this.code == null)
997            if (Configuration.errorOnAutoCreate())
998              throw new Error("Attempt to auto-create TerminologyCapabilitiesCodeSystemVersionFilterComponent.code");
999            else if (Configuration.doAutoCreate())
1000              this.code = new CodeType(); // bb
1001          return this.code;
1002        }
1003
1004        public boolean hasCodeElement() { 
1005          return this.code != null && !this.code.isEmpty();
1006        }
1007
1008        public boolean hasCode() { 
1009          return this.code != null && !this.code.isEmpty();
1010        }
1011
1012        /**
1013         * @param value {@link #code} (Code of the property supported.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1014         */
1015        public TerminologyCapabilitiesCodeSystemVersionFilterComponent setCodeElement(CodeType value) { 
1016          this.code = value;
1017          return this;
1018        }
1019
1020        /**
1021         * @return Code of the property supported.
1022         */
1023        public String getCode() { 
1024          return this.code == null ? null : this.code.getValue();
1025        }
1026
1027        /**
1028         * @param value Code of the property supported.
1029         */
1030        public TerminologyCapabilitiesCodeSystemVersionFilterComponent setCode(String value) { 
1031            if (this.code == null)
1032              this.code = new CodeType();
1033            this.code.setValue(value);
1034          return this;
1035        }
1036
1037        /**
1038         * @return {@link #op} (Operations supported for the property.)
1039         */
1040        public List<CodeType> getOp() { 
1041          if (this.op == null)
1042            this.op = new ArrayList<CodeType>();
1043          return this.op;
1044        }
1045
1046        /**
1047         * @return Returns a reference to <code>this</code> for easy method chaining
1048         */
1049        public TerminologyCapabilitiesCodeSystemVersionFilterComponent setOp(List<CodeType> theOp) { 
1050          this.op = theOp;
1051          return this;
1052        }
1053
1054        public boolean hasOp() { 
1055          if (this.op == null)
1056            return false;
1057          for (CodeType item : this.op)
1058            if (!item.isEmpty())
1059              return true;
1060          return false;
1061        }
1062
1063        /**
1064         * @return {@link #op} (Operations supported for the property.)
1065         */
1066        public CodeType addOpElement() {//2 
1067          CodeType t = new CodeType();
1068          if (this.op == null)
1069            this.op = new ArrayList<CodeType>();
1070          this.op.add(t);
1071          return t;
1072        }
1073
1074        /**
1075         * @param value {@link #op} (Operations supported for the property.)
1076         */
1077        public TerminologyCapabilitiesCodeSystemVersionFilterComponent addOp(String value) { //1
1078          CodeType t = new CodeType();
1079          t.setValue(value);
1080          if (this.op == null)
1081            this.op = new ArrayList<CodeType>();
1082          this.op.add(t);
1083          return this;
1084        }
1085
1086        /**
1087         * @param value {@link #op} (Operations supported for the property.)
1088         */
1089        public boolean hasOp(String value) { 
1090          if (this.op == null)
1091            return false;
1092          for (CodeType v : this.op)
1093            if (v.getValue().equals(value)) // code
1094              return true;
1095          return false;
1096        }
1097
1098        protected void listChildren(List<Property> children) {
1099          super.listChildren(children);
1100          children.add(new Property("code", "code", "Code of the property supported.", 0, 1, code));
1101          children.add(new Property("op", "code", "Operations supported for the property.", 0, java.lang.Integer.MAX_VALUE, op));
1102        }
1103
1104        @Override
1105        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1106          switch (_hash) {
1107          case 3059181: /*code*/  return new Property("code", "code", "Code of the property supported.", 0, 1, code);
1108          case 3553: /*op*/  return new Property("op", "code", "Operations supported for the property.", 0, java.lang.Integer.MAX_VALUE, op);
1109          default: return super.getNamedProperty(_hash, _name, _checkValid);
1110          }
1111
1112        }
1113
1114      @Override
1115      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1116        switch (hash) {
1117        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType
1118        case 3553: /*op*/ return this.op == null ? new Base[0] : this.op.toArray(new Base[this.op.size()]); // CodeType
1119        default: return super.getProperty(hash, name, checkValid);
1120        }
1121
1122      }
1123
1124      @Override
1125      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1126        switch (hash) {
1127        case 3059181: // code
1128          this.code = castToCode(value); // CodeType
1129          return value;
1130        case 3553: // op
1131          this.getOp().add(castToCode(value)); // CodeType
1132          return value;
1133        default: return super.setProperty(hash, name, value);
1134        }
1135
1136      }
1137
1138      @Override
1139      public Base setProperty(String name, Base value) throws FHIRException {
1140        if (name.equals("code")) {
1141          this.code = castToCode(value); // CodeType
1142        } else if (name.equals("op")) {
1143          this.getOp().add(castToCode(value));
1144        } else
1145          return super.setProperty(name, value);
1146        return value;
1147      }
1148
1149      @Override
1150      public Base makeProperty(int hash, String name) throws FHIRException {
1151        switch (hash) {
1152        case 3059181:  return getCodeElement();
1153        case 3553:  return addOpElement();
1154        default: return super.makeProperty(hash, name);
1155        }
1156
1157      }
1158
1159      @Override
1160      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1161        switch (hash) {
1162        case 3059181: /*code*/ return new String[] {"code"};
1163        case 3553: /*op*/ return new String[] {"code"};
1164        default: return super.getTypesForProperty(hash, name);
1165        }
1166
1167      }
1168
1169      @Override
1170      public Base addChild(String name) throws FHIRException {
1171        if (name.equals("code")) {
1172          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.code");
1173        }
1174        else if (name.equals("op")) {
1175          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.op");
1176        }
1177        else
1178          return super.addChild(name);
1179      }
1180
1181      public TerminologyCapabilitiesCodeSystemVersionFilterComponent copy() {
1182        TerminologyCapabilitiesCodeSystemVersionFilterComponent dst = new TerminologyCapabilitiesCodeSystemVersionFilterComponent();
1183        copyValues(dst);
1184        dst.code = code == null ? null : code.copy();
1185        if (op != null) {
1186          dst.op = new ArrayList<CodeType>();
1187          for (CodeType i : op)
1188            dst.op.add(i.copy());
1189        };
1190        return dst;
1191      }
1192
1193      @Override
1194      public boolean equalsDeep(Base other_) {
1195        if (!super.equalsDeep(other_))
1196          return false;
1197        if (!(other_ instanceof TerminologyCapabilitiesCodeSystemVersionFilterComponent))
1198          return false;
1199        TerminologyCapabilitiesCodeSystemVersionFilterComponent o = (TerminologyCapabilitiesCodeSystemVersionFilterComponent) other_;
1200        return compareDeep(code, o.code, true) && compareDeep(op, o.op, true);
1201      }
1202
1203      @Override
1204      public boolean equalsShallow(Base other_) {
1205        if (!super.equalsShallow(other_))
1206          return false;
1207        if (!(other_ instanceof TerminologyCapabilitiesCodeSystemVersionFilterComponent))
1208          return false;
1209        TerminologyCapabilitiesCodeSystemVersionFilterComponent o = (TerminologyCapabilitiesCodeSystemVersionFilterComponent) other_;
1210        return compareValues(code, o.code, true) && compareValues(op, o.op, true);
1211      }
1212
1213      public boolean isEmpty() {
1214        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, op);
1215      }
1216
1217  public String fhirType() {
1218    return "TerminologyCapabilities.codeSystem.version.filter";
1219
1220  }
1221
1222  }
1223
1224    @Block()
1225    public static class TerminologyCapabilitiesExpansionComponent extends BackboneElement implements IBaseBackboneElement {
1226        /**
1227         * Whether the server can return nested value sets.
1228         */
1229        @Child(name = "hierarchical", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1230        @Description(shortDefinition="Whether the server can return nested value sets", formalDefinition="Whether the server can return nested value sets." )
1231        protected BooleanType hierarchical;
1232
1233        /**
1234         * Whether the server supports paging on expansion.
1235         */
1236        @Child(name = "paging", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1237        @Description(shortDefinition="Whether the server supports paging on expansion", formalDefinition="Whether the server supports paging on expansion." )
1238        protected BooleanType paging;
1239
1240        /**
1241         * Allow request for incomplete expansions?
1242         */
1243        @Child(name = "incomplete", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1244        @Description(shortDefinition="Allow request for incomplete expansions?", formalDefinition="Allow request for incomplete expansions?" )
1245        protected BooleanType incomplete;
1246
1247        /**
1248         * Supported fields on ExpansionProfile.
1249         */
1250        @Child(name = "definition", type = {CanonicalType.class}, order=4, min=0, max=1, modifier=false, summary=false)
1251        @Description(shortDefinition="Supported fields on ExpansionProfile", formalDefinition="Supported fields on ExpansionProfile." )
1252        protected CanonicalType definition;
1253
1254        /**
1255         * Supported expansion profiles.
1256         */
1257        @Child(name = "profile", type = {CanonicalType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1258        @Description(shortDefinition="Supported expansion profiles", formalDefinition="Supported expansion profiles." )
1259        protected List<CanonicalType> profile;
1260
1261        /**
1262         * Documentation about text searching works.
1263         */
1264        @Child(name = "textFilter", type = {MarkdownType.class}, order=6, min=0, max=1, modifier=false, summary=false)
1265        @Description(shortDefinition="Documentation about text searching works", formalDefinition="Documentation about text searching works." )
1266        protected MarkdownType textFilter;
1267
1268        private static final long serialVersionUID = 1275156533L;
1269
1270    /**
1271     * Constructor
1272     */
1273      public TerminologyCapabilitiesExpansionComponent() {
1274        super();
1275      }
1276
1277        /**
1278         * @return {@link #hierarchical} (Whether the server can return nested value sets.). This is the underlying object with id, value and extensions. The accessor "getHierarchical" gives direct access to the value
1279         */
1280        public BooleanType getHierarchicalElement() { 
1281          if (this.hierarchical == null)
1282            if (Configuration.errorOnAutoCreate())
1283              throw new Error("Attempt to auto-create TerminologyCapabilitiesExpansionComponent.hierarchical");
1284            else if (Configuration.doAutoCreate())
1285              this.hierarchical = new BooleanType(); // bb
1286          return this.hierarchical;
1287        }
1288
1289        public boolean hasHierarchicalElement() { 
1290          return this.hierarchical != null && !this.hierarchical.isEmpty();
1291        }
1292
1293        public boolean hasHierarchical() { 
1294          return this.hierarchical != null && !this.hierarchical.isEmpty();
1295        }
1296
1297        /**
1298         * @param value {@link #hierarchical} (Whether the server can return nested value sets.). This is the underlying object with id, value and extensions. The accessor "getHierarchical" gives direct access to the value
1299         */
1300        public TerminologyCapabilitiesExpansionComponent setHierarchicalElement(BooleanType value) { 
1301          this.hierarchical = value;
1302          return this;
1303        }
1304
1305        /**
1306         * @return Whether the server can return nested value sets.
1307         */
1308        public boolean getHierarchical() { 
1309          return this.hierarchical == null || this.hierarchical.isEmpty() ? false : this.hierarchical.getValue();
1310        }
1311
1312        /**
1313         * @param value Whether the server can return nested value sets.
1314         */
1315        public TerminologyCapabilitiesExpansionComponent setHierarchical(boolean value) { 
1316            if (this.hierarchical == null)
1317              this.hierarchical = new BooleanType();
1318            this.hierarchical.setValue(value);
1319          return this;
1320        }
1321
1322        /**
1323         * @return {@link #paging} (Whether the server supports paging on expansion.). This is the underlying object with id, value and extensions. The accessor "getPaging" gives direct access to the value
1324         */
1325        public BooleanType getPagingElement() { 
1326          if (this.paging == null)
1327            if (Configuration.errorOnAutoCreate())
1328              throw new Error("Attempt to auto-create TerminologyCapabilitiesExpansionComponent.paging");
1329            else if (Configuration.doAutoCreate())
1330              this.paging = new BooleanType(); // bb
1331          return this.paging;
1332        }
1333
1334        public boolean hasPagingElement() { 
1335          return this.paging != null && !this.paging.isEmpty();
1336        }
1337
1338        public boolean hasPaging() { 
1339          return this.paging != null && !this.paging.isEmpty();
1340        }
1341
1342        /**
1343         * @param value {@link #paging} (Whether the server supports paging on expansion.). This is the underlying object with id, value and extensions. The accessor "getPaging" gives direct access to the value
1344         */
1345        public TerminologyCapabilitiesExpansionComponent setPagingElement(BooleanType value) { 
1346          this.paging = value;
1347          return this;
1348        }
1349
1350        /**
1351         * @return Whether the server supports paging on expansion.
1352         */
1353        public boolean getPaging() { 
1354          return this.paging == null || this.paging.isEmpty() ? false : this.paging.getValue();
1355        }
1356
1357        /**
1358         * @param value Whether the server supports paging on expansion.
1359         */
1360        public TerminologyCapabilitiesExpansionComponent setPaging(boolean value) { 
1361            if (this.paging == null)
1362              this.paging = new BooleanType();
1363            this.paging.setValue(value);
1364          return this;
1365        }
1366
1367        /**
1368         * @return {@link #incomplete} (Allow request for incomplete expansions?). This is the underlying object with id, value and extensions. The accessor "getIncomplete" gives direct access to the value
1369         */
1370        public BooleanType getIncompleteElement() { 
1371          if (this.incomplete == null)
1372            if (Configuration.errorOnAutoCreate())
1373              throw new Error("Attempt to auto-create TerminologyCapabilitiesExpansionComponent.incomplete");
1374            else if (Configuration.doAutoCreate())
1375              this.incomplete = new BooleanType(); // bb
1376          return this.incomplete;
1377        }
1378
1379        public boolean hasIncompleteElement() { 
1380          return this.incomplete != null && !this.incomplete.isEmpty();
1381        }
1382
1383        public boolean hasIncomplete() { 
1384          return this.incomplete != null && !this.incomplete.isEmpty();
1385        }
1386
1387        /**
1388         * @param value {@link #incomplete} (Allow request for incomplete expansions?). This is the underlying object with id, value and extensions. The accessor "getIncomplete" gives direct access to the value
1389         */
1390        public TerminologyCapabilitiesExpansionComponent setIncompleteElement(BooleanType value) { 
1391          this.incomplete = value;
1392          return this;
1393        }
1394
1395        /**
1396         * @return Allow request for incomplete expansions?
1397         */
1398        public boolean getIncomplete() { 
1399          return this.incomplete == null || this.incomplete.isEmpty() ? false : this.incomplete.getValue();
1400        }
1401
1402        /**
1403         * @param value Allow request for incomplete expansions?
1404         */
1405        public TerminologyCapabilitiesExpansionComponent setIncomplete(boolean value) { 
1406            if (this.incomplete == null)
1407              this.incomplete = new BooleanType();
1408            this.incomplete.setValue(value);
1409          return this;
1410        }
1411
1412        /**
1413         * @return {@link #definition} (Supported fields on ExpansionProfile.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
1414         */
1415        public CanonicalType getDefinitionElement() { 
1416          if (this.definition == null)
1417            if (Configuration.errorOnAutoCreate())
1418              throw new Error("Attempt to auto-create TerminologyCapabilitiesExpansionComponent.definition");
1419            else if (Configuration.doAutoCreate())
1420              this.definition = new CanonicalType(); // bb
1421          return this.definition;
1422        }
1423
1424        public boolean hasDefinitionElement() { 
1425          return this.definition != null && !this.definition.isEmpty();
1426        }
1427
1428        public boolean hasDefinition() { 
1429          return this.definition != null && !this.definition.isEmpty();
1430        }
1431
1432        /**
1433         * @param value {@link #definition} (Supported fields on ExpansionProfile.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
1434         */
1435        public TerminologyCapabilitiesExpansionComponent setDefinitionElement(CanonicalType value) { 
1436          this.definition = value;
1437          return this;
1438        }
1439
1440        /**
1441         * @return Supported fields on ExpansionProfile.
1442         */
1443        public String getDefinition() { 
1444          return this.definition == null ? null : this.definition.getValue();
1445        }
1446
1447        /**
1448         * @param value Supported fields on ExpansionProfile.
1449         */
1450        public TerminologyCapabilitiesExpansionComponent setDefinition(String value) { 
1451          if (Utilities.noString(value))
1452            this.definition = null;
1453          else {
1454            if (this.definition == null)
1455              this.definition = new CanonicalType();
1456            this.definition.setValue(value);
1457          }
1458          return this;
1459        }
1460
1461        /**
1462         * @return {@link #profile} (Supported expansion profiles.)
1463         */
1464        public List<CanonicalType> getProfile() { 
1465          if (this.profile == null)
1466            this.profile = new ArrayList<CanonicalType>();
1467          return this.profile;
1468        }
1469
1470        /**
1471         * @return Returns a reference to <code>this</code> for easy method chaining
1472         */
1473        public TerminologyCapabilitiesExpansionComponent setProfile(List<CanonicalType> theProfile) { 
1474          this.profile = theProfile;
1475          return this;
1476        }
1477
1478        public boolean hasProfile() { 
1479          if (this.profile == null)
1480            return false;
1481          for (CanonicalType item : this.profile)
1482            if (!item.isEmpty())
1483              return true;
1484          return false;
1485        }
1486
1487        /**
1488         * @return {@link #profile} (Supported expansion profiles.)
1489         */
1490        public CanonicalType addProfileElement() {//2 
1491          CanonicalType t = new CanonicalType();
1492          if (this.profile == null)
1493            this.profile = new ArrayList<CanonicalType>();
1494          this.profile.add(t);
1495          return t;
1496        }
1497
1498        /**
1499         * @param value {@link #profile} (Supported expansion profiles.)
1500         */
1501        public TerminologyCapabilitiesExpansionComponent addProfile(String value) { //1
1502          CanonicalType t = new CanonicalType();
1503          t.setValue(value);
1504          if (this.profile == null)
1505            this.profile = new ArrayList<CanonicalType>();
1506          this.profile.add(t);
1507          return this;
1508        }
1509
1510        /**
1511         * @param value {@link #profile} (Supported expansion profiles.)
1512         */
1513        public boolean hasProfile(String value) { 
1514          if (this.profile == null)
1515            return false;
1516          for (CanonicalType v : this.profile)
1517            if (v.getValue().equals(value)) // canonical(ExpansionProfile)
1518              return true;
1519          return false;
1520        }
1521
1522        /**
1523         * @return {@link #textFilter} (Documentation about text searching works.). This is the underlying object with id, value and extensions. The accessor "getTextFilter" gives direct access to the value
1524         */
1525        public MarkdownType getTextFilterElement() { 
1526          if (this.textFilter == null)
1527            if (Configuration.errorOnAutoCreate())
1528              throw new Error("Attempt to auto-create TerminologyCapabilitiesExpansionComponent.textFilter");
1529            else if (Configuration.doAutoCreate())
1530              this.textFilter = new MarkdownType(); // bb
1531          return this.textFilter;
1532        }
1533
1534        public boolean hasTextFilterElement() { 
1535          return this.textFilter != null && !this.textFilter.isEmpty();
1536        }
1537
1538        public boolean hasTextFilter() { 
1539          return this.textFilter != null && !this.textFilter.isEmpty();
1540        }
1541
1542        /**
1543         * @param value {@link #textFilter} (Documentation about text searching works.). This is the underlying object with id, value and extensions. The accessor "getTextFilter" gives direct access to the value
1544         */
1545        public TerminologyCapabilitiesExpansionComponent setTextFilterElement(MarkdownType value) { 
1546          this.textFilter = value;
1547          return this;
1548        }
1549
1550        /**
1551         * @return Documentation about text searching works.
1552         */
1553        public String getTextFilter() { 
1554          return this.textFilter == null ? null : this.textFilter.getValue();
1555        }
1556
1557        /**
1558         * @param value Documentation about text searching works.
1559         */
1560        public TerminologyCapabilitiesExpansionComponent setTextFilter(String value) { 
1561          if (value == null)
1562            this.textFilter = null;
1563          else {
1564            if (this.textFilter == null)
1565              this.textFilter = new MarkdownType();
1566            this.textFilter.setValue(value);
1567          }
1568          return this;
1569        }
1570
1571        protected void listChildren(List<Property> children) {
1572          super.listChildren(children);
1573          children.add(new Property("hierarchical", "boolean", "Whether the server can return nested value sets.", 0, 1, hierarchical));
1574          children.add(new Property("paging", "boolean", "Whether the server supports paging on expansion.", 0, 1, paging));
1575          children.add(new Property("incomplete", "boolean", "Allow request for incomplete expansions?", 0, 1, incomplete));
1576          children.add(new Property("definition", "canonical(StructureDefinition)", "Supported fields on ExpansionProfile.", 0, 1, definition));
1577          children.add(new Property("profile", "canonical(ExpansionProfile)", "Supported expansion profiles.", 0, java.lang.Integer.MAX_VALUE, profile));
1578          children.add(new Property("textFilter", "markdown", "Documentation about text searching works.", 0, 1, textFilter));
1579        }
1580
1581        @Override
1582        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1583          switch (_hash) {
1584          case 857636745: /*hierarchical*/  return new Property("hierarchical", "boolean", "Whether the server can return nested value sets.", 0, 1, hierarchical);
1585          case -995747956: /*paging*/  return new Property("paging", "boolean", "Whether the server supports paging on expansion.", 0, 1, paging);
1586          case -1010022050: /*incomplete*/  return new Property("incomplete", "boolean", "Allow request for incomplete expansions?", 0, 1, incomplete);
1587          case -1014418093: /*definition*/  return new Property("definition", "canonical(StructureDefinition)", "Supported fields on ExpansionProfile.", 0, 1, definition);
1588          case -309425751: /*profile*/  return new Property("profile", "canonical(ExpansionProfile)", "Supported expansion profiles.", 0, java.lang.Integer.MAX_VALUE, profile);
1589          case 1469359877: /*textFilter*/  return new Property("textFilter", "markdown", "Documentation about text searching works.", 0, 1, textFilter);
1590          default: return super.getNamedProperty(_hash, _name, _checkValid);
1591          }
1592
1593        }
1594
1595      @Override
1596      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1597        switch (hash) {
1598        case 857636745: /*hierarchical*/ return this.hierarchical == null ? new Base[0] : new Base[] {this.hierarchical}; // BooleanType
1599        case -995747956: /*paging*/ return this.paging == null ? new Base[0] : new Base[] {this.paging}; // BooleanType
1600        case -1010022050: /*incomplete*/ return this.incomplete == null ? new Base[0] : new Base[] {this.incomplete}; // BooleanType
1601        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // CanonicalType
1602        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // CanonicalType
1603        case 1469359877: /*textFilter*/ return this.textFilter == null ? new Base[0] : new Base[] {this.textFilter}; // MarkdownType
1604        default: return super.getProperty(hash, name, checkValid);
1605        }
1606
1607      }
1608
1609      @Override
1610      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1611        switch (hash) {
1612        case 857636745: // hierarchical
1613          this.hierarchical = castToBoolean(value); // BooleanType
1614          return value;
1615        case -995747956: // paging
1616          this.paging = castToBoolean(value); // BooleanType
1617          return value;
1618        case -1010022050: // incomplete
1619          this.incomplete = castToBoolean(value); // BooleanType
1620          return value;
1621        case -1014418093: // definition
1622          this.definition = castToCanonical(value); // CanonicalType
1623          return value;
1624        case -309425751: // profile
1625          this.getProfile().add(castToCanonical(value)); // CanonicalType
1626          return value;
1627        case 1469359877: // textFilter
1628          this.textFilter = castToMarkdown(value); // MarkdownType
1629          return value;
1630        default: return super.setProperty(hash, name, value);
1631        }
1632
1633      }
1634
1635      @Override
1636      public Base setProperty(String name, Base value) throws FHIRException {
1637        if (name.equals("hierarchical")) {
1638          this.hierarchical = castToBoolean(value); // BooleanType
1639        } else if (name.equals("paging")) {
1640          this.paging = castToBoolean(value); // BooleanType
1641        } else if (name.equals("incomplete")) {
1642          this.incomplete = castToBoolean(value); // BooleanType
1643        } else if (name.equals("definition")) {
1644          this.definition = castToCanonical(value); // CanonicalType
1645        } else if (name.equals("profile")) {
1646          this.getProfile().add(castToCanonical(value));
1647        } else if (name.equals("textFilter")) {
1648          this.textFilter = castToMarkdown(value); // MarkdownType
1649        } else
1650          return super.setProperty(name, value);
1651        return value;
1652      }
1653
1654      @Override
1655      public Base makeProperty(int hash, String name) throws FHIRException {
1656        switch (hash) {
1657        case 857636745:  return getHierarchicalElement();
1658        case -995747956:  return getPagingElement();
1659        case -1010022050:  return getIncompleteElement();
1660        case -1014418093:  return getDefinitionElement();
1661        case -309425751:  return addProfileElement();
1662        case 1469359877:  return getTextFilterElement();
1663        default: return super.makeProperty(hash, name);
1664        }
1665
1666      }
1667
1668      @Override
1669      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1670        switch (hash) {
1671        case 857636745: /*hierarchical*/ return new String[] {"boolean"};
1672        case -995747956: /*paging*/ return new String[] {"boolean"};
1673        case -1010022050: /*incomplete*/ return new String[] {"boolean"};
1674        case -1014418093: /*definition*/ return new String[] {"canonical"};
1675        case -309425751: /*profile*/ return new String[] {"canonical"};
1676        case 1469359877: /*textFilter*/ return new String[] {"markdown"};
1677        default: return super.getTypesForProperty(hash, name);
1678        }
1679
1680      }
1681
1682      @Override
1683      public Base addChild(String name) throws FHIRException {
1684        if (name.equals("hierarchical")) {
1685          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.hierarchical");
1686        }
1687        else if (name.equals("paging")) {
1688          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.paging");
1689        }
1690        else if (name.equals("incomplete")) {
1691          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.incomplete");
1692        }
1693        else if (name.equals("definition")) {
1694          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.definition");
1695        }
1696        else if (name.equals("profile")) {
1697          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.profile");
1698        }
1699        else if (name.equals("textFilter")) {
1700          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.textFilter");
1701        }
1702        else
1703          return super.addChild(name);
1704      }
1705
1706      public TerminologyCapabilitiesExpansionComponent copy() {
1707        TerminologyCapabilitiesExpansionComponent dst = new TerminologyCapabilitiesExpansionComponent();
1708        copyValues(dst);
1709        dst.hierarchical = hierarchical == null ? null : hierarchical.copy();
1710        dst.paging = paging == null ? null : paging.copy();
1711        dst.incomplete = incomplete == null ? null : incomplete.copy();
1712        dst.definition = definition == null ? null : definition.copy();
1713        if (profile != null) {
1714          dst.profile = new ArrayList<CanonicalType>();
1715          for (CanonicalType i : profile)
1716            dst.profile.add(i.copy());
1717        };
1718        dst.textFilter = textFilter == null ? null : textFilter.copy();
1719        return dst;
1720      }
1721
1722      @Override
1723      public boolean equalsDeep(Base other_) {
1724        if (!super.equalsDeep(other_))
1725          return false;
1726        if (!(other_ instanceof TerminologyCapabilitiesExpansionComponent))
1727          return false;
1728        TerminologyCapabilitiesExpansionComponent o = (TerminologyCapabilitiesExpansionComponent) other_;
1729        return compareDeep(hierarchical, o.hierarchical, true) && compareDeep(paging, o.paging, true) && compareDeep(incomplete, o.incomplete, true)
1730           && compareDeep(definition, o.definition, true) && compareDeep(profile, o.profile, true) && compareDeep(textFilter, o.textFilter, true)
1731          ;
1732      }
1733
1734      @Override
1735      public boolean equalsShallow(Base other_) {
1736        if (!super.equalsShallow(other_))
1737          return false;
1738        if (!(other_ instanceof TerminologyCapabilitiesExpansionComponent))
1739          return false;
1740        TerminologyCapabilitiesExpansionComponent o = (TerminologyCapabilitiesExpansionComponent) other_;
1741        return compareValues(hierarchical, o.hierarchical, true) && compareValues(paging, o.paging, true) && compareValues(incomplete, o.incomplete, true)
1742           && compareValues(textFilter, o.textFilter, true);
1743      }
1744
1745      public boolean isEmpty() {
1746        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(hierarchical, paging, incomplete
1747          , definition, profile, textFilter);
1748      }
1749
1750  public String fhirType() {
1751    return "TerminologyCapabilities.expansion";
1752
1753  }
1754
1755  }
1756
1757    @Block()
1758    public static class TerminologyCapabilitiesValidateCodeComponent extends BackboneElement implements IBaseBackboneElement {
1759        /**
1760         * Whether translations are validated.
1761         */
1762        @Child(name = "translations", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1763        @Description(shortDefinition="Whether translations are validated", formalDefinition="Whether translations are validated." )
1764        protected BooleanType translations;
1765
1766        private static final long serialVersionUID = -1212814906L;
1767
1768    /**
1769     * Constructor
1770     */
1771      public TerminologyCapabilitiesValidateCodeComponent() {
1772        super();
1773      }
1774
1775    /**
1776     * Constructor
1777     */
1778      public TerminologyCapabilitiesValidateCodeComponent(BooleanType translations) {
1779        super();
1780        this.translations = translations;
1781      }
1782
1783        /**
1784         * @return {@link #translations} (Whether translations are validated.). This is the underlying object with id, value and extensions. The accessor "getTranslations" gives direct access to the value
1785         */
1786        public BooleanType getTranslationsElement() { 
1787          if (this.translations == null)
1788            if (Configuration.errorOnAutoCreate())
1789              throw new Error("Attempt to auto-create TerminologyCapabilitiesValidateCodeComponent.translations");
1790            else if (Configuration.doAutoCreate())
1791              this.translations = new BooleanType(); // bb
1792          return this.translations;
1793        }
1794
1795        public boolean hasTranslationsElement() { 
1796          return this.translations != null && !this.translations.isEmpty();
1797        }
1798
1799        public boolean hasTranslations() { 
1800          return this.translations != null && !this.translations.isEmpty();
1801        }
1802
1803        /**
1804         * @param value {@link #translations} (Whether translations are validated.). This is the underlying object with id, value and extensions. The accessor "getTranslations" gives direct access to the value
1805         */
1806        public TerminologyCapabilitiesValidateCodeComponent setTranslationsElement(BooleanType value) { 
1807          this.translations = value;
1808          return this;
1809        }
1810
1811        /**
1812         * @return Whether translations are validated.
1813         */
1814        public boolean getTranslations() { 
1815          return this.translations == null || this.translations.isEmpty() ? false : this.translations.getValue();
1816        }
1817
1818        /**
1819         * @param value Whether translations are validated.
1820         */
1821        public TerminologyCapabilitiesValidateCodeComponent setTranslations(boolean value) { 
1822            if (this.translations == null)
1823              this.translations = new BooleanType();
1824            this.translations.setValue(value);
1825          return this;
1826        }
1827
1828        protected void listChildren(List<Property> children) {
1829          super.listChildren(children);
1830          children.add(new Property("translations", "boolean", "Whether translations are validated.", 0, 1, translations));
1831        }
1832
1833        @Override
1834        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1835          switch (_hash) {
1836          case -1225497630: /*translations*/  return new Property("translations", "boolean", "Whether translations are validated.", 0, 1, translations);
1837          default: return super.getNamedProperty(_hash, _name, _checkValid);
1838          }
1839
1840        }
1841
1842      @Override
1843      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1844        switch (hash) {
1845        case -1225497630: /*translations*/ return this.translations == null ? new Base[0] : new Base[] {this.translations}; // BooleanType
1846        default: return super.getProperty(hash, name, checkValid);
1847        }
1848
1849      }
1850
1851      @Override
1852      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1853        switch (hash) {
1854        case -1225497630: // translations
1855          this.translations = castToBoolean(value); // BooleanType
1856          return value;
1857        default: return super.setProperty(hash, name, value);
1858        }
1859
1860      }
1861
1862      @Override
1863      public Base setProperty(String name, Base value) throws FHIRException {
1864        if (name.equals("translations")) {
1865          this.translations = castToBoolean(value); // BooleanType
1866        } else
1867          return super.setProperty(name, value);
1868        return value;
1869      }
1870
1871      @Override
1872      public Base makeProperty(int hash, String name) throws FHIRException {
1873        switch (hash) {
1874        case -1225497630:  return getTranslationsElement();
1875        default: return super.makeProperty(hash, name);
1876        }
1877
1878      }
1879
1880      @Override
1881      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1882        switch (hash) {
1883        case -1225497630: /*translations*/ return new String[] {"boolean"};
1884        default: return super.getTypesForProperty(hash, name);
1885        }
1886
1887      }
1888
1889      @Override
1890      public Base addChild(String name) throws FHIRException {
1891        if (name.equals("translations")) {
1892          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.translations");
1893        }
1894        else
1895          return super.addChild(name);
1896      }
1897
1898      public TerminologyCapabilitiesValidateCodeComponent copy() {
1899        TerminologyCapabilitiesValidateCodeComponent dst = new TerminologyCapabilitiesValidateCodeComponent();
1900        copyValues(dst);
1901        dst.translations = translations == null ? null : translations.copy();
1902        return dst;
1903      }
1904
1905      @Override
1906      public boolean equalsDeep(Base other_) {
1907        if (!super.equalsDeep(other_))
1908          return false;
1909        if (!(other_ instanceof TerminologyCapabilitiesValidateCodeComponent))
1910          return false;
1911        TerminologyCapabilitiesValidateCodeComponent o = (TerminologyCapabilitiesValidateCodeComponent) other_;
1912        return compareDeep(translations, o.translations, true);
1913      }
1914
1915      @Override
1916      public boolean equalsShallow(Base other_) {
1917        if (!super.equalsShallow(other_))
1918          return false;
1919        if (!(other_ instanceof TerminologyCapabilitiesValidateCodeComponent))
1920          return false;
1921        TerminologyCapabilitiesValidateCodeComponent o = (TerminologyCapabilitiesValidateCodeComponent) other_;
1922        return compareValues(translations, o.translations, true);
1923      }
1924
1925      public boolean isEmpty() {
1926        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(translations);
1927      }
1928
1929  public String fhirType() {
1930    return "TerminologyCapabilities.validateCode";
1931
1932  }
1933
1934  }
1935
1936    @Block()
1937    public static class TerminologyCapabilitiesTranslationComponent extends BackboneElement implements IBaseBackboneElement {
1938        /**
1939         * Whether the client must identify the map.
1940         */
1941        @Child(name = "needsMap", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1942        @Description(shortDefinition="Whether the client must identify the map", formalDefinition="Whether the client must identify the map." )
1943        protected BooleanType needsMap;
1944
1945        private static final long serialVersionUID = -1727843575L;
1946
1947    /**
1948     * Constructor
1949     */
1950      public TerminologyCapabilitiesTranslationComponent() {
1951        super();
1952      }
1953
1954    /**
1955     * Constructor
1956     */
1957      public TerminologyCapabilitiesTranslationComponent(BooleanType needsMap) {
1958        super();
1959        this.needsMap = needsMap;
1960      }
1961
1962        /**
1963         * @return {@link #needsMap} (Whether the client must identify the map.). This is the underlying object with id, value and extensions. The accessor "getNeedsMap" gives direct access to the value
1964         */
1965        public BooleanType getNeedsMapElement() { 
1966          if (this.needsMap == null)
1967            if (Configuration.errorOnAutoCreate())
1968              throw new Error("Attempt to auto-create TerminologyCapabilitiesTranslationComponent.needsMap");
1969            else if (Configuration.doAutoCreate())
1970              this.needsMap = new BooleanType(); // bb
1971          return this.needsMap;
1972        }
1973
1974        public boolean hasNeedsMapElement() { 
1975          return this.needsMap != null && !this.needsMap.isEmpty();
1976        }
1977
1978        public boolean hasNeedsMap() { 
1979          return this.needsMap != null && !this.needsMap.isEmpty();
1980        }
1981
1982        /**
1983         * @param value {@link #needsMap} (Whether the client must identify the map.). This is the underlying object with id, value and extensions. The accessor "getNeedsMap" gives direct access to the value
1984         */
1985        public TerminologyCapabilitiesTranslationComponent setNeedsMapElement(BooleanType value) { 
1986          this.needsMap = value;
1987          return this;
1988        }
1989
1990        /**
1991         * @return Whether the client must identify the map.
1992         */
1993        public boolean getNeedsMap() { 
1994          return this.needsMap == null || this.needsMap.isEmpty() ? false : this.needsMap.getValue();
1995        }
1996
1997        /**
1998         * @param value Whether the client must identify the map.
1999         */
2000        public TerminologyCapabilitiesTranslationComponent setNeedsMap(boolean value) { 
2001            if (this.needsMap == null)
2002              this.needsMap = new BooleanType();
2003            this.needsMap.setValue(value);
2004          return this;
2005        }
2006
2007        protected void listChildren(List<Property> children) {
2008          super.listChildren(children);
2009          children.add(new Property("needsMap", "boolean", "Whether the client must identify the map.", 0, 1, needsMap));
2010        }
2011
2012        @Override
2013        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2014          switch (_hash) {
2015          case 866566527: /*needsMap*/  return new Property("needsMap", "boolean", "Whether the client must identify the map.", 0, 1, needsMap);
2016          default: return super.getNamedProperty(_hash, _name, _checkValid);
2017          }
2018
2019        }
2020
2021      @Override
2022      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2023        switch (hash) {
2024        case 866566527: /*needsMap*/ return this.needsMap == null ? new Base[0] : new Base[] {this.needsMap}; // BooleanType
2025        default: return super.getProperty(hash, name, checkValid);
2026        }
2027
2028      }
2029
2030      @Override
2031      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2032        switch (hash) {
2033        case 866566527: // needsMap
2034          this.needsMap = castToBoolean(value); // BooleanType
2035          return value;
2036        default: return super.setProperty(hash, name, value);
2037        }
2038
2039      }
2040
2041      @Override
2042      public Base setProperty(String name, Base value) throws FHIRException {
2043        if (name.equals("needsMap")) {
2044          this.needsMap = castToBoolean(value); // BooleanType
2045        } else
2046          return super.setProperty(name, value);
2047        return value;
2048      }
2049
2050      @Override
2051      public Base makeProperty(int hash, String name) throws FHIRException {
2052        switch (hash) {
2053        case 866566527:  return getNeedsMapElement();
2054        default: return super.makeProperty(hash, name);
2055        }
2056
2057      }
2058
2059      @Override
2060      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2061        switch (hash) {
2062        case 866566527: /*needsMap*/ return new String[] {"boolean"};
2063        default: return super.getTypesForProperty(hash, name);
2064        }
2065
2066      }
2067
2068      @Override
2069      public Base addChild(String name) throws FHIRException {
2070        if (name.equals("needsMap")) {
2071          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.needsMap");
2072        }
2073        else
2074          return super.addChild(name);
2075      }
2076
2077      public TerminologyCapabilitiesTranslationComponent copy() {
2078        TerminologyCapabilitiesTranslationComponent dst = new TerminologyCapabilitiesTranslationComponent();
2079        copyValues(dst);
2080        dst.needsMap = needsMap == null ? null : needsMap.copy();
2081        return dst;
2082      }
2083
2084      @Override
2085      public boolean equalsDeep(Base other_) {
2086        if (!super.equalsDeep(other_))
2087          return false;
2088        if (!(other_ instanceof TerminologyCapabilitiesTranslationComponent))
2089          return false;
2090        TerminologyCapabilitiesTranslationComponent o = (TerminologyCapabilitiesTranslationComponent) other_;
2091        return compareDeep(needsMap, o.needsMap, true);
2092      }
2093
2094      @Override
2095      public boolean equalsShallow(Base other_) {
2096        if (!super.equalsShallow(other_))
2097          return false;
2098        if (!(other_ instanceof TerminologyCapabilitiesTranslationComponent))
2099          return false;
2100        TerminologyCapabilitiesTranslationComponent o = (TerminologyCapabilitiesTranslationComponent) other_;
2101        return compareValues(needsMap, o.needsMap, true);
2102      }
2103
2104      public boolean isEmpty() {
2105        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(needsMap);
2106      }
2107
2108  public String fhirType() {
2109    return "TerminologyCapabilities.translation";
2110
2111  }
2112
2113  }
2114
2115    @Block()
2116    public static class TerminologyCapabilitiesClosureComponent extends BackboneElement implements IBaseBackboneElement {
2117        /**
2118         * If cross-system closure is supported.
2119         */
2120        @Child(name = "translation", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2121        @Description(shortDefinition="If cross-system closure is supported", formalDefinition="If cross-system closure is supported." )
2122        protected BooleanType translation;
2123
2124        private static final long serialVersionUID = 1900484343L;
2125
2126    /**
2127     * Constructor
2128     */
2129      public TerminologyCapabilitiesClosureComponent() {
2130        super();
2131      }
2132
2133        /**
2134         * @return {@link #translation} (If cross-system closure is supported.). This is the underlying object with id, value and extensions. The accessor "getTranslation" gives direct access to the value
2135         */
2136        public BooleanType getTranslationElement() { 
2137          if (this.translation == null)
2138            if (Configuration.errorOnAutoCreate())
2139              throw new Error("Attempt to auto-create TerminologyCapabilitiesClosureComponent.translation");
2140            else if (Configuration.doAutoCreate())
2141              this.translation = new BooleanType(); // bb
2142          return this.translation;
2143        }
2144
2145        public boolean hasTranslationElement() { 
2146          return this.translation != null && !this.translation.isEmpty();
2147        }
2148
2149        public boolean hasTranslation() { 
2150          return this.translation != null && !this.translation.isEmpty();
2151        }
2152
2153        /**
2154         * @param value {@link #translation} (If cross-system closure is supported.). This is the underlying object with id, value and extensions. The accessor "getTranslation" gives direct access to the value
2155         */
2156        public TerminologyCapabilitiesClosureComponent setTranslationElement(BooleanType value) { 
2157          this.translation = value;
2158          return this;
2159        }
2160
2161        /**
2162         * @return If cross-system closure is supported.
2163         */
2164        public boolean getTranslation() { 
2165          return this.translation == null || this.translation.isEmpty() ? false : this.translation.getValue();
2166        }
2167
2168        /**
2169         * @param value If cross-system closure is supported.
2170         */
2171        public TerminologyCapabilitiesClosureComponent setTranslation(boolean value) { 
2172            if (this.translation == null)
2173              this.translation = new BooleanType();
2174            this.translation.setValue(value);
2175          return this;
2176        }
2177
2178        protected void listChildren(List<Property> children) {
2179          super.listChildren(children);
2180          children.add(new Property("translation", "boolean", "If cross-system closure is supported.", 0, 1, translation));
2181        }
2182
2183        @Override
2184        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2185          switch (_hash) {
2186          case -1840647503: /*translation*/  return new Property("translation", "boolean", "If cross-system closure is supported.", 0, 1, translation);
2187          default: return super.getNamedProperty(_hash, _name, _checkValid);
2188          }
2189
2190        }
2191
2192      @Override
2193      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2194        switch (hash) {
2195        case -1840647503: /*translation*/ return this.translation == null ? new Base[0] : new Base[] {this.translation}; // BooleanType
2196        default: return super.getProperty(hash, name, checkValid);
2197        }
2198
2199      }
2200
2201      @Override
2202      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2203        switch (hash) {
2204        case -1840647503: // translation
2205          this.translation = castToBoolean(value); // BooleanType
2206          return value;
2207        default: return super.setProperty(hash, name, value);
2208        }
2209
2210      }
2211
2212      @Override
2213      public Base setProperty(String name, Base value) throws FHIRException {
2214        if (name.equals("translation")) {
2215          this.translation = castToBoolean(value); // BooleanType
2216        } else
2217          return super.setProperty(name, value);
2218        return value;
2219      }
2220
2221      @Override
2222      public Base makeProperty(int hash, String name) throws FHIRException {
2223        switch (hash) {
2224        case -1840647503:  return getTranslationElement();
2225        default: return super.makeProperty(hash, name);
2226        }
2227
2228      }
2229
2230      @Override
2231      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2232        switch (hash) {
2233        case -1840647503: /*translation*/ return new String[] {"boolean"};
2234        default: return super.getTypesForProperty(hash, name);
2235        }
2236
2237      }
2238
2239      @Override
2240      public Base addChild(String name) throws FHIRException {
2241        if (name.equals("translation")) {
2242          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.translation");
2243        }
2244        else
2245          return super.addChild(name);
2246      }
2247
2248      public TerminologyCapabilitiesClosureComponent copy() {
2249        TerminologyCapabilitiesClosureComponent dst = new TerminologyCapabilitiesClosureComponent();
2250        copyValues(dst);
2251        dst.translation = translation == null ? null : translation.copy();
2252        return dst;
2253      }
2254
2255      @Override
2256      public boolean equalsDeep(Base other_) {
2257        if (!super.equalsDeep(other_))
2258          return false;
2259        if (!(other_ instanceof TerminologyCapabilitiesClosureComponent))
2260          return false;
2261        TerminologyCapabilitiesClosureComponent o = (TerminologyCapabilitiesClosureComponent) other_;
2262        return compareDeep(translation, o.translation, true);
2263      }
2264
2265      @Override
2266      public boolean equalsShallow(Base other_) {
2267        if (!super.equalsShallow(other_))
2268          return false;
2269        if (!(other_ instanceof TerminologyCapabilitiesClosureComponent))
2270          return false;
2271        TerminologyCapabilitiesClosureComponent o = (TerminologyCapabilitiesClosureComponent) other_;
2272        return compareValues(translation, o.translation, true);
2273      }
2274
2275      public boolean isEmpty() {
2276        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(translation);
2277      }
2278
2279  public String fhirType() {
2280    return "TerminologyCapabilities.closure";
2281
2282  }
2283
2284  }
2285
2286    /**
2287     * Explanation of why this terminology capabilities is needed and why it has been designed as it has.
2288     */
2289    @Child(name = "purpose", type = {MarkdownType.class}, order=0, min=0, max=1, modifier=false, summary=false)
2290    @Description(shortDefinition="Why this terminology capabilities is defined", formalDefinition="Explanation of why this terminology capabilities is needed and why it has been designed as it has." )
2291    protected MarkdownType purpose;
2292
2293    /**
2294     * A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities.
2295     */
2296    @Child(name = "copyright", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=true)
2297    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities." )
2298    protected MarkdownType copyright;
2299
2300    /**
2301     * Whether the server supports lockedDate.
2302     */
2303    @Child(name = "lockedDate", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2304    @Description(shortDefinition="Whether lockedDate is supported", formalDefinition="Whether the server supports lockedDate." )
2305    protected BooleanType lockedDate;
2306
2307    /**
2308     * Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource.
2309     */
2310    @Child(name = "codeSystem", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2311    @Description(shortDefinition="A code system supported by the server", formalDefinition="Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource." )
2312    protected List<TerminologyCapabilitiesCodeSystemComponent> codeSystem;
2313
2314    /**
2315     * Information about the $expansion operation.
2316     */
2317    @Child(name = "expansion", type = {}, order=4, min=0, max=1, modifier=false, summary=false)
2318    @Description(shortDefinition="Information about the $expansion operation", formalDefinition="Information about the $expansion operation." )
2319    protected TerminologyCapabilitiesExpansionComponent expansion;
2320
2321    /**
2322     * The degree to which the server supports the code search parameter on ValueSet, if it is supported.
2323     */
2324    @Child(name = "codeSearch", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2325    @Description(shortDefinition="explicit | all", formalDefinition="The degree to which the server supports the code search parameter on ValueSet, if it is supported." )
2326    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/code-search-support")
2327    protected Enumeration<CodeSearchSupport> codeSearch;
2328
2329    /**
2330     * Information about the $validation operation.
2331     */
2332    @Child(name = "validateCode", type = {}, order=6, min=0, max=1, modifier=false, summary=false)
2333    @Description(shortDefinition="Information about the $validation operation", formalDefinition="Information about the $validation operation." )
2334    protected TerminologyCapabilitiesValidateCodeComponent validateCode;
2335
2336    /**
2337     * Information about the $translation operation.
2338     */
2339    @Child(name = "translation", type = {}, order=7, min=0, max=1, modifier=false, summary=false)
2340    @Description(shortDefinition="Information about the $translation operation", formalDefinition="Information about the $translation operation." )
2341    protected TerminologyCapabilitiesTranslationComponent translation;
2342
2343    /**
2344     * Whether the $closure operation is supported.
2345     */
2346    @Child(name = "closure", type = {}, order=8, min=0, max=1, modifier=false, summary=false)
2347    @Description(shortDefinition="Information about the $closure operation", formalDefinition="Whether the $closure operation is supported." )
2348    protected TerminologyCapabilitiesClosureComponent closure;
2349
2350    private static final long serialVersionUID = 2013682721L;
2351
2352  /**
2353   * Constructor
2354   */
2355    public TerminologyCapabilities() {
2356      super();
2357    }
2358
2359  /**
2360   * Constructor
2361   */
2362    public TerminologyCapabilities(Enumeration<PublicationStatus> status, DateTimeType date) {
2363      super();
2364      this.status = status;
2365      this.date = date;
2366    }
2367
2368    /**
2369     * @return {@link #url} (An absolute URI that is used to identify this terminology capabilities when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this terminology capabilities is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2370     */
2371    public UriType getUrlElement() { 
2372      if (this.url == null)
2373        if (Configuration.errorOnAutoCreate())
2374          throw new Error("Attempt to auto-create TerminologyCapabilities.url");
2375        else if (Configuration.doAutoCreate())
2376          this.url = new UriType(); // bb
2377      return this.url;
2378    }
2379
2380    public boolean hasUrlElement() { 
2381      return this.url != null && !this.url.isEmpty();
2382    }
2383
2384    public boolean hasUrl() { 
2385      return this.url != null && !this.url.isEmpty();
2386    }
2387
2388    /**
2389     * @param value {@link #url} (An absolute URI that is used to identify this terminology capabilities when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this terminology capabilities is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2390     */
2391    public TerminologyCapabilities setUrlElement(UriType value) { 
2392      this.url = value;
2393      return this;
2394    }
2395
2396    /**
2397     * @return An absolute URI that is used to identify this terminology capabilities when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this terminology capabilities is (or will be) published.
2398     */
2399    public String getUrl() { 
2400      return this.url == null ? null : this.url.getValue();
2401    }
2402
2403    /**
2404     * @param value An absolute URI that is used to identify this terminology capabilities when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this terminology capabilities is (or will be) published.
2405     */
2406    public TerminologyCapabilities setUrl(String value) { 
2407      if (Utilities.noString(value))
2408        this.url = null;
2409      else {
2410        if (this.url == null)
2411          this.url = new UriType();
2412        this.url.setValue(value);
2413      }
2414      return this;
2415    }
2416
2417    /**
2418     * @return {@link #version} (The identifier that is used to identify this version of the terminology capabilities when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the terminology capabilities author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2419     */
2420    public StringType getVersionElement() { 
2421      if (this.version == null)
2422        if (Configuration.errorOnAutoCreate())
2423          throw new Error("Attempt to auto-create TerminologyCapabilities.version");
2424        else if (Configuration.doAutoCreate())
2425          this.version = new StringType(); // bb
2426      return this.version;
2427    }
2428
2429    public boolean hasVersionElement() { 
2430      return this.version != null && !this.version.isEmpty();
2431    }
2432
2433    public boolean hasVersion() { 
2434      return this.version != null && !this.version.isEmpty();
2435    }
2436
2437    /**
2438     * @param value {@link #version} (The identifier that is used to identify this version of the terminology capabilities when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the terminology capabilities author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2439     */
2440    public TerminologyCapabilities setVersionElement(StringType value) { 
2441      this.version = value;
2442      return this;
2443    }
2444
2445    /**
2446     * @return The identifier that is used to identify this version of the terminology capabilities when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the terminology capabilities author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
2447     */
2448    public String getVersion() { 
2449      return this.version == null ? null : this.version.getValue();
2450    }
2451
2452    /**
2453     * @param value The identifier that is used to identify this version of the terminology capabilities when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the terminology capabilities author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
2454     */
2455    public TerminologyCapabilities setVersion(String value) { 
2456      if (Utilities.noString(value))
2457        this.version = null;
2458      else {
2459        if (this.version == null)
2460          this.version = new StringType();
2461        this.version.setValue(value);
2462      }
2463      return this;
2464    }
2465
2466    /**
2467     * @return {@link #name} (A natural language name identifying the terminology capabilities. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2468     */
2469    public StringType getNameElement() { 
2470      if (this.name == null)
2471        if (Configuration.errorOnAutoCreate())
2472          throw new Error("Attempt to auto-create TerminologyCapabilities.name");
2473        else if (Configuration.doAutoCreate())
2474          this.name = new StringType(); // bb
2475      return this.name;
2476    }
2477
2478    public boolean hasNameElement() { 
2479      return this.name != null && !this.name.isEmpty();
2480    }
2481
2482    public boolean hasName() { 
2483      return this.name != null && !this.name.isEmpty();
2484    }
2485
2486    /**
2487     * @param value {@link #name} (A natural language name identifying the terminology capabilities. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2488     */
2489    public TerminologyCapabilities setNameElement(StringType value) { 
2490      this.name = value;
2491      return this;
2492    }
2493
2494    /**
2495     * @return A natural language name identifying the terminology capabilities. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2496     */
2497    public String getName() { 
2498      return this.name == null ? null : this.name.getValue();
2499    }
2500
2501    /**
2502     * @param value A natural language name identifying the terminology capabilities. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2503     */
2504    public TerminologyCapabilities setName(String value) { 
2505      if (Utilities.noString(value))
2506        this.name = null;
2507      else {
2508        if (this.name == null)
2509          this.name = new StringType();
2510        this.name.setValue(value);
2511      }
2512      return this;
2513    }
2514
2515    /**
2516     * @return {@link #title} (A short, descriptive, user-friendly title for the terminology capabilities.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2517     */
2518    public StringType getTitleElement() { 
2519      if (this.title == null)
2520        if (Configuration.errorOnAutoCreate())
2521          throw new Error("Attempt to auto-create TerminologyCapabilities.title");
2522        else if (Configuration.doAutoCreate())
2523          this.title = new StringType(); // bb
2524      return this.title;
2525    }
2526
2527    public boolean hasTitleElement() { 
2528      return this.title != null && !this.title.isEmpty();
2529    }
2530
2531    public boolean hasTitle() { 
2532      return this.title != null && !this.title.isEmpty();
2533    }
2534
2535    /**
2536     * @param value {@link #title} (A short, descriptive, user-friendly title for the terminology capabilities.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2537     */
2538    public TerminologyCapabilities setTitleElement(StringType value) { 
2539      this.title = value;
2540      return this;
2541    }
2542
2543    /**
2544     * @return A short, descriptive, user-friendly title for the terminology capabilities.
2545     */
2546    public String getTitle() { 
2547      return this.title == null ? null : this.title.getValue();
2548    }
2549
2550    /**
2551     * @param value A short, descriptive, user-friendly title for the terminology capabilities.
2552     */
2553    public TerminologyCapabilities setTitle(String value) { 
2554      if (Utilities.noString(value))
2555        this.title = null;
2556      else {
2557        if (this.title == null)
2558          this.title = new StringType();
2559        this.title.setValue(value);
2560      }
2561      return this;
2562    }
2563
2564    /**
2565     * @return {@link #status} (The status of this terminology capabilities. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2566     */
2567    public Enumeration<PublicationStatus> getStatusElement() { 
2568      if (this.status == null)
2569        if (Configuration.errorOnAutoCreate())
2570          throw new Error("Attempt to auto-create TerminologyCapabilities.status");
2571        else if (Configuration.doAutoCreate())
2572          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
2573      return this.status;
2574    }
2575
2576    public boolean hasStatusElement() { 
2577      return this.status != null && !this.status.isEmpty();
2578    }
2579
2580    public boolean hasStatus() { 
2581      return this.status != null && !this.status.isEmpty();
2582    }
2583
2584    /**
2585     * @param value {@link #status} (The status of this terminology capabilities. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2586     */
2587    public TerminologyCapabilities setStatusElement(Enumeration<PublicationStatus> value) { 
2588      this.status = value;
2589      return this;
2590    }
2591
2592    /**
2593     * @return The status of this terminology capabilities. Enables tracking the life-cycle of the content.
2594     */
2595    public PublicationStatus getStatus() { 
2596      return this.status == null ? null : this.status.getValue();
2597    }
2598
2599    /**
2600     * @param value The status of this terminology capabilities. Enables tracking the life-cycle of the content.
2601     */
2602    public TerminologyCapabilities setStatus(PublicationStatus value) { 
2603        if (this.status == null)
2604          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
2605        this.status.setValue(value);
2606      return this;
2607    }
2608
2609    /**
2610     * @return {@link #experimental} (A Boolean value to indicate that this terminology capabilities is 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
2611     */
2612    public BooleanType getExperimentalElement() { 
2613      if (this.experimental == null)
2614        if (Configuration.errorOnAutoCreate())
2615          throw new Error("Attempt to auto-create TerminologyCapabilities.experimental");
2616        else if (Configuration.doAutoCreate())
2617          this.experimental = new BooleanType(); // bb
2618      return this.experimental;
2619    }
2620
2621    public boolean hasExperimentalElement() { 
2622      return this.experimental != null && !this.experimental.isEmpty();
2623    }
2624
2625    public boolean hasExperimental() { 
2626      return this.experimental != null && !this.experimental.isEmpty();
2627    }
2628
2629    /**
2630     * @param value {@link #experimental} (A Boolean value to indicate that this terminology capabilities is 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
2631     */
2632    public TerminologyCapabilities setExperimentalElement(BooleanType value) { 
2633      this.experimental = value;
2634      return this;
2635    }
2636
2637    /**
2638     * @return A Boolean value to indicate that this terminology capabilities is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
2639     */
2640    public boolean getExperimental() { 
2641      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
2642    }
2643
2644    /**
2645     * @param value A Boolean value to indicate that this terminology capabilities is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
2646     */
2647    public TerminologyCapabilities setExperimental(boolean value) { 
2648        if (this.experimental == null)
2649          this.experimental = new BooleanType();
2650        this.experimental.setValue(value);
2651      return this;
2652    }
2653
2654    /**
2655     * @return {@link #date} (The date  (and optionally time) when the terminology capabilities was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the terminology capabilities changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2656     */
2657    public DateTimeType getDateElement() { 
2658      if (this.date == null)
2659        if (Configuration.errorOnAutoCreate())
2660          throw new Error("Attempt to auto-create TerminologyCapabilities.date");
2661        else if (Configuration.doAutoCreate())
2662          this.date = new DateTimeType(); // bb
2663      return this.date;
2664    }
2665
2666    public boolean hasDateElement() { 
2667      return this.date != null && !this.date.isEmpty();
2668    }
2669
2670    public boolean hasDate() { 
2671      return this.date != null && !this.date.isEmpty();
2672    }
2673
2674    /**
2675     * @param value {@link #date} (The date  (and optionally time) when the terminology capabilities was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the terminology capabilities changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2676     */
2677    public TerminologyCapabilities setDateElement(DateTimeType value) { 
2678      this.date = value;
2679      return this;
2680    }
2681
2682    /**
2683     * @return The date  (and optionally time) when the terminology capabilities was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the terminology capabilities changes.
2684     */
2685    public Date getDate() { 
2686      return this.date == null ? null : this.date.getValue();
2687    }
2688
2689    /**
2690     * @param value The date  (and optionally time) when the terminology capabilities was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the terminology capabilities changes.
2691     */
2692    public TerminologyCapabilities setDate(Date value) { 
2693        if (this.date == null)
2694          this.date = new DateTimeType();
2695        this.date.setValue(value);
2696      return this;
2697    }
2698
2699    /**
2700     * @return {@link #publisher} (The name of the organization or individual that published the terminology capabilities.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2701     */
2702    public StringType getPublisherElement() { 
2703      if (this.publisher == null)
2704        if (Configuration.errorOnAutoCreate())
2705          throw new Error("Attempt to auto-create TerminologyCapabilities.publisher");
2706        else if (Configuration.doAutoCreate())
2707          this.publisher = new StringType(); // bb
2708      return this.publisher;
2709    }
2710
2711    public boolean hasPublisherElement() { 
2712      return this.publisher != null && !this.publisher.isEmpty();
2713    }
2714
2715    public boolean hasPublisher() { 
2716      return this.publisher != null && !this.publisher.isEmpty();
2717    }
2718
2719    /**
2720     * @param value {@link #publisher} (The name of the organization or individual that published the terminology capabilities.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2721     */
2722    public TerminologyCapabilities setPublisherElement(StringType value) { 
2723      this.publisher = value;
2724      return this;
2725    }
2726
2727    /**
2728     * @return The name of the organization or individual that published the terminology capabilities.
2729     */
2730    public String getPublisher() { 
2731      return this.publisher == null ? null : this.publisher.getValue();
2732    }
2733
2734    /**
2735     * @param value The name of the organization or individual that published the terminology capabilities.
2736     */
2737    public TerminologyCapabilities setPublisher(String value) { 
2738      if (Utilities.noString(value))
2739        this.publisher = null;
2740      else {
2741        if (this.publisher == null)
2742          this.publisher = new StringType();
2743        this.publisher.setValue(value);
2744      }
2745      return this;
2746    }
2747
2748    /**
2749     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
2750     */
2751    public List<ContactDetail> getContact() { 
2752      if (this.contact == null)
2753        this.contact = new ArrayList<ContactDetail>();
2754      return this.contact;
2755    }
2756
2757    /**
2758     * @return Returns a reference to <code>this</code> for easy method chaining
2759     */
2760    public TerminologyCapabilities setContact(List<ContactDetail> theContact) { 
2761      this.contact = theContact;
2762      return this;
2763    }
2764
2765    public boolean hasContact() { 
2766      if (this.contact == null)
2767        return false;
2768      for (ContactDetail item : this.contact)
2769        if (!item.isEmpty())
2770          return true;
2771      return false;
2772    }
2773
2774    public ContactDetail addContact() { //3
2775      ContactDetail t = new ContactDetail();
2776      if (this.contact == null)
2777        this.contact = new ArrayList<ContactDetail>();
2778      this.contact.add(t);
2779      return t;
2780    }
2781
2782    public TerminologyCapabilities addContact(ContactDetail t) { //3
2783      if (t == null)
2784        return this;
2785      if (this.contact == null)
2786        this.contact = new ArrayList<ContactDetail>();
2787      this.contact.add(t);
2788      return this;
2789    }
2790
2791    /**
2792     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
2793     */
2794    public ContactDetail getContactFirstRep() { 
2795      if (getContact().isEmpty()) {
2796        addContact();
2797      }
2798      return getContact().get(0);
2799    }
2800
2801    /**
2802     * @return {@link #description} (A free text natural language description of the terminology capabilities from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2803     */
2804    public MarkdownType getDescriptionElement() { 
2805      if (this.description == null)
2806        if (Configuration.errorOnAutoCreate())
2807          throw new Error("Attempt to auto-create TerminologyCapabilities.description");
2808        else if (Configuration.doAutoCreate())
2809          this.description = new MarkdownType(); // bb
2810      return this.description;
2811    }
2812
2813    public boolean hasDescriptionElement() { 
2814      return this.description != null && !this.description.isEmpty();
2815    }
2816
2817    public boolean hasDescription() { 
2818      return this.description != null && !this.description.isEmpty();
2819    }
2820
2821    /**
2822     * @param value {@link #description} (A free text natural language description of the terminology capabilities from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2823     */
2824    public TerminologyCapabilities setDescriptionElement(MarkdownType value) { 
2825      this.description = value;
2826      return this;
2827    }
2828
2829    /**
2830     * @return A free text natural language description of the terminology capabilities from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.
2831     */
2832    public String getDescription() { 
2833      return this.description == null ? null : this.description.getValue();
2834    }
2835
2836    /**
2837     * @param value A free text natural language description of the terminology capabilities from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.
2838     */
2839    public TerminologyCapabilities setDescription(String value) { 
2840      if (value == null)
2841        this.description = null;
2842      else {
2843        if (this.description == null)
2844          this.description = new MarkdownType();
2845        this.description.setValue(value);
2846      }
2847      return this;
2848    }
2849
2850    /**
2851     * @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 for appropriate terminology capabilities instances.)
2852     */
2853    public List<UsageContext> getUseContext() { 
2854      if (this.useContext == null)
2855        this.useContext = new ArrayList<UsageContext>();
2856      return this.useContext;
2857    }
2858
2859    /**
2860     * @return Returns a reference to <code>this</code> for easy method chaining
2861     */
2862    public TerminologyCapabilities setUseContext(List<UsageContext> theUseContext) { 
2863      this.useContext = theUseContext;
2864      return this;
2865    }
2866
2867    public boolean hasUseContext() { 
2868      if (this.useContext == null)
2869        return false;
2870      for (UsageContext item : this.useContext)
2871        if (!item.isEmpty())
2872          return true;
2873      return false;
2874    }
2875
2876    public UsageContext addUseContext() { //3
2877      UsageContext t = new UsageContext();
2878      if (this.useContext == null)
2879        this.useContext = new ArrayList<UsageContext>();
2880      this.useContext.add(t);
2881      return t;
2882    }
2883
2884    public TerminologyCapabilities addUseContext(UsageContext t) { //3
2885      if (t == null)
2886        return this;
2887      if (this.useContext == null)
2888        this.useContext = new ArrayList<UsageContext>();
2889      this.useContext.add(t);
2890      return this;
2891    }
2892
2893    /**
2894     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
2895     */
2896    public UsageContext getUseContextFirstRep() { 
2897      if (getUseContext().isEmpty()) {
2898        addUseContext();
2899      }
2900      return getUseContext().get(0);
2901    }
2902
2903    /**
2904     * @return {@link #jurisdiction} (A legal or geographic region in which the terminology capabilities is intended to be used.)
2905     */
2906    public List<CodeableConcept> getJurisdiction() { 
2907      if (this.jurisdiction == null)
2908        this.jurisdiction = new ArrayList<CodeableConcept>();
2909      return this.jurisdiction;
2910    }
2911
2912    /**
2913     * @return Returns a reference to <code>this</code> for easy method chaining
2914     */
2915    public TerminologyCapabilities setJurisdiction(List<CodeableConcept> theJurisdiction) { 
2916      this.jurisdiction = theJurisdiction;
2917      return this;
2918    }
2919
2920    public boolean hasJurisdiction() { 
2921      if (this.jurisdiction == null)
2922        return false;
2923      for (CodeableConcept item : this.jurisdiction)
2924        if (!item.isEmpty())
2925          return true;
2926      return false;
2927    }
2928
2929    public CodeableConcept addJurisdiction() { //3
2930      CodeableConcept t = new CodeableConcept();
2931      if (this.jurisdiction == null)
2932        this.jurisdiction = new ArrayList<CodeableConcept>();
2933      this.jurisdiction.add(t);
2934      return t;
2935    }
2936
2937    public TerminologyCapabilities addJurisdiction(CodeableConcept t) { //3
2938      if (t == null)
2939        return this;
2940      if (this.jurisdiction == null)
2941        this.jurisdiction = new ArrayList<CodeableConcept>();
2942      this.jurisdiction.add(t);
2943      return this;
2944    }
2945
2946    /**
2947     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
2948     */
2949    public CodeableConcept getJurisdictionFirstRep() { 
2950      if (getJurisdiction().isEmpty()) {
2951        addJurisdiction();
2952      }
2953      return getJurisdiction().get(0);
2954    }
2955
2956    /**
2957     * @return {@link #purpose} (Explanation of why this terminology capabilities is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
2958     */
2959    public MarkdownType getPurposeElement() { 
2960      if (this.purpose == null)
2961        if (Configuration.errorOnAutoCreate())
2962          throw new Error("Attempt to auto-create TerminologyCapabilities.purpose");
2963        else if (Configuration.doAutoCreate())
2964          this.purpose = new MarkdownType(); // bb
2965      return this.purpose;
2966    }
2967
2968    public boolean hasPurposeElement() { 
2969      return this.purpose != null && !this.purpose.isEmpty();
2970    }
2971
2972    public boolean hasPurpose() { 
2973      return this.purpose != null && !this.purpose.isEmpty();
2974    }
2975
2976    /**
2977     * @param value {@link #purpose} (Explanation of why this terminology capabilities is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
2978     */
2979    public TerminologyCapabilities setPurposeElement(MarkdownType value) { 
2980      this.purpose = value;
2981      return this;
2982    }
2983
2984    /**
2985     * @return Explanation of why this terminology capabilities is needed and why it has been designed as it has.
2986     */
2987    public String getPurpose() { 
2988      return this.purpose == null ? null : this.purpose.getValue();
2989    }
2990
2991    /**
2992     * @param value Explanation of why this terminology capabilities is needed and why it has been designed as it has.
2993     */
2994    public TerminologyCapabilities setPurpose(String value) { 
2995      if (value == null)
2996        this.purpose = null;
2997      else {
2998        if (this.purpose == null)
2999          this.purpose = new MarkdownType();
3000        this.purpose.setValue(value);
3001      }
3002      return this;
3003    }
3004
3005    /**
3006     * @return {@link #copyright} (A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3007     */
3008    public MarkdownType getCopyrightElement() { 
3009      if (this.copyright == null)
3010        if (Configuration.errorOnAutoCreate())
3011          throw new Error("Attempt to auto-create TerminologyCapabilities.copyright");
3012        else if (Configuration.doAutoCreate())
3013          this.copyright = new MarkdownType(); // bb
3014      return this.copyright;
3015    }
3016
3017    public boolean hasCopyrightElement() { 
3018      return this.copyright != null && !this.copyright.isEmpty();
3019    }
3020
3021    public boolean hasCopyright() { 
3022      return this.copyright != null && !this.copyright.isEmpty();
3023    }
3024
3025    /**
3026     * @param value {@link #copyright} (A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3027     */
3028    public TerminologyCapabilities setCopyrightElement(MarkdownType value) { 
3029      this.copyright = value;
3030      return this;
3031    }
3032
3033    /**
3034     * @return A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities.
3035     */
3036    public String getCopyright() { 
3037      return this.copyright == null ? null : this.copyright.getValue();
3038    }
3039
3040    /**
3041     * @param value A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities.
3042     */
3043    public TerminologyCapabilities setCopyright(String value) { 
3044      if (value == null)
3045        this.copyright = null;
3046      else {
3047        if (this.copyright == null)
3048          this.copyright = new MarkdownType();
3049        this.copyright.setValue(value);
3050      }
3051      return this;
3052    }
3053
3054    /**
3055     * @return {@link #lockedDate} (Whether the server supports lockedDate.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value
3056     */
3057    public BooleanType getLockedDateElement() { 
3058      if (this.lockedDate == null)
3059        if (Configuration.errorOnAutoCreate())
3060          throw new Error("Attempt to auto-create TerminologyCapabilities.lockedDate");
3061        else if (Configuration.doAutoCreate())
3062          this.lockedDate = new BooleanType(); // bb
3063      return this.lockedDate;
3064    }
3065
3066    public boolean hasLockedDateElement() { 
3067      return this.lockedDate != null && !this.lockedDate.isEmpty();
3068    }
3069
3070    public boolean hasLockedDate() { 
3071      return this.lockedDate != null && !this.lockedDate.isEmpty();
3072    }
3073
3074    /**
3075     * @param value {@link #lockedDate} (Whether the server supports lockedDate.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value
3076     */
3077    public TerminologyCapabilities setLockedDateElement(BooleanType value) { 
3078      this.lockedDate = value;
3079      return this;
3080    }
3081
3082    /**
3083     * @return Whether the server supports lockedDate.
3084     */
3085    public boolean getLockedDate() { 
3086      return this.lockedDate == null || this.lockedDate.isEmpty() ? false : this.lockedDate.getValue();
3087    }
3088
3089    /**
3090     * @param value Whether the server supports lockedDate.
3091     */
3092    public TerminologyCapabilities setLockedDate(boolean value) { 
3093        if (this.lockedDate == null)
3094          this.lockedDate = new BooleanType();
3095        this.lockedDate.setValue(value);
3096      return this;
3097    }
3098
3099    /**
3100     * @return {@link #codeSystem} (Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource.)
3101     */
3102    public List<TerminologyCapabilitiesCodeSystemComponent> getCodeSystem() { 
3103      if (this.codeSystem == null)
3104        this.codeSystem = new ArrayList<TerminologyCapabilitiesCodeSystemComponent>();
3105      return this.codeSystem;
3106    }
3107
3108    /**
3109     * @return Returns a reference to <code>this</code> for easy method chaining
3110     */
3111    public TerminologyCapabilities setCodeSystem(List<TerminologyCapabilitiesCodeSystemComponent> theCodeSystem) { 
3112      this.codeSystem = theCodeSystem;
3113      return this;
3114    }
3115
3116    public boolean hasCodeSystem() { 
3117      if (this.codeSystem == null)
3118        return false;
3119      for (TerminologyCapabilitiesCodeSystemComponent item : this.codeSystem)
3120        if (!item.isEmpty())
3121          return true;
3122      return false;
3123    }
3124
3125    public TerminologyCapabilitiesCodeSystemComponent addCodeSystem() { //3
3126      TerminologyCapabilitiesCodeSystemComponent t = new TerminologyCapabilitiesCodeSystemComponent();
3127      if (this.codeSystem == null)
3128        this.codeSystem = new ArrayList<TerminologyCapabilitiesCodeSystemComponent>();
3129      this.codeSystem.add(t);
3130      return t;
3131    }
3132
3133    public TerminologyCapabilities addCodeSystem(TerminologyCapabilitiesCodeSystemComponent t) { //3
3134      if (t == null)
3135        return this;
3136      if (this.codeSystem == null)
3137        this.codeSystem = new ArrayList<TerminologyCapabilitiesCodeSystemComponent>();
3138      this.codeSystem.add(t);
3139      return this;
3140    }
3141
3142    /**
3143     * @return The first repetition of repeating field {@link #codeSystem}, creating it if it does not already exist
3144     */
3145    public TerminologyCapabilitiesCodeSystemComponent getCodeSystemFirstRep() { 
3146      if (getCodeSystem().isEmpty()) {
3147        addCodeSystem();
3148      }
3149      return getCodeSystem().get(0);
3150    }
3151
3152    /**
3153     * @return {@link #expansion} (Information about the $expansion operation.)
3154     */
3155    public TerminologyCapabilitiesExpansionComponent getExpansion() { 
3156      if (this.expansion == null)
3157        if (Configuration.errorOnAutoCreate())
3158          throw new Error("Attempt to auto-create TerminologyCapabilities.expansion");
3159        else if (Configuration.doAutoCreate())
3160          this.expansion = new TerminologyCapabilitiesExpansionComponent(); // cc
3161      return this.expansion;
3162    }
3163
3164    public boolean hasExpansion() { 
3165      return this.expansion != null && !this.expansion.isEmpty();
3166    }
3167
3168    /**
3169     * @param value {@link #expansion} (Information about the $expansion operation.)
3170     */
3171    public TerminologyCapabilities setExpansion(TerminologyCapabilitiesExpansionComponent value) { 
3172      this.expansion = value;
3173      return this;
3174    }
3175
3176    /**
3177     * @return {@link #codeSearch} (The degree to which the server supports the code search parameter on ValueSet, if it is supported.). This is the underlying object with id, value and extensions. The accessor "getCodeSearch" gives direct access to the value
3178     */
3179    public Enumeration<CodeSearchSupport> getCodeSearchElement() { 
3180      if (this.codeSearch == null)
3181        if (Configuration.errorOnAutoCreate())
3182          throw new Error("Attempt to auto-create TerminologyCapabilities.codeSearch");
3183        else if (Configuration.doAutoCreate())
3184          this.codeSearch = new Enumeration<CodeSearchSupport>(new CodeSearchSupportEnumFactory()); // bb
3185      return this.codeSearch;
3186    }
3187
3188    public boolean hasCodeSearchElement() { 
3189      return this.codeSearch != null && !this.codeSearch.isEmpty();
3190    }
3191
3192    public boolean hasCodeSearch() { 
3193      return this.codeSearch != null && !this.codeSearch.isEmpty();
3194    }
3195
3196    /**
3197     * @param value {@link #codeSearch} (The degree to which the server supports the code search parameter on ValueSet, if it is supported.). This is the underlying object with id, value and extensions. The accessor "getCodeSearch" gives direct access to the value
3198     */
3199    public TerminologyCapabilities setCodeSearchElement(Enumeration<CodeSearchSupport> value) { 
3200      this.codeSearch = value;
3201      return this;
3202    }
3203
3204    /**
3205     * @return The degree to which the server supports the code search parameter on ValueSet, if it is supported.
3206     */
3207    public CodeSearchSupport getCodeSearch() { 
3208      return this.codeSearch == null ? null : this.codeSearch.getValue();
3209    }
3210
3211    /**
3212     * @param value The degree to which the server supports the code search parameter on ValueSet, if it is supported.
3213     */
3214    public TerminologyCapabilities setCodeSearch(CodeSearchSupport value) { 
3215      if (value == null)
3216        this.codeSearch = null;
3217      else {
3218        if (this.codeSearch == null)
3219          this.codeSearch = new Enumeration<CodeSearchSupport>(new CodeSearchSupportEnumFactory());
3220        this.codeSearch.setValue(value);
3221      }
3222      return this;
3223    }
3224
3225    /**
3226     * @return {@link #validateCode} (Information about the $validation operation.)
3227     */
3228    public TerminologyCapabilitiesValidateCodeComponent getValidateCode() { 
3229      if (this.validateCode == null)
3230        if (Configuration.errorOnAutoCreate())
3231          throw new Error("Attempt to auto-create TerminologyCapabilities.validateCode");
3232        else if (Configuration.doAutoCreate())
3233          this.validateCode = new TerminologyCapabilitiesValidateCodeComponent(); // cc
3234      return this.validateCode;
3235    }
3236
3237    public boolean hasValidateCode() { 
3238      return this.validateCode != null && !this.validateCode.isEmpty();
3239    }
3240
3241    /**
3242     * @param value {@link #validateCode} (Information about the $validation operation.)
3243     */
3244    public TerminologyCapabilities setValidateCode(TerminologyCapabilitiesValidateCodeComponent value) { 
3245      this.validateCode = value;
3246      return this;
3247    }
3248
3249    /**
3250     * @return {@link #translation} (Information about the $translation operation.)
3251     */
3252    public TerminologyCapabilitiesTranslationComponent getTranslation() { 
3253      if (this.translation == null)
3254        if (Configuration.errorOnAutoCreate())
3255          throw new Error("Attempt to auto-create TerminologyCapabilities.translation");
3256        else if (Configuration.doAutoCreate())
3257          this.translation = new TerminologyCapabilitiesTranslationComponent(); // cc
3258      return this.translation;
3259    }
3260
3261    public boolean hasTranslation() { 
3262      return this.translation != null && !this.translation.isEmpty();
3263    }
3264
3265    /**
3266     * @param value {@link #translation} (Information about the $translation operation.)
3267     */
3268    public TerminologyCapabilities setTranslation(TerminologyCapabilitiesTranslationComponent value) { 
3269      this.translation = value;
3270      return this;
3271    }
3272
3273    /**
3274     * @return {@link #closure} (Whether the $closure operation is supported.)
3275     */
3276    public TerminologyCapabilitiesClosureComponent getClosure() { 
3277      if (this.closure == null)
3278        if (Configuration.errorOnAutoCreate())
3279          throw new Error("Attempt to auto-create TerminologyCapabilities.closure");
3280        else if (Configuration.doAutoCreate())
3281          this.closure = new TerminologyCapabilitiesClosureComponent(); // cc
3282      return this.closure;
3283    }
3284
3285    public boolean hasClosure() { 
3286      return this.closure != null && !this.closure.isEmpty();
3287    }
3288
3289    /**
3290     * @param value {@link #closure} (Whether the $closure operation is supported.)
3291     */
3292    public TerminologyCapabilities setClosure(TerminologyCapabilitiesClosureComponent value) { 
3293      this.closure = value;
3294      return this;
3295    }
3296
3297      protected void listChildren(List<Property> children) {
3298        super.listChildren(children);
3299        children.add(new Property("url", "uri", "An absolute URI that is used to identify this terminology capabilities when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this terminology capabilities is (or will be) published.", 0, 1, url));
3300        children.add(new Property("version", "string", "The identifier that is used to identify this version of the terminology capabilities when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the terminology capabilities author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version));
3301        children.add(new Property("name", "string", "A natural language name identifying the terminology capabilities. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
3302        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the terminology capabilities.", 0, 1, title));
3303        children.add(new Property("status", "code", "The status of this terminology capabilities. Enables tracking the life-cycle of the content.", 0, 1, status));
3304        children.add(new Property("experimental", "boolean", "A Boolean value to indicate that this terminology capabilities is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental));
3305        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the terminology capabilities was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the terminology capabilities changes.", 0, 1, date));
3306        children.add(new Property("publisher", "string", "The name of the organization or individual that published the terminology capabilities.", 0, 1, publisher));
3307        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
3308        children.add(new Property("description", "markdown", "A free text natural language description of the terminology capabilities from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, 1, description));
3309        children.add(new Property("useContext", "UsageContext", "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 for appropriate terminology capabilities instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
3310        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the terminology capabilities is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
3311        children.add(new Property("purpose", "markdown", "Explanation of why this terminology capabilities is needed and why it has been designed as it has.", 0, 1, purpose));
3312        children.add(new Property("copyright", "markdown", "A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities.", 0, 1, copyright));
3313        children.add(new Property("lockedDate", "boolean", "Whether the server supports lockedDate.", 0, 1, lockedDate));
3314        children.add(new Property("codeSystem", "", "Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource.", 0, java.lang.Integer.MAX_VALUE, codeSystem));
3315        children.add(new Property("expansion", "", "Information about the $expansion operation.", 0, 1, expansion));
3316        children.add(new Property("codeSearch", "code", "The degree to which the server supports the code search parameter on ValueSet, if it is supported.", 0, 1, codeSearch));
3317        children.add(new Property("validateCode", "", "Information about the $validation operation.", 0, 1, validateCode));
3318        children.add(new Property("translation", "", "Information about the $translation operation.", 0, 1, translation));
3319        children.add(new Property("closure", "", "Whether the $closure operation is supported.", 0, 1, closure));
3320      }
3321
3322      @Override
3323      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3324        switch (_hash) {
3325        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this terminology capabilities when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this terminology capabilities is (or will be) published.", 0, 1, url);
3326        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the terminology capabilities when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the terminology capabilities author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version);
3327        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the terminology capabilities. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
3328        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the terminology capabilities.", 0, 1, title);
3329        case -892481550: /*status*/  return new Property("status", "code", "The status of this terminology capabilities. Enables tracking the life-cycle of the content.", 0, 1, status);
3330        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A Boolean value to indicate that this terminology capabilities is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental);
3331        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the terminology capabilities was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the terminology capabilities changes.", 0, 1, date);
3332        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the terminology capabilities.", 0, 1, publisher);
3333        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
3334        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the terminology capabilities from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, 1, description);
3335        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "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 for appropriate terminology capabilities instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
3336        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the terminology capabilities is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
3337        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explanation of why this terminology capabilities is needed and why it has been designed as it has.", 0, 1, purpose);
3338        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities.", 0, 1, copyright);
3339        case 1391591896: /*lockedDate*/  return new Property("lockedDate", "boolean", "Whether the server supports lockedDate.", 0, 1, lockedDate);
3340        case -916511108: /*codeSystem*/  return new Property("codeSystem", "", "Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource.", 0, java.lang.Integer.MAX_VALUE, codeSystem);
3341        case 17878207: /*expansion*/  return new Property("expansion", "", "Information about the $expansion operation.", 0, 1, expansion);
3342        case -935519755: /*codeSearch*/  return new Property("codeSearch", "code", "The degree to which the server supports the code search parameter on ValueSet, if it is supported.", 0, 1, codeSearch);
3343        case 1080737827: /*validateCode*/  return new Property("validateCode", "", "Information about the $validation operation.", 0, 1, validateCode);
3344        case -1840647503: /*translation*/  return new Property("translation", "", "Information about the $translation operation.", 0, 1, translation);
3345        case 866552379: /*closure*/  return new Property("closure", "", "Whether the $closure operation is supported.", 0, 1, closure);
3346        default: return super.getNamedProperty(_hash, _name, _checkValid);
3347        }
3348
3349      }
3350
3351      @Override
3352      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3353        switch (hash) {
3354        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3355        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
3356        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3357        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
3358        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
3359        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
3360        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
3361        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
3362        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
3363        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
3364        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
3365        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
3366        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
3367        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
3368        case 1391591896: /*lockedDate*/ return this.lockedDate == null ? new Base[0] : new Base[] {this.lockedDate}; // BooleanType
3369        case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // TerminologyCapabilitiesCodeSystemComponent
3370        case 17878207: /*expansion*/ return this.expansion == null ? new Base[0] : new Base[] {this.expansion}; // TerminologyCapabilitiesExpansionComponent
3371        case -935519755: /*codeSearch*/ return this.codeSearch == null ? new Base[0] : new Base[] {this.codeSearch}; // Enumeration<CodeSearchSupport>
3372        case 1080737827: /*validateCode*/ return this.validateCode == null ? new Base[0] : new Base[] {this.validateCode}; // TerminologyCapabilitiesValidateCodeComponent
3373        case -1840647503: /*translation*/ return this.translation == null ? new Base[0] : new Base[] {this.translation}; // TerminologyCapabilitiesTranslationComponent
3374        case 866552379: /*closure*/ return this.closure == null ? new Base[0] : new Base[] {this.closure}; // TerminologyCapabilitiesClosureComponent
3375        default: return super.getProperty(hash, name, checkValid);
3376        }
3377
3378      }
3379
3380      @Override
3381      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3382        switch (hash) {
3383        case 116079: // url
3384          this.url = castToUri(value); // UriType
3385          return value;
3386        case 351608024: // version
3387          this.version = castToString(value); // StringType
3388          return value;
3389        case 3373707: // name
3390          this.name = castToString(value); // StringType
3391          return value;
3392        case 110371416: // title
3393          this.title = castToString(value); // StringType
3394          return value;
3395        case -892481550: // status
3396          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3397          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3398          return value;
3399        case -404562712: // experimental
3400          this.experimental = castToBoolean(value); // BooleanType
3401          return value;
3402        case 3076014: // date
3403          this.date = castToDateTime(value); // DateTimeType
3404          return value;
3405        case 1447404028: // publisher
3406          this.publisher = castToString(value); // StringType
3407          return value;
3408        case 951526432: // contact
3409          this.getContact().add(castToContactDetail(value)); // ContactDetail
3410          return value;
3411        case -1724546052: // description
3412          this.description = castToMarkdown(value); // MarkdownType
3413          return value;
3414        case -669707736: // useContext
3415          this.getUseContext().add(castToUsageContext(value)); // UsageContext
3416          return value;
3417        case -507075711: // jurisdiction
3418          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
3419          return value;
3420        case -220463842: // purpose
3421          this.purpose = castToMarkdown(value); // MarkdownType
3422          return value;
3423        case 1522889671: // copyright
3424          this.copyright = castToMarkdown(value); // MarkdownType
3425          return value;
3426        case 1391591896: // lockedDate
3427          this.lockedDate = castToBoolean(value); // BooleanType
3428          return value;
3429        case -916511108: // codeSystem
3430          this.getCodeSystem().add((TerminologyCapabilitiesCodeSystemComponent) value); // TerminologyCapabilitiesCodeSystemComponent
3431          return value;
3432        case 17878207: // expansion
3433          this.expansion = (TerminologyCapabilitiesExpansionComponent) value; // TerminologyCapabilitiesExpansionComponent
3434          return value;
3435        case -935519755: // codeSearch
3436          value = new CodeSearchSupportEnumFactory().fromType(castToCode(value));
3437          this.codeSearch = (Enumeration) value; // Enumeration<CodeSearchSupport>
3438          return value;
3439        case 1080737827: // validateCode
3440          this.validateCode = (TerminologyCapabilitiesValidateCodeComponent) value; // TerminologyCapabilitiesValidateCodeComponent
3441          return value;
3442        case -1840647503: // translation
3443          this.translation = (TerminologyCapabilitiesTranslationComponent) value; // TerminologyCapabilitiesTranslationComponent
3444          return value;
3445        case 866552379: // closure
3446          this.closure = (TerminologyCapabilitiesClosureComponent) value; // TerminologyCapabilitiesClosureComponent
3447          return value;
3448        default: return super.setProperty(hash, name, value);
3449        }
3450
3451      }
3452
3453      @Override
3454      public Base setProperty(String name, Base value) throws FHIRException {
3455        if (name.equals("url")) {
3456          this.url = castToUri(value); // UriType
3457        } else if (name.equals("version")) {
3458          this.version = castToString(value); // StringType
3459        } else if (name.equals("name")) {
3460          this.name = castToString(value); // StringType
3461        } else if (name.equals("title")) {
3462          this.title = castToString(value); // StringType
3463        } else if (name.equals("status")) {
3464          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3465          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3466        } else if (name.equals("experimental")) {
3467          this.experimental = castToBoolean(value); // BooleanType
3468        } else if (name.equals("date")) {
3469          this.date = castToDateTime(value); // DateTimeType
3470        } else if (name.equals("publisher")) {
3471          this.publisher = castToString(value); // StringType
3472        } else if (name.equals("contact")) {
3473          this.getContact().add(castToContactDetail(value));
3474        } else if (name.equals("description")) {
3475          this.description = castToMarkdown(value); // MarkdownType
3476        } else if (name.equals("useContext")) {
3477          this.getUseContext().add(castToUsageContext(value));
3478        } else if (name.equals("jurisdiction")) {
3479          this.getJurisdiction().add(castToCodeableConcept(value));
3480        } else if (name.equals("purpose")) {
3481          this.purpose = castToMarkdown(value); // MarkdownType
3482        } else if (name.equals("copyright")) {
3483          this.copyright = castToMarkdown(value); // MarkdownType
3484        } else if (name.equals("lockedDate")) {
3485          this.lockedDate = castToBoolean(value); // BooleanType
3486        } else if (name.equals("codeSystem")) {
3487          this.getCodeSystem().add((TerminologyCapabilitiesCodeSystemComponent) value);
3488        } else if (name.equals("expansion")) {
3489          this.expansion = (TerminologyCapabilitiesExpansionComponent) value; // TerminologyCapabilitiesExpansionComponent
3490        } else if (name.equals("codeSearch")) {
3491          value = new CodeSearchSupportEnumFactory().fromType(castToCode(value));
3492          this.codeSearch = (Enumeration) value; // Enumeration<CodeSearchSupport>
3493        } else if (name.equals("validateCode")) {
3494          this.validateCode = (TerminologyCapabilitiesValidateCodeComponent) value; // TerminologyCapabilitiesValidateCodeComponent
3495        } else if (name.equals("translation")) {
3496          this.translation = (TerminologyCapabilitiesTranslationComponent) value; // TerminologyCapabilitiesTranslationComponent
3497        } else if (name.equals("closure")) {
3498          this.closure = (TerminologyCapabilitiesClosureComponent) value; // TerminologyCapabilitiesClosureComponent
3499        } else
3500          return super.setProperty(name, value);
3501        return value;
3502      }
3503
3504      @Override
3505      public Base makeProperty(int hash, String name) throws FHIRException {
3506        switch (hash) {
3507        case 116079:  return getUrlElement();
3508        case 351608024:  return getVersionElement();
3509        case 3373707:  return getNameElement();
3510        case 110371416:  return getTitleElement();
3511        case -892481550:  return getStatusElement();
3512        case -404562712:  return getExperimentalElement();
3513        case 3076014:  return getDateElement();
3514        case 1447404028:  return getPublisherElement();
3515        case 951526432:  return addContact(); 
3516        case -1724546052:  return getDescriptionElement();
3517        case -669707736:  return addUseContext(); 
3518        case -507075711:  return addJurisdiction(); 
3519        case -220463842:  return getPurposeElement();
3520        case 1522889671:  return getCopyrightElement();
3521        case 1391591896:  return getLockedDateElement();
3522        case -916511108:  return addCodeSystem(); 
3523        case 17878207:  return getExpansion(); 
3524        case -935519755:  return getCodeSearchElement();
3525        case 1080737827:  return getValidateCode(); 
3526        case -1840647503:  return getTranslation(); 
3527        case 866552379:  return getClosure(); 
3528        default: return super.makeProperty(hash, name);
3529        }
3530
3531      }
3532
3533      @Override
3534      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3535        switch (hash) {
3536        case 116079: /*url*/ return new String[] {"uri"};
3537        case 351608024: /*version*/ return new String[] {"string"};
3538        case 3373707: /*name*/ return new String[] {"string"};
3539        case 110371416: /*title*/ return new String[] {"string"};
3540        case -892481550: /*status*/ return new String[] {"code"};
3541        case -404562712: /*experimental*/ return new String[] {"boolean"};
3542        case 3076014: /*date*/ return new String[] {"dateTime"};
3543        case 1447404028: /*publisher*/ return new String[] {"string"};
3544        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
3545        case -1724546052: /*description*/ return new String[] {"markdown"};
3546        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
3547        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
3548        case -220463842: /*purpose*/ return new String[] {"markdown"};
3549        case 1522889671: /*copyright*/ return new String[] {"markdown"};
3550        case 1391591896: /*lockedDate*/ return new String[] {"boolean"};
3551        case -916511108: /*codeSystem*/ return new String[] {};
3552        case 17878207: /*expansion*/ return new String[] {};
3553        case -935519755: /*codeSearch*/ return new String[] {"code"};
3554        case 1080737827: /*validateCode*/ return new String[] {};
3555        case -1840647503: /*translation*/ return new String[] {};
3556        case 866552379: /*closure*/ return new String[] {};
3557        default: return super.getTypesForProperty(hash, name);
3558        }
3559
3560      }
3561
3562      @Override
3563      public Base addChild(String name) throws FHIRException {
3564        if (name.equals("url")) {
3565          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.url");
3566        }
3567        else if (name.equals("version")) {
3568          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.version");
3569        }
3570        else if (name.equals("name")) {
3571          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.name");
3572        }
3573        else if (name.equals("title")) {
3574          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.title");
3575        }
3576        else if (name.equals("status")) {
3577          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.status");
3578        }
3579        else if (name.equals("experimental")) {
3580          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.experimental");
3581        }
3582        else if (name.equals("date")) {
3583          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.date");
3584        }
3585        else if (name.equals("publisher")) {
3586          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.publisher");
3587        }
3588        else if (name.equals("contact")) {
3589          return addContact();
3590        }
3591        else if (name.equals("description")) {
3592          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.description");
3593        }
3594        else if (name.equals("useContext")) {
3595          return addUseContext();
3596        }
3597        else if (name.equals("jurisdiction")) {
3598          return addJurisdiction();
3599        }
3600        else if (name.equals("purpose")) {
3601          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.purpose");
3602        }
3603        else if (name.equals("copyright")) {
3604          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.copyright");
3605        }
3606        else if (name.equals("lockedDate")) {
3607          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.lockedDate");
3608        }
3609        else if (name.equals("codeSystem")) {
3610          return addCodeSystem();
3611        }
3612        else if (name.equals("expansion")) {
3613          this.expansion = new TerminologyCapabilitiesExpansionComponent();
3614          return this.expansion;
3615        }
3616        else if (name.equals("codeSearch")) {
3617          throw new FHIRException("Cannot call addChild on a primitive type TerminologyCapabilities.codeSearch");
3618        }
3619        else if (name.equals("validateCode")) {
3620          this.validateCode = new TerminologyCapabilitiesValidateCodeComponent();
3621          return this.validateCode;
3622        }
3623        else if (name.equals("translation")) {
3624          this.translation = new TerminologyCapabilitiesTranslationComponent();
3625          return this.translation;
3626        }
3627        else if (name.equals("closure")) {
3628          this.closure = new TerminologyCapabilitiesClosureComponent();
3629          return this.closure;
3630        }
3631        else
3632          return super.addChild(name);
3633      }
3634
3635  public String fhirType() {
3636    return "TerminologyCapabilities";
3637
3638  }
3639
3640      public TerminologyCapabilities copy() {
3641        TerminologyCapabilities dst = new TerminologyCapabilities();
3642        copyValues(dst);
3643        dst.url = url == null ? null : url.copy();
3644        dst.version = version == null ? null : version.copy();
3645        dst.name = name == null ? null : name.copy();
3646        dst.title = title == null ? null : title.copy();
3647        dst.status = status == null ? null : status.copy();
3648        dst.experimental = experimental == null ? null : experimental.copy();
3649        dst.date = date == null ? null : date.copy();
3650        dst.publisher = publisher == null ? null : publisher.copy();
3651        if (contact != null) {
3652          dst.contact = new ArrayList<ContactDetail>();
3653          for (ContactDetail i : contact)
3654            dst.contact.add(i.copy());
3655        };
3656        dst.description = description == null ? null : description.copy();
3657        if (useContext != null) {
3658          dst.useContext = new ArrayList<UsageContext>();
3659          for (UsageContext i : useContext)
3660            dst.useContext.add(i.copy());
3661        };
3662        if (jurisdiction != null) {
3663          dst.jurisdiction = new ArrayList<CodeableConcept>();
3664          for (CodeableConcept i : jurisdiction)
3665            dst.jurisdiction.add(i.copy());
3666        };
3667        dst.purpose = purpose == null ? null : purpose.copy();
3668        dst.copyright = copyright == null ? null : copyright.copy();
3669        dst.lockedDate = lockedDate == null ? null : lockedDate.copy();
3670        if (codeSystem != null) {
3671          dst.codeSystem = new ArrayList<TerminologyCapabilitiesCodeSystemComponent>();
3672          for (TerminologyCapabilitiesCodeSystemComponent i : codeSystem)
3673            dst.codeSystem.add(i.copy());
3674        };
3675        dst.expansion = expansion == null ? null : expansion.copy();
3676        dst.codeSearch = codeSearch == null ? null : codeSearch.copy();
3677        dst.validateCode = validateCode == null ? null : validateCode.copy();
3678        dst.translation = translation == null ? null : translation.copy();
3679        dst.closure = closure == null ? null : closure.copy();
3680        return dst;
3681      }
3682
3683      protected TerminologyCapabilities typedCopy() {
3684        return copy();
3685      }
3686
3687      @Override
3688      public boolean equalsDeep(Base other_) {
3689        if (!super.equalsDeep(other_))
3690          return false;
3691        if (!(other_ instanceof TerminologyCapabilities))
3692          return false;
3693        TerminologyCapabilities o = (TerminologyCapabilities) other_;
3694        return compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true) && compareDeep(lockedDate, o.lockedDate, true)
3695           && compareDeep(codeSystem, o.codeSystem, true) && compareDeep(expansion, o.expansion, true) && compareDeep(codeSearch, o.codeSearch, true)
3696           && compareDeep(validateCode, o.validateCode, true) && compareDeep(translation, o.translation, true)
3697           && compareDeep(closure, o.closure, true);
3698      }
3699
3700      @Override
3701      public boolean equalsShallow(Base other_) {
3702        if (!super.equalsShallow(other_))
3703          return false;
3704        if (!(other_ instanceof TerminologyCapabilities))
3705          return false;
3706        TerminologyCapabilities o = (TerminologyCapabilities) other_;
3707        return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(lockedDate, o.lockedDate, true)
3708           && compareValues(codeSearch, o.codeSearch, true);
3709      }
3710
3711      public boolean isEmpty() {
3712        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(purpose, copyright, lockedDate
3713          , codeSystem, expansion, codeSearch, validateCode, translation, closure);
3714      }
3715
3716  @Override
3717  public ResourceType getResourceType() {
3718    return ResourceType.TerminologyCapabilities;
3719   }
3720
3721 /**
3722   * Search parameter: <b>date</b>
3723   * <p>
3724   * Description: <b>The terminology capabilities publication date</b><br>
3725   * Type: <b>date</b><br>
3726   * Path: <b>TerminologyCapabilities.date</b><br>
3727   * </p>
3728   */
3729  @SearchParamDefinition(name="date", path="TerminologyCapabilities.date", description="The terminology capabilities publication date", type="date" )
3730  public static final String SP_DATE = "date";
3731 /**
3732   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3733   * <p>
3734   * Description: <b>The terminology capabilities publication date</b><br>
3735   * Type: <b>date</b><br>
3736   * Path: <b>TerminologyCapabilities.date</b><br>
3737   * </p>
3738   */
3739  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3740
3741 /**
3742   * Search parameter: <b>jurisdiction</b>
3743   * <p>
3744   * Description: <b>Intended jurisdiction for the terminology capabilities</b><br>
3745   * Type: <b>token</b><br>
3746   * Path: <b>TerminologyCapabilities.jurisdiction</b><br>
3747   * </p>
3748   */
3749  @SearchParamDefinition(name="jurisdiction", path="TerminologyCapabilities.jurisdiction", description="Intended jurisdiction for the terminology capabilities", type="token" )
3750  public static final String SP_JURISDICTION = "jurisdiction";
3751 /**
3752   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
3753   * <p>
3754   * Description: <b>Intended jurisdiction for the terminology capabilities</b><br>
3755   * Type: <b>token</b><br>
3756   * Path: <b>TerminologyCapabilities.jurisdiction</b><br>
3757   * </p>
3758   */
3759  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
3760
3761 /**
3762   * Search parameter: <b>name</b>
3763   * <p>
3764   * Description: <b>Computationally friendly name of the terminology capabilities</b><br>
3765   * Type: <b>string</b><br>
3766   * Path: <b>TerminologyCapabilities.name</b><br>
3767   * </p>
3768   */
3769  @SearchParamDefinition(name="name", path="TerminologyCapabilities.name", description="Computationally friendly name of the terminology capabilities", type="string" )
3770  public static final String SP_NAME = "name";
3771 /**
3772   * <b>Fluent Client</b> search parameter constant for <b>name</b>
3773   * <p>
3774   * Description: <b>Computationally friendly name of the terminology capabilities</b><br>
3775   * Type: <b>string</b><br>
3776   * Path: <b>TerminologyCapabilities.name</b><br>
3777   * </p>
3778   */
3779  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
3780
3781 /**
3782   * Search parameter: <b>description</b>
3783   * <p>
3784   * Description: <b>The description of the terminology capabilities</b><br>
3785   * Type: <b>string</b><br>
3786   * Path: <b>TerminologyCapabilities.description</b><br>
3787   * </p>
3788   */
3789  @SearchParamDefinition(name="description", path="TerminologyCapabilities.description", description="The description of the terminology capabilities", type="string" )
3790  public static final String SP_DESCRIPTION = "description";
3791 /**
3792   * <b>Fluent Client</b> search parameter constant for <b>description</b>
3793   * <p>
3794   * Description: <b>The description of the terminology capabilities</b><br>
3795   * Type: <b>string</b><br>
3796   * Path: <b>TerminologyCapabilities.description</b><br>
3797   * </p>
3798   */
3799  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
3800
3801 /**
3802   * Search parameter: <b>publisher</b>
3803   * <p>
3804   * Description: <b>Name of the publisher of the terminology capabilities</b><br>
3805   * Type: <b>string</b><br>
3806   * Path: <b>TerminologyCapabilities.publisher</b><br>
3807   * </p>
3808   */
3809  @SearchParamDefinition(name="publisher", path="TerminologyCapabilities.publisher", description="Name of the publisher of the terminology capabilities", type="string" )
3810  public static final String SP_PUBLISHER = "publisher";
3811 /**
3812   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
3813   * <p>
3814   * Description: <b>Name of the publisher of the terminology capabilities</b><br>
3815   * Type: <b>string</b><br>
3816   * Path: <b>TerminologyCapabilities.publisher</b><br>
3817   * </p>
3818   */
3819  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
3820
3821 /**
3822   * Search parameter: <b>title</b>
3823   * <p>
3824   * Description: <b>The human-friendly name of the terminology capabilities</b><br>
3825   * Type: <b>string</b><br>
3826   * Path: <b>TerminologyCapabilities.title</b><br>
3827   * </p>
3828   */
3829  @SearchParamDefinition(name="title", path="TerminologyCapabilities.title", description="The human-friendly name of the terminology capabilities", type="string" )
3830  public static final String SP_TITLE = "title";
3831 /**
3832   * <b>Fluent Client</b> search parameter constant for <b>title</b>
3833   * <p>
3834   * Description: <b>The human-friendly name of the terminology capabilities</b><br>
3835   * Type: <b>string</b><br>
3836   * Path: <b>TerminologyCapabilities.title</b><br>
3837   * </p>
3838   */
3839  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
3840
3841 /**
3842   * Search parameter: <b>version</b>
3843   * <p>
3844   * Description: <b>The business version of the terminology capabilities</b><br>
3845   * Type: <b>token</b><br>
3846   * Path: <b>TerminologyCapabilities.version</b><br>
3847   * </p>
3848   */
3849  @SearchParamDefinition(name="version", path="TerminologyCapabilities.version", description="The business version of the terminology capabilities", type="token" )
3850  public static final String SP_VERSION = "version";
3851 /**
3852   * <b>Fluent Client</b> search parameter constant for <b>version</b>
3853   * <p>
3854   * Description: <b>The business version of the terminology capabilities</b><br>
3855   * Type: <b>token</b><br>
3856   * Path: <b>TerminologyCapabilities.version</b><br>
3857   * </p>
3858   */
3859  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
3860
3861 /**
3862   * Search parameter: <b>url</b>
3863   * <p>
3864   * Description: <b>The uri that identifies the terminology capabilities</b><br>
3865   * Type: <b>uri</b><br>
3866   * Path: <b>TerminologyCapabilities.url</b><br>
3867   * </p>
3868   */
3869  @SearchParamDefinition(name="url", path="TerminologyCapabilities.url", description="The uri that identifies the terminology capabilities", type="uri" )
3870  public static final String SP_URL = "url";
3871 /**
3872   * <b>Fluent Client</b> search parameter constant for <b>url</b>
3873   * <p>
3874   * Description: <b>The uri that identifies the terminology capabilities</b><br>
3875   * Type: <b>uri</b><br>
3876   * Path: <b>TerminologyCapabilities.url</b><br>
3877   * </p>
3878   */
3879  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
3880
3881 /**
3882   * Search parameter: <b>status</b>
3883   * <p>
3884   * Description: <b>The current status of the terminology capabilities</b><br>
3885   * Type: <b>token</b><br>
3886   * Path: <b>TerminologyCapabilities.status</b><br>
3887   * </p>
3888   */
3889  @SearchParamDefinition(name="status", path="TerminologyCapabilities.status", description="The current status of the terminology capabilities", type="token" )
3890  public static final String SP_STATUS = "status";
3891 /**
3892   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3893   * <p>
3894   * Description: <b>The current status of the terminology capabilities</b><br>
3895   * Type: <b>token</b><br>
3896   * Path: <b>TerminologyCapabilities.status</b><br>
3897   * </p>
3898   */
3899  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3900
3901
3902}
3903