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.Child;
039import ca.uhn.fhir.model.api.annotation.ChildOrder;
040import ca.uhn.fhir.model.api.annotation.Description;
041import ca.uhn.fhir.model.api.annotation.DatatypeDef;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045// added from java-adornments.txt:
046import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
047
048
049// end addition
050/**
051 * Captures constraints on each element within the resource, profile, or extension.
052 */
053@DatatypeDef(name="ElementDefinition")
054public class ElementDefinition extends BackboneType implements ICompositeType {
055
056    public enum PropertyRepresentation {
057        /**
058         * In XML, this property is represented as an attribute not an element.
059         */
060        XMLATTR, 
061        /**
062         * This element is represented using the XML text attribute (primitives only)
063         */
064        XMLTEXT, 
065        /**
066         * The type of this element is indicated using xsi:type
067         */
068        TYPEATTR, 
069        /**
070         * Use CDA narrative instead of XHTML
071         */
072        CDATEXT, 
073        /**
074         * The property is represented using XHTML
075         */
076        XHTML, 
077        /**
078         * added to help the parsers with the generic types
079         */
080        NULL;
081        public static PropertyRepresentation fromCode(String codeString) throws FHIRException {
082            if (codeString == null || "".equals(codeString))
083                return null;
084        if ("xmlAttr".equals(codeString))
085          return XMLATTR;
086        if ("xmlText".equals(codeString))
087          return XMLTEXT;
088        if ("typeAttr".equals(codeString))
089          return TYPEATTR;
090        if ("cdaText".equals(codeString))
091          return CDATEXT;
092        if ("xhtml".equals(codeString))
093          return XHTML;
094        if (Configuration.isAcceptInvalidEnums())
095          return null;
096        else
097          throw new FHIRException("Unknown PropertyRepresentation code '"+codeString+"'");
098        }
099        public String toCode() {
100          switch (this) {
101            case XMLATTR: return "xmlAttr";
102            case XMLTEXT: return "xmlText";
103            case TYPEATTR: return "typeAttr";
104            case CDATEXT: return "cdaText";
105            case XHTML: return "xhtml";
106            default: return "?";
107          }
108        }
109        public String getSystem() {
110          switch (this) {
111            case XMLATTR: return "http://hl7.org/fhir/property-representation";
112            case XMLTEXT: return "http://hl7.org/fhir/property-representation";
113            case TYPEATTR: return "http://hl7.org/fhir/property-representation";
114            case CDATEXT: return "http://hl7.org/fhir/property-representation";
115            case XHTML: return "http://hl7.org/fhir/property-representation";
116            default: return "?";
117          }
118        }
119        public String getDefinition() {
120          switch (this) {
121            case XMLATTR: return "In XML, this property is represented as an attribute not an element.";
122            case XMLTEXT: return "This element is represented using the XML text attribute (primitives only)";
123            case TYPEATTR: return "The type of this element is indicated using xsi:type";
124            case CDATEXT: return "Use CDA narrative instead of XHTML";
125            case XHTML: return "The property is represented using XHTML";
126            default: return "?";
127          }
128        }
129        public String getDisplay() {
130          switch (this) {
131            case XMLATTR: return "XML Attribute";
132            case XMLTEXT: return "XML Text";
133            case TYPEATTR: return "Type Attribute";
134            case CDATEXT: return "CDA Text Format";
135            case XHTML: return "XHTML";
136            default: return "?";
137          }
138        }
139    }
140
141  public static class PropertyRepresentationEnumFactory implements EnumFactory<PropertyRepresentation> {
142    public PropertyRepresentation fromCode(String codeString) throws IllegalArgumentException {
143      if (codeString == null || "".equals(codeString))
144            if (codeString == null || "".equals(codeString))
145                return null;
146        if ("xmlAttr".equals(codeString))
147          return PropertyRepresentation.XMLATTR;
148        if ("xmlText".equals(codeString))
149          return PropertyRepresentation.XMLTEXT;
150        if ("typeAttr".equals(codeString))
151          return PropertyRepresentation.TYPEATTR;
152        if ("cdaText".equals(codeString))
153          return PropertyRepresentation.CDATEXT;
154        if ("xhtml".equals(codeString))
155          return PropertyRepresentation.XHTML;
156        throw new IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'");
157        }
158        public Enumeration<PropertyRepresentation> fromType(Base code) throws FHIRException {
159          if (code == null)
160            return null;
161          if (code.isEmpty())
162            return new Enumeration<PropertyRepresentation>(this);
163          String codeString = ((PrimitiveType) code).asStringValue();
164          if (codeString == null || "".equals(codeString))
165            return null;
166        if ("xmlAttr".equals(codeString))
167          return new Enumeration<PropertyRepresentation>(this, PropertyRepresentation.XMLATTR);
168        if ("xmlText".equals(codeString))
169          return new Enumeration<PropertyRepresentation>(this, PropertyRepresentation.XMLTEXT);
170        if ("typeAttr".equals(codeString))
171          return new Enumeration<PropertyRepresentation>(this, PropertyRepresentation.TYPEATTR);
172        if ("cdaText".equals(codeString))
173          return new Enumeration<PropertyRepresentation>(this, PropertyRepresentation.CDATEXT);
174        if ("xhtml".equals(codeString))
175          return new Enumeration<PropertyRepresentation>(this, PropertyRepresentation.XHTML);
176        throw new FHIRException("Unknown PropertyRepresentation code '"+codeString+"'");
177        }
178    public String toCode(PropertyRepresentation code) {
179      if (code == PropertyRepresentation.XMLATTR)
180        return "xmlAttr";
181      if (code == PropertyRepresentation.XMLTEXT)
182        return "xmlText";
183      if (code == PropertyRepresentation.TYPEATTR)
184        return "typeAttr";
185      if (code == PropertyRepresentation.CDATEXT)
186        return "cdaText";
187      if (code == PropertyRepresentation.XHTML)
188        return "xhtml";
189      return "?";
190      }
191    public String toSystem(PropertyRepresentation code) {
192      return code.getSystem();
193      }
194    }
195
196    public enum DiscriminatorType {
197        /**
198         * The slices have different values in the nominated element
199         */
200        VALUE, 
201        /**
202         * The slices are differentiated by the presence or absence of the nominated element
203         */
204        EXISTS, 
205        /**
206         * The slices have different values in the nominated element, as determined by testing them against the applicable ElementDefinition.pattern[x]
207         */
208        PATTERN, 
209        /**
210         * The slices are differentiated by type of the nominated element
211         */
212        TYPE, 
213        /**
214         * The slices are differentiated by conformance of the nominated element to a specified profile. Note that if the path specifies .resolve() then the profile is the target profile on the reference. In this case, validation by the possible profiles is required to differentiate the slices
215         */
216        PROFILE, 
217        /**
218         * added to help the parsers with the generic types
219         */
220        NULL;
221        public static DiscriminatorType fromCode(String codeString) throws FHIRException {
222            if (codeString == null || "".equals(codeString))
223                return null;
224        if ("value".equals(codeString))
225          return VALUE;
226        if ("exists".equals(codeString))
227          return EXISTS;
228        if ("pattern".equals(codeString))
229          return PATTERN;
230        if ("type".equals(codeString))
231          return TYPE;
232        if ("profile".equals(codeString))
233          return PROFILE;
234        if (Configuration.isAcceptInvalidEnums())
235          return null;
236        else
237          throw new FHIRException("Unknown DiscriminatorType code '"+codeString+"'");
238        }
239        public String toCode() {
240          switch (this) {
241            case VALUE: return "value";
242            case EXISTS: return "exists";
243            case PATTERN: return "pattern";
244            case TYPE: return "type";
245            case PROFILE: return "profile";
246            default: return "?";
247          }
248        }
249        public String getSystem() {
250          switch (this) {
251            case VALUE: return "http://hl7.org/fhir/discriminator-type";
252            case EXISTS: return "http://hl7.org/fhir/discriminator-type";
253            case PATTERN: return "http://hl7.org/fhir/discriminator-type";
254            case TYPE: return "http://hl7.org/fhir/discriminator-type";
255            case PROFILE: return "http://hl7.org/fhir/discriminator-type";
256            default: return "?";
257          }
258        }
259        public String getDefinition() {
260          switch (this) {
261            case VALUE: return "The slices have different values in the nominated element";
262            case EXISTS: return "The slices are differentiated by the presence or absence of the nominated element";
263            case PATTERN: return "The slices have different values in the nominated element, as determined by testing them against the applicable ElementDefinition.pattern[x]";
264            case TYPE: return "The slices are differentiated by type of the nominated element";
265            case PROFILE: return "The slices are differentiated by conformance of the nominated element to a specified profile. Note that if the path specifies .resolve() then the profile is the target profile on the reference. In this case, validation by the possible profiles is required to differentiate the slices";
266            default: return "?";
267          }
268        }
269        public String getDisplay() {
270          switch (this) {
271            case VALUE: return "Value";
272            case EXISTS: return "Exists";
273            case PATTERN: return "Pattern";
274            case TYPE: return "Type";
275            case PROFILE: return "Profile";
276            default: return "?";
277          }
278        }
279    }
280
281  public static class DiscriminatorTypeEnumFactory implements EnumFactory<DiscriminatorType> {
282    public DiscriminatorType fromCode(String codeString) throws IllegalArgumentException {
283      if (codeString == null || "".equals(codeString))
284            if (codeString == null || "".equals(codeString))
285                return null;
286        if ("value".equals(codeString))
287          return DiscriminatorType.VALUE;
288        if ("exists".equals(codeString))
289          return DiscriminatorType.EXISTS;
290        if ("pattern".equals(codeString))
291          return DiscriminatorType.PATTERN;
292        if ("type".equals(codeString))
293          return DiscriminatorType.TYPE;
294        if ("profile".equals(codeString))
295          return DiscriminatorType.PROFILE;
296        throw new IllegalArgumentException("Unknown DiscriminatorType code '"+codeString+"'");
297        }
298        public Enumeration<DiscriminatorType> fromType(Base code) throws FHIRException {
299          if (code == null)
300            return null;
301          if (code.isEmpty())
302            return new Enumeration<DiscriminatorType>(this);
303          String codeString = ((PrimitiveType) code).asStringValue();
304          if (codeString == null || "".equals(codeString))
305            return null;
306        if ("value".equals(codeString))
307          return new Enumeration<DiscriminatorType>(this, DiscriminatorType.VALUE);
308        if ("exists".equals(codeString))
309          return new Enumeration<DiscriminatorType>(this, DiscriminatorType.EXISTS);
310        if ("pattern".equals(codeString))
311          return new Enumeration<DiscriminatorType>(this, DiscriminatorType.PATTERN);
312        if ("type".equals(codeString))
313          return new Enumeration<DiscriminatorType>(this, DiscriminatorType.TYPE);
314        if ("profile".equals(codeString))
315          return new Enumeration<DiscriminatorType>(this, DiscriminatorType.PROFILE);
316        throw new FHIRException("Unknown DiscriminatorType code '"+codeString+"'");
317        }
318    public String toCode(DiscriminatorType code) {
319      if (code == DiscriminatorType.VALUE)
320        return "value";
321      if (code == DiscriminatorType.EXISTS)
322        return "exists";
323      if (code == DiscriminatorType.PATTERN)
324        return "pattern";
325      if (code == DiscriminatorType.TYPE)
326        return "type";
327      if (code == DiscriminatorType.PROFILE)
328        return "profile";
329      return "?";
330      }
331    public String toSystem(DiscriminatorType code) {
332      return code.getSystem();
333      }
334    }
335
336    public enum SlicingRules {
337        /**
338         * No additional content is allowed other than that described by the slices in this profile.
339         */
340        CLOSED, 
341        /**
342         * Additional content is allowed anywhere in the list.
343         */
344        OPEN, 
345        /**
346         * Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required.
347         */
348        OPENATEND, 
349        /**
350         * added to help the parsers with the generic types
351         */
352        NULL;
353        public static SlicingRules fromCode(String codeString) throws FHIRException {
354            if (codeString == null || "".equals(codeString))
355                return null;
356        if ("closed".equals(codeString))
357          return CLOSED;
358        if ("open".equals(codeString))
359          return OPEN;
360        if ("openAtEnd".equals(codeString))
361          return OPENATEND;
362        if (Configuration.isAcceptInvalidEnums())
363          return null;
364        else
365          throw new FHIRException("Unknown SlicingRules code '"+codeString+"'");
366        }
367        public String toCode() {
368          switch (this) {
369            case CLOSED: return "closed";
370            case OPEN: return "open";
371            case OPENATEND: return "openAtEnd";
372            default: return "?";
373          }
374        }
375        public String getSystem() {
376          switch (this) {
377            case CLOSED: return "http://hl7.org/fhir/resource-slicing-rules";
378            case OPEN: return "http://hl7.org/fhir/resource-slicing-rules";
379            case OPENATEND: return "http://hl7.org/fhir/resource-slicing-rules";
380            default: return "?";
381          }
382        }
383        public String getDefinition() {
384          switch (this) {
385            case CLOSED: return "No additional content is allowed other than that described by the slices in this profile.";
386            case OPEN: return "Additional content is allowed anywhere in the list.";
387            case OPENATEND: return "Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required.";
388            default: return "?";
389          }
390        }
391        public String getDisplay() {
392          switch (this) {
393            case CLOSED: return "Closed";
394            case OPEN: return "Open";
395            case OPENATEND: return "Open at End";
396            default: return "?";
397          }
398        }
399    }
400
401  public static class SlicingRulesEnumFactory implements EnumFactory<SlicingRules> {
402    public SlicingRules fromCode(String codeString) throws IllegalArgumentException {
403      if (codeString == null || "".equals(codeString))
404            if (codeString == null || "".equals(codeString))
405                return null;
406        if ("closed".equals(codeString))
407          return SlicingRules.CLOSED;
408        if ("open".equals(codeString))
409          return SlicingRules.OPEN;
410        if ("openAtEnd".equals(codeString))
411          return SlicingRules.OPENATEND;
412        throw new IllegalArgumentException("Unknown SlicingRules code '"+codeString+"'");
413        }
414        public Enumeration<SlicingRules> fromType(Base code) throws FHIRException {
415          if (code == null)
416            return null;
417          if (code.isEmpty())
418            return new Enumeration<SlicingRules>(this);
419          String codeString = ((PrimitiveType) code).asStringValue();
420          if (codeString == null || "".equals(codeString))
421            return null;
422        if ("closed".equals(codeString))
423          return new Enumeration<SlicingRules>(this, SlicingRules.CLOSED);
424        if ("open".equals(codeString))
425          return new Enumeration<SlicingRules>(this, SlicingRules.OPEN);
426        if ("openAtEnd".equals(codeString))
427          return new Enumeration<SlicingRules>(this, SlicingRules.OPENATEND);
428        throw new FHIRException("Unknown SlicingRules code '"+codeString+"'");
429        }
430    public String toCode(SlicingRules code) {
431      if (code == SlicingRules.CLOSED)
432        return "closed";
433      if (code == SlicingRules.OPEN)
434        return "open";
435      if (code == SlicingRules.OPENATEND)
436        return "openAtEnd";
437      return "?";
438      }
439    public String toSystem(SlicingRules code) {
440      return code.getSystem();
441      }
442    }
443
444    public enum AggregationMode {
445        /**
446         * The reference is a local reference to a contained resource.
447         */
448        CONTAINED, 
449        /**
450         * The reference to a resource that has to be resolved externally to the resource that includes the reference.
451         */
452        REFERENCED, 
453        /**
454         * The resource the reference points to will be found in the same bundle as the resource that includes the reference.
455         */
456        BUNDLED, 
457        /**
458         * added to help the parsers with the generic types
459         */
460        NULL;
461        public static AggregationMode fromCode(String codeString) throws FHIRException {
462            if (codeString == null || "".equals(codeString))
463                return null;
464        if ("contained".equals(codeString))
465          return CONTAINED;
466        if ("referenced".equals(codeString))
467          return REFERENCED;
468        if ("bundled".equals(codeString))
469          return BUNDLED;
470        if (Configuration.isAcceptInvalidEnums())
471          return null;
472        else
473          throw new FHIRException("Unknown AggregationMode code '"+codeString+"'");
474        }
475        public String toCode() {
476          switch (this) {
477            case CONTAINED: return "contained";
478            case REFERENCED: return "referenced";
479            case BUNDLED: return "bundled";
480            default: return "?";
481          }
482        }
483        public String getSystem() {
484          switch (this) {
485            case CONTAINED: return "http://hl7.org/fhir/resource-aggregation-mode";
486            case REFERENCED: return "http://hl7.org/fhir/resource-aggregation-mode";
487            case BUNDLED: return "http://hl7.org/fhir/resource-aggregation-mode";
488            default: return "?";
489          }
490        }
491        public String getDefinition() {
492          switch (this) {
493            case CONTAINED: return "The reference is a local reference to a contained resource.";
494            case REFERENCED: return "The reference to a resource that has to be resolved externally to the resource that includes the reference.";
495            case BUNDLED: return "The resource the reference points to will be found in the same bundle as the resource that includes the reference.";
496            default: return "?";
497          }
498        }
499        public String getDisplay() {
500          switch (this) {
501            case CONTAINED: return "Contained";
502            case REFERENCED: return "Referenced";
503            case BUNDLED: return "Bundled";
504            default: return "?";
505          }
506        }
507    }
508
509  public static class AggregationModeEnumFactory implements EnumFactory<AggregationMode> {
510    public AggregationMode fromCode(String codeString) throws IllegalArgumentException {
511      if (codeString == null || "".equals(codeString))
512            if (codeString == null || "".equals(codeString))
513                return null;
514        if ("contained".equals(codeString))
515          return AggregationMode.CONTAINED;
516        if ("referenced".equals(codeString))
517          return AggregationMode.REFERENCED;
518        if ("bundled".equals(codeString))
519          return AggregationMode.BUNDLED;
520        throw new IllegalArgumentException("Unknown AggregationMode code '"+codeString+"'");
521        }
522        public Enumeration<AggregationMode> fromType(Base code) throws FHIRException {
523          if (code == null)
524            return null;
525          if (code.isEmpty())
526            return new Enumeration<AggregationMode>(this);
527          String codeString = ((PrimitiveType) code).asStringValue();
528          if (codeString == null || "".equals(codeString))
529            return null;
530        if ("contained".equals(codeString))
531          return new Enumeration<AggregationMode>(this, AggregationMode.CONTAINED);
532        if ("referenced".equals(codeString))
533          return new Enumeration<AggregationMode>(this, AggregationMode.REFERENCED);
534        if ("bundled".equals(codeString))
535          return new Enumeration<AggregationMode>(this, AggregationMode.BUNDLED);
536        throw new FHIRException("Unknown AggregationMode code '"+codeString+"'");
537        }
538    public String toCode(AggregationMode code) {
539      if (code == AggregationMode.CONTAINED)
540        return "contained";
541      if (code == AggregationMode.REFERENCED)
542        return "referenced";
543      if (code == AggregationMode.BUNDLED)
544        return "bundled";
545      return "?";
546      }
547    public String toSystem(AggregationMode code) {
548      return code.getSystem();
549      }
550    }
551
552    public enum ReferenceVersionRules {
553        /**
554         * The reference may be either version independent or version specific
555         */
556        EITHER, 
557        /**
558         * The reference must be version independent
559         */
560        INDEPENDENT, 
561        /**
562         * The reference must be version specific
563         */
564        SPECIFIC, 
565        /**
566         * added to help the parsers with the generic types
567         */
568        NULL;
569        public static ReferenceVersionRules fromCode(String codeString) throws FHIRException {
570            if (codeString == null || "".equals(codeString))
571                return null;
572        if ("either".equals(codeString))
573          return EITHER;
574        if ("independent".equals(codeString))
575          return INDEPENDENT;
576        if ("specific".equals(codeString))
577          return SPECIFIC;
578        if (Configuration.isAcceptInvalidEnums())
579          return null;
580        else
581          throw new FHIRException("Unknown ReferenceVersionRules code '"+codeString+"'");
582        }
583        public String toCode() {
584          switch (this) {
585            case EITHER: return "either";
586            case INDEPENDENT: return "independent";
587            case SPECIFIC: return "specific";
588            default: return "?";
589          }
590        }
591        public String getSystem() {
592          switch (this) {
593            case EITHER: return "http://hl7.org/fhir/reference-version-rules";
594            case INDEPENDENT: return "http://hl7.org/fhir/reference-version-rules";
595            case SPECIFIC: return "http://hl7.org/fhir/reference-version-rules";
596            default: return "?";
597          }
598        }
599        public String getDefinition() {
600          switch (this) {
601            case EITHER: return "The reference may be either version independent or version specific";
602            case INDEPENDENT: return "The reference must be version independent";
603            case SPECIFIC: return "The reference must be version specific";
604            default: return "?";
605          }
606        }
607        public String getDisplay() {
608          switch (this) {
609            case EITHER: return "Either Specific or independent";
610            case INDEPENDENT: return "Version independent";
611            case SPECIFIC: return "Version Specific";
612            default: return "?";
613          }
614        }
615    }
616
617  public static class ReferenceVersionRulesEnumFactory implements EnumFactory<ReferenceVersionRules> {
618    public ReferenceVersionRules fromCode(String codeString) throws IllegalArgumentException {
619      if (codeString == null || "".equals(codeString))
620            if (codeString == null || "".equals(codeString))
621                return null;
622        if ("either".equals(codeString))
623          return ReferenceVersionRules.EITHER;
624        if ("independent".equals(codeString))
625          return ReferenceVersionRules.INDEPENDENT;
626        if ("specific".equals(codeString))
627          return ReferenceVersionRules.SPECIFIC;
628        throw new IllegalArgumentException("Unknown ReferenceVersionRules code '"+codeString+"'");
629        }
630        public Enumeration<ReferenceVersionRules> fromType(Base code) throws FHIRException {
631          if (code == null)
632            return null;
633          if (code.isEmpty())
634            return new Enumeration<ReferenceVersionRules>(this);
635          String codeString = ((PrimitiveType) code).asStringValue();
636          if (codeString == null || "".equals(codeString))
637            return null;
638        if ("either".equals(codeString))
639          return new Enumeration<ReferenceVersionRules>(this, ReferenceVersionRules.EITHER);
640        if ("independent".equals(codeString))
641          return new Enumeration<ReferenceVersionRules>(this, ReferenceVersionRules.INDEPENDENT);
642        if ("specific".equals(codeString))
643          return new Enumeration<ReferenceVersionRules>(this, ReferenceVersionRules.SPECIFIC);
644        throw new FHIRException("Unknown ReferenceVersionRules code '"+codeString+"'");
645        }
646    public String toCode(ReferenceVersionRules code) {
647      if (code == ReferenceVersionRules.EITHER)
648        return "either";
649      if (code == ReferenceVersionRules.INDEPENDENT)
650        return "independent";
651      if (code == ReferenceVersionRules.SPECIFIC)
652        return "specific";
653      return "?";
654      }
655    public String toSystem(ReferenceVersionRules code) {
656      return code.getSystem();
657      }
658    }
659
660    public enum ConstraintSeverity {
661        /**
662         * If the constraint is violated, the resource is not conformant.
663         */
664        ERROR, 
665        /**
666         * If the constraint is violated, the resource is conformant, but it is not necessarily following best practice.
667         */
668        WARNING, 
669        /**
670         * added to help the parsers with the generic types
671         */
672        NULL;
673        public static ConstraintSeverity fromCode(String codeString) throws FHIRException {
674            if (codeString == null || "".equals(codeString))
675                return null;
676        if ("error".equals(codeString))
677          return ERROR;
678        if ("warning".equals(codeString))
679          return WARNING;
680        if (Configuration.isAcceptInvalidEnums())
681          return null;
682        else
683          throw new FHIRException("Unknown ConstraintSeverity code '"+codeString+"'");
684        }
685        public String toCode() {
686          switch (this) {
687            case ERROR: return "error";
688            case WARNING: return "warning";
689            default: return "?";
690          }
691        }
692        public String getSystem() {
693          switch (this) {
694            case ERROR: return "http://hl7.org/fhir/constraint-severity";
695            case WARNING: return "http://hl7.org/fhir/constraint-severity";
696            default: return "?";
697          }
698        }
699        public String getDefinition() {
700          switch (this) {
701            case ERROR: return "If the constraint is violated, the resource is not conformant.";
702            case WARNING: return "If the constraint is violated, the resource is conformant, but it is not necessarily following best practice.";
703            default: return "?";
704          }
705        }
706        public String getDisplay() {
707          switch (this) {
708            case ERROR: return "Error";
709            case WARNING: return "Warning";
710            default: return "?";
711          }
712        }
713    }
714
715  public static class ConstraintSeverityEnumFactory implements EnumFactory<ConstraintSeverity> {
716    public ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException {
717      if (codeString == null || "".equals(codeString))
718            if (codeString == null || "".equals(codeString))
719                return null;
720        if ("error".equals(codeString))
721          return ConstraintSeverity.ERROR;
722        if ("warning".equals(codeString))
723          return ConstraintSeverity.WARNING;
724        throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'");
725        }
726        public Enumeration<ConstraintSeverity> fromType(Base code) throws FHIRException {
727          if (code == null)
728            return null;
729          if (code.isEmpty())
730            return new Enumeration<ConstraintSeverity>(this);
731          String codeString = ((PrimitiveType) code).asStringValue();
732          if (codeString == null || "".equals(codeString))
733            return null;
734        if ("error".equals(codeString))
735          return new Enumeration<ConstraintSeverity>(this, ConstraintSeverity.ERROR);
736        if ("warning".equals(codeString))
737          return new Enumeration<ConstraintSeverity>(this, ConstraintSeverity.WARNING);
738        throw new FHIRException("Unknown ConstraintSeverity code '"+codeString+"'");
739        }
740    public String toCode(ConstraintSeverity code) {
741      if (code == ConstraintSeverity.ERROR)
742        return "error";
743      if (code == ConstraintSeverity.WARNING)
744        return "warning";
745      return "?";
746      }
747    public String toSystem(ConstraintSeverity code) {
748      return code.getSystem();
749      }
750    }
751
752    @Block()
753    public static class ElementDefinitionSlicingComponent extends Element implements IBaseDatatypeElement {
754        /**
755         * Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.
756         */
757        @Child(name = "discriminator", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
758        @Description(shortDefinition="Element values that are used to distinguish the slices", formalDefinition="Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices." )
759        protected List<ElementDefinitionSlicingDiscriminatorComponent> discriminator;
760
761        /**
762         * A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.
763         */
764        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
765        @Description(shortDefinition="Text description of how slicing works (or not)", formalDefinition="A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated." )
766        protected StringType description;
767
768        /**
769         * If the matching elements have to occur in the same order as defined in the profile.
770         */
771        @Child(name = "ordered", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true)
772        @Description(shortDefinition="If elements must be in same order as slices", formalDefinition="If the matching elements have to occur in the same order as defined in the profile." )
773        protected BooleanType ordered;
774
775        /**
776         * Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.
777         */
778        @Child(name = "rules", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true)
779        @Description(shortDefinition="closed | open | openAtEnd", formalDefinition="Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end." )
780        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-slicing-rules")
781        protected Enumeration<SlicingRules> rules;
782
783        private static final long serialVersionUID = -311635839L;
784
785    /**
786     * Constructor
787     */
788      public ElementDefinitionSlicingComponent() {
789        super();
790      }
791
792    /**
793     * Constructor
794     */
795      public ElementDefinitionSlicingComponent(Enumeration<SlicingRules> rules) {
796        super();
797        this.rules = rules;
798      }
799
800        /**
801         * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.)
802         */
803        public List<ElementDefinitionSlicingDiscriminatorComponent> getDiscriminator() { 
804          if (this.discriminator == null)
805            this.discriminator = new ArrayList<ElementDefinitionSlicingDiscriminatorComponent>();
806          return this.discriminator;
807        }
808
809        /**
810         * @return Returns a reference to <code>this</code> for easy method chaining
811         */
812        public ElementDefinitionSlicingComponent setDiscriminator(List<ElementDefinitionSlicingDiscriminatorComponent> theDiscriminator) { 
813          this.discriminator = theDiscriminator;
814          return this;
815        }
816
817        public boolean hasDiscriminator() { 
818          if (this.discriminator == null)
819            return false;
820          for (ElementDefinitionSlicingDiscriminatorComponent item : this.discriminator)
821            if (!item.isEmpty())
822              return true;
823          return false;
824        }
825
826        public ElementDefinitionSlicingDiscriminatorComponent addDiscriminator() { //3
827          ElementDefinitionSlicingDiscriminatorComponent t = new ElementDefinitionSlicingDiscriminatorComponent();
828          if (this.discriminator == null)
829            this.discriminator = new ArrayList<ElementDefinitionSlicingDiscriminatorComponent>();
830          this.discriminator.add(t);
831          return t;
832        }
833
834        public ElementDefinitionSlicingComponent addDiscriminator(ElementDefinitionSlicingDiscriminatorComponent t) { //3
835          if (t == null)
836            return this;
837          if (this.discriminator == null)
838            this.discriminator = new ArrayList<ElementDefinitionSlicingDiscriminatorComponent>();
839          this.discriminator.add(t);
840          return this;
841        }
842
843        /**
844         * @return The first repetition of repeating field {@link #discriminator}, creating it if it does not already exist
845         */
846        public ElementDefinitionSlicingDiscriminatorComponent getDiscriminatorFirstRep() { 
847          if (getDiscriminator().isEmpty()) {
848            addDiscriminator();
849          }
850          return getDiscriminator().get(0);
851        }
852
853        /**
854         * @return {@link #description} (A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
855         */
856        public StringType getDescriptionElement() { 
857          if (this.description == null)
858            if (Configuration.errorOnAutoCreate())
859              throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.description");
860            else if (Configuration.doAutoCreate())
861              this.description = new StringType(); // bb
862          return this.description;
863        }
864
865        public boolean hasDescriptionElement() { 
866          return this.description != null && !this.description.isEmpty();
867        }
868
869        public boolean hasDescription() { 
870          return this.description != null && !this.description.isEmpty();
871        }
872
873        /**
874         * @param value {@link #description} (A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
875         */
876        public ElementDefinitionSlicingComponent setDescriptionElement(StringType value) { 
877          this.description = value;
878          return this;
879        }
880
881        /**
882         * @return A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.
883         */
884        public String getDescription() { 
885          return this.description == null ? null : this.description.getValue();
886        }
887
888        /**
889         * @param value A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.
890         */
891        public ElementDefinitionSlicingComponent setDescription(String value) { 
892          if (Utilities.noString(value))
893            this.description = null;
894          else {
895            if (this.description == null)
896              this.description = new StringType();
897            this.description.setValue(value);
898          }
899          return this;
900        }
901
902        /**
903         * @return {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value
904         */
905        public BooleanType getOrderedElement() { 
906          if (this.ordered == null)
907            if (Configuration.errorOnAutoCreate())
908              throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.ordered");
909            else if (Configuration.doAutoCreate())
910              this.ordered = new BooleanType(); // bb
911          return this.ordered;
912        }
913
914        public boolean hasOrderedElement() { 
915          return this.ordered != null && !this.ordered.isEmpty();
916        }
917
918        public boolean hasOrdered() { 
919          return this.ordered != null && !this.ordered.isEmpty();
920        }
921
922        /**
923         * @param value {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value
924         */
925        public ElementDefinitionSlicingComponent setOrderedElement(BooleanType value) { 
926          this.ordered = value;
927          return this;
928        }
929
930        /**
931         * @return If the matching elements have to occur in the same order as defined in the profile.
932         */
933        public boolean getOrdered() { 
934          return this.ordered == null || this.ordered.isEmpty() ? false : this.ordered.getValue();
935        }
936
937        /**
938         * @param value If the matching elements have to occur in the same order as defined in the profile.
939         */
940        public ElementDefinitionSlicingComponent setOrdered(boolean value) { 
941            if (this.ordered == null)
942              this.ordered = new BooleanType();
943            this.ordered.setValue(value);
944          return this;
945        }
946
947        /**
948         * @return {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value
949         */
950        public Enumeration<SlicingRules> getRulesElement() { 
951          if (this.rules == null)
952            if (Configuration.errorOnAutoCreate())
953              throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.rules");
954            else if (Configuration.doAutoCreate())
955              this.rules = new Enumeration<SlicingRules>(new SlicingRulesEnumFactory()); // bb
956          return this.rules;
957        }
958
959        public boolean hasRulesElement() { 
960          return this.rules != null && !this.rules.isEmpty();
961        }
962
963        public boolean hasRules() { 
964          return this.rules != null && !this.rules.isEmpty();
965        }
966
967        /**
968         * @param value {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value
969         */
970        public ElementDefinitionSlicingComponent setRulesElement(Enumeration<SlicingRules> value) { 
971          this.rules = value;
972          return this;
973        }
974
975        /**
976         * @return Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.
977         */
978        public SlicingRules getRules() { 
979          return this.rules == null ? null : this.rules.getValue();
980        }
981
982        /**
983         * @param value Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.
984         */
985        public ElementDefinitionSlicingComponent setRules(SlicingRules value) { 
986            if (this.rules == null)
987              this.rules = new Enumeration<SlicingRules>(new SlicingRulesEnumFactory());
988            this.rules.setValue(value);
989          return this;
990        }
991
992        protected void listChildren(List<Property> children) {
993          super.listChildren(children);
994          children.add(new Property("discriminator", "", "Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.", 0, java.lang.Integer.MAX_VALUE, discriminator));
995          children.add(new Property("description", "string", "A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.", 0, 1, description));
996          children.add(new Property("ordered", "boolean", "If the matching elements have to occur in the same order as defined in the profile.", 0, 1, ordered));
997          children.add(new Property("rules", "code", "Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.", 0, 1, rules));
998        }
999
1000        @Override
1001        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1002          switch (_hash) {
1003          case -1888270692: /*discriminator*/  return new Property("discriminator", "", "Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.", 0, java.lang.Integer.MAX_VALUE, discriminator);
1004          case -1724546052: /*description*/  return new Property("description", "string", "A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.", 0, 1, description);
1005          case -1207109523: /*ordered*/  return new Property("ordered", "boolean", "If the matching elements have to occur in the same order as defined in the profile.", 0, 1, ordered);
1006          case 108873975: /*rules*/  return new Property("rules", "code", "Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.", 0, 1, rules);
1007          default: return super.getNamedProperty(_hash, _name, _checkValid);
1008          }
1009
1010        }
1011
1012      @Override
1013      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1014        switch (hash) {
1015        case -1888270692: /*discriminator*/ return this.discriminator == null ? new Base[0] : this.discriminator.toArray(new Base[this.discriminator.size()]); // ElementDefinitionSlicingDiscriminatorComponent
1016        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1017        case -1207109523: /*ordered*/ return this.ordered == null ? new Base[0] : new Base[] {this.ordered}; // BooleanType
1018        case 108873975: /*rules*/ return this.rules == null ? new Base[0] : new Base[] {this.rules}; // Enumeration<SlicingRules>
1019        default: return super.getProperty(hash, name, checkValid);
1020        }
1021
1022      }
1023
1024      @Override
1025      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1026        switch (hash) {
1027        case -1888270692: // discriminator
1028          this.getDiscriminator().add((ElementDefinitionSlicingDiscriminatorComponent) value); // ElementDefinitionSlicingDiscriminatorComponent
1029          return value;
1030        case -1724546052: // description
1031          this.description = castToString(value); // StringType
1032          return value;
1033        case -1207109523: // ordered
1034          this.ordered = castToBoolean(value); // BooleanType
1035          return value;
1036        case 108873975: // rules
1037          value = new SlicingRulesEnumFactory().fromType(castToCode(value));
1038          this.rules = (Enumeration) value; // Enumeration<SlicingRules>
1039          return value;
1040        default: return super.setProperty(hash, name, value);
1041        }
1042
1043      }
1044
1045      @Override
1046      public Base setProperty(String name, Base value) throws FHIRException {
1047        if (name.equals("discriminator")) {
1048          this.getDiscriminator().add((ElementDefinitionSlicingDiscriminatorComponent) value);
1049        } else if (name.equals("description")) {
1050          this.description = castToString(value); // StringType
1051        } else if (name.equals("ordered")) {
1052          this.ordered = castToBoolean(value); // BooleanType
1053        } else if (name.equals("rules")) {
1054          value = new SlicingRulesEnumFactory().fromType(castToCode(value));
1055          this.rules = (Enumeration) value; // Enumeration<SlicingRules>
1056        } else
1057          return super.setProperty(name, value);
1058        return value;
1059      }
1060
1061      @Override
1062      public Base makeProperty(int hash, String name) throws FHIRException {
1063        switch (hash) {
1064        case -1888270692:  return addDiscriminator(); 
1065        case -1724546052:  return getDescriptionElement();
1066        case -1207109523:  return getOrderedElement();
1067        case 108873975:  return getRulesElement();
1068        default: return super.makeProperty(hash, name);
1069        }
1070
1071      }
1072
1073      @Override
1074      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1075        switch (hash) {
1076        case -1888270692: /*discriminator*/ return new String[] {};
1077        case -1724546052: /*description*/ return new String[] {"string"};
1078        case -1207109523: /*ordered*/ return new String[] {"boolean"};
1079        case 108873975: /*rules*/ return new String[] {"code"};
1080        default: return super.getTypesForProperty(hash, name);
1081        }
1082
1083      }
1084
1085      @Override
1086      public Base addChild(String name) throws FHIRException {
1087        if (name.equals("discriminator")) {
1088          return addDiscriminator();
1089        }
1090        else if (name.equals("description")) {
1091          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.description");
1092        }
1093        else if (name.equals("ordered")) {
1094          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.ordered");
1095        }
1096        else if (name.equals("rules")) {
1097          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.rules");
1098        }
1099        else
1100          return super.addChild(name);
1101      }
1102
1103      public ElementDefinitionSlicingComponent copy() {
1104        ElementDefinitionSlicingComponent dst = new ElementDefinitionSlicingComponent();
1105        copyValues(dst);
1106        if (discriminator != null) {
1107          dst.discriminator = new ArrayList<ElementDefinitionSlicingDiscriminatorComponent>();
1108          for (ElementDefinitionSlicingDiscriminatorComponent i : discriminator)
1109            dst.discriminator.add(i.copy());
1110        };
1111        dst.description = description == null ? null : description.copy();
1112        dst.ordered = ordered == null ? null : ordered.copy();
1113        dst.rules = rules == null ? null : rules.copy();
1114        return dst;
1115      }
1116
1117      @Override
1118      public boolean equalsDeep(Base other_) {
1119        if (!super.equalsDeep(other_))
1120          return false;
1121        if (!(other_ instanceof ElementDefinitionSlicingComponent))
1122          return false;
1123        ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other_;
1124        return compareDeep(discriminator, o.discriminator, true) && compareDeep(description, o.description, true)
1125           && compareDeep(ordered, o.ordered, true) && compareDeep(rules, o.rules, true);
1126      }
1127
1128      @Override
1129      public boolean equalsShallow(Base other_) {
1130        if (!super.equalsShallow(other_))
1131          return false;
1132        if (!(other_ instanceof ElementDefinitionSlicingComponent))
1133          return false;
1134        ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other_;
1135        return compareValues(description, o.description, true) && compareValues(ordered, o.ordered, true) && compareValues(rules, o.rules, true)
1136          ;
1137      }
1138
1139      public boolean isEmpty() {
1140        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(discriminator, description
1141          , ordered, rules);
1142      }
1143
1144  public String fhirType() {
1145    return "ElementDefinition.slicing";
1146
1147  }
1148
1149  }
1150
1151    @Block()
1152    public static class ElementDefinitionSlicingDiscriminatorComponent extends Element implements IBaseDatatypeElement {
1153        /**
1154         * How the element value is interpreted when discrimination is evaluated.
1155         */
1156        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1157        @Description(shortDefinition="value | exists | pattern | type | profile", formalDefinition="How the element value is interpreted when discrimination is evaluated." )
1158        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/discriminator-type")
1159        protected Enumeration<DiscriminatorType> type;
1160
1161        /**
1162         * A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.
1163         */
1164        @Child(name = "path", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1165        @Description(shortDefinition="Path to element value", formalDefinition="A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based." )
1166        protected StringType path;
1167
1168        private static final long serialVersionUID = 1151159293L;
1169
1170    /**
1171     * Constructor
1172     */
1173      public ElementDefinitionSlicingDiscriminatorComponent() {
1174        super();
1175      }
1176
1177    /**
1178     * Constructor
1179     */
1180      public ElementDefinitionSlicingDiscriminatorComponent(Enumeration<DiscriminatorType> type, StringType path) {
1181        super();
1182        this.type = type;
1183        this.path = path;
1184      }
1185
1186        /**
1187         * @return {@link #type} (How the element value is interpreted when discrimination is evaluated.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1188         */
1189        public Enumeration<DiscriminatorType> getTypeElement() { 
1190          if (this.type == null)
1191            if (Configuration.errorOnAutoCreate())
1192              throw new Error("Attempt to auto-create ElementDefinitionSlicingDiscriminatorComponent.type");
1193            else if (Configuration.doAutoCreate())
1194              this.type = new Enumeration<DiscriminatorType>(new DiscriminatorTypeEnumFactory()); // bb
1195          return this.type;
1196        }
1197
1198        public boolean hasTypeElement() { 
1199          return this.type != null && !this.type.isEmpty();
1200        }
1201
1202        public boolean hasType() { 
1203          return this.type != null && !this.type.isEmpty();
1204        }
1205
1206        /**
1207         * @param value {@link #type} (How the element value is interpreted when discrimination is evaluated.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1208         */
1209        public ElementDefinitionSlicingDiscriminatorComponent setTypeElement(Enumeration<DiscriminatorType> value) { 
1210          this.type = value;
1211          return this;
1212        }
1213
1214        /**
1215         * @return How the element value is interpreted when discrimination is evaluated.
1216         */
1217        public DiscriminatorType getType() { 
1218          return this.type == null ? null : this.type.getValue();
1219        }
1220
1221        /**
1222         * @param value How the element value is interpreted when discrimination is evaluated.
1223         */
1224        public ElementDefinitionSlicingDiscriminatorComponent setType(DiscriminatorType value) { 
1225            if (this.type == null)
1226              this.type = new Enumeration<DiscriminatorType>(new DiscriminatorTypeEnumFactory());
1227            this.type.setValue(value);
1228          return this;
1229        }
1230
1231        /**
1232         * @return {@link #path} (A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
1233         */
1234        public StringType getPathElement() { 
1235          if (this.path == null)
1236            if (Configuration.errorOnAutoCreate())
1237              throw new Error("Attempt to auto-create ElementDefinitionSlicingDiscriminatorComponent.path");
1238            else if (Configuration.doAutoCreate())
1239              this.path = new StringType(); // bb
1240          return this.path;
1241        }
1242
1243        public boolean hasPathElement() { 
1244          return this.path != null && !this.path.isEmpty();
1245        }
1246
1247        public boolean hasPath() { 
1248          return this.path != null && !this.path.isEmpty();
1249        }
1250
1251        /**
1252         * @param value {@link #path} (A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
1253         */
1254        public ElementDefinitionSlicingDiscriminatorComponent setPathElement(StringType value) { 
1255          this.path = value;
1256          return this;
1257        }
1258
1259        /**
1260         * @return A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.
1261         */
1262        public String getPath() { 
1263          return this.path == null ? null : this.path.getValue();
1264        }
1265
1266        /**
1267         * @param value A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.
1268         */
1269        public ElementDefinitionSlicingDiscriminatorComponent setPath(String value) { 
1270            if (this.path == null)
1271              this.path = new StringType();
1272            this.path.setValue(value);
1273          return this;
1274        }
1275
1276        protected void listChildren(List<Property> children) {
1277          super.listChildren(children);
1278          children.add(new Property("type", "code", "How the element value is interpreted when discrimination is evaluated.", 0, 1, type));
1279          children.add(new Property("path", "string", "A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.", 0, 1, path));
1280        }
1281
1282        @Override
1283        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1284          switch (_hash) {
1285          case 3575610: /*type*/  return new Property("type", "code", "How the element value is interpreted when discrimination is evaluated.", 0, 1, type);
1286          case 3433509: /*path*/  return new Property("path", "string", "A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.", 0, 1, path);
1287          default: return super.getNamedProperty(_hash, _name, _checkValid);
1288          }
1289
1290        }
1291
1292      @Override
1293      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1294        switch (hash) {
1295        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<DiscriminatorType>
1296        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
1297        default: return super.getProperty(hash, name, checkValid);
1298        }
1299
1300      }
1301
1302      @Override
1303      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1304        switch (hash) {
1305        case 3575610: // type
1306          value = new DiscriminatorTypeEnumFactory().fromType(castToCode(value));
1307          this.type = (Enumeration) value; // Enumeration<DiscriminatorType>
1308          return value;
1309        case 3433509: // path
1310          this.path = castToString(value); // StringType
1311          return value;
1312        default: return super.setProperty(hash, name, value);
1313        }
1314
1315      }
1316
1317      @Override
1318      public Base setProperty(String name, Base value) throws FHIRException {
1319        if (name.equals("type")) {
1320          value = new DiscriminatorTypeEnumFactory().fromType(castToCode(value));
1321          this.type = (Enumeration) value; // Enumeration<DiscriminatorType>
1322        } else if (name.equals("path")) {
1323          this.path = castToString(value); // StringType
1324        } else
1325          return super.setProperty(name, value);
1326        return value;
1327      }
1328
1329      @Override
1330      public Base makeProperty(int hash, String name) throws FHIRException {
1331        switch (hash) {
1332        case 3575610:  return getTypeElement();
1333        case 3433509:  return getPathElement();
1334        default: return super.makeProperty(hash, name);
1335        }
1336
1337      }
1338
1339      @Override
1340      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1341        switch (hash) {
1342        case 3575610: /*type*/ return new String[] {"code"};
1343        case 3433509: /*path*/ return new String[] {"string"};
1344        default: return super.getTypesForProperty(hash, name);
1345        }
1346
1347      }
1348
1349      @Override
1350      public Base addChild(String name) throws FHIRException {
1351        if (name.equals("type")) {
1352          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.type");
1353        }
1354        else if (name.equals("path")) {
1355          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.path");
1356        }
1357        else
1358          return super.addChild(name);
1359      }
1360
1361      public ElementDefinitionSlicingDiscriminatorComponent copy() {
1362        ElementDefinitionSlicingDiscriminatorComponent dst = new ElementDefinitionSlicingDiscriminatorComponent();
1363        copyValues(dst);
1364        dst.type = type == null ? null : type.copy();
1365        dst.path = path == null ? null : path.copy();
1366        return dst;
1367      }
1368
1369      @Override
1370      public boolean equalsDeep(Base other_) {
1371        if (!super.equalsDeep(other_))
1372          return false;
1373        if (!(other_ instanceof ElementDefinitionSlicingDiscriminatorComponent))
1374          return false;
1375        ElementDefinitionSlicingDiscriminatorComponent o = (ElementDefinitionSlicingDiscriminatorComponent) other_;
1376        return compareDeep(type, o.type, true) && compareDeep(path, o.path, true);
1377      }
1378
1379      @Override
1380      public boolean equalsShallow(Base other_) {
1381        if (!super.equalsShallow(other_))
1382          return false;
1383        if (!(other_ instanceof ElementDefinitionSlicingDiscriminatorComponent))
1384          return false;
1385        ElementDefinitionSlicingDiscriminatorComponent o = (ElementDefinitionSlicingDiscriminatorComponent) other_;
1386        return compareValues(type, o.type, true) && compareValues(path, o.path, true);
1387      }
1388
1389      public boolean isEmpty() {
1390        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, path);
1391      }
1392
1393  public String fhirType() {
1394    return "ElementDefinition.slicing.discriminator";
1395
1396  }
1397
1398  }
1399
1400    @Block()
1401    public static class ElementDefinitionBaseComponent extends Element implements IBaseDatatypeElement {
1402        /**
1403         * The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.
1404         */
1405        @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1406        @Description(shortDefinition="Path that identifies the base element", formalDefinition="The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base." )
1407        protected StringType path;
1408
1409        /**
1410         * Minimum cardinality of the base element identified by the path.
1411         */
1412        @Child(name = "min", type = {UnsignedIntType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1413        @Description(shortDefinition="Min cardinality of the base element", formalDefinition="Minimum cardinality of the base element identified by the path." )
1414        protected UnsignedIntType min;
1415
1416        /**
1417         * Maximum cardinality of the base element identified by the path.
1418         */
1419        @Child(name = "max", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true)
1420        @Description(shortDefinition="Max cardinality of the base element", formalDefinition="Maximum cardinality of the base element identified by the path." )
1421        protected StringType max;
1422
1423        private static final long serialVersionUID = -1412704221L;
1424
1425    /**
1426     * Constructor
1427     */
1428      public ElementDefinitionBaseComponent() {
1429        super();
1430      }
1431
1432    /**
1433     * Constructor
1434     */
1435      public ElementDefinitionBaseComponent(StringType path, UnsignedIntType min, StringType max) {
1436        super();
1437        this.path = path;
1438        this.min = min;
1439        this.max = max;
1440      }
1441
1442        /**
1443         * @return {@link #path} (The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
1444         */
1445        public StringType getPathElement() { 
1446          if (this.path == null)
1447            if (Configuration.errorOnAutoCreate())
1448              throw new Error("Attempt to auto-create ElementDefinitionBaseComponent.path");
1449            else if (Configuration.doAutoCreate())
1450              this.path = new StringType(); // bb
1451          return this.path;
1452        }
1453
1454        public boolean hasPathElement() { 
1455          return this.path != null && !this.path.isEmpty();
1456        }
1457
1458        public boolean hasPath() { 
1459          return this.path != null && !this.path.isEmpty();
1460        }
1461
1462        /**
1463         * @param value {@link #path} (The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
1464         */
1465        public ElementDefinitionBaseComponent setPathElement(StringType value) { 
1466          this.path = value;
1467          return this;
1468        }
1469
1470        /**
1471         * @return The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.
1472         */
1473        public String getPath() { 
1474          return this.path == null ? null : this.path.getValue();
1475        }
1476
1477        /**
1478         * @param value The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.
1479         */
1480        public ElementDefinitionBaseComponent setPath(String value) { 
1481            if (this.path == null)
1482              this.path = new StringType();
1483            this.path.setValue(value);
1484          return this;
1485        }
1486
1487        /**
1488         * @return {@link #min} (Minimum cardinality of the base element identified by the path.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
1489         */
1490        public UnsignedIntType getMinElement() { 
1491          if (this.min == null)
1492            if (Configuration.errorOnAutoCreate())
1493              throw new Error("Attempt to auto-create ElementDefinitionBaseComponent.min");
1494            else if (Configuration.doAutoCreate())
1495              this.min = new UnsignedIntType(); // bb
1496          return this.min;
1497        }
1498
1499        public boolean hasMinElement() { 
1500          return this.min != null && !this.min.isEmpty();
1501        }
1502
1503        public boolean hasMin() { 
1504          return this.min != null && !this.min.isEmpty();
1505        }
1506
1507        /**
1508         * @param value {@link #min} (Minimum cardinality of the base element identified by the path.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
1509         */
1510        public ElementDefinitionBaseComponent setMinElement(UnsignedIntType value) { 
1511          this.min = value;
1512          return this;
1513        }
1514
1515        /**
1516         * @return Minimum cardinality of the base element identified by the path.
1517         */
1518        public int getMin() { 
1519          return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue();
1520        }
1521
1522        /**
1523         * @param value Minimum cardinality of the base element identified by the path.
1524         */
1525        public ElementDefinitionBaseComponent setMin(int value) { 
1526            if (this.min == null)
1527              this.min = new UnsignedIntType();
1528            this.min.setValue(value);
1529          return this;
1530        }
1531
1532        /**
1533         * @return {@link #max} (Maximum cardinality of the base element identified by the path.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
1534         */
1535        public StringType getMaxElement() { 
1536          if (this.max == null)
1537            if (Configuration.errorOnAutoCreate())
1538              throw new Error("Attempt to auto-create ElementDefinitionBaseComponent.max");
1539            else if (Configuration.doAutoCreate())
1540              this.max = new StringType(); // bb
1541          return this.max;
1542        }
1543
1544        public boolean hasMaxElement() { 
1545          return this.max != null && !this.max.isEmpty();
1546        }
1547
1548        public boolean hasMax() { 
1549          return this.max != null && !this.max.isEmpty();
1550        }
1551
1552        /**
1553         * @param value {@link #max} (Maximum cardinality of the base element identified by the path.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
1554         */
1555        public ElementDefinitionBaseComponent setMaxElement(StringType value) { 
1556          this.max = value;
1557          return this;
1558        }
1559
1560        /**
1561         * @return Maximum cardinality of the base element identified by the path.
1562         */
1563        public String getMax() { 
1564          return this.max == null ? null : this.max.getValue();
1565        }
1566
1567        /**
1568         * @param value Maximum cardinality of the base element identified by the path.
1569         */
1570        public ElementDefinitionBaseComponent setMax(String value) { 
1571            if (this.max == null)
1572              this.max = new StringType();
1573            this.max.setValue(value);
1574          return this;
1575        }
1576
1577        protected void listChildren(List<Property> children) {
1578          super.listChildren(children);
1579          children.add(new Property("path", "string", "The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.", 0, 1, path));
1580          children.add(new Property("min", "unsignedInt", "Minimum cardinality of the base element identified by the path.", 0, 1, min));
1581          children.add(new Property("max", "string", "Maximum cardinality of the base element identified by the path.", 0, 1, max));
1582        }
1583
1584        @Override
1585        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1586          switch (_hash) {
1587          case 3433509: /*path*/  return new Property("path", "string", "The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.", 0, 1, path);
1588          case 108114: /*min*/  return new Property("min", "unsignedInt", "Minimum cardinality of the base element identified by the path.", 0, 1, min);
1589          case 107876: /*max*/  return new Property("max", "string", "Maximum cardinality of the base element identified by the path.", 0, 1, max);
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 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
1599        case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // UnsignedIntType
1600        case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType
1601        default: return super.getProperty(hash, name, checkValid);
1602        }
1603
1604      }
1605
1606      @Override
1607      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1608        switch (hash) {
1609        case 3433509: // path
1610          this.path = castToString(value); // StringType
1611          return value;
1612        case 108114: // min
1613          this.min = castToUnsignedInt(value); // UnsignedIntType
1614          return value;
1615        case 107876: // max
1616          this.max = castToString(value); // StringType
1617          return value;
1618        default: return super.setProperty(hash, name, value);
1619        }
1620
1621      }
1622
1623      @Override
1624      public Base setProperty(String name, Base value) throws FHIRException {
1625        if (name.equals("path")) {
1626          this.path = castToString(value); // StringType
1627        } else if (name.equals("min")) {
1628          this.min = castToUnsignedInt(value); // UnsignedIntType
1629        } else if (name.equals("max")) {
1630          this.max = castToString(value); // StringType
1631        } else
1632          return super.setProperty(name, value);
1633        return value;
1634      }
1635
1636      @Override
1637      public Base makeProperty(int hash, String name) throws FHIRException {
1638        switch (hash) {
1639        case 3433509:  return getPathElement();
1640        case 108114:  return getMinElement();
1641        case 107876:  return getMaxElement();
1642        default: return super.makeProperty(hash, name);
1643        }
1644
1645      }
1646
1647      @Override
1648      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1649        switch (hash) {
1650        case 3433509: /*path*/ return new String[] {"string"};
1651        case 108114: /*min*/ return new String[] {"unsignedInt"};
1652        case 107876: /*max*/ return new String[] {"string"};
1653        default: return super.getTypesForProperty(hash, name);
1654        }
1655
1656      }
1657
1658      @Override
1659      public Base addChild(String name) throws FHIRException {
1660        if (name.equals("path")) {
1661          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.path");
1662        }
1663        else if (name.equals("min")) {
1664          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.min");
1665        }
1666        else if (name.equals("max")) {
1667          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.max");
1668        }
1669        else
1670          return super.addChild(name);
1671      }
1672
1673      public ElementDefinitionBaseComponent copy() {
1674        ElementDefinitionBaseComponent dst = new ElementDefinitionBaseComponent();
1675        copyValues(dst);
1676        dst.path = path == null ? null : path.copy();
1677        dst.min = min == null ? null : min.copy();
1678        dst.max = max == null ? null : max.copy();
1679        return dst;
1680      }
1681
1682      @Override
1683      public boolean equalsDeep(Base other_) {
1684        if (!super.equalsDeep(other_))
1685          return false;
1686        if (!(other_ instanceof ElementDefinitionBaseComponent))
1687          return false;
1688        ElementDefinitionBaseComponent o = (ElementDefinitionBaseComponent) other_;
1689        return compareDeep(path, o.path, true) && compareDeep(min, o.min, true) && compareDeep(max, o.max, true)
1690          ;
1691      }
1692
1693      @Override
1694      public boolean equalsShallow(Base other_) {
1695        if (!super.equalsShallow(other_))
1696          return false;
1697        if (!(other_ instanceof ElementDefinitionBaseComponent))
1698          return false;
1699        ElementDefinitionBaseComponent o = (ElementDefinitionBaseComponent) other_;
1700        return compareValues(path, o.path, true) && compareValues(min, o.min, true) && compareValues(max, o.max, true)
1701          ;
1702      }
1703
1704      public boolean isEmpty() {
1705        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(path, min, max);
1706      }
1707
1708  public String fhirType() {
1709    return "ElementDefinition.base";
1710
1711  }
1712
1713  }
1714
1715    @Block()
1716    public static class TypeRefComponent extends Element implements IBaseDatatypeElement {
1717        /**
1718         * URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.
1719         */
1720        @Child(name = "code", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1721        @Description(shortDefinition="Data type or Resource (reference to definition)", formalDefinition="URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. \"string\" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models." )
1722        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
1723        protected UriType code;
1724
1725        /**
1726         * Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide.
1727         */
1728        @Child(name = "profile", type = {CanonicalType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1729        @Description(shortDefinition="Profiles (StructureDefinition or IG) - one must apply", formalDefinition="Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide." )
1730        protected List<CanonicalType> profile;
1731
1732        /**
1733         * Used when the type is "Reference", and Identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.
1734         */
1735        @Child(name = "targetProfile", type = {CanonicalType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1736        @Description(shortDefinition="Profile (StructureDefinition or IG) on the Reference target - one must apply", formalDefinition="Used when the type is \"Reference\", and Identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide." )
1737        protected List<CanonicalType> targetProfile;
1738
1739        /**
1740         * If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.
1741         */
1742        @Child(name = "aggregation", type = {CodeType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1743        @Description(shortDefinition="contained | referenced | bundled - how aggregated", formalDefinition="If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle." )
1744        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-aggregation-mode")
1745        protected List<Enumeration<AggregationMode>> aggregation;
1746
1747        /**
1748         * Whether this reference needs to be version specific or version independent, or whether either can be used.
1749         */
1750        @Child(name = "versioning", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
1751        @Description(shortDefinition="either | independent | specific", formalDefinition="Whether this reference needs to be version specific or version independent, or whether either can be used." )
1752        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/reference-version-rules")
1753        protected Enumeration<ReferenceVersionRules> versioning;
1754
1755        private static final long serialVersionUID = 957891653L;
1756
1757    /**
1758     * Constructor
1759     */
1760      public TypeRefComponent() {
1761        super();
1762      }
1763
1764    /**
1765     * Constructor
1766     */
1767      public TypeRefComponent(UriType code) {
1768        super();
1769        this.code = code;
1770      }
1771
1772        /**
1773         * @return {@link #code} (URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1774         */
1775        public UriType getCodeElement() { 
1776          if (this.code == null)
1777            if (Configuration.errorOnAutoCreate())
1778              throw new Error("Attempt to auto-create TypeRefComponent.code");
1779            else if (Configuration.doAutoCreate())
1780              this.code = new UriType(); // bb
1781          return this.code;
1782        }
1783
1784        public boolean hasCodeElement() { 
1785          return this.code != null && !this.code.isEmpty();
1786        }
1787
1788        public boolean hasCode() { 
1789          return this.code != null && !this.code.isEmpty();
1790        }
1791
1792        /**
1793         * @param value {@link #code} (URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
1794         */
1795        public TypeRefComponent setCodeElement(UriType value) { 
1796          this.code = value;
1797          return this;
1798        }
1799
1800        /**
1801         * @return URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.
1802         */
1803        public String getCode() { 
1804          return this.code == null ? null : this.code.getValue();
1805        }
1806
1807        /**
1808         * @param value URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.
1809         */
1810        public TypeRefComponent setCode(String value) { 
1811            if (this.code == null)
1812              this.code = new UriType();
1813            this.code.setValue(value);
1814          return this;
1815        }
1816
1817        /**
1818         * @return {@link #profile} (Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide.)
1819         */
1820        public List<CanonicalType> getProfile() { 
1821          if (this.profile == null)
1822            this.profile = new ArrayList<CanonicalType>();
1823          return this.profile;
1824        }
1825
1826        /**
1827         * @return Returns a reference to <code>this</code> for easy method chaining
1828         */
1829        public TypeRefComponent setProfile(List<CanonicalType> theProfile) { 
1830          this.profile = theProfile;
1831          return this;
1832        }
1833
1834        public boolean hasProfile() { 
1835          if (this.profile == null)
1836            return false;
1837          for (CanonicalType item : this.profile)
1838            if (!item.isEmpty())
1839              return true;
1840          return false;
1841        }
1842
1843        /**
1844         * @return {@link #profile} (Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide.)
1845         */
1846        public CanonicalType addProfileElement() {//2 
1847          CanonicalType t = new CanonicalType();
1848          if (this.profile == null)
1849            this.profile = new ArrayList<CanonicalType>();
1850          this.profile.add(t);
1851          return t;
1852        }
1853
1854        /**
1855         * @param value {@link #profile} (Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide.)
1856         */
1857        public TypeRefComponent addProfile(String value) { //1
1858          CanonicalType t = new CanonicalType();
1859          t.setValue(value);
1860          if (this.profile == null)
1861            this.profile = new ArrayList<CanonicalType>();
1862          this.profile.add(t);
1863          return this;
1864        }
1865
1866        /**
1867         * @param value {@link #profile} (Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide.)
1868         */
1869        public boolean hasProfile(String value) { 
1870          if (this.profile == null)
1871            return false;
1872          for (CanonicalType v : this.profile)
1873            if (v.getValue().equals(value)) // canonical(StructureDefinition|ImplementationGuide)
1874              return true;
1875          return false;
1876        }
1877
1878        /**
1879         * @return {@link #targetProfile} (Used when the type is "Reference", and Identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.)
1880         */
1881        public List<CanonicalType> getTargetProfile() { 
1882          if (this.targetProfile == null)
1883            this.targetProfile = new ArrayList<CanonicalType>();
1884          return this.targetProfile;
1885        }
1886
1887        /**
1888         * @return Returns a reference to <code>this</code> for easy method chaining
1889         */
1890        public TypeRefComponent setTargetProfile(List<CanonicalType> theTargetProfile) { 
1891          this.targetProfile = theTargetProfile;
1892          return this;
1893        }
1894
1895        public boolean hasTargetProfile() { 
1896          if (this.targetProfile == null)
1897            return false;
1898          for (CanonicalType item : this.targetProfile)
1899            if (!item.isEmpty())
1900              return true;
1901          return false;
1902        }
1903
1904        /**
1905         * @return {@link #targetProfile} (Used when the type is "Reference", and Identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.)
1906         */
1907        public CanonicalType addTargetProfileElement() {//2 
1908          CanonicalType t = new CanonicalType();
1909          if (this.targetProfile == null)
1910            this.targetProfile = new ArrayList<CanonicalType>();
1911          this.targetProfile.add(t);
1912          return t;
1913        }
1914
1915        /**
1916         * @param value {@link #targetProfile} (Used when the type is "Reference", and Identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.)
1917         */
1918        public TypeRefComponent addTargetProfile(String value) { //1
1919          CanonicalType t = new CanonicalType();
1920          t.setValue(value);
1921          if (this.targetProfile == null)
1922            this.targetProfile = new ArrayList<CanonicalType>();
1923          this.targetProfile.add(t);
1924          return this;
1925        }
1926
1927        /**
1928         * @param value {@link #targetProfile} (Used when the type is "Reference", and Identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.)
1929         */
1930        public boolean hasTargetProfile(String value) { 
1931          if (this.targetProfile == null)
1932            return false;
1933          for (CanonicalType v : this.targetProfile)
1934            if (v.getValue().equals(value)) // canonical(StructureDefinition|ImplementationGuide)
1935              return true;
1936          return false;
1937        }
1938
1939        /**
1940         * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.)
1941         */
1942        public List<Enumeration<AggregationMode>> getAggregation() { 
1943          if (this.aggregation == null)
1944            this.aggregation = new ArrayList<Enumeration<AggregationMode>>();
1945          return this.aggregation;
1946        }
1947
1948        /**
1949         * @return Returns a reference to <code>this</code> for easy method chaining
1950         */
1951        public TypeRefComponent setAggregation(List<Enumeration<AggregationMode>> theAggregation) { 
1952          this.aggregation = theAggregation;
1953          return this;
1954        }
1955
1956        public boolean hasAggregation() { 
1957          if (this.aggregation == null)
1958            return false;
1959          for (Enumeration<AggregationMode> item : this.aggregation)
1960            if (!item.isEmpty())
1961              return true;
1962          return false;
1963        }
1964
1965        /**
1966         * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.)
1967         */
1968        public Enumeration<AggregationMode> addAggregationElement() {//2 
1969          Enumeration<AggregationMode> t = new Enumeration<AggregationMode>(new AggregationModeEnumFactory());
1970          if (this.aggregation == null)
1971            this.aggregation = new ArrayList<Enumeration<AggregationMode>>();
1972          this.aggregation.add(t);
1973          return t;
1974        }
1975
1976        /**
1977         * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.)
1978         */
1979        public TypeRefComponent addAggregation(AggregationMode value) { //1
1980          Enumeration<AggregationMode> t = new Enumeration<AggregationMode>(new AggregationModeEnumFactory());
1981          t.setValue(value);
1982          if (this.aggregation == null)
1983            this.aggregation = new ArrayList<Enumeration<AggregationMode>>();
1984          this.aggregation.add(t);
1985          return this;
1986        }
1987
1988        /**
1989         * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.)
1990         */
1991        public boolean hasAggregation(AggregationMode value) { 
1992          if (this.aggregation == null)
1993            return false;
1994          for (Enumeration<AggregationMode> v : this.aggregation)
1995            if (v.getValue().equals(value)) // code
1996              return true;
1997          return false;
1998        }
1999
2000        /**
2001         * @return {@link #versioning} (Whether this reference needs to be version specific or version independent, or whether either can be used.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value
2002         */
2003        public Enumeration<ReferenceVersionRules> getVersioningElement() { 
2004          if (this.versioning == null)
2005            if (Configuration.errorOnAutoCreate())
2006              throw new Error("Attempt to auto-create TypeRefComponent.versioning");
2007            else if (Configuration.doAutoCreate())
2008              this.versioning = new Enumeration<ReferenceVersionRules>(new ReferenceVersionRulesEnumFactory()); // bb
2009          return this.versioning;
2010        }
2011
2012        public boolean hasVersioningElement() { 
2013          return this.versioning != null && !this.versioning.isEmpty();
2014        }
2015
2016        public boolean hasVersioning() { 
2017          return this.versioning != null && !this.versioning.isEmpty();
2018        }
2019
2020        /**
2021         * @param value {@link #versioning} (Whether this reference needs to be version specific or version independent, or whether either can be used.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value
2022         */
2023        public TypeRefComponent setVersioningElement(Enumeration<ReferenceVersionRules> value) { 
2024          this.versioning = value;
2025          return this;
2026        }
2027
2028        /**
2029         * @return Whether this reference needs to be version specific or version independent, or whether either can be used.
2030         */
2031        public ReferenceVersionRules getVersioning() { 
2032          return this.versioning == null ? null : this.versioning.getValue();
2033        }
2034
2035        /**
2036         * @param value Whether this reference needs to be version specific or version independent, or whether either can be used.
2037         */
2038        public TypeRefComponent setVersioning(ReferenceVersionRules value) { 
2039          if (value == null)
2040            this.versioning = null;
2041          else {
2042            if (this.versioning == null)
2043              this.versioning = new Enumeration<ReferenceVersionRules>(new ReferenceVersionRulesEnumFactory());
2044            this.versioning.setValue(value);
2045          }
2046          return this;
2047        }
2048
2049        protected void listChildren(List<Property> children) {
2050          super.listChildren(children);
2051          children.add(new Property("code", "uri", "URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. \"string\" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.", 0, 1, code));
2052          children.add(new Property("profile", "canonical(StructureDefinition|ImplementationGuide)", "Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide.", 0, java.lang.Integer.MAX_VALUE, profile));
2053          children.add(new Property("targetProfile", "canonical(StructureDefinition|ImplementationGuide)", "Used when the type is \"Reference\", and Identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.", 0, java.lang.Integer.MAX_VALUE, targetProfile));
2054          children.add(new Property("aggregation", "code", "If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.", 0, java.lang.Integer.MAX_VALUE, aggregation));
2055          children.add(new Property("versioning", "code", "Whether this reference needs to be version specific or version independent, or whether either can be used.", 0, 1, versioning));
2056        }
2057
2058        @Override
2059        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2060          switch (_hash) {
2061          case 3059181: /*code*/  return new Property("code", "uri", "URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. \"string\" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.", 0, 1, code);
2062          case -309425751: /*profile*/  return new Property("profile", "canonical(StructureDefinition|ImplementationGuide)", "Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide.", 0, java.lang.Integer.MAX_VALUE, profile);
2063          case 1994521304: /*targetProfile*/  return new Property("targetProfile", "canonical(StructureDefinition|ImplementationGuide)", "Used when the type is \"Reference\", and Identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.", 0, java.lang.Integer.MAX_VALUE, targetProfile);
2064          case 841524962: /*aggregation*/  return new Property("aggregation", "code", "If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.", 0, java.lang.Integer.MAX_VALUE, aggregation);
2065          case -670487542: /*versioning*/  return new Property("versioning", "code", "Whether this reference needs to be version specific or version independent, or whether either can be used.", 0, 1, versioning);
2066          default: return super.getNamedProperty(_hash, _name, _checkValid);
2067          }
2068
2069        }
2070
2071      @Override
2072      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2073        switch (hash) {
2074        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // UriType
2075        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // CanonicalType
2076        case 1994521304: /*targetProfile*/ return this.targetProfile == null ? new Base[0] : this.targetProfile.toArray(new Base[this.targetProfile.size()]); // CanonicalType
2077        case 841524962: /*aggregation*/ return this.aggregation == null ? new Base[0] : this.aggregation.toArray(new Base[this.aggregation.size()]); // Enumeration<AggregationMode>
2078        case -670487542: /*versioning*/ return this.versioning == null ? new Base[0] : new Base[] {this.versioning}; // Enumeration<ReferenceVersionRules>
2079        default: return super.getProperty(hash, name, checkValid);
2080        }
2081
2082      }
2083
2084      @Override
2085      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2086        switch (hash) {
2087        case 3059181: // code
2088          this.code = castToUri(value); // UriType
2089          return value;
2090        case -309425751: // profile
2091          this.getProfile().add(castToCanonical(value)); // CanonicalType
2092          return value;
2093        case 1994521304: // targetProfile
2094          this.getTargetProfile().add(castToCanonical(value)); // CanonicalType
2095          return value;
2096        case 841524962: // aggregation
2097          value = new AggregationModeEnumFactory().fromType(castToCode(value));
2098          this.getAggregation().add((Enumeration) value); // Enumeration<AggregationMode>
2099          return value;
2100        case -670487542: // versioning
2101          value = new ReferenceVersionRulesEnumFactory().fromType(castToCode(value));
2102          this.versioning = (Enumeration) value; // Enumeration<ReferenceVersionRules>
2103          return value;
2104        default: return super.setProperty(hash, name, value);
2105        }
2106
2107      }
2108
2109      @Override
2110      public Base setProperty(String name, Base value) throws FHIRException {
2111        if (name.equals("code")) {
2112          this.code = castToUri(value); // UriType
2113        } else if (name.equals("profile")) {
2114          this.getProfile().add(castToCanonical(value));
2115        } else if (name.equals("targetProfile")) {
2116          this.getTargetProfile().add(castToCanonical(value));
2117        } else if (name.equals("aggregation")) {
2118          value = new AggregationModeEnumFactory().fromType(castToCode(value));
2119          this.getAggregation().add((Enumeration) value);
2120        } else if (name.equals("versioning")) {
2121          value = new ReferenceVersionRulesEnumFactory().fromType(castToCode(value));
2122          this.versioning = (Enumeration) value; // Enumeration<ReferenceVersionRules>
2123        } else
2124          return super.setProperty(name, value);
2125        return value;
2126      }
2127
2128      @Override
2129      public Base makeProperty(int hash, String name) throws FHIRException {
2130        switch (hash) {
2131        case 3059181:  return getCodeElement();
2132        case -309425751:  return addProfileElement();
2133        case 1994521304:  return addTargetProfileElement();
2134        case 841524962:  return addAggregationElement();
2135        case -670487542:  return getVersioningElement();
2136        default: return super.makeProperty(hash, name);
2137        }
2138
2139      }
2140
2141      @Override
2142      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2143        switch (hash) {
2144        case 3059181: /*code*/ return new String[] {"uri"};
2145        case -309425751: /*profile*/ return new String[] {"canonical"};
2146        case 1994521304: /*targetProfile*/ return new String[] {"canonical"};
2147        case 841524962: /*aggregation*/ return new String[] {"code"};
2148        case -670487542: /*versioning*/ return new String[] {"code"};
2149        default: return super.getTypesForProperty(hash, name);
2150        }
2151
2152      }
2153
2154      @Override
2155      public Base addChild(String name) throws FHIRException {
2156        if (name.equals("code")) {
2157          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.code");
2158        }
2159        else if (name.equals("profile")) {
2160          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.profile");
2161        }
2162        else if (name.equals("targetProfile")) {
2163          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.targetProfile");
2164        }
2165        else if (name.equals("aggregation")) {
2166          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.aggregation");
2167        }
2168        else if (name.equals("versioning")) {
2169          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.versioning");
2170        }
2171        else
2172          return super.addChild(name);
2173      }
2174
2175      public TypeRefComponent copy() {
2176        TypeRefComponent dst = new TypeRefComponent();
2177        copyValues(dst);
2178        dst.code = code == null ? null : code.copy();
2179        if (profile != null) {
2180          dst.profile = new ArrayList<CanonicalType>();
2181          for (CanonicalType i : profile)
2182            dst.profile.add(i.copy());
2183        };
2184        if (targetProfile != null) {
2185          dst.targetProfile = new ArrayList<CanonicalType>();
2186          for (CanonicalType i : targetProfile)
2187            dst.targetProfile.add(i.copy());
2188        };
2189        if (aggregation != null) {
2190          dst.aggregation = new ArrayList<Enumeration<AggregationMode>>();
2191          for (Enumeration<AggregationMode> i : aggregation)
2192            dst.aggregation.add(i.copy());
2193        };
2194        dst.versioning = versioning == null ? null : versioning.copy();
2195        return dst;
2196      }
2197
2198      @Override
2199      public boolean equalsDeep(Base other_) {
2200        if (!super.equalsDeep(other_))
2201          return false;
2202        if (!(other_ instanceof TypeRefComponent))
2203          return false;
2204        TypeRefComponent o = (TypeRefComponent) other_;
2205        return compareDeep(code, o.code, true) && compareDeep(profile, o.profile, true) && compareDeep(targetProfile, o.targetProfile, true)
2206           && compareDeep(aggregation, o.aggregation, true) && compareDeep(versioning, o.versioning, true)
2207          ;
2208      }
2209
2210      @Override
2211      public boolean equalsShallow(Base other_) {
2212        if (!super.equalsShallow(other_))
2213          return false;
2214        if (!(other_ instanceof TypeRefComponent))
2215          return false;
2216        TypeRefComponent o = (TypeRefComponent) other_;
2217        return compareValues(code, o.code, true) && compareValues(aggregation, o.aggregation, true) && compareValues(versioning, o.versioning, true)
2218          ;
2219      }
2220
2221      public boolean isEmpty() {
2222        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, profile, targetProfile
2223          , aggregation, versioning);
2224      }
2225
2226  public String fhirType() {
2227    return "ElementDefinition.type";
2228
2229  }
2230
2231// added from java-adornments.txt:
2232
2233  public boolean hasTarget() {
2234    return Utilities.existsInList(getCode(), "Reference", "canonical");
2235  }
2236
2237// end addition
2238  }
2239
2240    @Block()
2241    public static class ElementDefinitionExampleComponent extends Element implements IBaseDatatypeElement {
2242        /**
2243         * Describes the purpose of this example amoung the set of examples.
2244         */
2245        @Child(name = "label", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2246        @Description(shortDefinition="Describes the purpose of this example", formalDefinition="Describes the purpose of this example amoung the set of examples." )
2247        protected StringType label;
2248
2249        /**
2250         * The actual value for the element, which must be one of the types allowed for this element.
2251         */
2252        @Child(name = "value", type = {}, order=2, min=1, max=1, modifier=false, summary=true)
2253        @Description(shortDefinition="Value of Example (one of allowed types)", formalDefinition="The actual value for the element, which must be one of the types allowed for this element." )
2254        protected org.hl7.fhir.r4.model.Type value;
2255
2256        private static final long serialVersionUID = 457572481L;
2257
2258    /**
2259     * Constructor
2260     */
2261      public ElementDefinitionExampleComponent() {
2262        super();
2263      }
2264
2265    /**
2266     * Constructor
2267     */
2268      public ElementDefinitionExampleComponent(StringType label, org.hl7.fhir.r4.model.Type value) {
2269        super();
2270        this.label = label;
2271        this.value = value;
2272      }
2273
2274        /**
2275         * @return {@link #label} (Describes the purpose of this example amoung the set of examples.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value
2276         */
2277        public StringType getLabelElement() { 
2278          if (this.label == null)
2279            if (Configuration.errorOnAutoCreate())
2280              throw new Error("Attempt to auto-create ElementDefinitionExampleComponent.label");
2281            else if (Configuration.doAutoCreate())
2282              this.label = new StringType(); // bb
2283          return this.label;
2284        }
2285
2286        public boolean hasLabelElement() { 
2287          return this.label != null && !this.label.isEmpty();
2288        }
2289
2290        public boolean hasLabel() { 
2291          return this.label != null && !this.label.isEmpty();
2292        }
2293
2294        /**
2295         * @param value {@link #label} (Describes the purpose of this example amoung the set of examples.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value
2296         */
2297        public ElementDefinitionExampleComponent setLabelElement(StringType value) { 
2298          this.label = value;
2299          return this;
2300        }
2301
2302        /**
2303         * @return Describes the purpose of this example amoung the set of examples.
2304         */
2305        public String getLabel() { 
2306          return this.label == null ? null : this.label.getValue();
2307        }
2308
2309        /**
2310         * @param value Describes the purpose of this example amoung the set of examples.
2311         */
2312        public ElementDefinitionExampleComponent setLabel(String value) { 
2313            if (this.label == null)
2314              this.label = new StringType();
2315            this.label.setValue(value);
2316          return this;
2317        }
2318
2319        /**
2320         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2321         */
2322        public org.hl7.fhir.r4.model.Type getValue() { 
2323          return this.value;
2324        }
2325
2326        public boolean hasValue() { 
2327          return this.value != null && !this.value.isEmpty();
2328        }
2329
2330        /**
2331         * @param value {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2332         */
2333        public ElementDefinitionExampleComponent setValue(org.hl7.fhir.r4.model.Type value) { 
2334          this.value = value;
2335          return this;
2336        }
2337
2338        protected void listChildren(List<Property> children) {
2339          super.listChildren(children);
2340          children.add(new Property("label", "string", "Describes the purpose of this example amoung the set of examples.", 0, 1, label));
2341          children.add(new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value));
2342        }
2343
2344        @Override
2345        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2346          switch (_hash) {
2347          case 102727412: /*label*/  return new Property("label", "string", "Describes the purpose of this example amoung the set of examples.", 0, 1, label);
2348          case -1410166417: /*value[x]*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2349          case 111972721: /*value*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2350          case -1535024575: /*valueBase64Binary*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2351          case 733421943: /*valueBoolean*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2352          case -786218365: /*valueCanonical*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2353          case -766209282: /*valueCode*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2354          case -766192449: /*valueDate*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2355          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2356          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2357          case 231604844: /*valueId*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2358          case -1668687056: /*valueInstant*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2359          case -1668204915: /*valueInteger*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2360          case -497880704: /*valueMarkdown*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2361          case -1410178407: /*valueOid*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2362          case -1249932027: /*valuePositiveInt*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2363          case -1424603934: /*valueString*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2364          case -765708322: /*valueTime*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2365          case 26529417: /*valueUnsignedInt*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2366          case -1410172357: /*valueUri*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2367          case -1410172354: /*valueUrl*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2368          case -765667124: /*valueUuid*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2369          case -478981821: /*valueAddress*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2370          case -67108992: /*valueAnnotation*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2371          case -475566732: /*valueAttachment*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2372          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2373          case -1887705029: /*valueCoding*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2374          case 944904545: /*valueContactPoint*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2375          case -2026205465: /*valueHumanName*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2376          case -130498310: /*valueIdentifier*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2377          case -1524344174: /*valuePeriod*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2378          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2379          case 2030761548: /*valueRange*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2380          case 2030767386: /*valueRatio*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2381          case 1755241690: /*valueReference*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2382          case -962229101: /*valueSampledData*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2383          case -540985785: /*valueSignature*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2384          case -1406282469: /*valueTiming*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2385          case -1858636920: /*valueDosage*/  return new Property("value[x]", "*", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
2386          default: return super.getNamedProperty(_hash, _name, _checkValid);
2387          }
2388
2389        }
2390
2391      @Override
2392      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2393        switch (hash) {
2394        case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType
2395        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.r4.model.Type
2396        default: return super.getProperty(hash, name, checkValid);
2397        }
2398
2399      }
2400
2401      @Override
2402      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2403        switch (hash) {
2404        case 102727412: // label
2405          this.label = castToString(value); // StringType
2406          return value;
2407        case 111972721: // value
2408          this.value = castToType(value); // org.hl7.fhir.r4.model.Type
2409          return value;
2410        default: return super.setProperty(hash, name, value);
2411        }
2412
2413      }
2414
2415      @Override
2416      public Base setProperty(String name, Base value) throws FHIRException {
2417        if (name.equals("label")) {
2418          this.label = castToString(value); // StringType
2419        } else if (name.equals("value[x]")) {
2420          this.value = castToType(value); // org.hl7.fhir.r4.model.Type
2421        } else
2422          return super.setProperty(name, value);
2423        return value;
2424      }
2425
2426      @Override
2427      public Base makeProperty(int hash, String name) throws FHIRException {
2428        switch (hash) {
2429        case 102727412:  return getLabelElement();
2430        case -1410166417:  return getValue(); 
2431        case 111972721:  return getValue(); 
2432        default: return super.makeProperty(hash, name);
2433        }
2434
2435      }
2436
2437      @Override
2438      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2439        switch (hash) {
2440        case 102727412: /*label*/ return new String[] {"string"};
2441        case 111972721: /*value*/ return new String[] {"*"};
2442        default: return super.getTypesForProperty(hash, name);
2443        }
2444
2445      }
2446
2447      @Override
2448      public Base addChild(String name) throws FHIRException {
2449        if (name.equals("label")) {
2450          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.label");
2451        }
2452        else if (name.equals("valueBase64Binary")) {
2453          this.value = new Base64BinaryType();
2454          return this.value;
2455        }
2456        else if (name.equals("valueBoolean")) {
2457          this.value = new BooleanType();
2458          return this.value;
2459        }
2460        else if (name.equals("valueCanonical")) {
2461          this.value = new CanonicalType();
2462          return this.value;
2463        }
2464        else if (name.equals("valueCode")) {
2465          this.value = new CodeType();
2466          return this.value;
2467        }
2468        else if (name.equals("valueDate")) {
2469          this.value = new DateType();
2470          return this.value;
2471        }
2472        else if (name.equals("valueDateTime")) {
2473          this.value = new DateTimeType();
2474          return this.value;
2475        }
2476        else if (name.equals("valueDecimal")) {
2477          this.value = new DecimalType();
2478          return this.value;
2479        }
2480        else if (name.equals("valueId")) {
2481          this.value = new IdType();
2482          return this.value;
2483        }
2484        else if (name.equals("valueInstant")) {
2485          this.value = new InstantType();
2486          return this.value;
2487        }
2488        else if (name.equals("valueInteger")) {
2489          this.value = new IntegerType();
2490          return this.value;
2491        }
2492        else if (name.equals("valueMarkdown")) {
2493          this.value = new MarkdownType();
2494          return this.value;
2495        }
2496        else if (name.equals("valueOid")) {
2497          this.value = new OidType();
2498          return this.value;
2499        }
2500        else if (name.equals("valuePositiveInt")) {
2501          this.value = new PositiveIntType();
2502          return this.value;
2503        }
2504        else if (name.equals("valueString")) {
2505          this.value = new StringType();
2506          return this.value;
2507        }
2508        else if (name.equals("valueTime")) {
2509          this.value = new TimeType();
2510          return this.value;
2511        }
2512        else if (name.equals("valueUnsignedInt")) {
2513          this.value = new UnsignedIntType();
2514          return this.value;
2515        }
2516        else if (name.equals("valueUri")) {
2517          this.value = new UriType();
2518          return this.value;
2519        }
2520        else if (name.equals("valueUrl")) {
2521          this.value = new UrlType();
2522          return this.value;
2523        }
2524        else if (name.equals("valueUuid")) {
2525          this.value = new UuidType();
2526          return this.value;
2527        }
2528        else if (name.equals("valueAddress")) {
2529          this.value = new Address();
2530          return this.value;
2531        }
2532        else if (name.equals("valueAge")) {
2533          this.value = new Age();
2534          return this.value;
2535        }
2536        else if (name.equals("valueAnnotation")) {
2537          this.value = new Annotation();
2538          return this.value;
2539        }
2540        else if (name.equals("valueAttachment")) {
2541          this.value = new Attachment();
2542          return this.value;
2543        }
2544        else if (name.equals("valueCodeableConcept")) {
2545          this.value = new CodeableConcept();
2546          return this.value;
2547        }
2548        else if (name.equals("valueCoding")) {
2549          this.value = new Coding();
2550          return this.value;
2551        }
2552        else if (name.equals("valueContactPoint")) {
2553          this.value = new ContactPoint();
2554          return this.value;
2555        }
2556        else if (name.equals("valueCount")) {
2557          this.value = new Count();
2558          return this.value;
2559        }
2560        else if (name.equals("valueDistance")) {
2561          this.value = new Distance();
2562          return this.value;
2563        }
2564        else if (name.equals("valueDuration")) {
2565          this.value = new Duration();
2566          return this.value;
2567        }
2568        else if (name.equals("valueHumanName")) {
2569          this.value = new HumanName();
2570          return this.value;
2571        }
2572        else if (name.equals("valueIdentifier")) {
2573          this.value = new Identifier();
2574          return this.value;
2575        }
2576        else if (name.equals("valueMoney")) {
2577          this.value = new Money();
2578          return this.value;
2579        }
2580        else if (name.equals("valuePeriod")) {
2581          this.value = new Period();
2582          return this.value;
2583        }
2584        else if (name.equals("valueQuantity")) {
2585          this.value = new Quantity();
2586          return this.value;
2587        }
2588        else if (name.equals("valueRange")) {
2589          this.value = new Range();
2590          return this.value;
2591        }
2592        else if (name.equals("valueRatio")) {
2593          this.value = new Ratio();
2594          return this.value;
2595        }
2596        else if (name.equals("valueReference")) {
2597          this.value = new Reference();
2598          return this.value;
2599        }
2600        else if (name.equals("valueSampledData")) {
2601          this.value = new SampledData();
2602          return this.value;
2603        }
2604        else if (name.equals("valueSignature")) {
2605          this.value = new Signature();
2606          return this.value;
2607        }
2608        else if (name.equals("valueTiming")) {
2609          this.value = new Timing();
2610          return this.value;
2611        }
2612        else if (name.equals("valueParameterDefinition")) {
2613          this.value = new ParameterDefinition();
2614          return this.value;
2615        }
2616        else if (name.equals("valueDataRequirement")) {
2617          this.value = new DataRequirement();
2618          return this.value;
2619        }
2620        else if (name.equals("valueRelatedArtifact")) {
2621          this.value = new RelatedArtifact();
2622          return this.value;
2623        }
2624        else if (name.equals("valueContactDetail")) {
2625          this.value = new ContactDetail();
2626          return this.value;
2627        }
2628        else if (name.equals("valueContributor")) {
2629          this.value = new Contributor();
2630          return this.value;
2631        }
2632        else if (name.equals("valueTriggerDefinition")) {
2633          this.value = new TriggerDefinition();
2634          return this.value;
2635        }
2636        else if (name.equals("valueUsageContext")) {
2637          this.value = new UsageContext();
2638          return this.value;
2639        }
2640        else if (name.equals("valueDosage")) {
2641          this.value = new Dosage();
2642          return this.value;
2643        }
2644        else
2645          return super.addChild(name);
2646      }
2647
2648      public ElementDefinitionExampleComponent copy() {
2649        ElementDefinitionExampleComponent dst = new ElementDefinitionExampleComponent();
2650        copyValues(dst);
2651        dst.label = label == null ? null : label.copy();
2652        dst.value = value == null ? null : value.copy();
2653        return dst;
2654      }
2655
2656      @Override
2657      public boolean equalsDeep(Base other_) {
2658        if (!super.equalsDeep(other_))
2659          return false;
2660        if (!(other_ instanceof ElementDefinitionExampleComponent))
2661          return false;
2662        ElementDefinitionExampleComponent o = (ElementDefinitionExampleComponent) other_;
2663        return compareDeep(label, o.label, true) && compareDeep(value, o.value, true);
2664      }
2665
2666      @Override
2667      public boolean equalsShallow(Base other_) {
2668        if (!super.equalsShallow(other_))
2669          return false;
2670        if (!(other_ instanceof ElementDefinitionExampleComponent))
2671          return false;
2672        ElementDefinitionExampleComponent o = (ElementDefinitionExampleComponent) other_;
2673        return compareValues(label, o.label, true);
2674      }
2675
2676      public boolean isEmpty() {
2677        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(label, value);
2678      }
2679
2680  public String fhirType() {
2681    return "ElementDefinition.example";
2682
2683  }
2684
2685  }
2686
2687    @Block()
2688    public static class ElementDefinitionConstraintComponent extends Element implements IBaseDatatypeElement {
2689        /**
2690         * Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.
2691         */
2692        @Child(name = "key", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2693        @Description(shortDefinition="Target of 'condition' reference above", formalDefinition="Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality." )
2694        protected IdType key;
2695
2696        /**
2697         * Description of why this constraint is necessary or appropriate.
2698         */
2699        @Child(name = "requirements", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2700        @Description(shortDefinition="Why this constraint is necessary or appropriate", formalDefinition="Description of why this constraint is necessary or appropriate." )
2701        protected StringType requirements;
2702
2703        /**
2704         * Identifies the impact constraint violation has on the conformance of the instance.
2705         */
2706        @Child(name = "severity", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true)
2707        @Description(shortDefinition="error | warning", formalDefinition="Identifies the impact constraint violation has on the conformance of the instance." )
2708        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/constraint-severity")
2709        protected Enumeration<ConstraintSeverity> severity;
2710
2711        /**
2712         * Text that can be used to describe the constraint in messages identifying that the constraint has been violated.
2713         */
2714        @Child(name = "human", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=true)
2715        @Description(shortDefinition="Human description of constraint", formalDefinition="Text that can be used to describe the constraint in messages identifying that the constraint has been violated." )
2716        protected StringType human;
2717
2718        /**
2719         * A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.
2720         */
2721        @Child(name = "expression", type = {StringType.class}, order=5, min=1, max=1, modifier=false, summary=true)
2722        @Description(shortDefinition="FHIRPath expression of constraint", formalDefinition="A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met." )
2723        protected StringType expression;
2724
2725        /**
2726         * An XPath expression of constraint that can be executed to see if this constraint is met.
2727         */
2728        @Child(name = "xpath", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
2729        @Description(shortDefinition="XPath expression of constraint", formalDefinition="An XPath expression of constraint that can be executed to see if this constraint is met." )
2730        protected StringType xpath;
2731
2732        /**
2733         * A reference to the original source of the constraint, for traceability purposes.
2734         */
2735        @Child(name = "source", type = {CanonicalType.class}, order=7, min=0, max=1, modifier=false, summary=true)
2736        @Description(shortDefinition="Reference to original source of constraint", formalDefinition="A reference to the original source of the constraint, for traceability purposes." )
2737        protected CanonicalType source;
2738
2739        private static final long serialVersionUID = 1048354565L;
2740
2741    /**
2742     * Constructor
2743     */
2744      public ElementDefinitionConstraintComponent() {
2745        super();
2746      }
2747
2748    /**
2749     * Constructor
2750     */
2751      public ElementDefinitionConstraintComponent(IdType key, Enumeration<ConstraintSeverity> severity, StringType human, StringType expression) {
2752        super();
2753        this.key = key;
2754        this.severity = severity;
2755        this.human = human;
2756        this.expression = expression;
2757      }
2758
2759        /**
2760         * @return {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value
2761         */
2762        public IdType getKeyElement() { 
2763          if (this.key == null)
2764            if (Configuration.errorOnAutoCreate())
2765              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.key");
2766            else if (Configuration.doAutoCreate())
2767              this.key = new IdType(); // bb
2768          return this.key;
2769        }
2770
2771        public boolean hasKeyElement() { 
2772          return this.key != null && !this.key.isEmpty();
2773        }
2774
2775        public boolean hasKey() { 
2776          return this.key != null && !this.key.isEmpty();
2777        }
2778
2779        /**
2780         * @param value {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value
2781         */
2782        public ElementDefinitionConstraintComponent setKeyElement(IdType value) { 
2783          this.key = value;
2784          return this;
2785        }
2786
2787        /**
2788         * @return Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.
2789         */
2790        public String getKey() { 
2791          return this.key == null ? null : this.key.getValue();
2792        }
2793
2794        /**
2795         * @param value Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.
2796         */
2797        public ElementDefinitionConstraintComponent setKey(String value) { 
2798            if (this.key == null)
2799              this.key = new IdType();
2800            this.key.setValue(value);
2801          return this;
2802        }
2803
2804        /**
2805         * @return {@link #requirements} (Description of why this constraint is necessary or appropriate.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
2806         */
2807        public StringType getRequirementsElement() { 
2808          if (this.requirements == null)
2809            if (Configuration.errorOnAutoCreate())
2810              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.requirements");
2811            else if (Configuration.doAutoCreate())
2812              this.requirements = new StringType(); // bb
2813          return this.requirements;
2814        }
2815
2816        public boolean hasRequirementsElement() { 
2817          return this.requirements != null && !this.requirements.isEmpty();
2818        }
2819
2820        public boolean hasRequirements() { 
2821          return this.requirements != null && !this.requirements.isEmpty();
2822        }
2823
2824        /**
2825         * @param value {@link #requirements} (Description of why this constraint is necessary or appropriate.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
2826         */
2827        public ElementDefinitionConstraintComponent setRequirementsElement(StringType value) { 
2828          this.requirements = value;
2829          return this;
2830        }
2831
2832        /**
2833         * @return Description of why this constraint is necessary or appropriate.
2834         */
2835        public String getRequirements() { 
2836          return this.requirements == null ? null : this.requirements.getValue();
2837        }
2838
2839        /**
2840         * @param value Description of why this constraint is necessary or appropriate.
2841         */
2842        public ElementDefinitionConstraintComponent setRequirements(String value) { 
2843          if (Utilities.noString(value))
2844            this.requirements = null;
2845          else {
2846            if (this.requirements == null)
2847              this.requirements = new StringType();
2848            this.requirements.setValue(value);
2849          }
2850          return this;
2851        }
2852
2853        /**
2854         * @return {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value
2855         */
2856        public Enumeration<ConstraintSeverity> getSeverityElement() { 
2857          if (this.severity == null)
2858            if (Configuration.errorOnAutoCreate())
2859              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.severity");
2860            else if (Configuration.doAutoCreate())
2861              this.severity = new Enumeration<ConstraintSeverity>(new ConstraintSeverityEnumFactory()); // bb
2862          return this.severity;
2863        }
2864
2865        public boolean hasSeverityElement() { 
2866          return this.severity != null && !this.severity.isEmpty();
2867        }
2868
2869        public boolean hasSeverity() { 
2870          return this.severity != null && !this.severity.isEmpty();
2871        }
2872
2873        /**
2874         * @param value {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value
2875         */
2876        public ElementDefinitionConstraintComponent setSeverityElement(Enumeration<ConstraintSeverity> value) { 
2877          this.severity = value;
2878          return this;
2879        }
2880
2881        /**
2882         * @return Identifies the impact constraint violation has on the conformance of the instance.
2883         */
2884        public ConstraintSeverity getSeverity() { 
2885          return this.severity == null ? null : this.severity.getValue();
2886        }
2887
2888        /**
2889         * @param value Identifies the impact constraint violation has on the conformance of the instance.
2890         */
2891        public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) { 
2892            if (this.severity == null)
2893              this.severity = new Enumeration<ConstraintSeverity>(new ConstraintSeverityEnumFactory());
2894            this.severity.setValue(value);
2895          return this;
2896        }
2897
2898        /**
2899         * @return {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value
2900         */
2901        public StringType getHumanElement() { 
2902          if (this.human == null)
2903            if (Configuration.errorOnAutoCreate())
2904              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.human");
2905            else if (Configuration.doAutoCreate())
2906              this.human = new StringType(); // bb
2907          return this.human;
2908        }
2909
2910        public boolean hasHumanElement() { 
2911          return this.human != null && !this.human.isEmpty();
2912        }
2913
2914        public boolean hasHuman() { 
2915          return this.human != null && !this.human.isEmpty();
2916        }
2917
2918        /**
2919         * @param value {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value
2920         */
2921        public ElementDefinitionConstraintComponent setHumanElement(StringType value) { 
2922          this.human = value;
2923          return this;
2924        }
2925
2926        /**
2927         * @return Text that can be used to describe the constraint in messages identifying that the constraint has been violated.
2928         */
2929        public String getHuman() { 
2930          return this.human == null ? null : this.human.getValue();
2931        }
2932
2933        /**
2934         * @param value Text that can be used to describe the constraint in messages identifying that the constraint has been violated.
2935         */
2936        public ElementDefinitionConstraintComponent setHuman(String value) { 
2937            if (this.human == null)
2938              this.human = new StringType();
2939            this.human.setValue(value);
2940          return this;
2941        }
2942
2943        /**
2944         * @return {@link #expression} (A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value
2945         */
2946        public StringType getExpressionElement() { 
2947          if (this.expression == null)
2948            if (Configuration.errorOnAutoCreate())
2949              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.expression");
2950            else if (Configuration.doAutoCreate())
2951              this.expression = new StringType(); // bb
2952          return this.expression;
2953        }
2954
2955        public boolean hasExpressionElement() { 
2956          return this.expression != null && !this.expression.isEmpty();
2957        }
2958
2959        public boolean hasExpression() { 
2960          return this.expression != null && !this.expression.isEmpty();
2961        }
2962
2963        /**
2964         * @param value {@link #expression} (A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value
2965         */
2966        public ElementDefinitionConstraintComponent setExpressionElement(StringType value) { 
2967          this.expression = value;
2968          return this;
2969        }
2970
2971        /**
2972         * @return A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.
2973         */
2974        public String getExpression() { 
2975          return this.expression == null ? null : this.expression.getValue();
2976        }
2977
2978        /**
2979         * @param value A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.
2980         */
2981        public ElementDefinitionConstraintComponent setExpression(String value) { 
2982            if (this.expression == null)
2983              this.expression = new StringType();
2984            this.expression.setValue(value);
2985          return this;
2986        }
2987
2988        /**
2989         * @return {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value
2990         */
2991        public StringType getXpathElement() { 
2992          if (this.xpath == null)
2993            if (Configuration.errorOnAutoCreate())
2994              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.xpath");
2995            else if (Configuration.doAutoCreate())
2996              this.xpath = new StringType(); // bb
2997          return this.xpath;
2998        }
2999
3000        public boolean hasXpathElement() { 
3001          return this.xpath != null && !this.xpath.isEmpty();
3002        }
3003
3004        public boolean hasXpath() { 
3005          return this.xpath != null && !this.xpath.isEmpty();
3006        }
3007
3008        /**
3009         * @param value {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value
3010         */
3011        public ElementDefinitionConstraintComponent setXpathElement(StringType value) { 
3012          this.xpath = value;
3013          return this;
3014        }
3015
3016        /**
3017         * @return An XPath expression of constraint that can be executed to see if this constraint is met.
3018         */
3019        public String getXpath() { 
3020          return this.xpath == null ? null : this.xpath.getValue();
3021        }
3022
3023        /**
3024         * @param value An XPath expression of constraint that can be executed to see if this constraint is met.
3025         */
3026        public ElementDefinitionConstraintComponent setXpath(String value) { 
3027          if (Utilities.noString(value))
3028            this.xpath = null;
3029          else {
3030            if (this.xpath == null)
3031              this.xpath = new StringType();
3032            this.xpath.setValue(value);
3033          }
3034          return this;
3035        }
3036
3037        /**
3038         * @return {@link #source} (A reference to the original source of the constraint, for traceability purposes.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value
3039         */
3040        public CanonicalType getSourceElement() { 
3041          if (this.source == null)
3042            if (Configuration.errorOnAutoCreate())
3043              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.source");
3044            else if (Configuration.doAutoCreate())
3045              this.source = new CanonicalType(); // bb
3046          return this.source;
3047        }
3048
3049        public boolean hasSourceElement() { 
3050          return this.source != null && !this.source.isEmpty();
3051        }
3052
3053        public boolean hasSource() { 
3054          return this.source != null && !this.source.isEmpty();
3055        }
3056
3057        /**
3058         * @param value {@link #source} (A reference to the original source of the constraint, for traceability purposes.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value
3059         */
3060        public ElementDefinitionConstraintComponent setSourceElement(CanonicalType value) { 
3061          this.source = value;
3062          return this;
3063        }
3064
3065        /**
3066         * @return A reference to the original source of the constraint, for traceability purposes.
3067         */
3068        public String getSource() { 
3069          return this.source == null ? null : this.source.getValue();
3070        }
3071
3072        /**
3073         * @param value A reference to the original source of the constraint, for traceability purposes.
3074         */
3075        public ElementDefinitionConstraintComponent setSource(String value) { 
3076          if (Utilities.noString(value))
3077            this.source = null;
3078          else {
3079            if (this.source == null)
3080              this.source = new CanonicalType();
3081            this.source.setValue(value);
3082          }
3083          return this;
3084        }
3085
3086        protected void listChildren(List<Property> children) {
3087          super.listChildren(children);
3088          children.add(new Property("key", "id", "Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.", 0, 1, key));
3089          children.add(new Property("requirements", "string", "Description of why this constraint is necessary or appropriate.", 0, 1, requirements));
3090          children.add(new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, 1, severity));
3091          children.add(new Property("human", "string", "Text that can be used to describe the constraint in messages identifying that the constraint has been violated.", 0, 1, human));
3092          children.add(new Property("expression", "string", "A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.", 0, 1, expression));
3093          children.add(new Property("xpath", "string", "An XPath expression of constraint that can be executed to see if this constraint is met.", 0, 1, xpath));
3094          children.add(new Property("source", "canonical(StructureDefinition)", "A reference to the original source of the constraint, for traceability purposes.", 0, 1, source));
3095        }
3096
3097        @Override
3098        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3099          switch (_hash) {
3100          case 106079: /*key*/  return new Property("key", "id", "Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.", 0, 1, key);
3101          case -1619874672: /*requirements*/  return new Property("requirements", "string", "Description of why this constraint is necessary or appropriate.", 0, 1, requirements);
3102          case 1478300413: /*severity*/  return new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, 1, severity);
3103          case 99639597: /*human*/  return new Property("human", "string", "Text that can be used to describe the constraint in messages identifying that the constraint has been violated.", 0, 1, human);
3104          case -1795452264: /*expression*/  return new Property("expression", "string", "A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.", 0, 1, expression);
3105          case 114256029: /*xpath*/  return new Property("xpath", "string", "An XPath expression of constraint that can be executed to see if this constraint is met.", 0, 1, xpath);
3106          case -896505829: /*source*/  return new Property("source", "canonical(StructureDefinition)", "A reference to the original source of the constraint, for traceability purposes.", 0, 1, source);
3107          default: return super.getNamedProperty(_hash, _name, _checkValid);
3108          }
3109
3110        }
3111
3112      @Override
3113      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3114        switch (hash) {
3115        case 106079: /*key*/ return this.key == null ? new Base[0] : new Base[] {this.key}; // IdType
3116        case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType
3117        case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration<ConstraintSeverity>
3118        case 99639597: /*human*/ return this.human == null ? new Base[0] : new Base[] {this.human}; // StringType
3119        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType
3120        case 114256029: /*xpath*/ return this.xpath == null ? new Base[0] : new Base[] {this.xpath}; // StringType
3121        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // CanonicalType
3122        default: return super.getProperty(hash, name, checkValid);
3123        }
3124
3125      }
3126
3127      @Override
3128      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3129        switch (hash) {
3130        case 106079: // key
3131          this.key = castToId(value); // IdType
3132          return value;
3133        case -1619874672: // requirements
3134          this.requirements = castToString(value); // StringType
3135          return value;
3136        case 1478300413: // severity
3137          value = new ConstraintSeverityEnumFactory().fromType(castToCode(value));
3138          this.severity = (Enumeration) value; // Enumeration<ConstraintSeverity>
3139          return value;
3140        case 99639597: // human
3141          this.human = castToString(value); // StringType
3142          return value;
3143        case -1795452264: // expression
3144          this.expression = castToString(value); // StringType
3145          return value;
3146        case 114256029: // xpath
3147          this.xpath = castToString(value); // StringType
3148          return value;
3149        case -896505829: // source
3150          this.source = castToCanonical(value); // CanonicalType
3151          return value;
3152        default: return super.setProperty(hash, name, value);
3153        }
3154
3155      }
3156
3157      @Override
3158      public Base setProperty(String name, Base value) throws FHIRException {
3159        if (name.equals("key")) {
3160          this.key = castToId(value); // IdType
3161        } else if (name.equals("requirements")) {
3162          this.requirements = castToString(value); // StringType
3163        } else if (name.equals("severity")) {
3164          value = new ConstraintSeverityEnumFactory().fromType(castToCode(value));
3165          this.severity = (Enumeration) value; // Enumeration<ConstraintSeverity>
3166        } else if (name.equals("human")) {
3167          this.human = castToString(value); // StringType
3168        } else if (name.equals("expression")) {
3169          this.expression = castToString(value); // StringType
3170        } else if (name.equals("xpath")) {
3171          this.xpath = castToString(value); // StringType
3172        } else if (name.equals("source")) {
3173          this.source = castToCanonical(value); // CanonicalType
3174        } else
3175          return super.setProperty(name, value);
3176        return value;
3177      }
3178
3179      @Override
3180      public Base makeProperty(int hash, String name) throws FHIRException {
3181        switch (hash) {
3182        case 106079:  return getKeyElement();
3183        case -1619874672:  return getRequirementsElement();
3184        case 1478300413:  return getSeverityElement();
3185        case 99639597:  return getHumanElement();
3186        case -1795452264:  return getExpressionElement();
3187        case 114256029:  return getXpathElement();
3188        case -896505829:  return getSourceElement();
3189        default: return super.makeProperty(hash, name);
3190        }
3191
3192      }
3193
3194      @Override
3195      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3196        switch (hash) {
3197        case 106079: /*key*/ return new String[] {"id"};
3198        case -1619874672: /*requirements*/ return new String[] {"string"};
3199        case 1478300413: /*severity*/ return new String[] {"code"};
3200        case 99639597: /*human*/ return new String[] {"string"};
3201        case -1795452264: /*expression*/ return new String[] {"string"};
3202        case 114256029: /*xpath*/ return new String[] {"string"};
3203        case -896505829: /*source*/ return new String[] {"canonical"};
3204        default: return super.getTypesForProperty(hash, name);
3205        }
3206
3207      }
3208
3209      @Override
3210      public Base addChild(String name) throws FHIRException {
3211        if (name.equals("key")) {
3212          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.key");
3213        }
3214        else if (name.equals("requirements")) {
3215          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.requirements");
3216        }
3217        else if (name.equals("severity")) {
3218          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.severity");
3219        }
3220        else if (name.equals("human")) {
3221          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.human");
3222        }
3223        else if (name.equals("expression")) {
3224          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.expression");
3225        }
3226        else if (name.equals("xpath")) {
3227          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.xpath");
3228        }
3229        else if (name.equals("source")) {
3230          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.source");
3231        }
3232        else
3233          return super.addChild(name);
3234      }
3235
3236      public ElementDefinitionConstraintComponent copy() {
3237        ElementDefinitionConstraintComponent dst = new ElementDefinitionConstraintComponent();
3238        copyValues(dst);
3239        dst.key = key == null ? null : key.copy();
3240        dst.requirements = requirements == null ? null : requirements.copy();
3241        dst.severity = severity == null ? null : severity.copy();
3242        dst.human = human == null ? null : human.copy();
3243        dst.expression = expression == null ? null : expression.copy();
3244        dst.xpath = xpath == null ? null : xpath.copy();
3245        dst.source = source == null ? null : source.copy();
3246        return dst;
3247      }
3248
3249      @Override
3250      public boolean equalsDeep(Base other_) {
3251        if (!super.equalsDeep(other_))
3252          return false;
3253        if (!(other_ instanceof ElementDefinitionConstraintComponent))
3254          return false;
3255        ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other_;
3256        return compareDeep(key, o.key, true) && compareDeep(requirements, o.requirements, true) && compareDeep(severity, o.severity, true)
3257           && compareDeep(human, o.human, true) && compareDeep(expression, o.expression, true) && compareDeep(xpath, o.xpath, true)
3258           && compareDeep(source, o.source, true);
3259      }
3260
3261      @Override
3262      public boolean equalsShallow(Base other_) {
3263        if (!super.equalsShallow(other_))
3264          return false;
3265        if (!(other_ instanceof ElementDefinitionConstraintComponent))
3266          return false;
3267        ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other_;
3268        return compareValues(key, o.key, true) && compareValues(requirements, o.requirements, true) && compareValues(severity, o.severity, true)
3269           && compareValues(human, o.human, true) && compareValues(expression, o.expression, true) && compareValues(xpath, o.xpath, true)
3270          ;
3271      }
3272
3273      public boolean isEmpty() {
3274        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(key, requirements, severity
3275          , human, expression, xpath, source);
3276      }
3277
3278  public String fhirType() {
3279    return "ElementDefinition.constraint";
3280
3281  }
3282
3283  }
3284
3285    @Block()
3286    public static class ElementDefinitionBindingComponent extends Element implements IBaseDatatypeElement {
3287        /**
3288         * Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.
3289         */
3290        @Child(name = "strength", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
3291        @Description(shortDefinition="required | extensible | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances." )
3292        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/binding-strength")
3293        protected Enumeration<BindingStrength> strength;
3294
3295        /**
3296         * Describes the intended use of this particular set of codes.
3297         */
3298        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
3299        @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." )
3300        protected StringType description;
3301
3302        /**
3303         * Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.
3304         */
3305        @Child(name = "valueSet", type = {UriType.class, CanonicalType.class}, order=3, min=0, max=1, modifier=false, summary=true)
3306        @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri." )
3307        protected Type valueSet;
3308
3309        private static final long serialVersionUID = 1355538460L;
3310
3311    /**
3312     * Constructor
3313     */
3314      public ElementDefinitionBindingComponent() {
3315        super();
3316      }
3317
3318    /**
3319     * Constructor
3320     */
3321      public ElementDefinitionBindingComponent(Enumeration<BindingStrength> strength) {
3322        super();
3323        this.strength = strength;
3324      }
3325
3326        /**
3327         * @return {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value
3328         */
3329        public Enumeration<BindingStrength> getStrengthElement() { 
3330          if (this.strength == null)
3331            if (Configuration.errorOnAutoCreate())
3332              throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.strength");
3333            else if (Configuration.doAutoCreate())
3334              this.strength = new Enumeration<BindingStrength>(new BindingStrengthEnumFactory()); // bb
3335          return this.strength;
3336        }
3337
3338        public boolean hasStrengthElement() { 
3339          return this.strength != null && !this.strength.isEmpty();
3340        }
3341
3342        public boolean hasStrength() { 
3343          return this.strength != null && !this.strength.isEmpty();
3344        }
3345
3346        /**
3347         * @param value {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value
3348         */
3349        public ElementDefinitionBindingComponent setStrengthElement(Enumeration<BindingStrength> value) { 
3350          this.strength = value;
3351          return this;
3352        }
3353
3354        /**
3355         * @return Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.
3356         */
3357        public BindingStrength getStrength() { 
3358          return this.strength == null ? null : this.strength.getValue();
3359        }
3360
3361        /**
3362         * @param value Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.
3363         */
3364        public ElementDefinitionBindingComponent setStrength(BindingStrength value) { 
3365            if (this.strength == null)
3366              this.strength = new Enumeration<BindingStrength>(new BindingStrengthEnumFactory());
3367            this.strength.setValue(value);
3368          return this;
3369        }
3370
3371        /**
3372         * @return {@link #description} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3373         */
3374        public StringType getDescriptionElement() { 
3375          if (this.description == null)
3376            if (Configuration.errorOnAutoCreate())
3377              throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.description");
3378            else if (Configuration.doAutoCreate())
3379              this.description = new StringType(); // bb
3380          return this.description;
3381        }
3382
3383        public boolean hasDescriptionElement() { 
3384          return this.description != null && !this.description.isEmpty();
3385        }
3386
3387        public boolean hasDescription() { 
3388          return this.description != null && !this.description.isEmpty();
3389        }
3390
3391        /**
3392         * @param value {@link #description} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3393         */
3394        public ElementDefinitionBindingComponent setDescriptionElement(StringType value) { 
3395          this.description = value;
3396          return this;
3397        }
3398
3399        /**
3400         * @return Describes the intended use of this particular set of codes.
3401         */
3402        public String getDescription() { 
3403          return this.description == null ? null : this.description.getValue();
3404        }
3405
3406        /**
3407         * @param value Describes the intended use of this particular set of codes.
3408         */
3409        public ElementDefinitionBindingComponent setDescription(String value) { 
3410          if (Utilities.noString(value))
3411            this.description = null;
3412          else {
3413            if (this.description == null)
3414              this.description = new StringType();
3415            this.description.setValue(value);
3416          }
3417          return this;
3418        }
3419
3420        /**
3421         * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.)
3422         */
3423        public Type getValueSet() { 
3424          return this.valueSet;
3425        }
3426
3427        /**
3428         * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.)
3429         */
3430        public UriType getValueSetUriType() throws FHIRException { 
3431          if (this.valueSet == null)
3432            return null;
3433          if (!(this.valueSet instanceof UriType))
3434            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.valueSet.getClass().getName()+" was encountered");
3435          return (UriType) this.valueSet;
3436        }
3437
3438        public boolean hasValueSetUriType() { 
3439          return this != null && this.valueSet instanceof UriType;
3440        }
3441
3442        /**
3443         * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.)
3444         */
3445        public CanonicalType getValueSetCanonicalType() throws FHIRException { 
3446          if (this.valueSet == null)
3447            return null;
3448          if (!(this.valueSet instanceof CanonicalType))
3449            throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.valueSet.getClass().getName()+" was encountered");
3450          return (CanonicalType) this.valueSet;
3451        }
3452
3453        public boolean hasValueSetCanonicalType() { 
3454          return this != null && this.valueSet instanceof CanonicalType;
3455        }
3456
3457        public boolean hasValueSet() { 
3458          return this.valueSet != null && !this.valueSet.isEmpty();
3459        }
3460
3461        /**
3462         * @param value {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.)
3463         */
3464        public ElementDefinitionBindingComponent setValueSet(Type value) { 
3465          if (value != null && !(value instanceof UriType || value instanceof CanonicalType))
3466            throw new Error("Not the right type for ElementDefinition.binding.valueSet[x]: "+value.fhirType());
3467          this.valueSet = value;
3468          return this;
3469        }
3470
3471        protected void listChildren(List<Property> children) {
3472          super.listChildren(children);
3473          children.add(new Property("strength", "code", "Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.", 0, 1, strength));
3474          children.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, 1, description));
3475          children.add(new Property("valueSet[x]", "uri|canonical(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.", 0, 1, valueSet));
3476        }
3477
3478        @Override
3479        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3480          switch (_hash) {
3481          case 1791316033: /*strength*/  return new Property("strength", "code", "Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.", 0, 1, strength);
3482          case -1724546052: /*description*/  return new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, 1, description);
3483          case -1438410321: /*valueSet[x]*/  return new Property("valueSet[x]", "uri|canonical(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.", 0, 1, valueSet);
3484          case -1410174671: /*valueSet*/  return new Property("valueSet[x]", "uri|canonical(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.", 0, 1, valueSet);
3485          case -1438416261: /*valueSetUri*/  return new Property("valueSet[x]", "uri|canonical(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.", 0, 1, valueSet);
3486          case 2048727747: /*valueSetCanonical*/  return new Property("valueSet[x]", "uri|canonical(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. If the binding refers to an explicit value set - the normal case - then use a canonical(ValueSet) preferably containing the canonical URL for the value set. If the reference is to an implicit value set - usually, an IETF RFC that defines a grammar, such as mime types - then use a uri.", 0, 1, valueSet);
3487          default: return super.getNamedProperty(_hash, _name, _checkValid);
3488          }
3489
3490        }
3491
3492      @Override
3493      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3494        switch (hash) {
3495        case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : new Base[] {this.strength}; // Enumeration<BindingStrength>
3496        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
3497        case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // Type
3498        default: return super.getProperty(hash, name, checkValid);
3499        }
3500
3501      }
3502
3503      @Override
3504      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3505        switch (hash) {
3506        case 1791316033: // strength
3507          value = new BindingStrengthEnumFactory().fromType(castToCode(value));
3508          this.strength = (Enumeration) value; // Enumeration<BindingStrength>
3509          return value;
3510        case -1724546052: // description
3511          this.description = castToString(value); // StringType
3512          return value;
3513        case -1410174671: // valueSet
3514          this.valueSet = castToType(value); // Type
3515          return value;
3516        default: return super.setProperty(hash, name, value);
3517        }
3518
3519      }
3520
3521      @Override
3522      public Base setProperty(String name, Base value) throws FHIRException {
3523        if (name.equals("strength")) {
3524          value = new BindingStrengthEnumFactory().fromType(castToCode(value));
3525          this.strength = (Enumeration) value; // Enumeration<BindingStrength>
3526        } else if (name.equals("description")) {
3527          this.description = castToString(value); // StringType
3528        } else if (name.equals("valueSet[x]")) {
3529          this.valueSet = castToType(value); // Type
3530        } else
3531          return super.setProperty(name, value);
3532        return value;
3533      }
3534
3535      @Override
3536      public Base makeProperty(int hash, String name) throws FHIRException {
3537        switch (hash) {
3538        case 1791316033:  return getStrengthElement();
3539        case -1724546052:  return getDescriptionElement();
3540        case -1438410321:  return getValueSet(); 
3541        case -1410174671:  return getValueSet(); 
3542        default: return super.makeProperty(hash, name);
3543        }
3544
3545      }
3546
3547      @Override
3548      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3549        switch (hash) {
3550        case 1791316033: /*strength*/ return new String[] {"code"};
3551        case -1724546052: /*description*/ return new String[] {"string"};
3552        case -1410174671: /*valueSet*/ return new String[] {"uri", "canonical"};
3553        default: return super.getTypesForProperty(hash, name);
3554        }
3555
3556      }
3557
3558      @Override
3559      public Base addChild(String name) throws FHIRException {
3560        if (name.equals("strength")) {
3561          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.strength");
3562        }
3563        else if (name.equals("description")) {
3564          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.description");
3565        }
3566        else if (name.equals("valueSetUri")) {
3567          this.valueSet = new UriType();
3568          return this.valueSet;
3569        }
3570        else if (name.equals("valueSetCanonical")) {
3571          this.valueSet = new CanonicalType();
3572          return this.valueSet;
3573        }
3574        else
3575          return super.addChild(name);
3576      }
3577
3578      public ElementDefinitionBindingComponent copy() {
3579        ElementDefinitionBindingComponent dst = new ElementDefinitionBindingComponent();
3580        copyValues(dst);
3581        dst.strength = strength == null ? null : strength.copy();
3582        dst.description = description == null ? null : description.copy();
3583        dst.valueSet = valueSet == null ? null : valueSet.copy();
3584        return dst;
3585      }
3586
3587      @Override
3588      public boolean equalsDeep(Base other_) {
3589        if (!super.equalsDeep(other_))
3590          return false;
3591        if (!(other_ instanceof ElementDefinitionBindingComponent))
3592          return false;
3593        ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other_;
3594        return compareDeep(strength, o.strength, true) && compareDeep(description, o.description, true)
3595           && compareDeep(valueSet, o.valueSet, true);
3596      }
3597
3598      @Override
3599      public boolean equalsShallow(Base other_) {
3600        if (!super.equalsShallow(other_))
3601          return false;
3602        if (!(other_ instanceof ElementDefinitionBindingComponent))
3603          return false;
3604        ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other_;
3605        return compareValues(strength, o.strength, true) && compareValues(description, o.description, true)
3606          ;
3607      }
3608
3609      public boolean isEmpty() {
3610        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(strength, description, valueSet
3611          );
3612      }
3613
3614  public String fhirType() {
3615    return "ElementDefinition.binding";
3616
3617  }
3618
3619  }
3620
3621    @Block()
3622    public static class ElementDefinitionMappingComponent extends Element implements IBaseDatatypeElement {
3623        /**
3624         * An internal reference to the definition of a mapping.
3625         */
3626        @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
3627        @Description(shortDefinition="Reference to mapping declaration", formalDefinition="An internal reference to the definition of a mapping." )
3628        protected IdType identity;
3629
3630        /**
3631         * Identifies the computable language in which mapping.map is expressed.
3632         */
3633        @Child(name = "language", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
3634        @Description(shortDefinition="Computable language of mapping", formalDefinition="Identifies the computable language in which mapping.map is expressed." )
3635        protected CodeType language;
3636
3637        /**
3638         * Expresses what part of the target specification corresponds to this element.
3639         */
3640        @Child(name = "map", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true)
3641        @Description(shortDefinition="Details of the mapping", formalDefinition="Expresses what part of the target specification corresponds to this element." )
3642        protected StringType map;
3643
3644        /**
3645         * Comments that provide information about the mapping or its use.
3646         */
3647        @Child(name = "comment", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
3648        @Description(shortDefinition="Comments about the mapping or its use", formalDefinition="Comments that provide information about the mapping or its use." )
3649        protected StringType comment;
3650
3651        private static final long serialVersionUID = 1386816887L;
3652
3653    /**
3654     * Constructor
3655     */
3656      public ElementDefinitionMappingComponent() {
3657        super();
3658      }
3659
3660    /**
3661     * Constructor
3662     */
3663      public ElementDefinitionMappingComponent(IdType identity, StringType map) {
3664        super();
3665        this.identity = identity;
3666        this.map = map;
3667      }
3668
3669        /**
3670         * @return {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value
3671         */
3672        public IdType getIdentityElement() { 
3673          if (this.identity == null)
3674            if (Configuration.errorOnAutoCreate())
3675              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.identity");
3676            else if (Configuration.doAutoCreate())
3677              this.identity = new IdType(); // bb
3678          return this.identity;
3679        }
3680
3681        public boolean hasIdentityElement() { 
3682          return this.identity != null && !this.identity.isEmpty();
3683        }
3684
3685        public boolean hasIdentity() { 
3686          return this.identity != null && !this.identity.isEmpty();
3687        }
3688
3689        /**
3690         * @param value {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value
3691         */
3692        public ElementDefinitionMappingComponent setIdentityElement(IdType value) { 
3693          this.identity = value;
3694          return this;
3695        }
3696
3697        /**
3698         * @return An internal reference to the definition of a mapping.
3699         */
3700        public String getIdentity() { 
3701          return this.identity == null ? null : this.identity.getValue();
3702        }
3703
3704        /**
3705         * @param value An internal reference to the definition of a mapping.
3706         */
3707        public ElementDefinitionMappingComponent setIdentity(String value) { 
3708            if (this.identity == null)
3709              this.identity = new IdType();
3710            this.identity.setValue(value);
3711          return this;
3712        }
3713
3714        /**
3715         * @return {@link #language} (Identifies the computable language in which mapping.map is expressed.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
3716         */
3717        public CodeType getLanguageElement() { 
3718          if (this.language == null)
3719            if (Configuration.errorOnAutoCreate())
3720              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.language");
3721            else if (Configuration.doAutoCreate())
3722              this.language = new CodeType(); // bb
3723          return this.language;
3724        }
3725
3726        public boolean hasLanguageElement() { 
3727          return this.language != null && !this.language.isEmpty();
3728        }
3729
3730        public boolean hasLanguage() { 
3731          return this.language != null && !this.language.isEmpty();
3732        }
3733
3734        /**
3735         * @param value {@link #language} (Identifies the computable language in which mapping.map is expressed.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value
3736         */
3737        public ElementDefinitionMappingComponent setLanguageElement(CodeType value) { 
3738          this.language = value;
3739          return this;
3740        }
3741
3742        /**
3743         * @return Identifies the computable language in which mapping.map is expressed.
3744         */
3745        public String getLanguage() { 
3746          return this.language == null ? null : this.language.getValue();
3747        }
3748
3749        /**
3750         * @param value Identifies the computable language in which mapping.map is expressed.
3751         */
3752        public ElementDefinitionMappingComponent setLanguage(String value) { 
3753          if (Utilities.noString(value))
3754            this.language = null;
3755          else {
3756            if (this.language == null)
3757              this.language = new CodeType();
3758            this.language.setValue(value);
3759          }
3760          return this;
3761        }
3762
3763        /**
3764         * @return {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value
3765         */
3766        public StringType getMapElement() { 
3767          if (this.map == null)
3768            if (Configuration.errorOnAutoCreate())
3769              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.map");
3770            else if (Configuration.doAutoCreate())
3771              this.map = new StringType(); // bb
3772          return this.map;
3773        }
3774
3775        public boolean hasMapElement() { 
3776          return this.map != null && !this.map.isEmpty();
3777        }
3778
3779        public boolean hasMap() { 
3780          return this.map != null && !this.map.isEmpty();
3781        }
3782
3783        /**
3784         * @param value {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value
3785         */
3786        public ElementDefinitionMappingComponent setMapElement(StringType value) { 
3787          this.map = value;
3788          return this;
3789        }
3790
3791        /**
3792         * @return Expresses what part of the target specification corresponds to this element.
3793         */
3794        public String getMap() { 
3795          return this.map == null ? null : this.map.getValue();
3796        }
3797
3798        /**
3799         * @param value Expresses what part of the target specification corresponds to this element.
3800         */
3801        public ElementDefinitionMappingComponent setMap(String value) { 
3802            if (this.map == null)
3803              this.map = new StringType();
3804            this.map.setValue(value);
3805          return this;
3806        }
3807
3808        /**
3809         * @return {@link #comment} (Comments that provide information about the mapping or its use.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
3810         */
3811        public StringType getCommentElement() { 
3812          if (this.comment == null)
3813            if (Configuration.errorOnAutoCreate())
3814              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.comment");
3815            else if (Configuration.doAutoCreate())
3816              this.comment = new StringType(); // bb
3817          return this.comment;
3818        }
3819
3820        public boolean hasCommentElement() { 
3821          return this.comment != null && !this.comment.isEmpty();
3822        }
3823
3824        public boolean hasComment() { 
3825          return this.comment != null && !this.comment.isEmpty();
3826        }
3827
3828        /**
3829         * @param value {@link #comment} (Comments that provide information about the mapping or its use.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
3830         */
3831        public ElementDefinitionMappingComponent setCommentElement(StringType value) { 
3832          this.comment = value;
3833          return this;
3834        }
3835
3836        /**
3837         * @return Comments that provide information about the mapping or its use.
3838         */
3839        public String getComment() { 
3840          return this.comment == null ? null : this.comment.getValue();
3841        }
3842
3843        /**
3844         * @param value Comments that provide information about the mapping or its use.
3845         */
3846        public ElementDefinitionMappingComponent setComment(String value) { 
3847          if (Utilities.noString(value))
3848            this.comment = null;
3849          else {
3850            if (this.comment == null)
3851              this.comment = new StringType();
3852            this.comment.setValue(value);
3853          }
3854          return this;
3855        }
3856
3857        protected void listChildren(List<Property> children) {
3858          super.listChildren(children);
3859          children.add(new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, 1, identity));
3860          children.add(new Property("language", "code", "Identifies the computable language in which mapping.map is expressed.", 0, 1, language));
3861          children.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, 1, map));
3862          children.add(new Property("comment", "string", "Comments that provide information about the mapping or its use.", 0, 1, comment));
3863        }
3864
3865        @Override
3866        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3867          switch (_hash) {
3868          case -135761730: /*identity*/  return new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, 1, identity);
3869          case -1613589672: /*language*/  return new Property("language", "code", "Identifies the computable language in which mapping.map is expressed.", 0, 1, language);
3870          case 107868: /*map*/  return new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, 1, map);
3871          case 950398559: /*comment*/  return new Property("comment", "string", "Comments that provide information about the mapping or its use.", 0, 1, comment);
3872          default: return super.getNamedProperty(_hash, _name, _checkValid);
3873          }
3874
3875        }
3876
3877      @Override
3878      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3879        switch (hash) {
3880        case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType
3881        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType
3882        case 107868: /*map*/ return this.map == null ? new Base[0] : new Base[] {this.map}; // StringType
3883        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
3884        default: return super.getProperty(hash, name, checkValid);
3885        }
3886
3887      }
3888
3889      @Override
3890      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3891        switch (hash) {
3892        case -135761730: // identity
3893          this.identity = castToId(value); // IdType
3894          return value;
3895        case -1613589672: // language
3896          this.language = castToCode(value); // CodeType
3897          return value;
3898        case 107868: // map
3899          this.map = castToString(value); // StringType
3900          return value;
3901        case 950398559: // comment
3902          this.comment = castToString(value); // StringType
3903          return value;
3904        default: return super.setProperty(hash, name, value);
3905        }
3906
3907      }
3908
3909      @Override
3910      public Base setProperty(String name, Base value) throws FHIRException {
3911        if (name.equals("identity")) {
3912          this.identity = castToId(value); // IdType
3913        } else if (name.equals("language")) {
3914          this.language = castToCode(value); // CodeType
3915        } else if (name.equals("map")) {
3916          this.map = castToString(value); // StringType
3917        } else if (name.equals("comment")) {
3918          this.comment = castToString(value); // StringType
3919        } else
3920          return super.setProperty(name, value);
3921        return value;
3922      }
3923
3924      @Override
3925      public Base makeProperty(int hash, String name) throws FHIRException {
3926        switch (hash) {
3927        case -135761730:  return getIdentityElement();
3928        case -1613589672:  return getLanguageElement();
3929        case 107868:  return getMapElement();
3930        case 950398559:  return getCommentElement();
3931        default: return super.makeProperty(hash, name);
3932        }
3933
3934      }
3935
3936      @Override
3937      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3938        switch (hash) {
3939        case -135761730: /*identity*/ return new String[] {"id"};
3940        case -1613589672: /*language*/ return new String[] {"code"};
3941        case 107868: /*map*/ return new String[] {"string"};
3942        case 950398559: /*comment*/ return new String[] {"string"};
3943        default: return super.getTypesForProperty(hash, name);
3944        }
3945
3946      }
3947
3948      @Override
3949      public Base addChild(String name) throws FHIRException {
3950        if (name.equals("identity")) {
3951          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.identity");
3952        }
3953        else if (name.equals("language")) {
3954          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.language");
3955        }
3956        else if (name.equals("map")) {
3957          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.map");
3958        }
3959        else if (name.equals("comment")) {
3960          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.comment");
3961        }
3962        else
3963          return super.addChild(name);
3964      }
3965
3966      public ElementDefinitionMappingComponent copy() {
3967        ElementDefinitionMappingComponent dst = new ElementDefinitionMappingComponent();
3968        copyValues(dst);
3969        dst.identity = identity == null ? null : identity.copy();
3970        dst.language = language == null ? null : language.copy();
3971        dst.map = map == null ? null : map.copy();
3972        dst.comment = comment == null ? null : comment.copy();
3973        return dst;
3974      }
3975
3976      @Override
3977      public boolean equalsDeep(Base other_) {
3978        if (!super.equalsDeep(other_))
3979          return false;
3980        if (!(other_ instanceof ElementDefinitionMappingComponent))
3981          return false;
3982        ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other_;
3983        return compareDeep(identity, o.identity, true) && compareDeep(language, o.language, true) && compareDeep(map, o.map, true)
3984           && compareDeep(comment, o.comment, true);
3985      }
3986
3987      @Override
3988      public boolean equalsShallow(Base other_) {
3989        if (!super.equalsShallow(other_))
3990          return false;
3991        if (!(other_ instanceof ElementDefinitionMappingComponent))
3992          return false;
3993        ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other_;
3994        return compareValues(identity, o.identity, true) && compareValues(language, o.language, true) && compareValues(map, o.map, true)
3995           && compareValues(comment, o.comment, true);
3996      }
3997
3998      public boolean isEmpty() {
3999        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identity, language, map
4000          , comment);
4001      }
4002
4003  public String fhirType() {
4004    return "ElementDefinition.mapping";
4005
4006  }
4007
4008  }
4009
4010    /**
4011     * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.
4012     */
4013    @Child(name = "path", type = {StringType.class}, order=0, min=1, max=1, modifier=false, summary=true)
4014    @Description(shortDefinition="Path of the element in the hierarchy of elements", formalDefinition="The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource or extension." )
4015    protected StringType path;
4016
4017    /**
4018     * Codes that define how this element is represented in instances, when the deviation varies from the normal case.
4019     */
4020    @Child(name = "representation", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4021    @Description(shortDefinition="xmlAttr | xmlText | typeAttr | cdaText | xhtml", formalDefinition="Codes that define how this element is represented in instances, when the deviation varies from the normal case." )
4022    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/property-representation")
4023    protected List<Enumeration<PropertyRepresentation>> representation;
4024
4025    /**
4026     * The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.
4027     */
4028    @Child(name = "sliceName", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
4029    @Description(shortDefinition="Name for this particular element (in a set of slices)", formalDefinition="The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element." )
4030    protected StringType sliceName;
4031
4032    /**
4033     * A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.
4034     */
4035    @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
4036    @Description(shortDefinition="Name for element to display with or prompt for element", formalDefinition="A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form." )
4037    protected StringType label;
4038
4039    /**
4040     * A code that has the same meaning as the element in a particular terminology.
4041     */
4042    @Child(name = "code", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4043    @Description(shortDefinition="Corresponding codes in terminologies", formalDefinition="A code that has the same meaning as the element in a particular terminology." )
4044    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-codes")
4045    protected List<Coding> code;
4046
4047    /**
4048     * Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).
4049     */
4050    @Child(name = "slicing", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
4051    @Description(shortDefinition="This element is sliced - slices follow", formalDefinition="Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set)." )
4052    protected ElementDefinitionSlicingComponent slicing;
4053
4054    /**
4055     * A concise description of what this element means (e.g. for use in autogenerated summaries).
4056     */
4057    @Child(name = "short", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
4058    @Description(shortDefinition="Concise definition for space-constrained presentation", formalDefinition="A concise description of what this element means (e.g. for use in autogenerated summaries)." )
4059    protected StringType short_;
4060
4061    /**
4062     * Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.
4063     */
4064    @Child(name = "definition", type = {MarkdownType.class}, order=7, min=0, max=1, modifier=false, summary=true)
4065    @Description(shortDefinition="Full formal definition as narrative text", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource." )
4066    protected MarkdownType definition;
4067
4068    /**
4069     * Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.
4070     */
4071    @Child(name = "comment", type = {MarkdownType.class}, order=8, min=0, max=1, modifier=false, summary=true)
4072    @Description(shortDefinition="Comments about the use of this element", formalDefinition="Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc." )
4073    protected MarkdownType comment;
4074
4075    /**
4076     * This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.
4077     */
4078    @Child(name = "requirements", type = {MarkdownType.class}, order=9, min=0, max=1, modifier=false, summary=true)
4079    @Description(shortDefinition="Why this resource has been created", formalDefinition="This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element." )
4080    protected MarkdownType requirements;
4081
4082    /**
4083     * Identifies additional names by which this element might also be known.
4084     */
4085    @Child(name = "alias", type = {StringType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4086    @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." )
4087    protected List<StringType> alias;
4088
4089    /**
4090     * The minimum number of times this element SHALL appear in the instance.
4091     */
4092    @Child(name = "min", type = {UnsignedIntType.class}, order=11, min=0, max=1, modifier=false, summary=true)
4093    @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this element SHALL appear in the instance." )
4094    protected UnsignedIntType min;
4095
4096    /**
4097     * The maximum number of times this element is permitted to appear in the instance.
4098     */
4099    @Child(name = "max", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true)
4100    @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the instance." )
4101    protected StringType max;
4102
4103    /**
4104     * Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same.
4105     */
4106    @Child(name = "base", type = {}, order=13, min=0, max=1, modifier=false, summary=true)
4107    @Description(shortDefinition="Base definition information for tools", formalDefinition="Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same." )
4108    protected ElementDefinitionBaseComponent base;
4109
4110    /**
4111     * Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.
4112     */
4113    @Child(name = "contentReference", type = {UriType.class}, order=14, min=0, max=1, modifier=false, summary=true)
4114    @Description(shortDefinition="Reference to definition of content for the element", formalDefinition="Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element." )
4115    protected UriType contentReference;
4116
4117    /**
4118     * The data type or resource that the value of this element is permitted to be.
4119     */
4120    @Child(name = "type", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4121    @Description(shortDefinition="Data type and Profile for this element", formalDefinition="The data type or resource that the value of this element is permitted to be." )
4122    protected List<TypeRefComponent> type;
4123
4124    /**
4125     * The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').
4126     */
4127    @Child(name = "defaultValue", type = {}, order=16, min=0, max=1, modifier=false, summary=true)
4128    @Description(shortDefinition="Specified value if missing from instance", formalDefinition="The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false')." )
4129    protected org.hl7.fhir.r4.model.Type defaultValue;
4130
4131    /**
4132     * The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.
4133     */
4134    @Child(name = "meaningWhenMissing", type = {MarkdownType.class}, order=17, min=0, max=1, modifier=false, summary=true)
4135    @Description(shortDefinition="Implicit meaning when this element is missing", formalDefinition="The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'." )
4136    protected MarkdownType meaningWhenMissing;
4137
4138    /**
4139     * If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.
4140     */
4141    @Child(name = "orderMeaning", type = {StringType.class}, order=18, min=0, max=1, modifier=false, summary=true)
4142    @Description(shortDefinition="What the order of the elements means", formalDefinition="If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning." )
4143    protected StringType orderMeaning;
4144
4145    /**
4146     * Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.
4147     */
4148    @Child(name = "fixed", type = {}, order=19, min=0, max=1, modifier=false, summary=true)
4149    @Description(shortDefinition="Value must be exactly this", formalDefinition="Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing." )
4150    protected org.hl7.fhir.r4.model.Type fixed;
4151
4152    /**
4153     * Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).
4154     */
4155    @Child(name = "pattern", type = {}, order=20, min=0, max=1, modifier=false, summary=true)
4156    @Description(shortDefinition="Value must have at least these property values", formalDefinition="Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.)." )
4157    protected org.hl7.fhir.r4.model.Type pattern;
4158
4159    /**
4160     * A sample value for this element demonstrating the type of information that would typically be found in the element.
4161     */
4162    @Child(name = "example", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4163    @Description(shortDefinition="Example value (as defined for type)", formalDefinition="A sample value for this element demonstrating the type of information that would typically be found in the element." )
4164    protected List<ElementDefinitionExampleComponent> example;
4165
4166    /**
4167     * The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.
4168     */
4169    @Child(name = "minValue", type = {DateType.class, DateTimeType.class, InstantType.class, TimeType.class, DecimalType.class, IntegerType.class, PositiveIntType.class, UnsignedIntType.class, Quantity.class}, order=22, min=0, max=1, modifier=false, summary=true)
4170    @Description(shortDefinition="Minimum Allowed Value (for some types)", formalDefinition="The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity." )
4171    protected Type minValue;
4172
4173    /**
4174     * The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.
4175     */
4176    @Child(name = "maxValue", type = {DateType.class, DateTimeType.class, InstantType.class, TimeType.class, DecimalType.class, IntegerType.class, PositiveIntType.class, UnsignedIntType.class, Quantity.class}, order=23, min=0, max=1, modifier=false, summary=true)
4177    @Description(shortDefinition="Maximum Allowed Value (for some types)", formalDefinition="The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity." )
4178    protected Type maxValue;
4179
4180    /**
4181     * Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.
4182     */
4183    @Child(name = "maxLength", type = {IntegerType.class}, order=24, min=0, max=1, modifier=false, summary=true)
4184    @Description(shortDefinition="Max length for strings", formalDefinition="Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element." )
4185    protected IntegerType maxLength;
4186
4187    /**
4188     * A reference to an invariant that may make additional statements about the cardinality or value in the instance.
4189     */
4190    @Child(name = "condition", type = {IdType.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4191    @Description(shortDefinition="Reference to invariant about presence", formalDefinition="A reference to an invariant that may make additional statements about the cardinality or value in the instance." )
4192    protected List<IdType> condition;
4193
4194    /**
4195     * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.
4196     */
4197    @Child(name = "constraint", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4198    @Description(shortDefinition="Condition that must evaluate to true", formalDefinition="Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance." )
4199    protected List<ElementDefinitionConstraintComponent> constraint;
4200
4201    /**
4202     * If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way.  If false, the element may be ignored and not supported.
4203     */
4204    @Child(name = "mustSupport", type = {BooleanType.class}, order=27, min=0, max=1, modifier=false, summary=true)
4205    @Description(shortDefinition="If the element must supported", formalDefinition="If true, implementations that produce or consume resources SHALL provide \"support\" for the element in some meaningful way.  If false, the element may be ignored and not supported." )
4206    protected BooleanType mustSupport;
4207
4208    /**
4209     * If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.
4210     */
4211    @Child(name = "isModifier", type = {BooleanType.class}, order=28, min=0, max=1, modifier=false, summary=true)
4212    @Description(shortDefinition="If this modifies the meaning of other elements", formalDefinition="If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system." )
4213    protected BooleanType isModifier;
4214
4215    /**
4216     * Explains how that element affects the interpretation of the resource or element that contains it.
4217     */
4218    @Child(name = "isModifierReason", type = {StringType.class}, order=29, min=0, max=1, modifier=false, summary=true)
4219    @Description(shortDefinition="Reason that this element is marked as a modifier", formalDefinition="Explains how that element affects the interpretation of the resource or element that contains it." )
4220    protected StringType isModifierReason;
4221
4222    /**
4223     * Whether the element should be included if a client requests a search with the parameter _summary=true.
4224     */
4225    @Child(name = "isSummary", type = {BooleanType.class}, order=30, min=0, max=1, modifier=false, summary=true)
4226    @Description(shortDefinition="Include when _summary = true?", formalDefinition="Whether the element should be included if a client requests a search with the parameter _summary=true." )
4227    protected BooleanType isSummary;
4228
4229    /**
4230     * Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).
4231     */
4232    @Child(name = "binding", type = {}, order=31, min=0, max=1, modifier=false, summary=true)
4233    @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri)." )
4234    protected ElementDefinitionBindingComponent binding;
4235
4236    /**
4237     * Identifies a concept from an external specification that roughly corresponds to this element.
4238     */
4239    @Child(name = "mapping", type = {}, order=32, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4240    @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." )
4241    protected List<ElementDefinitionMappingComponent> mapping;
4242
4243    private static final long serialVersionUID = 158101607L;
4244
4245  /**
4246   * Constructor
4247   */
4248    public ElementDefinition() {
4249      super();
4250    }
4251
4252  /**
4253   * Constructor
4254   */
4255    public ElementDefinition(StringType path) {
4256      super();
4257      this.path = path;
4258    }
4259
4260    /**
4261     * @return {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
4262     */
4263    public StringType getPathElement() { 
4264      if (this.path == null)
4265        if (Configuration.errorOnAutoCreate())
4266          throw new Error("Attempt to auto-create ElementDefinition.path");
4267        else if (Configuration.doAutoCreate())
4268          this.path = new StringType(); // bb
4269      return this.path;
4270    }
4271
4272    public boolean hasPathElement() { 
4273      return this.path != null && !this.path.isEmpty();
4274    }
4275
4276    public boolean hasPath() { 
4277      return this.path != null && !this.path.isEmpty();
4278    }
4279
4280    /**
4281     * @param value {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
4282     */
4283    public ElementDefinition setPathElement(StringType value) { 
4284      this.path = value;
4285      return this;
4286    }
4287
4288    /**
4289     * @return The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.
4290     */
4291    public String getPath() { 
4292      return this.path == null ? null : this.path.getValue();
4293    }
4294
4295    /**
4296     * @param value The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.
4297     */
4298    public ElementDefinition setPath(String value) { 
4299        if (this.path == null)
4300          this.path = new StringType();
4301        this.path.setValue(value);
4302      return this;
4303    }
4304
4305    /**
4306     * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
4307     */
4308    public List<Enumeration<PropertyRepresentation>> getRepresentation() { 
4309      if (this.representation == null)
4310        this.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
4311      return this.representation;
4312    }
4313
4314    /**
4315     * @return Returns a reference to <code>this</code> for easy method chaining
4316     */
4317    public ElementDefinition setRepresentation(List<Enumeration<PropertyRepresentation>> theRepresentation) { 
4318      this.representation = theRepresentation;
4319      return this;
4320    }
4321
4322    public boolean hasRepresentation() { 
4323      if (this.representation == null)
4324        return false;
4325      for (Enumeration<PropertyRepresentation> item : this.representation)
4326        if (!item.isEmpty())
4327          return true;
4328      return false;
4329    }
4330
4331    /**
4332     * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
4333     */
4334    public Enumeration<PropertyRepresentation> addRepresentationElement() {//2 
4335      Enumeration<PropertyRepresentation> t = new Enumeration<PropertyRepresentation>(new PropertyRepresentationEnumFactory());
4336      if (this.representation == null)
4337        this.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
4338      this.representation.add(t);
4339      return t;
4340    }
4341
4342    /**
4343     * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
4344     */
4345    public ElementDefinition addRepresentation(PropertyRepresentation value) { //1
4346      Enumeration<PropertyRepresentation> t = new Enumeration<PropertyRepresentation>(new PropertyRepresentationEnumFactory());
4347      t.setValue(value);
4348      if (this.representation == null)
4349        this.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
4350      this.representation.add(t);
4351      return this;
4352    }
4353
4354    /**
4355     * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
4356     */
4357    public boolean hasRepresentation(PropertyRepresentation value) { 
4358      if (this.representation == null)
4359        return false;
4360      for (Enumeration<PropertyRepresentation> v : this.representation)
4361        if (v.getValue().equals(value)) // code
4362          return true;
4363      return false;
4364    }
4365
4366    /**
4367     * @return {@link #sliceName} (The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getSliceName" gives direct access to the value
4368     */
4369    public StringType getSliceNameElement() { 
4370      if (this.sliceName == null)
4371        if (Configuration.errorOnAutoCreate())
4372          throw new Error("Attempt to auto-create ElementDefinition.sliceName");
4373        else if (Configuration.doAutoCreate())
4374          this.sliceName = new StringType(); // bb
4375      return this.sliceName;
4376    }
4377
4378    public boolean hasSliceNameElement() { 
4379      return this.sliceName != null && !this.sliceName.isEmpty();
4380    }
4381
4382    public boolean hasSliceName() { 
4383      return this.sliceName != null && !this.sliceName.isEmpty();
4384    }
4385
4386    /**
4387     * @param value {@link #sliceName} (The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getSliceName" gives direct access to the value
4388     */
4389    public ElementDefinition setSliceNameElement(StringType value) { 
4390      this.sliceName = value;
4391      return this;
4392    }
4393
4394    /**
4395     * @return The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.
4396     */
4397    public String getSliceName() { 
4398      return this.sliceName == null ? null : this.sliceName.getValue();
4399    }
4400
4401    /**
4402     * @param value The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.
4403     */
4404    public ElementDefinition setSliceName(String value) { 
4405      if (Utilities.noString(value))
4406        this.sliceName = null;
4407      else {
4408        if (this.sliceName == null)
4409          this.sliceName = new StringType();
4410        this.sliceName.setValue(value);
4411      }
4412      return this;
4413    }
4414
4415    /**
4416     * @return {@link #label} (A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value
4417     */
4418    public StringType getLabelElement() { 
4419      if (this.label == null)
4420        if (Configuration.errorOnAutoCreate())
4421          throw new Error("Attempt to auto-create ElementDefinition.label");
4422        else if (Configuration.doAutoCreate())
4423          this.label = new StringType(); // bb
4424      return this.label;
4425    }
4426
4427    public boolean hasLabelElement() { 
4428      return this.label != null && !this.label.isEmpty();
4429    }
4430
4431    public boolean hasLabel() { 
4432      return this.label != null && !this.label.isEmpty();
4433    }
4434
4435    /**
4436     * @param value {@link #label} (A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value
4437     */
4438    public ElementDefinition setLabelElement(StringType value) { 
4439      this.label = value;
4440      return this;
4441    }
4442
4443    /**
4444     * @return A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.
4445     */
4446    public String getLabel() { 
4447      return this.label == null ? null : this.label.getValue();
4448    }
4449
4450    /**
4451     * @param value A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.
4452     */
4453    public ElementDefinition setLabel(String value) { 
4454      if (Utilities.noString(value))
4455        this.label = null;
4456      else {
4457        if (this.label == null)
4458          this.label = new StringType();
4459        this.label.setValue(value);
4460      }
4461      return this;
4462    }
4463
4464    /**
4465     * @return {@link #code} (A code that has the same meaning as the element in a particular terminology.)
4466     */
4467    public List<Coding> getCode() { 
4468      if (this.code == null)
4469        this.code = new ArrayList<Coding>();
4470      return this.code;
4471    }
4472
4473    /**
4474     * @return Returns a reference to <code>this</code> for easy method chaining
4475     */
4476    public ElementDefinition setCode(List<Coding> theCode) { 
4477      this.code = theCode;
4478      return this;
4479    }
4480
4481    public boolean hasCode() { 
4482      if (this.code == null)
4483        return false;
4484      for (Coding item : this.code)
4485        if (!item.isEmpty())
4486          return true;
4487      return false;
4488    }
4489
4490    public Coding addCode() { //3
4491      Coding t = new Coding();
4492      if (this.code == null)
4493        this.code = new ArrayList<Coding>();
4494      this.code.add(t);
4495      return t;
4496    }
4497
4498    public ElementDefinition addCode(Coding t) { //3
4499      if (t == null)
4500        return this;
4501      if (this.code == null)
4502        this.code = new ArrayList<Coding>();
4503      this.code.add(t);
4504      return this;
4505    }
4506
4507    /**
4508     * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist
4509     */
4510    public Coding getCodeFirstRep() { 
4511      if (getCode().isEmpty()) {
4512        addCode();
4513      }
4514      return getCode().get(0);
4515    }
4516
4517    /**
4518     * @return {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).)
4519     */
4520    public ElementDefinitionSlicingComponent getSlicing() { 
4521      if (this.slicing == null)
4522        if (Configuration.errorOnAutoCreate())
4523          throw new Error("Attempt to auto-create ElementDefinition.slicing");
4524        else if (Configuration.doAutoCreate())
4525          this.slicing = new ElementDefinitionSlicingComponent(); // cc
4526      return this.slicing;
4527    }
4528
4529    public boolean hasSlicing() { 
4530      return this.slicing != null && !this.slicing.isEmpty();
4531    }
4532
4533    /**
4534     * @param value {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).)
4535     */
4536    public ElementDefinition setSlicing(ElementDefinitionSlicingComponent value) { 
4537      this.slicing = value;
4538      return this;
4539    }
4540
4541    /**
4542     * @return {@link #short_} (A concise description of what this element means (e.g. for use in autogenerated summaries).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value
4543     */
4544    public StringType getShortElement() { 
4545      if (this.short_ == null)
4546        if (Configuration.errorOnAutoCreate())
4547          throw new Error("Attempt to auto-create ElementDefinition.short_");
4548        else if (Configuration.doAutoCreate())
4549          this.short_ = new StringType(); // bb
4550      return this.short_;
4551    }
4552
4553    public boolean hasShortElement() { 
4554      return this.short_ != null && !this.short_.isEmpty();
4555    }
4556
4557    public boolean hasShort() { 
4558      return this.short_ != null && !this.short_.isEmpty();
4559    }
4560
4561    /**
4562     * @param value {@link #short_} (A concise description of what this element means (e.g. for use in autogenerated summaries).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value
4563     */
4564    public ElementDefinition setShortElement(StringType value) { 
4565      this.short_ = value;
4566      return this;
4567    }
4568
4569    /**
4570     * @return A concise description of what this element means (e.g. for use in autogenerated summaries).
4571     */
4572    public String getShort() { 
4573      return this.short_ == null ? null : this.short_.getValue();
4574    }
4575
4576    /**
4577     * @param value A concise description of what this element means (e.g. for use in autogenerated summaries).
4578     */
4579    public ElementDefinition setShort(String value) { 
4580      if (Utilities.noString(value))
4581        this.short_ = null;
4582      else {
4583        if (this.short_ == null)
4584          this.short_ = new StringType();
4585        this.short_.setValue(value);
4586      }
4587      return this;
4588    }
4589
4590    /**
4591     * @return {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
4592     */
4593    public MarkdownType getDefinitionElement() { 
4594      if (this.definition == null)
4595        if (Configuration.errorOnAutoCreate())
4596          throw new Error("Attempt to auto-create ElementDefinition.definition");
4597        else if (Configuration.doAutoCreate())
4598          this.definition = new MarkdownType(); // bb
4599      return this.definition;
4600    }
4601
4602    public boolean hasDefinitionElement() { 
4603      return this.definition != null && !this.definition.isEmpty();
4604    }
4605
4606    public boolean hasDefinition() { 
4607      return this.definition != null && !this.definition.isEmpty();
4608    }
4609
4610    /**
4611     * @param value {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
4612     */
4613    public ElementDefinition setDefinitionElement(MarkdownType value) { 
4614      this.definition = value;
4615      return this;
4616    }
4617
4618    /**
4619     * @return Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.
4620     */
4621    public String getDefinition() { 
4622      return this.definition == null ? null : this.definition.getValue();
4623    }
4624
4625    /**
4626     * @param value Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.
4627     */
4628    public ElementDefinition setDefinition(String value) { 
4629      if (value == null)
4630        this.definition = null;
4631      else {
4632        if (this.definition == null)
4633          this.definition = new MarkdownType();
4634        this.definition.setValue(value);
4635      }
4636      return this;
4637    }
4638
4639    /**
4640     * @return {@link #comment} (Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
4641     */
4642    public MarkdownType getCommentElement() { 
4643      if (this.comment == null)
4644        if (Configuration.errorOnAutoCreate())
4645          throw new Error("Attempt to auto-create ElementDefinition.comment");
4646        else if (Configuration.doAutoCreate())
4647          this.comment = new MarkdownType(); // bb
4648      return this.comment;
4649    }
4650
4651    public boolean hasCommentElement() { 
4652      return this.comment != null && !this.comment.isEmpty();
4653    }
4654
4655    public boolean hasComment() { 
4656      return this.comment != null && !this.comment.isEmpty();
4657    }
4658
4659    /**
4660     * @param value {@link #comment} (Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
4661     */
4662    public ElementDefinition setCommentElement(MarkdownType value) { 
4663      this.comment = value;
4664      return this;
4665    }
4666
4667    /**
4668     * @return Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.
4669     */
4670    public String getComment() { 
4671      return this.comment == null ? null : this.comment.getValue();
4672    }
4673
4674    /**
4675     * @param value Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.
4676     */
4677    public ElementDefinition setComment(String value) { 
4678      if (value == null)
4679        this.comment = null;
4680      else {
4681        if (this.comment == null)
4682          this.comment = new MarkdownType();
4683        this.comment.setValue(value);
4684      }
4685      return this;
4686    }
4687
4688    /**
4689     * @return {@link #requirements} (This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
4690     */
4691    public MarkdownType getRequirementsElement() { 
4692      if (this.requirements == null)
4693        if (Configuration.errorOnAutoCreate())
4694          throw new Error("Attempt to auto-create ElementDefinition.requirements");
4695        else if (Configuration.doAutoCreate())
4696          this.requirements = new MarkdownType(); // bb
4697      return this.requirements;
4698    }
4699
4700    public boolean hasRequirementsElement() { 
4701      return this.requirements != null && !this.requirements.isEmpty();
4702    }
4703
4704    public boolean hasRequirements() { 
4705      return this.requirements != null && !this.requirements.isEmpty();
4706    }
4707
4708    /**
4709     * @param value {@link #requirements} (This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
4710     */
4711    public ElementDefinition setRequirementsElement(MarkdownType value) { 
4712      this.requirements = value;
4713      return this;
4714    }
4715
4716    /**
4717     * @return This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.
4718     */
4719    public String getRequirements() { 
4720      return this.requirements == null ? null : this.requirements.getValue();
4721    }
4722
4723    /**
4724     * @param value This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.
4725     */
4726    public ElementDefinition setRequirements(String value) { 
4727      if (value == null)
4728        this.requirements = null;
4729      else {
4730        if (this.requirements == null)
4731          this.requirements = new MarkdownType();
4732        this.requirements.setValue(value);
4733      }
4734      return this;
4735    }
4736
4737    /**
4738     * @return {@link #alias} (Identifies additional names by which this element might also be known.)
4739     */
4740    public List<StringType> getAlias() { 
4741      if (this.alias == null)
4742        this.alias = new ArrayList<StringType>();
4743      return this.alias;
4744    }
4745
4746    /**
4747     * @return Returns a reference to <code>this</code> for easy method chaining
4748     */
4749    public ElementDefinition setAlias(List<StringType> theAlias) { 
4750      this.alias = theAlias;
4751      return this;
4752    }
4753
4754    public boolean hasAlias() { 
4755      if (this.alias == null)
4756        return false;
4757      for (StringType item : this.alias)
4758        if (!item.isEmpty())
4759          return true;
4760      return false;
4761    }
4762
4763    /**
4764     * @return {@link #alias} (Identifies additional names by which this element might also be known.)
4765     */
4766    public StringType addAliasElement() {//2 
4767      StringType t = new StringType();
4768      if (this.alias == null)
4769        this.alias = new ArrayList<StringType>();
4770      this.alias.add(t);
4771      return t;
4772    }
4773
4774    /**
4775     * @param value {@link #alias} (Identifies additional names by which this element might also be known.)
4776     */
4777    public ElementDefinition addAlias(String value) { //1
4778      StringType t = new StringType();
4779      t.setValue(value);
4780      if (this.alias == null)
4781        this.alias = new ArrayList<StringType>();
4782      this.alias.add(t);
4783      return this;
4784    }
4785
4786    /**
4787     * @param value {@link #alias} (Identifies additional names by which this element might also be known.)
4788     */
4789    public boolean hasAlias(String value) { 
4790      if (this.alias == null)
4791        return false;
4792      for (StringType v : this.alias)
4793        if (v.getValue().equals(value)) // string
4794          return true;
4795      return false;
4796    }
4797
4798    /**
4799     * @return {@link #min} (The minimum number of times this element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
4800     */
4801    public UnsignedIntType getMinElement() { 
4802      if (this.min == null)
4803        if (Configuration.errorOnAutoCreate())
4804          throw new Error("Attempt to auto-create ElementDefinition.min");
4805        else if (Configuration.doAutoCreate())
4806          this.min = new UnsignedIntType(); // bb
4807      return this.min;
4808    }
4809
4810    public boolean hasMinElement() { 
4811      return this.min != null && !this.min.isEmpty();
4812    }
4813
4814    public boolean hasMin() { 
4815      return this.min != null && !this.min.isEmpty();
4816    }
4817
4818    /**
4819     * @param value {@link #min} (The minimum number of times this element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
4820     */
4821    public ElementDefinition setMinElement(UnsignedIntType value) { 
4822      this.min = value;
4823      return this;
4824    }
4825
4826    /**
4827     * @return The minimum number of times this element SHALL appear in the instance.
4828     */
4829    public int getMin() { 
4830      return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue();
4831    }
4832
4833    /**
4834     * @param value The minimum number of times this element SHALL appear in the instance.
4835     */
4836    public ElementDefinition setMin(int value) { 
4837        if (this.min == null)
4838          this.min = new UnsignedIntType();
4839        this.min.setValue(value);
4840      return this;
4841    }
4842
4843    /**
4844     * @return {@link #max} (The maximum number of times this element is permitted to appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
4845     */
4846    public StringType getMaxElement() { 
4847      if (this.max == null)
4848        if (Configuration.errorOnAutoCreate())
4849          throw new Error("Attempt to auto-create ElementDefinition.max");
4850        else if (Configuration.doAutoCreate())
4851          this.max = new StringType(); // bb
4852      return this.max;
4853    }
4854
4855    public boolean hasMaxElement() { 
4856      return this.max != null && !this.max.isEmpty();
4857    }
4858
4859    public boolean hasMax() { 
4860      return this.max != null && !this.max.isEmpty();
4861    }
4862
4863    /**
4864     * @param value {@link #max} (The maximum number of times this element is permitted to appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
4865     */
4866    public ElementDefinition setMaxElement(StringType value) { 
4867      this.max = value;
4868      return this;
4869    }
4870
4871    /**
4872     * @return The maximum number of times this element is permitted to appear in the instance.
4873     */
4874    public String getMax() { 
4875      return this.max == null ? null : this.max.getValue();
4876    }
4877
4878    /**
4879     * @param value The maximum number of times this element is permitted to appear in the instance.
4880     */
4881    public ElementDefinition setMax(String value) { 
4882      if (Utilities.noString(value))
4883        this.max = null;
4884      else {
4885        if (this.max == null)
4886          this.max = new StringType();
4887        this.max.setValue(value);
4888      }
4889      return this;
4890    }
4891
4892    /**
4893     * @return {@link #base} (Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same.)
4894     */
4895    public ElementDefinitionBaseComponent getBase() { 
4896      if (this.base == null)
4897        if (Configuration.errorOnAutoCreate())
4898          throw new Error("Attempt to auto-create ElementDefinition.base");
4899        else if (Configuration.doAutoCreate())
4900          this.base = new ElementDefinitionBaseComponent(); // cc
4901      return this.base;
4902    }
4903
4904    public boolean hasBase() { 
4905      return this.base != null && !this.base.isEmpty();
4906    }
4907
4908    /**
4909     * @param value {@link #base} (Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same.)
4910     */
4911    public ElementDefinition setBase(ElementDefinitionBaseComponent value) { 
4912      this.base = value;
4913      return this;
4914    }
4915
4916    /**
4917     * @return {@link #contentReference} (Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getContentReference" gives direct access to the value
4918     */
4919    public UriType getContentReferenceElement() { 
4920      if (this.contentReference == null)
4921        if (Configuration.errorOnAutoCreate())
4922          throw new Error("Attempt to auto-create ElementDefinition.contentReference");
4923        else if (Configuration.doAutoCreate())
4924          this.contentReference = new UriType(); // bb
4925      return this.contentReference;
4926    }
4927
4928    public boolean hasContentReferenceElement() { 
4929      return this.contentReference != null && !this.contentReference.isEmpty();
4930    }
4931
4932    public boolean hasContentReference() { 
4933      return this.contentReference != null && !this.contentReference.isEmpty();
4934    }
4935
4936    /**
4937     * @param value {@link #contentReference} (Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getContentReference" gives direct access to the value
4938     */
4939    public ElementDefinition setContentReferenceElement(UriType value) { 
4940      this.contentReference = value;
4941      return this;
4942    }
4943
4944    /**
4945     * @return Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.
4946     */
4947    public String getContentReference() { 
4948      return this.contentReference == null ? null : this.contentReference.getValue();
4949    }
4950
4951    /**
4952     * @param value Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.
4953     */
4954    public ElementDefinition setContentReference(String value) { 
4955      if (Utilities.noString(value))
4956        this.contentReference = null;
4957      else {
4958        if (this.contentReference == null)
4959          this.contentReference = new UriType();
4960        this.contentReference.setValue(value);
4961      }
4962      return this;
4963    }
4964
4965    /**
4966     * @return {@link #type} (The data type or resource that the value of this element is permitted to be.)
4967     */
4968    public List<TypeRefComponent> getType() { 
4969      if (this.type == null)
4970        this.type = new ArrayList<TypeRefComponent>();
4971      return this.type;
4972    }
4973
4974    /**
4975     * @return Returns a reference to <code>this</code> for easy method chaining
4976     */
4977    public ElementDefinition setType(List<TypeRefComponent> theType) { 
4978      this.type = theType;
4979      return this;
4980    }
4981
4982    public boolean hasType() { 
4983      if (this.type == null)
4984        return false;
4985      for (TypeRefComponent item : this.type)
4986        if (!item.isEmpty())
4987          return true;
4988      return false;
4989    }
4990
4991    public TypeRefComponent addType() { //3
4992      TypeRefComponent t = new TypeRefComponent();
4993      if (this.type == null)
4994        this.type = new ArrayList<TypeRefComponent>();
4995      this.type.add(t);
4996      return t;
4997    }
4998
4999    public ElementDefinition addType(TypeRefComponent t) { //3
5000      if (t == null)
5001        return this;
5002      if (this.type == null)
5003        this.type = new ArrayList<TypeRefComponent>();
5004      this.type.add(t);
5005      return this;
5006    }
5007
5008    /**
5009     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist
5010     */
5011    public TypeRefComponent getTypeFirstRep() { 
5012      if (getType().isEmpty()) {
5013        addType();
5014      }
5015      return getType().get(0);
5016    }
5017
5018    /**
5019     * @return {@link #defaultValue} (The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').)
5020     */
5021    public org.hl7.fhir.r4.model.Type getDefaultValue() { 
5022      return this.defaultValue;
5023    }
5024
5025    public boolean hasDefaultValue() { 
5026      return this.defaultValue != null && !this.defaultValue.isEmpty();
5027    }
5028
5029    /**
5030     * @param value {@link #defaultValue} (The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').)
5031     */
5032    public ElementDefinition setDefaultValue(org.hl7.fhir.r4.model.Type value) { 
5033      this.defaultValue = value;
5034      return this;
5035    }
5036
5037    /**
5038     * @return {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value
5039     */
5040    public MarkdownType getMeaningWhenMissingElement() { 
5041      if (this.meaningWhenMissing == null)
5042        if (Configuration.errorOnAutoCreate())
5043          throw new Error("Attempt to auto-create ElementDefinition.meaningWhenMissing");
5044        else if (Configuration.doAutoCreate())
5045          this.meaningWhenMissing = new MarkdownType(); // bb
5046      return this.meaningWhenMissing;
5047    }
5048
5049    public boolean hasMeaningWhenMissingElement() { 
5050      return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty();
5051    }
5052
5053    public boolean hasMeaningWhenMissing() { 
5054      return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty();
5055    }
5056
5057    /**
5058     * @param value {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value
5059     */
5060    public ElementDefinition setMeaningWhenMissingElement(MarkdownType value) { 
5061      this.meaningWhenMissing = value;
5062      return this;
5063    }
5064
5065    /**
5066     * @return The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.
5067     */
5068    public String getMeaningWhenMissing() { 
5069      return this.meaningWhenMissing == null ? null : this.meaningWhenMissing.getValue();
5070    }
5071
5072    /**
5073     * @param value The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.
5074     */
5075    public ElementDefinition setMeaningWhenMissing(String value) { 
5076      if (value == null)
5077        this.meaningWhenMissing = null;
5078      else {
5079        if (this.meaningWhenMissing == null)
5080          this.meaningWhenMissing = new MarkdownType();
5081        this.meaningWhenMissing.setValue(value);
5082      }
5083      return this;
5084    }
5085
5086    /**
5087     * @return {@link #orderMeaning} (If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.). This is the underlying object with id, value and extensions. The accessor "getOrderMeaning" gives direct access to the value
5088     */
5089    public StringType getOrderMeaningElement() { 
5090      if (this.orderMeaning == null)
5091        if (Configuration.errorOnAutoCreate())
5092          throw new Error("Attempt to auto-create ElementDefinition.orderMeaning");
5093        else if (Configuration.doAutoCreate())
5094          this.orderMeaning = new StringType(); // bb
5095      return this.orderMeaning;
5096    }
5097
5098    public boolean hasOrderMeaningElement() { 
5099      return this.orderMeaning != null && !this.orderMeaning.isEmpty();
5100    }
5101
5102    public boolean hasOrderMeaning() { 
5103      return this.orderMeaning != null && !this.orderMeaning.isEmpty();
5104    }
5105
5106    /**
5107     * @param value {@link #orderMeaning} (If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.). This is the underlying object with id, value and extensions. The accessor "getOrderMeaning" gives direct access to the value
5108     */
5109    public ElementDefinition setOrderMeaningElement(StringType value) { 
5110      this.orderMeaning = value;
5111      return this;
5112    }
5113
5114    /**
5115     * @return If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.
5116     */
5117    public String getOrderMeaning() { 
5118      return this.orderMeaning == null ? null : this.orderMeaning.getValue();
5119    }
5120
5121    /**
5122     * @param value If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.
5123     */
5124    public ElementDefinition setOrderMeaning(String value) { 
5125      if (Utilities.noString(value))
5126        this.orderMeaning = null;
5127      else {
5128        if (this.orderMeaning == null)
5129          this.orderMeaning = new StringType();
5130        this.orderMeaning.setValue(value);
5131      }
5132      return this;
5133    }
5134
5135    /**
5136     * @return {@link #fixed} (Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.)
5137     */
5138    public org.hl7.fhir.r4.model.Type getFixed() { 
5139      return this.fixed;
5140    }
5141
5142    public boolean hasFixed() { 
5143      return this.fixed != null && !this.fixed.isEmpty();
5144    }
5145
5146    /**
5147     * @param value {@link #fixed} (Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.)
5148     */
5149    public ElementDefinition setFixed(org.hl7.fhir.r4.model.Type value) { 
5150      this.fixed = value;
5151      return this;
5152    }
5153
5154    /**
5155     * @return {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).)
5156     */
5157    public org.hl7.fhir.r4.model.Type getPattern() { 
5158      return this.pattern;
5159    }
5160
5161    public boolean hasPattern() { 
5162      return this.pattern != null && !this.pattern.isEmpty();
5163    }
5164
5165    /**
5166     * @param value {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).)
5167     */
5168    public ElementDefinition setPattern(org.hl7.fhir.r4.model.Type value) { 
5169      this.pattern = value;
5170      return this;
5171    }
5172
5173    /**
5174     * @return {@link #example} (A sample value for this element demonstrating the type of information that would typically be found in the element.)
5175     */
5176    public List<ElementDefinitionExampleComponent> getExample() { 
5177      if (this.example == null)
5178        this.example = new ArrayList<ElementDefinitionExampleComponent>();
5179      return this.example;
5180    }
5181
5182    /**
5183     * @return Returns a reference to <code>this</code> for easy method chaining
5184     */
5185    public ElementDefinition setExample(List<ElementDefinitionExampleComponent> theExample) { 
5186      this.example = theExample;
5187      return this;
5188    }
5189
5190    public boolean hasExample() { 
5191      if (this.example == null)
5192        return false;
5193      for (ElementDefinitionExampleComponent item : this.example)
5194        if (!item.isEmpty())
5195          return true;
5196      return false;
5197    }
5198
5199    public ElementDefinitionExampleComponent addExample() { //3
5200      ElementDefinitionExampleComponent t = new ElementDefinitionExampleComponent();
5201      if (this.example == null)
5202        this.example = new ArrayList<ElementDefinitionExampleComponent>();
5203      this.example.add(t);
5204      return t;
5205    }
5206
5207    public ElementDefinition addExample(ElementDefinitionExampleComponent t) { //3
5208      if (t == null)
5209        return this;
5210      if (this.example == null)
5211        this.example = new ArrayList<ElementDefinitionExampleComponent>();
5212      this.example.add(t);
5213      return this;
5214    }
5215
5216    /**
5217     * @return The first repetition of repeating field {@link #example}, creating it if it does not already exist
5218     */
5219    public ElementDefinitionExampleComponent getExampleFirstRep() { 
5220      if (getExample().isEmpty()) {
5221        addExample();
5222      }
5223      return getExample().get(0);
5224    }
5225
5226    /**
5227     * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5228     */
5229    public Type getMinValue() { 
5230      return this.minValue;
5231    }
5232
5233    /**
5234     * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5235     */
5236    public DateType getMinValueDateType() throws FHIRException { 
5237      if (this.minValue == null)
5238        return null;
5239      if (!(this.minValue instanceof DateType))
5240        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5241      return (DateType) this.minValue;
5242    }
5243
5244    public boolean hasMinValueDateType() { 
5245      return this != null && this.minValue instanceof DateType;
5246    }
5247
5248    /**
5249     * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5250     */
5251    public DateTimeType getMinValueDateTimeType() throws FHIRException { 
5252      if (this.minValue == null)
5253        return null;
5254      if (!(this.minValue instanceof DateTimeType))
5255        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5256      return (DateTimeType) this.minValue;
5257    }
5258
5259    public boolean hasMinValueDateTimeType() { 
5260      return this != null && this.minValue instanceof DateTimeType;
5261    }
5262
5263    /**
5264     * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5265     */
5266    public InstantType getMinValueInstantType() throws FHIRException { 
5267      if (this.minValue == null)
5268        return null;
5269      if (!(this.minValue instanceof InstantType))
5270        throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5271      return (InstantType) this.minValue;
5272    }
5273
5274    public boolean hasMinValueInstantType() { 
5275      return this != null && this.minValue instanceof InstantType;
5276    }
5277
5278    /**
5279     * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5280     */
5281    public TimeType getMinValueTimeType() throws FHIRException { 
5282      if (this.minValue == null)
5283        return null;
5284      if (!(this.minValue instanceof TimeType))
5285        throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5286      return (TimeType) this.minValue;
5287    }
5288
5289    public boolean hasMinValueTimeType() { 
5290      return this != null && this.minValue instanceof TimeType;
5291    }
5292
5293    /**
5294     * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5295     */
5296    public DecimalType getMinValueDecimalType() throws FHIRException { 
5297      if (this.minValue == null)
5298        return null;
5299      if (!(this.minValue instanceof DecimalType))
5300        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5301      return (DecimalType) this.minValue;
5302    }
5303
5304    public boolean hasMinValueDecimalType() { 
5305      return this != null && this.minValue instanceof DecimalType;
5306    }
5307
5308    /**
5309     * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5310     */
5311    public IntegerType getMinValueIntegerType() throws FHIRException { 
5312      if (this.minValue == null)
5313        return null;
5314      if (!(this.minValue instanceof IntegerType))
5315        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5316      return (IntegerType) this.minValue;
5317    }
5318
5319    public boolean hasMinValueIntegerType() { 
5320      return this != null && this.minValue instanceof IntegerType;
5321    }
5322
5323    /**
5324     * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5325     */
5326    public PositiveIntType getMinValuePositiveIntType() throws FHIRException { 
5327      if (this.minValue == null)
5328        return null;
5329      if (!(this.minValue instanceof PositiveIntType))
5330        throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5331      return (PositiveIntType) this.minValue;
5332    }
5333
5334    public boolean hasMinValuePositiveIntType() { 
5335      return this != null && this.minValue instanceof PositiveIntType;
5336    }
5337
5338    /**
5339     * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5340     */
5341    public UnsignedIntType getMinValueUnsignedIntType() throws FHIRException { 
5342      if (this.minValue == null)
5343        return null;
5344      if (!(this.minValue instanceof UnsignedIntType))
5345        throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5346      return (UnsignedIntType) this.minValue;
5347    }
5348
5349    public boolean hasMinValueUnsignedIntType() { 
5350      return this != null && this.minValue instanceof UnsignedIntType;
5351    }
5352
5353    /**
5354     * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5355     */
5356    public Quantity getMinValueQuantity() throws FHIRException { 
5357      if (this.minValue == null)
5358        return null;
5359      if (!(this.minValue instanceof Quantity))
5360        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.minValue.getClass().getName()+" was encountered");
5361      return (Quantity) this.minValue;
5362    }
5363
5364    public boolean hasMinValueQuantity() { 
5365      return this != null && this.minValue instanceof Quantity;
5366    }
5367
5368    public boolean hasMinValue() { 
5369      return this.minValue != null && !this.minValue.isEmpty();
5370    }
5371
5372    /**
5373     * @param value {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5374     */
5375    public ElementDefinition setMinValue(Type value) { 
5376      if (value != null && !(value instanceof DateType || value instanceof DateTimeType || value instanceof InstantType || value instanceof TimeType || value instanceof DecimalType || value instanceof IntegerType || value instanceof PositiveIntType || value instanceof UnsignedIntType || value instanceof Quantity))
5377        throw new Error("Not the right type for ElementDefinition.minValue[x]: "+value.fhirType());
5378      this.minValue = value;
5379      return this;
5380    }
5381
5382    /**
5383     * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5384     */
5385    public Type getMaxValue() { 
5386      return this.maxValue;
5387    }
5388
5389    /**
5390     * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5391     */
5392    public DateType getMaxValueDateType() throws FHIRException { 
5393      if (this.maxValue == null)
5394        return null;
5395      if (!(this.maxValue instanceof DateType))
5396        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5397      return (DateType) this.maxValue;
5398    }
5399
5400    public boolean hasMaxValueDateType() { 
5401      return this != null && this.maxValue instanceof DateType;
5402    }
5403
5404    /**
5405     * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5406     */
5407    public DateTimeType getMaxValueDateTimeType() throws FHIRException { 
5408      if (this.maxValue == null)
5409        return null;
5410      if (!(this.maxValue instanceof DateTimeType))
5411        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5412      return (DateTimeType) this.maxValue;
5413    }
5414
5415    public boolean hasMaxValueDateTimeType() { 
5416      return this != null && this.maxValue instanceof DateTimeType;
5417    }
5418
5419    /**
5420     * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5421     */
5422    public InstantType getMaxValueInstantType() throws FHIRException { 
5423      if (this.maxValue == null)
5424        return null;
5425      if (!(this.maxValue instanceof InstantType))
5426        throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5427      return (InstantType) this.maxValue;
5428    }
5429
5430    public boolean hasMaxValueInstantType() { 
5431      return this != null && this.maxValue instanceof InstantType;
5432    }
5433
5434    /**
5435     * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5436     */
5437    public TimeType getMaxValueTimeType() throws FHIRException { 
5438      if (this.maxValue == null)
5439        return null;
5440      if (!(this.maxValue instanceof TimeType))
5441        throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5442      return (TimeType) this.maxValue;
5443    }
5444
5445    public boolean hasMaxValueTimeType() { 
5446      return this != null && this.maxValue instanceof TimeType;
5447    }
5448
5449    /**
5450     * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5451     */
5452    public DecimalType getMaxValueDecimalType() throws FHIRException { 
5453      if (this.maxValue == null)
5454        return null;
5455      if (!(this.maxValue instanceof DecimalType))
5456        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5457      return (DecimalType) this.maxValue;
5458    }
5459
5460    public boolean hasMaxValueDecimalType() { 
5461      return this != null && this.maxValue instanceof DecimalType;
5462    }
5463
5464    /**
5465     * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5466     */
5467    public IntegerType getMaxValueIntegerType() throws FHIRException { 
5468      if (this.maxValue == null)
5469        return null;
5470      if (!(this.maxValue instanceof IntegerType))
5471        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5472      return (IntegerType) this.maxValue;
5473    }
5474
5475    public boolean hasMaxValueIntegerType() { 
5476      return this != null && this.maxValue instanceof IntegerType;
5477    }
5478
5479    /**
5480     * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5481     */
5482    public PositiveIntType getMaxValuePositiveIntType() throws FHIRException { 
5483      if (this.maxValue == null)
5484        return null;
5485      if (!(this.maxValue instanceof PositiveIntType))
5486        throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5487      return (PositiveIntType) this.maxValue;
5488    }
5489
5490    public boolean hasMaxValuePositiveIntType() { 
5491      return this != null && this.maxValue instanceof PositiveIntType;
5492    }
5493
5494    /**
5495     * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5496     */
5497    public UnsignedIntType getMaxValueUnsignedIntType() throws FHIRException { 
5498      if (this.maxValue == null)
5499        return null;
5500      if (!(this.maxValue instanceof UnsignedIntType))
5501        throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5502      return (UnsignedIntType) this.maxValue;
5503    }
5504
5505    public boolean hasMaxValueUnsignedIntType() { 
5506      return this != null && this.maxValue instanceof UnsignedIntType;
5507    }
5508
5509    /**
5510     * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5511     */
5512    public Quantity getMaxValueQuantity() throws FHIRException { 
5513      if (this.maxValue == null)
5514        return null;
5515      if (!(this.maxValue instanceof Quantity))
5516        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5517      return (Quantity) this.maxValue;
5518    }
5519
5520    public boolean hasMaxValueQuantity() { 
5521      return this != null && this.maxValue instanceof Quantity;
5522    }
5523
5524    public boolean hasMaxValue() { 
5525      return this.maxValue != null && !this.maxValue.isEmpty();
5526    }
5527
5528    /**
5529     * @param value {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.)
5530     */
5531    public ElementDefinition setMaxValue(Type value) { 
5532      if (value != null && !(value instanceof DateType || value instanceof DateTimeType || value instanceof InstantType || value instanceof TimeType || value instanceof DecimalType || value instanceof IntegerType || value instanceof PositiveIntType || value instanceof UnsignedIntType || value instanceof Quantity))
5533        throw new Error("Not the right type for ElementDefinition.maxValue[x]: "+value.fhirType());
5534      this.maxValue = value;
5535      return this;
5536    }
5537
5538    /**
5539     * @return {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value
5540     */
5541    public IntegerType getMaxLengthElement() { 
5542      if (this.maxLength == null)
5543        if (Configuration.errorOnAutoCreate())
5544          throw new Error("Attempt to auto-create ElementDefinition.maxLength");
5545        else if (Configuration.doAutoCreate())
5546          this.maxLength = new IntegerType(); // bb
5547      return this.maxLength;
5548    }
5549
5550    public boolean hasMaxLengthElement() { 
5551      return this.maxLength != null && !this.maxLength.isEmpty();
5552    }
5553
5554    public boolean hasMaxLength() { 
5555      return this.maxLength != null && !this.maxLength.isEmpty();
5556    }
5557
5558    /**
5559     * @param value {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value
5560     */
5561    public ElementDefinition setMaxLengthElement(IntegerType value) { 
5562      this.maxLength = value;
5563      return this;
5564    }
5565
5566    /**
5567     * @return Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.
5568     */
5569    public int getMaxLength() { 
5570      return this.maxLength == null || this.maxLength.isEmpty() ? 0 : this.maxLength.getValue();
5571    }
5572
5573    /**
5574     * @param value Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.
5575     */
5576    public ElementDefinition setMaxLength(int value) { 
5577        if (this.maxLength == null)
5578          this.maxLength = new IntegerType();
5579        this.maxLength.setValue(value);
5580      return this;
5581    }
5582
5583    /**
5584     * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
5585     */
5586    public List<IdType> getCondition() { 
5587      if (this.condition == null)
5588        this.condition = new ArrayList<IdType>();
5589      return this.condition;
5590    }
5591
5592    /**
5593     * @return Returns a reference to <code>this</code> for easy method chaining
5594     */
5595    public ElementDefinition setCondition(List<IdType> theCondition) { 
5596      this.condition = theCondition;
5597      return this;
5598    }
5599
5600    public boolean hasCondition() { 
5601      if (this.condition == null)
5602        return false;
5603      for (IdType item : this.condition)
5604        if (!item.isEmpty())
5605          return true;
5606      return false;
5607    }
5608
5609    /**
5610     * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
5611     */
5612    public IdType addConditionElement() {//2 
5613      IdType t = new IdType();
5614      if (this.condition == null)
5615        this.condition = new ArrayList<IdType>();
5616      this.condition.add(t);
5617      return t;
5618    }
5619
5620    /**
5621     * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
5622     */
5623    public ElementDefinition addCondition(String value) { //1
5624      IdType t = new IdType();
5625      t.setValue(value);
5626      if (this.condition == null)
5627        this.condition = new ArrayList<IdType>();
5628      this.condition.add(t);
5629      return this;
5630    }
5631
5632    /**
5633     * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
5634     */
5635    public boolean hasCondition(String value) { 
5636      if (this.condition == null)
5637        return false;
5638      for (IdType v : this.condition)
5639        if (v.getValue().equals(value)) // id
5640          return true;
5641      return false;
5642    }
5643
5644    /**
5645     * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.)
5646     */
5647    public List<ElementDefinitionConstraintComponent> getConstraint() { 
5648      if (this.constraint == null)
5649        this.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
5650      return this.constraint;
5651    }
5652
5653    /**
5654     * @return Returns a reference to <code>this</code> for easy method chaining
5655     */
5656    public ElementDefinition setConstraint(List<ElementDefinitionConstraintComponent> theConstraint) { 
5657      this.constraint = theConstraint;
5658      return this;
5659    }
5660
5661    public boolean hasConstraint() { 
5662      if (this.constraint == null)
5663        return false;
5664      for (ElementDefinitionConstraintComponent item : this.constraint)
5665        if (!item.isEmpty())
5666          return true;
5667      return false;
5668    }
5669
5670    public ElementDefinitionConstraintComponent addConstraint() { //3
5671      ElementDefinitionConstraintComponent t = new ElementDefinitionConstraintComponent();
5672      if (this.constraint == null)
5673        this.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
5674      this.constraint.add(t);
5675      return t;
5676    }
5677
5678    public ElementDefinition addConstraint(ElementDefinitionConstraintComponent t) { //3
5679      if (t == null)
5680        return this;
5681      if (this.constraint == null)
5682        this.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
5683      this.constraint.add(t);
5684      return this;
5685    }
5686
5687    /**
5688     * @return The first repetition of repeating field {@link #constraint}, creating it if it does not already exist
5689     */
5690    public ElementDefinitionConstraintComponent getConstraintFirstRep() { 
5691      if (getConstraint().isEmpty()) {
5692        addConstraint();
5693      }
5694      return getConstraint().get(0);
5695    }
5696
5697    /**
5698     * @return {@link #mustSupport} (If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way.  If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value
5699     */
5700    public BooleanType getMustSupportElement() { 
5701      if (this.mustSupport == null)
5702        if (Configuration.errorOnAutoCreate())
5703          throw new Error("Attempt to auto-create ElementDefinition.mustSupport");
5704        else if (Configuration.doAutoCreate())
5705          this.mustSupport = new BooleanType(); // bb
5706      return this.mustSupport;
5707    }
5708
5709    public boolean hasMustSupportElement() { 
5710      return this.mustSupport != null && !this.mustSupport.isEmpty();
5711    }
5712
5713    public boolean hasMustSupport() { 
5714      return this.mustSupport != null && !this.mustSupport.isEmpty();
5715    }
5716
5717    /**
5718     * @param value {@link #mustSupport} (If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way.  If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value
5719     */
5720    public ElementDefinition setMustSupportElement(BooleanType value) { 
5721      this.mustSupport = value;
5722      return this;
5723    }
5724
5725    /**
5726     * @return If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way.  If false, the element may be ignored and not supported.
5727     */
5728    public boolean getMustSupport() { 
5729      return this.mustSupport == null || this.mustSupport.isEmpty() ? false : this.mustSupport.getValue();
5730    }
5731
5732    /**
5733     * @param value If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way.  If false, the element may be ignored and not supported.
5734     */
5735    public ElementDefinition setMustSupport(boolean value) { 
5736        if (this.mustSupport == null)
5737          this.mustSupport = new BooleanType();
5738        this.mustSupport.setValue(value);
5739      return this;
5740    }
5741
5742    /**
5743     * @return {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value
5744     */
5745    public BooleanType getIsModifierElement() { 
5746      if (this.isModifier == null)
5747        if (Configuration.errorOnAutoCreate())
5748          throw new Error("Attempt to auto-create ElementDefinition.isModifier");
5749        else if (Configuration.doAutoCreate())
5750          this.isModifier = new BooleanType(); // bb
5751      return this.isModifier;
5752    }
5753
5754    public boolean hasIsModifierElement() { 
5755      return this.isModifier != null && !this.isModifier.isEmpty();
5756    }
5757
5758    public boolean hasIsModifier() { 
5759      return this.isModifier != null && !this.isModifier.isEmpty();
5760    }
5761
5762    /**
5763     * @param value {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value
5764     */
5765    public ElementDefinition setIsModifierElement(BooleanType value) { 
5766      this.isModifier = value;
5767      return this;
5768    }
5769
5770    /**
5771     * @return If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.
5772     */
5773    public boolean getIsModifier() { 
5774      return this.isModifier == null || this.isModifier.isEmpty() ? false : this.isModifier.getValue();
5775    }
5776
5777    /**
5778     * @param value If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.
5779     */
5780    public ElementDefinition setIsModifier(boolean value) { 
5781        if (this.isModifier == null)
5782          this.isModifier = new BooleanType();
5783        this.isModifier.setValue(value);
5784      return this;
5785    }
5786
5787    /**
5788     * @return {@link #isModifierReason} (Explains how that element affects the interpretation of the resource or element that contains it.). This is the underlying object with id, value and extensions. The accessor "getIsModifierReason" gives direct access to the value
5789     */
5790    public StringType getIsModifierReasonElement() { 
5791      if (this.isModifierReason == null)
5792        if (Configuration.errorOnAutoCreate())
5793          throw new Error("Attempt to auto-create ElementDefinition.isModifierReason");
5794        else if (Configuration.doAutoCreate())
5795          this.isModifierReason = new StringType(); // bb
5796      return this.isModifierReason;
5797    }
5798
5799    public boolean hasIsModifierReasonElement() { 
5800      return this.isModifierReason != null && !this.isModifierReason.isEmpty();
5801    }
5802
5803    public boolean hasIsModifierReason() { 
5804      return this.isModifierReason != null && !this.isModifierReason.isEmpty();
5805    }
5806
5807    /**
5808     * @param value {@link #isModifierReason} (Explains how that element affects the interpretation of the resource or element that contains it.). This is the underlying object with id, value and extensions. The accessor "getIsModifierReason" gives direct access to the value
5809     */
5810    public ElementDefinition setIsModifierReasonElement(StringType value) { 
5811      this.isModifierReason = value;
5812      return this;
5813    }
5814
5815    /**
5816     * @return Explains how that element affects the interpretation of the resource or element that contains it.
5817     */
5818    public String getIsModifierReason() { 
5819      return this.isModifierReason == null ? null : this.isModifierReason.getValue();
5820    }
5821
5822    /**
5823     * @param value Explains how that element affects the interpretation of the resource or element that contains it.
5824     */
5825    public ElementDefinition setIsModifierReason(String value) { 
5826      if (Utilities.noString(value))
5827        this.isModifierReason = null;
5828      else {
5829        if (this.isModifierReason == null)
5830          this.isModifierReason = new StringType();
5831        this.isModifierReason.setValue(value);
5832      }
5833      return this;
5834    }
5835
5836    /**
5837     * @return {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value
5838     */
5839    public BooleanType getIsSummaryElement() { 
5840      if (this.isSummary == null)
5841        if (Configuration.errorOnAutoCreate())
5842          throw new Error("Attempt to auto-create ElementDefinition.isSummary");
5843        else if (Configuration.doAutoCreate())
5844          this.isSummary = new BooleanType(); // bb
5845      return this.isSummary;
5846    }
5847
5848    public boolean hasIsSummaryElement() { 
5849      return this.isSummary != null && !this.isSummary.isEmpty();
5850    }
5851
5852    public boolean hasIsSummary() { 
5853      return this.isSummary != null && !this.isSummary.isEmpty();
5854    }
5855
5856    /**
5857     * @param value {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value
5858     */
5859    public ElementDefinition setIsSummaryElement(BooleanType value) { 
5860      this.isSummary = value;
5861      return this;
5862    }
5863
5864    /**
5865     * @return Whether the element should be included if a client requests a search with the parameter _summary=true.
5866     */
5867    public boolean getIsSummary() { 
5868      return this.isSummary == null || this.isSummary.isEmpty() ? false : this.isSummary.getValue();
5869    }
5870
5871    /**
5872     * @param value Whether the element should be included if a client requests a search with the parameter _summary=true.
5873     */
5874    public ElementDefinition setIsSummary(boolean value) { 
5875        if (this.isSummary == null)
5876          this.isSummary = new BooleanType();
5877        this.isSummary.setValue(value);
5878      return this;
5879    }
5880
5881    /**
5882     * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).)
5883     */
5884    public ElementDefinitionBindingComponent getBinding() { 
5885      if (this.binding == null)
5886        if (Configuration.errorOnAutoCreate())
5887          throw new Error("Attempt to auto-create ElementDefinition.binding");
5888        else if (Configuration.doAutoCreate())
5889          this.binding = new ElementDefinitionBindingComponent(); // cc
5890      return this.binding;
5891    }
5892
5893    public boolean hasBinding() { 
5894      return this.binding != null && !this.binding.isEmpty();
5895    }
5896
5897    /**
5898     * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).)
5899     */
5900    public ElementDefinition setBinding(ElementDefinitionBindingComponent value) { 
5901      this.binding = value;
5902      return this;
5903    }
5904
5905    /**
5906     * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.)
5907     */
5908    public List<ElementDefinitionMappingComponent> getMapping() { 
5909      if (this.mapping == null)
5910        this.mapping = new ArrayList<ElementDefinitionMappingComponent>();
5911      return this.mapping;
5912    }
5913
5914    /**
5915     * @return Returns a reference to <code>this</code> for easy method chaining
5916     */
5917    public ElementDefinition setMapping(List<ElementDefinitionMappingComponent> theMapping) { 
5918      this.mapping = theMapping;
5919      return this;
5920    }
5921
5922    public boolean hasMapping() { 
5923      if (this.mapping == null)
5924        return false;
5925      for (ElementDefinitionMappingComponent item : this.mapping)
5926        if (!item.isEmpty())
5927          return true;
5928      return false;
5929    }
5930
5931    public ElementDefinitionMappingComponent addMapping() { //3
5932      ElementDefinitionMappingComponent t = new ElementDefinitionMappingComponent();
5933      if (this.mapping == null)
5934        this.mapping = new ArrayList<ElementDefinitionMappingComponent>();
5935      this.mapping.add(t);
5936      return t;
5937    }
5938
5939    public ElementDefinition addMapping(ElementDefinitionMappingComponent t) { //3
5940      if (t == null)
5941        return this;
5942      if (this.mapping == null)
5943        this.mapping = new ArrayList<ElementDefinitionMappingComponent>();
5944      this.mapping.add(t);
5945      return this;
5946    }
5947
5948    /**
5949     * @return The first repetition of repeating field {@link #mapping}, creating it if it does not already exist
5950     */
5951    public ElementDefinitionMappingComponent getMappingFirstRep() { 
5952      if (getMapping().isEmpty()) {
5953        addMapping();
5954      }
5955      return getMapping().get(0);
5956    }
5957
5958      protected void listChildren(List<Property> children) {
5959        super.listChildren(children);
5960        children.add(new Property("path", "string", "The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource or extension.", 0, 1, path));
5961        children.add(new Property("representation", "code", "Codes that define how this element is represented in instances, when the deviation varies from the normal case.", 0, java.lang.Integer.MAX_VALUE, representation));
5962        children.add(new Property("sliceName", "string", "The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.", 0, 1, sliceName));
5963        children.add(new Property("label", "string", "A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.", 0, 1, label));
5964        children.add(new Property("code", "Coding", "A code that has the same meaning as the element in a particular terminology.", 0, java.lang.Integer.MAX_VALUE, code));
5965        children.add(new Property("slicing", "", "Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).", 0, 1, slicing));
5966        children.add(new Property("short", "string", "A concise description of what this element means (e.g. for use in autogenerated summaries).", 0, 1, short_));
5967        children.add(new Property("definition", "markdown", "Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.", 0, 1, definition));
5968        children.add(new Property("comment", "markdown", "Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.", 0, 1, comment));
5969        children.add(new Property("requirements", "markdown", "This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.", 0, 1, requirements));
5970        children.add(new Property("alias", "string", "Identifies additional names by which this element might also be known.", 0, java.lang.Integer.MAX_VALUE, alias));
5971        children.add(new Property("min", "unsignedInt", "The minimum number of times this element SHALL appear in the instance.", 0, 1, min));
5972        children.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the instance.", 0, 1, max));
5973        children.add(new Property("base", "", "Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same.", 0, 1, base));
5974        children.add(new Property("contentReference", "uri", "Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.", 0, 1, contentReference));
5975        children.add(new Property("type", "", "The data type or resource that the value of this element is permitted to be.", 0, java.lang.Integer.MAX_VALUE, type));
5976        children.add(new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue));
5977        children.add(new Property("meaningWhenMissing", "markdown", "The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.", 0, 1, meaningWhenMissing));
5978        children.add(new Property("orderMeaning", "string", "If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.", 0, 1, orderMeaning));
5979        children.add(new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed));
5980        children.add(new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern));
5981        children.add(new Property("example", "", "A sample value for this element demonstrating the type of information that would typically be found in the element.", 0, java.lang.Integer.MAX_VALUE, example));
5982        children.add(new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue));
5983        children.add(new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue));
5984        children.add(new Property("maxLength", "integer", "Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.", 0, 1, maxLength));
5985        children.add(new Property("condition", "id", "A reference to an invariant that may make additional statements about the cardinality or value in the instance.", 0, java.lang.Integer.MAX_VALUE, condition));
5986        children.add(new Property("constraint", "", "Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.", 0, java.lang.Integer.MAX_VALUE, constraint));
5987        children.add(new Property("mustSupport", "boolean", "If true, implementations that produce or consume resources SHALL provide \"support\" for the element in some meaningful way.  If false, the element may be ignored and not supported.", 0, 1, mustSupport));
5988        children.add(new Property("isModifier", "boolean", "If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.", 0, 1, isModifier));
5989        children.add(new Property("isModifierReason", "string", "Explains how that element affects the interpretation of the resource or element that contains it.", 0, 1, isModifierReason));
5990        children.add(new Property("isSummary", "boolean", "Whether the element should be included if a client requests a search with the parameter _summary=true.", 0, 1, isSummary));
5991        children.add(new Property("binding", "", "Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).", 0, 1, binding));
5992        children.add(new Property("mapping", "", "Identifies a concept from an external specification that roughly corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, mapping));
5993      }
5994
5995      @Override
5996      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5997        switch (_hash) {
5998        case 3433509: /*path*/  return new Property("path", "string", "The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource or extension.", 0, 1, path);
5999        case -671065907: /*representation*/  return new Property("representation", "code", "Codes that define how this element is represented in instances, when the deviation varies from the normal case.", 0, java.lang.Integer.MAX_VALUE, representation);
6000        case -825289923: /*sliceName*/  return new Property("sliceName", "string", "The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.", 0, 1, sliceName);
6001        case 102727412: /*label*/  return new Property("label", "string", "A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.", 0, 1, label);
6002        case 3059181: /*code*/  return new Property("code", "Coding", "A code that has the same meaning as the element in a particular terminology.", 0, java.lang.Integer.MAX_VALUE, code);
6003        case -2119287345: /*slicing*/  return new Property("slicing", "", "Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).", 0, 1, slicing);
6004        case 109413500: /*short*/  return new Property("short", "string", "A concise description of what this element means (e.g. for use in autogenerated summaries).", 0, 1, short_);
6005        case -1014418093: /*definition*/  return new Property("definition", "markdown", "Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.", 0, 1, definition);
6006        case 950398559: /*comment*/  return new Property("comment", "markdown", "Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.", 0, 1, comment);
6007        case -1619874672: /*requirements*/  return new Property("requirements", "markdown", "This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.", 0, 1, requirements);
6008        case 92902992: /*alias*/  return new Property("alias", "string", "Identifies additional names by which this element might also be known.", 0, java.lang.Integer.MAX_VALUE, alias);
6009        case 108114: /*min*/  return new Property("min", "unsignedInt", "The minimum number of times this element SHALL appear in the instance.", 0, 1, min);
6010        case 107876: /*max*/  return new Property("max", "string", "The maximum number of times this element is permitted to appear in the instance.", 0, 1, max);
6011        case 3016401: /*base*/  return new Property("base", "", "Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same.", 0, 1, base);
6012        case 1193747154: /*contentReference*/  return new Property("contentReference", "uri", "Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.", 0, 1, contentReference);
6013        case 3575610: /*type*/  return new Property("type", "", "The data type or resource that the value of this element is permitted to be.", 0, java.lang.Integer.MAX_VALUE, type);
6014        case 587922128: /*defaultValue[x]*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6015        case -659125328: /*defaultValue*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6016        case 1470297600: /*defaultValueBase64Binary*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6017        case 600437336: /*defaultValueBoolean*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6018        case 264593188: /*defaultValueCanonical*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6019        case 1044993469: /*defaultValueCode*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6020        case 1045010302: /*defaultValueDate*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6021        case 1220374379: /*defaultValueDateTime*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6022        case 2077989249: /*defaultValueDecimal*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6023        case -2059245333: /*defaultValueId*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6024        case -1801671663: /*defaultValueInstant*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6025        case -1801189522: /*defaultValueInteger*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6026        case -325436225: /*defaultValueMarkdown*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6027        case 587910138: /*defaultValueOid*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6028        case -737344154: /*defaultValuePositiveInt*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6029        case -320515103: /*defaultValueString*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6030        case 1045494429: /*defaultValueTime*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6031        case 539117290: /*defaultValueUnsignedInt*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6032        case 587916188: /*defaultValueUri*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6033        case 587916191: /*defaultValueUrl*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6034        case 1045535627: /*defaultValueUuid*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6035        case -611966428: /*defaultValueAddress*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6036        case -1851689217: /*defaultValueAnnotation*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6037        case 2034820339: /*defaultValueAttachment*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6038        case -410434095: /*defaultValueCodeableConcept*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6039        case -783616198: /*defaultValueCoding*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6040        case -344740576: /*defaultValueContactPoint*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6041        case -975393912: /*defaultValueHumanName*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6042        case -1915078535: /*defaultValueIdentifier*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6043        case -420255343: /*defaultValuePeriod*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6044        case -1857379237: /*defaultValueQuantity*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6045        case -1951495315: /*defaultValueRange*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6046        case -1951489477: /*defaultValueRatio*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6047        case -1488914053: /*defaultValueReference*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6048        case -449641228: /*defaultValueSampledData*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6049        case 509825768: /*defaultValueSignature*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6050        case -302193638: /*defaultValueTiming*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6051        case -754548089: /*defaultValueDosage*/  return new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, 1, defaultValue);
6052        case 1857257103: /*meaningWhenMissing*/  return new Property("meaningWhenMissing", "markdown", "The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.", 0, 1, meaningWhenMissing);
6053        case 1828196047: /*orderMeaning*/  return new Property("orderMeaning", "string", "If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.", 0, 1, orderMeaning);
6054        case -391522164: /*fixed[x]*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6055        case 97445748: /*fixed*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6056        case -799290428: /*fixedBase64Binary*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6057        case 520851988: /*fixedBoolean*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6058        case 1092485088: /*fixedCanonical*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6059        case 746991489: /*fixedCode*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6060        case 747008322: /*fixedDate*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6061        case -1246771409: /*fixedDateTime*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6062        case 1998403901: /*fixedDecimal*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6063        case -843914321: /*fixedId*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6064        case -1881257011: /*fixedInstant*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6065        case -1880774870: /*fixedInteger*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6066        case 1502385283: /*fixedMarkdown*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6067        case -391534154: /*fixedOid*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6068        case 297821986: /*fixedPositiveInt*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6069        case 1062390949: /*fixedString*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6070        case 747492449: /*fixedTime*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6071        case 1574283430: /*fixedUnsignedInt*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6072        case -391528104: /*fixedUri*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6073        case -391528101: /*fixedUrl*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6074        case 747533647: /*fixedUuid*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6075        case -691551776: /*fixedAddress*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6076        case -1956844093: /*fixedAnnotation*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6077        case 1929665463: /*fixedAttachment*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6078        case 1962764685: /*fixedCodeableConcept*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6079        case 599289854: /*fixedCoding*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6080        case 1680638692: /*fixedContactPoint*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6081        case -147502012: /*fixedHumanName*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6082        case -2020233411: /*fixedIdentifier*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6083        case 962650709: /*fixedPeriod*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6084        case -29557729: /*fixedQuantity*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6085        case 1695345193: /*fixedRange*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6086        case 1695351031: /*fixedRatio*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6087        case -661022153: /*fixedReference*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6088        case 585524912: /*fixedSampledData*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6089        case 1337717668: /*fixedSignature*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6090        case 1080712414: /*fixedTiming*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6091        case 628357963: /*fixedDosage*/  return new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, 1, fixed);
6092        case -885125392: /*pattern[x]*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6093        case -791090288: /*pattern*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6094        case 2127857120: /*patternBase64Binary*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6095        case -1776945544: /*patternBoolean*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6096        case 522246980: /*patternCanonical*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6097        case -1669806691: /*patternCode*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6098        case -1669789858: /*patternDate*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6099        case 535949131: /*patternDateTime*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6100        case -299393631: /*patternDecimal*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6101        case -28553013: /*patternId*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6102        case 115912753: /*patternInstant*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6103        case 116394894: /*patternInteger*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6104        case -1009861473: /*patternMarkdown*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6105        case -885137382: /*patternOid*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6106        case 2054814086: /*patternPositiveInt*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6107        case 2096647105: /*patternString*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6108        case -1669305731: /*patternTime*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6109        case -963691766: /*patternUnsignedInt*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6110        case -885131332: /*patternUri*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6111        case -885131329: /*patternUrl*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6112        case -1669264533: /*patternUuid*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6113        case 1305617988: /*patternAddress*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6114        case 1840611039: /*patternAnnotation*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6115        case 1432153299: /*patternAttachment*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6116        case -400610831: /*patternCodeableConcept*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6117        case 1633546010: /*patternCoding*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6118        case 312818944: /*patternContactPoint*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6119        case -717740120: /*patternHumanName*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6120        case 1777221721: /*patternIdentifier*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6121        case 1996906865: /*patternPeriod*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6122        case 1753162811: /*patternQuantity*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6123        case -210954355: /*patternRange*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6124        case -210948517: /*patternRatio*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6125        case -1231260261: /*patternReference*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6126        case -1952450284: /*patternSampledData*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6127        case 767479560: /*patternSignature*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6128        case 2114968570: /*patternTiming*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6129        case 1662614119: /*patternDosage*/  return new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, 1, pattern);
6130        case -1322970774: /*example*/  return new Property("example", "", "A sample value for this element demonstrating the type of information that would typically be found in the element.", 0, java.lang.Integer.MAX_VALUE, example);
6131        case -55301663: /*minValue[x]*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6132        case -1376969153: /*minValue*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6133        case -1715058035: /*minValueDate*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6134        case 1635517178: /*minValueDateTime*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6135        case 151382690: /*minValueInstant*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6136        case -1714573908: /*minValueTime*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6137        case -263923694: /*minValueDecimal*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6138        case 151864831: /*minValueInteger*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6139        case 1570935671: /*minValuePositiveInt*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6140        case -1447570181: /*minValueUnsignedInt*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6141        case -1442236438: /*minValueQuantity*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, minValue);
6142        case 622130931: /*maxValue[x]*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6143        case 399227501: /*maxValue*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6144        case 2105483195: /*maxValueDate*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6145        case 1699385640: /*maxValueDateTime*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6146        case 1261821620: /*maxValueInstant*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6147        case 2105967322: /*maxValueTime*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6148        case 846515236: /*maxValueDecimal*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6149        case 1262303761: /*maxValueInteger*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6150        case 1605774985: /*maxValuePositiveInt*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6151        case -1412730867: /*maxValueUnsignedInt*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6152        case -1378367976: /*maxValueQuantity*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|positiveInt|unsignedInt|Quantity", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, 1, maxValue);
6153        case -791400086: /*maxLength*/  return new Property("maxLength", "integer", "Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.", 0, 1, maxLength);
6154        case -861311717: /*condition*/  return new Property("condition", "id", "A reference to an invariant that may make additional statements about the cardinality or value in the instance.", 0, java.lang.Integer.MAX_VALUE, condition);
6155        case -190376483: /*constraint*/  return new Property("constraint", "", "Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.", 0, java.lang.Integer.MAX_VALUE, constraint);
6156        case -1402857082: /*mustSupport*/  return new Property("mustSupport", "boolean", "If true, implementations that produce or consume resources SHALL provide \"support\" for the element in some meaningful way.  If false, the element may be ignored and not supported.", 0, 1, mustSupport);
6157        case -1408783839: /*isModifier*/  return new Property("isModifier", "boolean", "If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.", 0, 1, isModifier);
6158        case -1854387259: /*isModifierReason*/  return new Property("isModifierReason", "string", "Explains how that element affects the interpretation of the resource or element that contains it.", 0, 1, isModifierReason);
6159        case 1857548060: /*isSummary*/  return new Property("isSummary", "boolean", "Whether the element should be included if a client requests a search with the parameter _summary=true.", 0, 1, isSummary);
6160        case -108220795: /*binding*/  return new Property("binding", "", "Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).", 0, 1, binding);
6161        case 837556430: /*mapping*/  return new Property("mapping", "", "Identifies a concept from an external specification that roughly corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, mapping);
6162        default: return super.getNamedProperty(_hash, _name, _checkValid);
6163        }
6164
6165      }
6166
6167      @Override
6168      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6169        switch (hash) {
6170        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
6171        case -671065907: /*representation*/ return this.representation == null ? new Base[0] : this.representation.toArray(new Base[this.representation.size()]); // Enumeration<PropertyRepresentation>
6172        case -825289923: /*sliceName*/ return this.sliceName == null ? new Base[0] : new Base[] {this.sliceName}; // StringType
6173        case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType
6174        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // Coding
6175        case -2119287345: /*slicing*/ return this.slicing == null ? new Base[0] : new Base[] {this.slicing}; // ElementDefinitionSlicingComponent
6176        case 109413500: /*short*/ return this.short_ == null ? new Base[0] : new Base[] {this.short_}; // StringType
6177        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // MarkdownType
6178        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // MarkdownType
6179        case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // MarkdownType
6180        case 92902992: /*alias*/ return this.alias == null ? new Base[0] : this.alias.toArray(new Base[this.alias.size()]); // StringType
6181        case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // UnsignedIntType
6182        case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType
6183        case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // ElementDefinitionBaseComponent
6184        case 1193747154: /*contentReference*/ return this.contentReference == null ? new Base[0] : new Base[] {this.contentReference}; // UriType
6185        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // TypeRefComponent
6186        case -659125328: /*defaultValue*/ return this.defaultValue == null ? new Base[0] : new Base[] {this.defaultValue}; // org.hl7.fhir.r4.model.Type
6187        case 1857257103: /*meaningWhenMissing*/ return this.meaningWhenMissing == null ? new Base[0] : new Base[] {this.meaningWhenMissing}; // MarkdownType
6188        case 1828196047: /*orderMeaning*/ return this.orderMeaning == null ? new Base[0] : new Base[] {this.orderMeaning}; // StringType
6189        case 97445748: /*fixed*/ return this.fixed == null ? new Base[0] : new Base[] {this.fixed}; // org.hl7.fhir.r4.model.Type
6190        case -791090288: /*pattern*/ return this.pattern == null ? new Base[0] : new Base[] {this.pattern}; // org.hl7.fhir.r4.model.Type
6191        case -1322970774: /*example*/ return this.example == null ? new Base[0] : this.example.toArray(new Base[this.example.size()]); // ElementDefinitionExampleComponent
6192        case -1376969153: /*minValue*/ return this.minValue == null ? new Base[0] : new Base[] {this.minValue}; // Type
6193        case 399227501: /*maxValue*/ return this.maxValue == null ? new Base[0] : new Base[] {this.maxValue}; // Type
6194        case -791400086: /*maxLength*/ return this.maxLength == null ? new Base[0] : new Base[] {this.maxLength}; // IntegerType
6195        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // IdType
6196        case -190376483: /*constraint*/ return this.constraint == null ? new Base[0] : this.constraint.toArray(new Base[this.constraint.size()]); // ElementDefinitionConstraintComponent
6197        case -1402857082: /*mustSupport*/ return this.mustSupport == null ? new Base[0] : new Base[] {this.mustSupport}; // BooleanType
6198        case -1408783839: /*isModifier*/ return this.isModifier == null ? new Base[0] : new Base[] {this.isModifier}; // BooleanType
6199        case -1854387259: /*isModifierReason*/ return this.isModifierReason == null ? new Base[0] : new Base[] {this.isModifierReason}; // StringType
6200        case 1857548060: /*isSummary*/ return this.isSummary == null ? new Base[0] : new Base[] {this.isSummary}; // BooleanType
6201        case -108220795: /*binding*/ return this.binding == null ? new Base[0] : new Base[] {this.binding}; // ElementDefinitionBindingComponent
6202        case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // ElementDefinitionMappingComponent
6203        default: return super.getProperty(hash, name, checkValid);
6204        }
6205
6206      }
6207
6208      @Override
6209      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6210        switch (hash) {
6211        case 3433509: // path
6212          this.path = castToString(value); // StringType
6213          return value;
6214        case -671065907: // representation
6215          value = new PropertyRepresentationEnumFactory().fromType(castToCode(value));
6216          this.getRepresentation().add((Enumeration) value); // Enumeration<PropertyRepresentation>
6217          return value;
6218        case -825289923: // sliceName
6219          this.sliceName = castToString(value); // StringType
6220          return value;
6221        case 102727412: // label
6222          this.label = castToString(value); // StringType
6223          return value;
6224        case 3059181: // code
6225          this.getCode().add(castToCoding(value)); // Coding
6226          return value;
6227        case -2119287345: // slicing
6228          this.slicing = (ElementDefinitionSlicingComponent) value; // ElementDefinitionSlicingComponent
6229          return value;
6230        case 109413500: // short
6231          this.short_ = castToString(value); // StringType
6232          return value;
6233        case -1014418093: // definition
6234          this.definition = castToMarkdown(value); // MarkdownType
6235          return value;
6236        case 950398559: // comment
6237          this.comment = castToMarkdown(value); // MarkdownType
6238          return value;
6239        case -1619874672: // requirements
6240          this.requirements = castToMarkdown(value); // MarkdownType
6241          return value;
6242        case 92902992: // alias
6243          this.getAlias().add(castToString(value)); // StringType
6244          return value;
6245        case 108114: // min
6246          this.min = castToUnsignedInt(value); // UnsignedIntType
6247          return value;
6248        case 107876: // max
6249          this.max = castToString(value); // StringType
6250          return value;
6251        case 3016401: // base
6252          this.base = (ElementDefinitionBaseComponent) value; // ElementDefinitionBaseComponent
6253          return value;
6254        case 1193747154: // contentReference
6255          this.contentReference = castToUri(value); // UriType
6256          return value;
6257        case 3575610: // type
6258          this.getType().add((TypeRefComponent) value); // TypeRefComponent
6259          return value;
6260        case -659125328: // defaultValue
6261          this.defaultValue = castToType(value); // org.hl7.fhir.r4.model.Type
6262          return value;
6263        case 1857257103: // meaningWhenMissing
6264          this.meaningWhenMissing = castToMarkdown(value); // MarkdownType
6265          return value;
6266        case 1828196047: // orderMeaning
6267          this.orderMeaning = castToString(value); // StringType
6268          return value;
6269        case 97445748: // fixed
6270          this.fixed = castToType(value); // org.hl7.fhir.r4.model.Type
6271          return value;
6272        case -791090288: // pattern
6273          this.pattern = castToType(value); // org.hl7.fhir.r4.model.Type
6274          return value;
6275        case -1322970774: // example
6276          this.getExample().add((ElementDefinitionExampleComponent) value); // ElementDefinitionExampleComponent
6277          return value;
6278        case -1376969153: // minValue
6279          this.minValue = castToType(value); // Type
6280          return value;
6281        case 399227501: // maxValue
6282          this.maxValue = castToType(value); // Type
6283          return value;
6284        case -791400086: // maxLength
6285          this.maxLength = castToInteger(value); // IntegerType
6286          return value;
6287        case -861311717: // condition
6288          this.getCondition().add(castToId(value)); // IdType
6289          return value;
6290        case -190376483: // constraint
6291          this.getConstraint().add((ElementDefinitionConstraintComponent) value); // ElementDefinitionConstraintComponent
6292          return value;
6293        case -1402857082: // mustSupport
6294          this.mustSupport = castToBoolean(value); // BooleanType
6295          return value;
6296        case -1408783839: // isModifier
6297          this.isModifier = castToBoolean(value); // BooleanType
6298          return value;
6299        case -1854387259: // isModifierReason
6300          this.isModifierReason = castToString(value); // StringType
6301          return value;
6302        case 1857548060: // isSummary
6303          this.isSummary = castToBoolean(value); // BooleanType
6304          return value;
6305        case -108220795: // binding
6306          this.binding = (ElementDefinitionBindingComponent) value; // ElementDefinitionBindingComponent
6307          return value;
6308        case 837556430: // mapping
6309          this.getMapping().add((ElementDefinitionMappingComponent) value); // ElementDefinitionMappingComponent
6310          return value;
6311        default: return super.setProperty(hash, name, value);
6312        }
6313
6314      }
6315
6316      @Override
6317      public Base setProperty(String name, Base value) throws FHIRException {
6318        if (name.equals("path")) {
6319          this.path = castToString(value); // StringType
6320        } else if (name.equals("representation")) {
6321          value = new PropertyRepresentationEnumFactory().fromType(castToCode(value));
6322          this.getRepresentation().add((Enumeration) value);
6323        } else if (name.equals("sliceName")) {
6324          this.sliceName = castToString(value); // StringType
6325        } else if (name.equals("label")) {
6326          this.label = castToString(value); // StringType
6327        } else if (name.equals("code")) {
6328          this.getCode().add(castToCoding(value));
6329        } else if (name.equals("slicing")) {
6330          this.slicing = (ElementDefinitionSlicingComponent) value; // ElementDefinitionSlicingComponent
6331        } else if (name.equals("short")) {
6332          this.short_ = castToString(value); // StringType
6333        } else if (name.equals("definition")) {
6334          this.definition = castToMarkdown(value); // MarkdownType
6335        } else if (name.equals("comment")) {
6336          this.comment = castToMarkdown(value); // MarkdownType
6337        } else if (name.equals("requirements")) {
6338          this.requirements = castToMarkdown(value); // MarkdownType
6339        } else if (name.equals("alias")) {
6340          this.getAlias().add(castToString(value));
6341        } else if (name.equals("min")) {
6342          this.min = castToUnsignedInt(value); // UnsignedIntType
6343        } else if (name.equals("max")) {
6344          this.max = castToString(value); // StringType
6345        } else if (name.equals("base")) {
6346          this.base = (ElementDefinitionBaseComponent) value; // ElementDefinitionBaseComponent
6347        } else if (name.equals("contentReference")) {
6348          this.contentReference = castToUri(value); // UriType
6349        } else if (name.equals("type")) {
6350          this.getType().add((TypeRefComponent) value);
6351        } else if (name.equals("defaultValue[x]")) {
6352          this.defaultValue = castToType(value); // org.hl7.fhir.r4.model.Type
6353        } else if (name.equals("meaningWhenMissing")) {
6354          this.meaningWhenMissing = castToMarkdown(value); // MarkdownType
6355        } else if (name.equals("orderMeaning")) {
6356          this.orderMeaning = castToString(value); // StringType
6357        } else if (name.equals("fixed[x]")) {
6358          this.fixed = castToType(value); // org.hl7.fhir.r4.model.Type
6359        } else if (name.equals("pattern[x]")) {
6360          this.pattern = castToType(value); // org.hl7.fhir.r4.model.Type
6361        } else if (name.equals("example")) {
6362          this.getExample().add((ElementDefinitionExampleComponent) value);
6363        } else if (name.equals("minValue[x]")) {
6364          this.minValue = castToType(value); // Type
6365        } else if (name.equals("maxValue[x]")) {
6366          this.maxValue = castToType(value); // Type
6367        } else if (name.equals("maxLength")) {
6368          this.maxLength = castToInteger(value); // IntegerType
6369        } else if (name.equals("condition")) {
6370          this.getCondition().add(castToId(value));
6371        } else if (name.equals("constraint")) {
6372          this.getConstraint().add((ElementDefinitionConstraintComponent) value);
6373        } else if (name.equals("mustSupport")) {
6374          this.mustSupport = castToBoolean(value); // BooleanType
6375        } else if (name.equals("isModifier")) {
6376          this.isModifier = castToBoolean(value); // BooleanType
6377        } else if (name.equals("isModifierReason")) {
6378          this.isModifierReason = castToString(value); // StringType
6379        } else if (name.equals("isSummary")) {
6380          this.isSummary = castToBoolean(value); // BooleanType
6381        } else if (name.equals("binding")) {
6382          this.binding = (ElementDefinitionBindingComponent) value; // ElementDefinitionBindingComponent
6383        } else if (name.equals("mapping")) {
6384          this.getMapping().add((ElementDefinitionMappingComponent) value);
6385        } else
6386          return super.setProperty(name, value);
6387        return value;
6388      }
6389
6390      @Override
6391      public Base makeProperty(int hash, String name) throws FHIRException {
6392        switch (hash) {
6393        case 3433509:  return getPathElement();
6394        case -671065907:  return addRepresentationElement();
6395        case -825289923:  return getSliceNameElement();
6396        case 102727412:  return getLabelElement();
6397        case 3059181:  return addCode(); 
6398        case -2119287345:  return getSlicing(); 
6399        case 109413500:  return getShortElement();
6400        case -1014418093:  return getDefinitionElement();
6401        case 950398559:  return getCommentElement();
6402        case -1619874672:  return getRequirementsElement();
6403        case 92902992:  return addAliasElement();
6404        case 108114:  return getMinElement();
6405        case 107876:  return getMaxElement();
6406        case 3016401:  return getBase(); 
6407        case 1193747154:  return getContentReferenceElement();
6408        case 3575610:  return addType(); 
6409        case 587922128:  return getDefaultValue(); 
6410        case -659125328:  return getDefaultValue(); 
6411        case 1857257103:  return getMeaningWhenMissingElement();
6412        case 1828196047:  return getOrderMeaningElement();
6413        case -391522164:  return getFixed(); 
6414        case 97445748:  return getFixed(); 
6415        case -885125392:  return getPattern(); 
6416        case -791090288:  return getPattern(); 
6417        case -1322970774:  return addExample(); 
6418        case -55301663:  return getMinValue(); 
6419        case -1376969153:  return getMinValue(); 
6420        case 622130931:  return getMaxValue(); 
6421        case 399227501:  return getMaxValue(); 
6422        case -791400086:  return getMaxLengthElement();
6423        case -861311717:  return addConditionElement();
6424        case -190376483:  return addConstraint(); 
6425        case -1402857082:  return getMustSupportElement();
6426        case -1408783839:  return getIsModifierElement();
6427        case -1854387259:  return getIsModifierReasonElement();
6428        case 1857548060:  return getIsSummaryElement();
6429        case -108220795:  return getBinding(); 
6430        case 837556430:  return addMapping(); 
6431        default: return super.makeProperty(hash, name);
6432        }
6433
6434      }
6435
6436      @Override
6437      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6438        switch (hash) {
6439        case 3433509: /*path*/ return new String[] {"string"};
6440        case -671065907: /*representation*/ return new String[] {"code"};
6441        case -825289923: /*sliceName*/ return new String[] {"string"};
6442        case 102727412: /*label*/ return new String[] {"string"};
6443        case 3059181: /*code*/ return new String[] {"Coding"};
6444        case -2119287345: /*slicing*/ return new String[] {};
6445        case 109413500: /*short*/ return new String[] {"string"};
6446        case -1014418093: /*definition*/ return new String[] {"markdown"};
6447        case 950398559: /*comment*/ return new String[] {"markdown"};
6448        case -1619874672: /*requirements*/ return new String[] {"markdown"};
6449        case 92902992: /*alias*/ return new String[] {"string"};
6450        case 108114: /*min*/ return new String[] {"unsignedInt"};
6451        case 107876: /*max*/ return new String[] {"string"};
6452        case 3016401: /*base*/ return new String[] {};
6453        case 1193747154: /*contentReference*/ return new String[] {"uri"};
6454        case 3575610: /*type*/ return new String[] {};
6455        case -659125328: /*defaultValue*/ return new String[] {"*"};
6456        case 1857257103: /*meaningWhenMissing*/ return new String[] {"markdown"};
6457        case 1828196047: /*orderMeaning*/ return new String[] {"string"};
6458        case 97445748: /*fixed*/ return new String[] {"*"};
6459        case -791090288: /*pattern*/ return new String[] {"*"};
6460        case -1322970774: /*example*/ return new String[] {};
6461        case -1376969153: /*minValue*/ return new String[] {"date", "dateTime", "instant", "time", "decimal", "integer", "positiveInt", "unsignedInt", "Quantity"};
6462        case 399227501: /*maxValue*/ return new String[] {"date", "dateTime", "instant", "time", "decimal", "integer", "positiveInt", "unsignedInt", "Quantity"};
6463        case -791400086: /*maxLength*/ return new String[] {"integer"};
6464        case -861311717: /*condition*/ return new String[] {"id"};
6465        case -190376483: /*constraint*/ return new String[] {};
6466        case -1402857082: /*mustSupport*/ return new String[] {"boolean"};
6467        case -1408783839: /*isModifier*/ return new String[] {"boolean"};
6468        case -1854387259: /*isModifierReason*/ return new String[] {"string"};
6469        case 1857548060: /*isSummary*/ return new String[] {"boolean"};
6470        case -108220795: /*binding*/ return new String[] {};
6471        case 837556430: /*mapping*/ return new String[] {};
6472        default: return super.getTypesForProperty(hash, name);
6473        }
6474
6475      }
6476
6477      @Override
6478      public Base addChild(String name) throws FHIRException {
6479        if (name.equals("path")) {
6480          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.path");
6481        }
6482        else if (name.equals("representation")) {
6483          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.representation");
6484        }
6485        else if (name.equals("sliceName")) {
6486          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.sliceName");
6487        }
6488        else if (name.equals("label")) {
6489          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.label");
6490        }
6491        else if (name.equals("code")) {
6492          return addCode();
6493        }
6494        else if (name.equals("slicing")) {
6495          this.slicing = new ElementDefinitionSlicingComponent();
6496          return this.slicing;
6497        }
6498        else if (name.equals("short")) {
6499          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.short");
6500        }
6501        else if (name.equals("definition")) {
6502          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.definition");
6503        }
6504        else if (name.equals("comment")) {
6505          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.comment");
6506        }
6507        else if (name.equals("requirements")) {
6508          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.requirements");
6509        }
6510        else if (name.equals("alias")) {
6511          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.alias");
6512        }
6513        else if (name.equals("min")) {
6514          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.min");
6515        }
6516        else if (name.equals("max")) {
6517          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.max");
6518        }
6519        else if (name.equals("base")) {
6520          this.base = new ElementDefinitionBaseComponent();
6521          return this.base;
6522        }
6523        else if (name.equals("contentReference")) {
6524          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.contentReference");
6525        }
6526        else if (name.equals("type")) {
6527          return addType();
6528        }
6529        else if (name.equals("defaultValueBase64Binary")) {
6530          this.defaultValue = new Base64BinaryType();
6531          return this.defaultValue;
6532        }
6533        else if (name.equals("defaultValueBoolean")) {
6534          this.defaultValue = new BooleanType();
6535          return this.defaultValue;
6536        }
6537        else if (name.equals("defaultValueCanonical")) {
6538          this.defaultValue = new CanonicalType();
6539          return this.defaultValue;
6540        }
6541        else if (name.equals("defaultValueCode")) {
6542          this.defaultValue = new CodeType();
6543          return this.defaultValue;
6544        }
6545        else if (name.equals("defaultValueDate")) {
6546          this.defaultValue = new DateType();
6547          return this.defaultValue;
6548        }
6549        else if (name.equals("defaultValueDateTime")) {
6550          this.defaultValue = new DateTimeType();
6551          return this.defaultValue;
6552        }
6553        else if (name.equals("defaultValueDecimal")) {
6554          this.defaultValue = new DecimalType();
6555          return this.defaultValue;
6556        }
6557        else if (name.equals("defaultValueId")) {
6558          this.defaultValue = new IdType();
6559          return this.defaultValue;
6560        }
6561        else if (name.equals("defaultValueInstant")) {
6562          this.defaultValue = new InstantType();
6563          return this.defaultValue;
6564        }
6565        else if (name.equals("defaultValueInteger")) {
6566          this.defaultValue = new IntegerType();
6567          return this.defaultValue;
6568        }
6569        else if (name.equals("defaultValueMarkdown")) {
6570          this.defaultValue = new MarkdownType();
6571          return this.defaultValue;
6572        }
6573        else if (name.equals("defaultValueOid")) {
6574          this.defaultValue = new OidType();
6575          return this.defaultValue;
6576        }
6577        else if (name.equals("defaultValuePositiveInt")) {
6578          this.defaultValue = new PositiveIntType();
6579          return this.defaultValue;
6580        }
6581        else if (name.equals("defaultValueString")) {
6582          this.defaultValue = new StringType();
6583          return this.defaultValue;
6584        }
6585        else if (name.equals("defaultValueTime")) {
6586          this.defaultValue = new TimeType();
6587          return this.defaultValue;
6588        }
6589        else if (name.equals("defaultValueUnsignedInt")) {
6590          this.defaultValue = new UnsignedIntType();
6591          return this.defaultValue;
6592        }
6593        else if (name.equals("defaultValueUri")) {
6594          this.defaultValue = new UriType();
6595          return this.defaultValue;
6596        }
6597        else if (name.equals("defaultValueUrl")) {
6598          this.defaultValue = new UrlType();
6599          return this.defaultValue;
6600        }
6601        else if (name.equals("defaultValueUuid")) {
6602          this.defaultValue = new UuidType();
6603          return this.defaultValue;
6604        }
6605        else if (name.equals("defaultValueAddress")) {
6606          this.defaultValue = new Address();
6607          return this.defaultValue;
6608        }
6609        else if (name.equals("defaultValueAge")) {
6610          this.defaultValue = new Age();
6611          return this.defaultValue;
6612        }
6613        else if (name.equals("defaultValueAnnotation")) {
6614          this.defaultValue = new Annotation();
6615          return this.defaultValue;
6616        }
6617        else if (name.equals("defaultValueAttachment")) {
6618          this.defaultValue = new Attachment();
6619          return this.defaultValue;
6620        }
6621        else if (name.equals("defaultValueCodeableConcept")) {
6622          this.defaultValue = new CodeableConcept();
6623          return this.defaultValue;
6624        }
6625        else if (name.equals("defaultValueCoding")) {
6626          this.defaultValue = new Coding();
6627          return this.defaultValue;
6628        }
6629        else if (name.equals("defaultValueContactPoint")) {
6630          this.defaultValue = new ContactPoint();
6631          return this.defaultValue;
6632        }
6633        else if (name.equals("defaultValueCount")) {
6634          this.defaultValue = new Count();
6635          return this.defaultValue;
6636        }
6637        else if (name.equals("defaultValueDistance")) {
6638          this.defaultValue = new Distance();
6639          return this.defaultValue;
6640        }
6641        else if (name.equals("defaultValueDuration")) {
6642          this.defaultValue = new Duration();
6643          return this.defaultValue;
6644        }
6645        else if (name.equals("defaultValueHumanName")) {
6646          this.defaultValue = new HumanName();
6647          return this.defaultValue;
6648        }
6649        else if (name.equals("defaultValueIdentifier")) {
6650          this.defaultValue = new Identifier();
6651          return this.defaultValue;
6652        }
6653        else if (name.equals("defaultValueMoney")) {
6654          this.defaultValue = new Money();
6655          return this.defaultValue;
6656        }
6657        else if (name.equals("defaultValuePeriod")) {
6658          this.defaultValue = new Period();
6659          return this.defaultValue;
6660        }
6661        else if (name.equals("defaultValueQuantity")) {
6662          this.defaultValue = new Quantity();
6663          return this.defaultValue;
6664        }
6665        else if (name.equals("defaultValueRange")) {
6666          this.defaultValue = new Range();
6667          return this.defaultValue;
6668        }
6669        else if (name.equals("defaultValueRatio")) {
6670          this.defaultValue = new Ratio();
6671          return this.defaultValue;
6672        }
6673        else if (name.equals("defaultValueReference")) {
6674          this.defaultValue = new Reference();
6675          return this.defaultValue;
6676        }
6677        else if (name.equals("defaultValueSampledData")) {
6678          this.defaultValue = new SampledData();
6679          return this.defaultValue;
6680        }
6681        else if (name.equals("defaultValueSignature")) {
6682          this.defaultValue = new Signature();
6683          return this.defaultValue;
6684        }
6685        else if (name.equals("defaultValueTiming")) {
6686          this.defaultValue = new Timing();
6687          return this.defaultValue;
6688        }
6689        else if (name.equals("defaultValueParameterDefinition")) {
6690          this.defaultValue = new ParameterDefinition();
6691          return this.defaultValue;
6692        }
6693        else if (name.equals("defaultValueDataRequirement")) {
6694          this.defaultValue = new DataRequirement();
6695          return this.defaultValue;
6696        }
6697        else if (name.equals("defaultValueRelatedArtifact")) {
6698          this.defaultValue = new RelatedArtifact();
6699          return this.defaultValue;
6700        }
6701        else if (name.equals("defaultValueContactDetail")) {
6702          this.defaultValue = new ContactDetail();
6703          return this.defaultValue;
6704        }
6705        else if (name.equals("defaultValueContributor")) {
6706          this.defaultValue = new Contributor();
6707          return this.defaultValue;
6708        }
6709        else if (name.equals("defaultValueTriggerDefinition")) {
6710          this.defaultValue = new TriggerDefinition();
6711          return this.defaultValue;
6712        }
6713        else if (name.equals("defaultValueUsageContext")) {
6714          this.defaultValue = new UsageContext();
6715          return this.defaultValue;
6716        }
6717        else if (name.equals("defaultValueDosage")) {
6718          this.defaultValue = new Dosage();
6719          return this.defaultValue;
6720        }
6721        else if (name.equals("meaningWhenMissing")) {
6722          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.meaningWhenMissing");
6723        }
6724        else if (name.equals("orderMeaning")) {
6725          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.orderMeaning");
6726        }
6727        else if (name.equals("fixedBase64Binary")) {
6728          this.fixed = new Base64BinaryType();
6729          return this.fixed;
6730        }
6731        else if (name.equals("fixedBoolean")) {
6732          this.fixed = new BooleanType();
6733          return this.fixed;
6734        }
6735        else if (name.equals("fixedCanonical")) {
6736          this.fixed = new CanonicalType();
6737          return this.fixed;
6738        }
6739        else if (name.equals("fixedCode")) {
6740          this.fixed = new CodeType();
6741          return this.fixed;
6742        }
6743        else if (name.equals("fixedDate")) {
6744          this.fixed = new DateType();
6745          return this.fixed;
6746        }
6747        else if (name.equals("fixedDateTime")) {
6748          this.fixed = new DateTimeType();
6749          return this.fixed;
6750        }
6751        else if (name.equals("fixedDecimal")) {
6752          this.fixed = new DecimalType();
6753          return this.fixed;
6754        }
6755        else if (name.equals("fixedId")) {
6756          this.fixed = new IdType();
6757          return this.fixed;
6758        }
6759        else if (name.equals("fixedInstant")) {
6760          this.fixed = new InstantType();
6761          return this.fixed;
6762        }
6763        else if (name.equals("fixedInteger")) {
6764          this.fixed = new IntegerType();
6765          return this.fixed;
6766        }
6767        else if (name.equals("fixedMarkdown")) {
6768          this.fixed = new MarkdownType();
6769          return this.fixed;
6770        }
6771        else if (name.equals("fixedOid")) {
6772          this.fixed = new OidType();
6773          return this.fixed;
6774        }
6775        else if (name.equals("fixedPositiveInt")) {
6776          this.fixed = new PositiveIntType();
6777          return this.fixed;
6778        }
6779        else if (name.equals("fixedString")) {
6780          this.fixed = new StringType();
6781          return this.fixed;
6782        }
6783        else if (name.equals("fixedTime")) {
6784          this.fixed = new TimeType();
6785          return this.fixed;
6786        }
6787        else if (name.equals("fixedUnsignedInt")) {
6788          this.fixed = new UnsignedIntType();
6789          return this.fixed;
6790        }
6791        else if (name.equals("fixedUri")) {
6792          this.fixed = new UriType();
6793          return this.fixed;
6794        }
6795        else if (name.equals("fixedUrl")) {
6796          this.fixed = new UrlType();
6797          return this.fixed;
6798        }
6799        else if (name.equals("fixedUuid")) {
6800          this.fixed = new UuidType();
6801          return this.fixed;
6802        }
6803        else if (name.equals("fixedAddress")) {
6804          this.fixed = new Address();
6805          return this.fixed;
6806        }
6807        else if (name.equals("fixedAge")) {
6808          this.fixed = new Age();
6809          return this.fixed;
6810        }
6811        else if (name.equals("fixedAnnotation")) {
6812          this.fixed = new Annotation();
6813          return this.fixed;
6814        }
6815        else if (name.equals("fixedAttachment")) {
6816          this.fixed = new Attachment();
6817          return this.fixed;
6818        }
6819        else if (name.equals("fixedCodeableConcept")) {
6820          this.fixed = new CodeableConcept();
6821          return this.fixed;
6822        }
6823        else if (name.equals("fixedCoding")) {
6824          this.fixed = new Coding();
6825          return this.fixed;
6826        }
6827        else if (name.equals("fixedContactPoint")) {
6828          this.fixed = new ContactPoint();
6829          return this.fixed;
6830        }
6831        else if (name.equals("fixedCount")) {
6832          this.fixed = new Count();
6833          return this.fixed;
6834        }
6835        else if (name.equals("fixedDistance")) {
6836          this.fixed = new Distance();
6837          return this.fixed;
6838        }
6839        else if (name.equals("fixedDuration")) {
6840          this.fixed = new Duration();
6841          return this.fixed;
6842        }
6843        else if (name.equals("fixedHumanName")) {
6844          this.fixed = new HumanName();
6845          return this.fixed;
6846        }
6847        else if (name.equals("fixedIdentifier")) {
6848          this.fixed = new Identifier();
6849          return this.fixed;
6850        }
6851        else if (name.equals("fixedMoney")) {
6852          this.fixed = new Money();
6853          return this.fixed;
6854        }
6855        else if (name.equals("fixedPeriod")) {
6856          this.fixed = new Period();
6857          return this.fixed;
6858        }
6859        else if (name.equals("fixedQuantity")) {
6860          this.fixed = new Quantity();
6861          return this.fixed;
6862        }
6863        else if (name.equals("fixedRange")) {
6864          this.fixed = new Range();
6865          return this.fixed;
6866        }
6867        else if (name.equals("fixedRatio")) {
6868          this.fixed = new Ratio();
6869          return this.fixed;
6870        }
6871        else if (name.equals("fixedReference")) {
6872          this.fixed = new Reference();
6873          return this.fixed;
6874        }
6875        else if (name.equals("fixedSampledData")) {
6876          this.fixed = new SampledData();
6877          return this.fixed;
6878        }
6879        else if (name.equals("fixedSignature")) {
6880          this.fixed = new Signature();
6881          return this.fixed;
6882        }
6883        else if (name.equals("fixedTiming")) {
6884          this.fixed = new Timing();
6885          return this.fixed;
6886        }
6887        else if (name.equals("fixedParameterDefinition")) {
6888          this.fixed = new ParameterDefinition();
6889          return this.fixed;
6890        }
6891        else if (name.equals("fixedDataRequirement")) {
6892          this.fixed = new DataRequirement();
6893          return this.fixed;
6894        }
6895        else if (name.equals("fixedRelatedArtifact")) {
6896          this.fixed = new RelatedArtifact();
6897          return this.fixed;
6898        }
6899        else if (name.equals("fixedContactDetail")) {
6900          this.fixed = new ContactDetail();
6901          return this.fixed;
6902        }
6903        else if (name.equals("fixedContributor")) {
6904          this.fixed = new Contributor();
6905          return this.fixed;
6906        }
6907        else if (name.equals("fixedTriggerDefinition")) {
6908          this.fixed = new TriggerDefinition();
6909          return this.fixed;
6910        }
6911        else if (name.equals("fixedUsageContext")) {
6912          this.fixed = new UsageContext();
6913          return this.fixed;
6914        }
6915        else if (name.equals("fixedDosage")) {
6916          this.fixed = new Dosage();
6917          return this.fixed;
6918        }
6919        else if (name.equals("patternBase64Binary")) {
6920          this.pattern = new Base64BinaryType();
6921          return this.pattern;
6922        }
6923        else if (name.equals("patternBoolean")) {
6924          this.pattern = new BooleanType();
6925          return this.pattern;
6926        }
6927        else if (name.equals("patternCanonical")) {
6928          this.pattern = new CanonicalType();
6929          return this.pattern;
6930        }
6931        else if (name.equals("patternCode")) {
6932          this.pattern = new CodeType();
6933          return this.pattern;
6934        }
6935        else if (name.equals("patternDate")) {
6936          this.pattern = new DateType();
6937          return this.pattern;
6938        }
6939        else if (name.equals("patternDateTime")) {
6940          this.pattern = new DateTimeType();
6941          return this.pattern;
6942        }
6943        else if (name.equals("patternDecimal")) {
6944          this.pattern = new DecimalType();
6945          return this.pattern;
6946        }
6947        else if (name.equals("patternId")) {
6948          this.pattern = new IdType();
6949          return this.pattern;
6950        }
6951        else if (name.equals("patternInstant")) {
6952          this.pattern = new InstantType();
6953          return this.pattern;
6954        }
6955        else if (name.equals("patternInteger")) {
6956          this.pattern = new IntegerType();
6957          return this.pattern;
6958        }
6959        else if (name.equals("patternMarkdown")) {
6960          this.pattern = new MarkdownType();
6961          return this.pattern;
6962        }
6963        else if (name.equals("patternOid")) {
6964          this.pattern = new OidType();
6965          return this.pattern;
6966        }
6967        else if (name.equals("patternPositiveInt")) {
6968          this.pattern = new PositiveIntType();
6969          return this.pattern;
6970        }
6971        else if (name.equals("patternString")) {
6972          this.pattern = new StringType();
6973          return this.pattern;
6974        }
6975        else if (name.equals("patternTime")) {
6976          this.pattern = new TimeType();
6977          return this.pattern;
6978        }
6979        else if (name.equals("patternUnsignedInt")) {
6980          this.pattern = new UnsignedIntType();
6981          return this.pattern;
6982        }
6983        else if (name.equals("patternUri")) {
6984          this.pattern = new UriType();
6985          return this.pattern;
6986        }
6987        else if (name.equals("patternUrl")) {
6988          this.pattern = new UrlType();
6989          return this.pattern;
6990        }
6991        else if (name.equals("patternUuid")) {
6992          this.pattern = new UuidType();
6993          return this.pattern;
6994        }
6995        else if (name.equals("patternAddress")) {
6996          this.pattern = new Address();
6997          return this.pattern;
6998        }
6999        else if (name.equals("patternAge")) {
7000          this.pattern = new Age();
7001          return this.pattern;
7002        }
7003        else if (name.equals("patternAnnotation")) {
7004          this.pattern = new Annotation();
7005          return this.pattern;
7006        }
7007        else if (name.equals("patternAttachment")) {
7008          this.pattern = new Attachment();
7009          return this.pattern;
7010        }
7011        else if (name.equals("patternCodeableConcept")) {
7012          this.pattern = new CodeableConcept();
7013          return this.pattern;
7014        }
7015        else if (name.equals("patternCoding")) {
7016          this.pattern = new Coding();
7017          return this.pattern;
7018        }
7019        else if (name.equals("patternContactPoint")) {
7020          this.pattern = new ContactPoint();
7021          return this.pattern;
7022        }
7023        else if (name.equals("patternCount")) {
7024          this.pattern = new Count();
7025          return this.pattern;
7026        }
7027        else if (name.equals("patternDistance")) {
7028          this.pattern = new Distance();
7029          return this.pattern;
7030        }
7031        else if (name.equals("patternDuration")) {
7032          this.pattern = new Duration();
7033          return this.pattern;
7034        }
7035        else if (name.equals("patternHumanName")) {
7036          this.pattern = new HumanName();
7037          return this.pattern;
7038        }
7039        else if (name.equals("patternIdentifier")) {
7040          this.pattern = new Identifier();
7041          return this.pattern;
7042        }
7043        else if (name.equals("patternMoney")) {
7044          this.pattern = new Money();
7045          return this.pattern;
7046        }
7047        else if (name.equals("patternPeriod")) {
7048          this.pattern = new Period();
7049          return this.pattern;
7050        }
7051        else if (name.equals("patternQuantity")) {
7052          this.pattern = new Quantity();
7053          return this.pattern;
7054        }
7055        else if (name.equals("patternRange")) {
7056          this.pattern = new Range();
7057          return this.pattern;
7058        }
7059        else if (name.equals("patternRatio")) {
7060          this.pattern = new Ratio();
7061          return this.pattern;
7062        }
7063        else if (name.equals("patternReference")) {
7064          this.pattern = new Reference();
7065          return this.pattern;
7066        }
7067        else if (name.equals("patternSampledData")) {
7068          this.pattern = new SampledData();
7069          return this.pattern;
7070        }
7071        else if (name.equals("patternSignature")) {
7072          this.pattern = new Signature();
7073          return this.pattern;
7074        }
7075        else if (name.equals("patternTiming")) {
7076          this.pattern = new Timing();
7077          return this.pattern;
7078        }
7079        else if (name.equals("patternParameterDefinition")) {
7080          this.pattern = new ParameterDefinition();
7081          return this.pattern;
7082        }
7083        else if (name.equals("patternDataRequirement")) {
7084          this.pattern = new DataRequirement();
7085          return this.pattern;
7086        }
7087        else if (name.equals("patternRelatedArtifact")) {
7088          this.pattern = new RelatedArtifact();
7089          return this.pattern;
7090        }
7091        else if (name.equals("patternContactDetail")) {
7092          this.pattern = new ContactDetail();
7093          return this.pattern;
7094        }
7095        else if (name.equals("patternContributor")) {
7096          this.pattern = new Contributor();
7097          return this.pattern;
7098        }
7099        else if (name.equals("patternTriggerDefinition")) {
7100          this.pattern = new TriggerDefinition();
7101          return this.pattern;
7102        }
7103        else if (name.equals("patternUsageContext")) {
7104          this.pattern = new UsageContext();
7105          return this.pattern;
7106        }
7107        else if (name.equals("patternDosage")) {
7108          this.pattern = new Dosage();
7109          return this.pattern;
7110        }
7111        else if (name.equals("example")) {
7112          return addExample();
7113        }
7114        else if (name.equals("minValueDate")) {
7115          this.minValue = new DateType();
7116          return this.minValue;
7117        }
7118        else if (name.equals("minValueDateTime")) {
7119          this.minValue = new DateTimeType();
7120          return this.minValue;
7121        }
7122        else if (name.equals("minValueInstant")) {
7123          this.minValue = new InstantType();
7124          return this.minValue;
7125        }
7126        else if (name.equals("minValueTime")) {
7127          this.minValue = new TimeType();
7128          return this.minValue;
7129        }
7130        else if (name.equals("minValueDecimal")) {
7131          this.minValue = new DecimalType();
7132          return this.minValue;
7133        }
7134        else if (name.equals("minValueInteger")) {
7135          this.minValue = new IntegerType();
7136          return this.minValue;
7137        }
7138        else if (name.equals("minValuePositiveInt")) {
7139          this.minValue = new PositiveIntType();
7140          return this.minValue;
7141        }
7142        else if (name.equals("minValueUnsignedInt")) {
7143          this.minValue = new UnsignedIntType();
7144          return this.minValue;
7145        }
7146        else if (name.equals("minValueQuantity")) {
7147          this.minValue = new Quantity();
7148          return this.minValue;
7149        }
7150        else if (name.equals("maxValueDate")) {
7151          this.maxValue = new DateType();
7152          return this.maxValue;
7153        }
7154        else if (name.equals("maxValueDateTime")) {
7155          this.maxValue = new DateTimeType();
7156          return this.maxValue;
7157        }
7158        else if (name.equals("maxValueInstant")) {
7159          this.maxValue = new InstantType();
7160          return this.maxValue;
7161        }
7162        else if (name.equals("maxValueTime")) {
7163          this.maxValue = new TimeType();
7164          return this.maxValue;
7165        }
7166        else if (name.equals("maxValueDecimal")) {
7167          this.maxValue = new DecimalType();
7168          return this.maxValue;
7169        }
7170        else if (name.equals("maxValueInteger")) {
7171          this.maxValue = new IntegerType();
7172          return this.maxValue;
7173        }
7174        else if (name.equals("maxValuePositiveInt")) {
7175          this.maxValue = new PositiveIntType();
7176          return this.maxValue;
7177        }
7178        else if (name.equals("maxValueUnsignedInt")) {
7179          this.maxValue = new UnsignedIntType();
7180          return this.maxValue;
7181        }
7182        else if (name.equals("maxValueQuantity")) {
7183          this.maxValue = new Quantity();
7184          return this.maxValue;
7185        }
7186        else if (name.equals("maxLength")) {
7187          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.maxLength");
7188        }
7189        else if (name.equals("condition")) {
7190          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.condition");
7191        }
7192        else if (name.equals("constraint")) {
7193          return addConstraint();
7194        }
7195        else if (name.equals("mustSupport")) {
7196          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.mustSupport");
7197        }
7198        else if (name.equals("isModifier")) {
7199          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isModifier");
7200        }
7201        else if (name.equals("isModifierReason")) {
7202          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isModifierReason");
7203        }
7204        else if (name.equals("isSummary")) {
7205          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isSummary");
7206        }
7207        else if (name.equals("binding")) {
7208          this.binding = new ElementDefinitionBindingComponent();
7209          return this.binding;
7210        }
7211        else if (name.equals("mapping")) {
7212          return addMapping();
7213        }
7214        else
7215          return super.addChild(name);
7216      }
7217
7218  public String fhirType() {
7219    return "ElementDefinition";
7220
7221  }
7222
7223      public ElementDefinition copy() {
7224        ElementDefinition dst = new ElementDefinition();
7225        copyValues(dst);
7226        dst.path = path == null ? null : path.copy();
7227        if (representation != null) {
7228          dst.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
7229          for (Enumeration<PropertyRepresentation> i : representation)
7230            dst.representation.add(i.copy());
7231        };
7232        dst.sliceName = sliceName == null ? null : sliceName.copy();
7233        dst.label = label == null ? null : label.copy();
7234        if (code != null) {
7235          dst.code = new ArrayList<Coding>();
7236          for (Coding i : code)
7237            dst.code.add(i.copy());
7238        };
7239        dst.slicing = slicing == null ? null : slicing.copy();
7240        dst.short_ = short_ == null ? null : short_.copy();
7241        dst.definition = definition == null ? null : definition.copy();
7242        dst.comment = comment == null ? null : comment.copy();
7243        dst.requirements = requirements == null ? null : requirements.copy();
7244        if (alias != null) {
7245          dst.alias = new ArrayList<StringType>();
7246          for (StringType i : alias)
7247            dst.alias.add(i.copy());
7248        };
7249        dst.min = min == null ? null : min.copy();
7250        dst.max = max == null ? null : max.copy();
7251        dst.base = base == null ? null : base.copy();
7252        dst.contentReference = contentReference == null ? null : contentReference.copy();
7253        if (type != null) {
7254          dst.type = new ArrayList<TypeRefComponent>();
7255          for (TypeRefComponent i : type)
7256            dst.type.add(i.copy());
7257        };
7258        dst.defaultValue = defaultValue == null ? null : defaultValue.copy();
7259        dst.meaningWhenMissing = meaningWhenMissing == null ? null : meaningWhenMissing.copy();
7260        dst.orderMeaning = orderMeaning == null ? null : orderMeaning.copy();
7261        dst.fixed = fixed == null ? null : fixed.copy();
7262        dst.pattern = pattern == null ? null : pattern.copy();
7263        if (example != null) {
7264          dst.example = new ArrayList<ElementDefinitionExampleComponent>();
7265          for (ElementDefinitionExampleComponent i : example)
7266            dst.example.add(i.copy());
7267        };
7268        dst.minValue = minValue == null ? null : minValue.copy();
7269        dst.maxValue = maxValue == null ? null : maxValue.copy();
7270        dst.maxLength = maxLength == null ? null : maxLength.copy();
7271        if (condition != null) {
7272          dst.condition = new ArrayList<IdType>();
7273          for (IdType i : condition)
7274            dst.condition.add(i.copy());
7275        };
7276        if (constraint != null) {
7277          dst.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
7278          for (ElementDefinitionConstraintComponent i : constraint)
7279            dst.constraint.add(i.copy());
7280        };
7281        dst.mustSupport = mustSupport == null ? null : mustSupport.copy();
7282        dst.isModifier = isModifier == null ? null : isModifier.copy();
7283        dst.isModifierReason = isModifierReason == null ? null : isModifierReason.copy();
7284        dst.isSummary = isSummary == null ? null : isSummary.copy();
7285        dst.binding = binding == null ? null : binding.copy();
7286        if (mapping != null) {
7287          dst.mapping = new ArrayList<ElementDefinitionMappingComponent>();
7288          for (ElementDefinitionMappingComponent i : mapping)
7289            dst.mapping.add(i.copy());
7290        };
7291        return dst;
7292      }
7293
7294      protected ElementDefinition typedCopy() {
7295        return copy();
7296      }
7297
7298      @Override
7299      public boolean equalsDeep(Base other_) {
7300        if (!super.equalsDeep(other_))
7301          return false;
7302        if (!(other_ instanceof ElementDefinition))
7303          return false;
7304        ElementDefinition o = (ElementDefinition) other_;
7305        return compareDeep(path, o.path, true) && compareDeep(representation, o.representation, true) && compareDeep(sliceName, o.sliceName, true)
7306           && compareDeep(label, o.label, true) && compareDeep(code, o.code, true) && compareDeep(slicing, o.slicing, true)
7307           && compareDeep(short_, o.short_, true) && compareDeep(definition, o.definition, true) && compareDeep(comment, o.comment, true)
7308           && compareDeep(requirements, o.requirements, true) && compareDeep(alias, o.alias, true) && compareDeep(min, o.min, true)
7309           && compareDeep(max, o.max, true) && compareDeep(base, o.base, true) && compareDeep(contentReference, o.contentReference, true)
7310           && compareDeep(type, o.type, true) && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(meaningWhenMissing, o.meaningWhenMissing, true)
7311           && compareDeep(orderMeaning, o.orderMeaning, true) && compareDeep(fixed, o.fixed, true) && compareDeep(pattern, o.pattern, true)
7312           && compareDeep(example, o.example, true) && compareDeep(minValue, o.minValue, true) && compareDeep(maxValue, o.maxValue, true)
7313           && compareDeep(maxLength, o.maxLength, true) && compareDeep(condition, o.condition, true) && compareDeep(constraint, o.constraint, true)
7314           && compareDeep(mustSupport, o.mustSupport, true) && compareDeep(isModifier, o.isModifier, true)
7315           && compareDeep(isModifierReason, o.isModifierReason, true) && compareDeep(isSummary, o.isSummary, true)
7316           && compareDeep(binding, o.binding, true) && compareDeep(mapping, o.mapping, true);
7317      }
7318
7319      @Override
7320      public boolean equalsShallow(Base other_) {
7321        if (!super.equalsShallow(other_))
7322          return false;
7323        if (!(other_ instanceof ElementDefinition))
7324          return false;
7325        ElementDefinition o = (ElementDefinition) other_;
7326        return compareValues(path, o.path, true) && compareValues(representation, o.representation, true) && compareValues(sliceName, o.sliceName, true)
7327           && compareValues(label, o.label, true) && compareValues(short_, o.short_, true) && compareValues(definition, o.definition, true)
7328           && compareValues(comment, o.comment, true) && compareValues(requirements, o.requirements, true) && compareValues(alias, o.alias, true)
7329           && compareValues(min, o.min, true) && compareValues(max, o.max, true) && compareValues(contentReference, o.contentReference, true)
7330           && compareValues(meaningWhenMissing, o.meaningWhenMissing, true) && compareValues(orderMeaning, o.orderMeaning, true)
7331           && compareValues(maxLength, o.maxLength, true) && compareValues(condition, o.condition, true) && compareValues(mustSupport, o.mustSupport, true)
7332           && compareValues(isModifier, o.isModifier, true) && compareValues(isModifierReason, o.isModifierReason, true)
7333           && compareValues(isSummary, o.isSummary, true);
7334      }
7335
7336      public boolean isEmpty() {
7337        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(path, representation, sliceName
7338          , label, code, slicing, short_, definition, comment, requirements, alias, min
7339          , max, base, contentReference, type, defaultValue, meaningWhenMissing, orderMeaning
7340          , fixed, pattern, example, minValue, maxValue, maxLength, condition, constraint
7341          , mustSupport, isModifier, isModifierReason, isSummary, binding, mapping);
7342      }
7343
7344// added from java-adornments.txt:
7345  
7346  public String toString() {
7347    if (hasId())
7348      return getId();
7349    if (hasSliceName())
7350      return getPath()+":"+getSliceName();
7351    else
7352      return getPath();
7353  }
7354    
7355  public void makeBase(String path, int min, String max) {
7356    ElementDefinitionBaseComponent self = getBase();
7357    self.setPath(path);
7358    self.setMin(min);
7359    self.setMax(max);
7360  }
7361  
7362  public void makeBase() {
7363    ElementDefinitionBaseComponent self = getBase();
7364    self.setPath(getPath());
7365    self.setMin(getMin());
7366    self.setMax(getMax());
7367  }
7368  
7369  
7370  
7371  public String typeSummary() {
7372    CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
7373    for (TypeRefComponent tr : type) {
7374      if (tr.hasCode())
7375        b.append(tr.getCode());
7376    }
7377    return b.toString();
7378   }
7379  
7380  public TypeRefComponent getType(String code) {
7381    for (TypeRefComponent tr : getType()) 
7382      if (tr.getCode().equals(code))
7383        return tr;
7384    TypeRefComponent tr = new TypeRefComponent();
7385    tr.setCode(code);
7386    type.add(tr);
7387    return tr;
7388  }
7389
7390  public static final boolean NOT_MODIFIER = false;
7391  public static final boolean NOT_IN_SUMMARY = false;
7392  public static final boolean IS_MODIFIER = true;
7393  public static final boolean IS_IN_SUMMARY = true;
7394  public ElementDefinition(boolean defaults, boolean modifier, boolean inSummary) {
7395    super();
7396    if (defaults) {
7397      setIsModifier(modifier);
7398      setIsSummary(inSummary);
7399    }
7400  }  
7401
7402
7403// end addition
7404
7405}
7406