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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.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" or "canonical", 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/canonical target - one must apply", formalDefinition="Used when the type is \"Reference\" or \"canonical\", 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" or "canonical", 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" or "canonical", 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" or "canonical", 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" or "canonical", 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\" or \"canonical\", 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\" or \"canonical\", 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("valueExpression")) {
2637          this.value = new Expression();
2638          return this.value;
2639        }
2640        else if (name.equals("valueUsageContext")) {
2641          this.value = new UsageContext();
2642          return this.value;
2643        }
2644        else if (name.equals("valueDosage")) {
2645          this.value = new Dosage();
2646          return this.value;
2647        }
2648        else
2649          return super.addChild(name);
2650      }
2651
2652      public ElementDefinitionExampleComponent copy() {
2653        ElementDefinitionExampleComponent dst = new ElementDefinitionExampleComponent();
2654        copyValues(dst);
2655        dst.label = label == null ? null : label.copy();
2656        dst.value = value == null ? null : value.copy();
2657        return dst;
2658      }
2659
2660      @Override
2661      public boolean equalsDeep(Base other_) {
2662        if (!super.equalsDeep(other_))
2663          return false;
2664        if (!(other_ instanceof ElementDefinitionExampleComponent))
2665          return false;
2666        ElementDefinitionExampleComponent o = (ElementDefinitionExampleComponent) other_;
2667        return compareDeep(label, o.label, true) && compareDeep(value, o.value, true);
2668      }
2669
2670      @Override
2671      public boolean equalsShallow(Base other_) {
2672        if (!super.equalsShallow(other_))
2673          return false;
2674        if (!(other_ instanceof ElementDefinitionExampleComponent))
2675          return false;
2676        ElementDefinitionExampleComponent o = (ElementDefinitionExampleComponent) other_;
2677        return compareValues(label, o.label, true);
2678      }
2679
2680      public boolean isEmpty() {
2681        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(label, value);
2682      }
2683
2684  public String fhirType() {
2685    return "ElementDefinition.example";
2686
2687  }
2688
2689  }
2690
2691    @Block()
2692    public static class ElementDefinitionConstraintComponent extends Element implements IBaseDatatypeElement {
2693        /**
2694         * Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.
2695         */
2696        @Child(name = "key", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2697        @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." )
2698        protected IdType key;
2699
2700        /**
2701         * Description of why this constraint is necessary or appropriate.
2702         */
2703        @Child(name = "requirements", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2704        @Description(shortDefinition="Why this constraint is necessary or appropriate", formalDefinition="Description of why this constraint is necessary or appropriate." )
2705        protected StringType requirements;
2706
2707        /**
2708         * Identifies the impact constraint violation has on the conformance of the instance.
2709         */
2710        @Child(name = "severity", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true)
2711        @Description(shortDefinition="error | warning", formalDefinition="Identifies the impact constraint violation has on the conformance of the instance." )
2712        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/constraint-severity")
2713        protected Enumeration<ConstraintSeverity> severity;
2714
2715        /**
2716         * Text that can be used to describe the constraint in messages identifying that the constraint has been violated.
2717         */
2718        @Child(name = "human", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=true)
2719        @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." )
2720        protected StringType human;
2721
2722        /**
2723         * A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.
2724         */
2725        @Child(name = "expression", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
2726        @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." )
2727        protected StringType expression;
2728
2729        /**
2730         * An XPath expression of constraint that can be executed to see if this constraint is met.
2731         */
2732        @Child(name = "xpath", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
2733        @Description(shortDefinition="XPath expression of constraint", formalDefinition="An XPath expression of constraint that can be executed to see if this constraint is met." )
2734        protected StringType xpath;
2735
2736        /**
2737         * A reference to the original source of the constraint, for traceability purposes.
2738         */
2739        @Child(name = "source", type = {CanonicalType.class}, order=7, min=0, max=1, modifier=false, summary=true)
2740        @Description(shortDefinition="Reference to original source of constraint", formalDefinition="A reference to the original source of the constraint, for traceability purposes." )
2741        protected CanonicalType source;
2742
2743        private static final long serialVersionUID = 1048354565L;
2744
2745    /**
2746     * Constructor
2747     */
2748      public ElementDefinitionConstraintComponent() {
2749        super();
2750      }
2751
2752    /**
2753     * Constructor
2754     */
2755      public ElementDefinitionConstraintComponent(IdType key, Enumeration<ConstraintSeverity> severity, StringType human) {
2756        super();
2757        this.key = key;
2758        this.severity = severity;
2759        this.human = human;
2760      }
2761
2762        /**
2763         * @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
2764         */
2765        public IdType getKeyElement() { 
2766          if (this.key == null)
2767            if (Configuration.errorOnAutoCreate())
2768              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.key");
2769            else if (Configuration.doAutoCreate())
2770              this.key = new IdType(); // bb
2771          return this.key;
2772        }
2773
2774        public boolean hasKeyElement() { 
2775          return this.key != null && !this.key.isEmpty();
2776        }
2777
2778        public boolean hasKey() { 
2779          return this.key != null && !this.key.isEmpty();
2780        }
2781
2782        /**
2783         * @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
2784         */
2785        public ElementDefinitionConstraintComponent setKeyElement(IdType value) { 
2786          this.key = value;
2787          return this;
2788        }
2789
2790        /**
2791         * @return Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.
2792         */
2793        public String getKey() { 
2794          return this.key == null ? null : this.key.getValue();
2795        }
2796
2797        /**
2798         * @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.
2799         */
2800        public ElementDefinitionConstraintComponent setKey(String value) { 
2801            if (this.key == null)
2802              this.key = new IdType();
2803            this.key.setValue(value);
2804          return this;
2805        }
2806
2807        /**
2808         * @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
2809         */
2810        public StringType getRequirementsElement() { 
2811          if (this.requirements == null)
2812            if (Configuration.errorOnAutoCreate())
2813              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.requirements");
2814            else if (Configuration.doAutoCreate())
2815              this.requirements = new StringType(); // bb
2816          return this.requirements;
2817        }
2818
2819        public boolean hasRequirementsElement() { 
2820          return this.requirements != null && !this.requirements.isEmpty();
2821        }
2822
2823        public boolean hasRequirements() { 
2824          return this.requirements != null && !this.requirements.isEmpty();
2825        }
2826
2827        /**
2828         * @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
2829         */
2830        public ElementDefinitionConstraintComponent setRequirementsElement(StringType value) { 
2831          this.requirements = value;
2832          return this;
2833        }
2834
2835        /**
2836         * @return Description of why this constraint is necessary or appropriate.
2837         */
2838        public String getRequirements() { 
2839          return this.requirements == null ? null : this.requirements.getValue();
2840        }
2841
2842        /**
2843         * @param value Description of why this constraint is necessary or appropriate.
2844         */
2845        public ElementDefinitionConstraintComponent setRequirements(String value) { 
2846          if (Utilities.noString(value))
2847            this.requirements = null;
2848          else {
2849            if (this.requirements == null)
2850              this.requirements = new StringType();
2851            this.requirements.setValue(value);
2852          }
2853          return this;
2854        }
2855
2856        /**
2857         * @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
2858         */
2859        public Enumeration<ConstraintSeverity> getSeverityElement() { 
2860          if (this.severity == null)
2861            if (Configuration.errorOnAutoCreate())
2862              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.severity");
2863            else if (Configuration.doAutoCreate())
2864              this.severity = new Enumeration<ConstraintSeverity>(new ConstraintSeverityEnumFactory()); // bb
2865          return this.severity;
2866        }
2867
2868        public boolean hasSeverityElement() { 
2869          return this.severity != null && !this.severity.isEmpty();
2870        }
2871
2872        public boolean hasSeverity() { 
2873          return this.severity != null && !this.severity.isEmpty();
2874        }
2875
2876        /**
2877         * @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
2878         */
2879        public ElementDefinitionConstraintComponent setSeverityElement(Enumeration<ConstraintSeverity> value) { 
2880          this.severity = value;
2881          return this;
2882        }
2883
2884        /**
2885         * @return Identifies the impact constraint violation has on the conformance of the instance.
2886         */
2887        public ConstraintSeverity getSeverity() { 
2888          return this.severity == null ? null : this.severity.getValue();
2889        }
2890
2891        /**
2892         * @param value Identifies the impact constraint violation has on the conformance of the instance.
2893         */
2894        public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) { 
2895            if (this.severity == null)
2896              this.severity = new Enumeration<ConstraintSeverity>(new ConstraintSeverityEnumFactory());
2897            this.severity.setValue(value);
2898          return this;
2899        }
2900
2901        /**
2902         * @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
2903         */
2904        public StringType getHumanElement() { 
2905          if (this.human == null)
2906            if (Configuration.errorOnAutoCreate())
2907              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.human");
2908            else if (Configuration.doAutoCreate())
2909              this.human = new StringType(); // bb
2910          return this.human;
2911        }
2912
2913        public boolean hasHumanElement() { 
2914          return this.human != null && !this.human.isEmpty();
2915        }
2916
2917        public boolean hasHuman() { 
2918          return this.human != null && !this.human.isEmpty();
2919        }
2920
2921        /**
2922         * @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
2923         */
2924        public ElementDefinitionConstraintComponent setHumanElement(StringType value) { 
2925          this.human = value;
2926          return this;
2927        }
2928
2929        /**
2930         * @return Text that can be used to describe the constraint in messages identifying that the constraint has been violated.
2931         */
2932        public String getHuman() { 
2933          return this.human == null ? null : this.human.getValue();
2934        }
2935
2936        /**
2937         * @param value Text that can be used to describe the constraint in messages identifying that the constraint has been violated.
2938         */
2939        public ElementDefinitionConstraintComponent setHuman(String value) { 
2940            if (this.human == null)
2941              this.human = new StringType();
2942            this.human.setValue(value);
2943          return this;
2944        }
2945
2946        /**
2947         * @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
2948         */
2949        public StringType getExpressionElement() { 
2950          if (this.expression == null)
2951            if (Configuration.errorOnAutoCreate())
2952              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.expression");
2953            else if (Configuration.doAutoCreate())
2954              this.expression = new StringType(); // bb
2955          return this.expression;
2956        }
2957
2958        public boolean hasExpressionElement() { 
2959          return this.expression != null && !this.expression.isEmpty();
2960        }
2961
2962        public boolean hasExpression() { 
2963          return this.expression != null && !this.expression.isEmpty();
2964        }
2965
2966        /**
2967         * @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
2968         */
2969        public ElementDefinitionConstraintComponent setExpressionElement(StringType value) { 
2970          this.expression = value;
2971          return this;
2972        }
2973
2974        /**
2975         * @return A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.
2976         */
2977        public String getExpression() { 
2978          return this.expression == null ? null : this.expression.getValue();
2979        }
2980
2981        /**
2982         * @param value A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.
2983         */
2984        public ElementDefinitionConstraintComponent setExpression(String value) { 
2985          if (Utilities.noString(value))
2986            this.expression = null;
2987          else {
2988            if (this.expression == null)
2989              this.expression = new StringType();
2990            this.expression.setValue(value);
2991          }
2992          return this;
2993        }
2994
2995        /**
2996         * @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
2997         */
2998        public StringType getXpathElement() { 
2999          if (this.xpath == null)
3000            if (Configuration.errorOnAutoCreate())
3001              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.xpath");
3002            else if (Configuration.doAutoCreate())
3003              this.xpath = new StringType(); // bb
3004          return this.xpath;
3005        }
3006
3007        public boolean hasXpathElement() { 
3008          return this.xpath != null && !this.xpath.isEmpty();
3009        }
3010
3011        public boolean hasXpath() { 
3012          return this.xpath != null && !this.xpath.isEmpty();
3013        }
3014
3015        /**
3016         * @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
3017         */
3018        public ElementDefinitionConstraintComponent setXpathElement(StringType value) { 
3019          this.xpath = value;
3020          return this;
3021        }
3022
3023        /**
3024         * @return An XPath expression of constraint that can be executed to see if this constraint is met.
3025         */
3026        public String getXpath() { 
3027          return this.xpath == null ? null : this.xpath.getValue();
3028        }
3029
3030        /**
3031         * @param value An XPath expression of constraint that can be executed to see if this constraint is met.
3032         */
3033        public ElementDefinitionConstraintComponent setXpath(String value) { 
3034          if (Utilities.noString(value))
3035            this.xpath = null;
3036          else {
3037            if (this.xpath == null)
3038              this.xpath = new StringType();
3039            this.xpath.setValue(value);
3040          }
3041          return this;
3042        }
3043
3044        /**
3045         * @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
3046         */
3047        public CanonicalType getSourceElement() { 
3048          if (this.source == null)
3049            if (Configuration.errorOnAutoCreate())
3050              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.source");
3051            else if (Configuration.doAutoCreate())
3052              this.source = new CanonicalType(); // bb
3053          return this.source;
3054        }
3055
3056        public boolean hasSourceElement() { 
3057          return this.source != null && !this.source.isEmpty();
3058        }
3059
3060        public boolean hasSource() { 
3061          return this.source != null && !this.source.isEmpty();
3062        }
3063
3064        /**
3065         * @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
3066         */
3067        public ElementDefinitionConstraintComponent setSourceElement(CanonicalType value) { 
3068          this.source = value;
3069          return this;
3070        }
3071
3072        /**
3073         * @return A reference to the original source of the constraint, for traceability purposes.
3074         */
3075        public String getSource() { 
3076          return this.source == null ? null : this.source.getValue();
3077        }
3078
3079        /**
3080         * @param value A reference to the original source of the constraint, for traceability purposes.
3081         */
3082        public ElementDefinitionConstraintComponent setSource(String value) { 
3083          if (Utilities.noString(value))
3084            this.source = null;
3085          else {
3086            if (this.source == null)
3087              this.source = new CanonicalType();
3088            this.source.setValue(value);
3089          }
3090          return this;
3091        }
3092
3093        protected void listChildren(List<Property> children) {
3094          super.listChildren(children);
3095          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));
3096          children.add(new Property("requirements", "string", "Description of why this constraint is necessary or appropriate.", 0, 1, requirements));
3097          children.add(new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, 1, severity));
3098          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));
3099          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));
3100          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));
3101          children.add(new Property("source", "canonical(StructureDefinition)", "A reference to the original source of the constraint, for traceability purposes.", 0, 1, source));
3102        }
3103
3104        @Override
3105        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3106          switch (_hash) {
3107          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);
3108          case -1619874672: /*requirements*/  return new Property("requirements", "string", "Description of why this constraint is necessary or appropriate.", 0, 1, requirements);
3109          case 1478300413: /*severity*/  return new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, 1, severity);
3110          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);
3111          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);
3112          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);
3113          case -896505829: /*source*/  return new Property("source", "canonical(StructureDefinition)", "A reference to the original source of the constraint, for traceability purposes.", 0, 1, source);
3114          default: return super.getNamedProperty(_hash, _name, _checkValid);
3115          }
3116
3117        }
3118
3119      @Override
3120      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3121        switch (hash) {
3122        case 106079: /*key*/ return this.key == null ? new Base[0] : new Base[] {this.key}; // IdType
3123        case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType
3124        case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration<ConstraintSeverity>
3125        case 99639597: /*human*/ return this.human == null ? new Base[0] : new Base[] {this.human}; // StringType
3126        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType
3127        case 114256029: /*xpath*/ return this.xpath == null ? new Base[0] : new Base[] {this.xpath}; // StringType
3128        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // CanonicalType
3129        default: return super.getProperty(hash, name, checkValid);
3130        }
3131
3132      }
3133
3134      @Override
3135      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3136        switch (hash) {
3137        case 106079: // key
3138          this.key = castToId(value); // IdType
3139          return value;
3140        case -1619874672: // requirements
3141          this.requirements = castToString(value); // StringType
3142          return value;
3143        case 1478300413: // severity
3144          value = new ConstraintSeverityEnumFactory().fromType(castToCode(value));
3145          this.severity = (Enumeration) value; // Enumeration<ConstraintSeverity>
3146          return value;
3147        case 99639597: // human
3148          this.human = castToString(value); // StringType
3149          return value;
3150        case -1795452264: // expression
3151          this.expression = castToString(value); // StringType
3152          return value;
3153        case 114256029: // xpath
3154          this.xpath = castToString(value); // StringType
3155          return value;
3156        case -896505829: // source
3157          this.source = castToCanonical(value); // CanonicalType
3158          return value;
3159        default: return super.setProperty(hash, name, value);
3160        }
3161
3162      }
3163
3164      @Override
3165      public Base setProperty(String name, Base value) throws FHIRException {
3166        if (name.equals("key")) {
3167          this.key = castToId(value); // IdType
3168        } else if (name.equals("requirements")) {
3169          this.requirements = castToString(value); // StringType
3170        } else if (name.equals("severity")) {
3171          value = new ConstraintSeverityEnumFactory().fromType(castToCode(value));
3172          this.severity = (Enumeration) value; // Enumeration<ConstraintSeverity>
3173        } else if (name.equals("human")) {
3174          this.human = castToString(value); // StringType
3175        } else if (name.equals("expression")) {
3176          this.expression = castToString(value); // StringType
3177        } else if (name.equals("xpath")) {
3178          this.xpath = castToString(value); // StringType
3179        } else if (name.equals("source")) {
3180          this.source = castToCanonical(value); // CanonicalType
3181        } else
3182          return super.setProperty(name, value);
3183        return value;
3184      }
3185
3186      @Override
3187      public Base makeProperty(int hash, String name) throws FHIRException {
3188        switch (hash) {
3189        case 106079:  return getKeyElement();
3190        case -1619874672:  return getRequirementsElement();
3191        case 1478300413:  return getSeverityElement();
3192        case 99639597:  return getHumanElement();
3193        case -1795452264:  return getExpressionElement();
3194        case 114256029:  return getXpathElement();
3195        case -896505829:  return getSourceElement();
3196        default: return super.makeProperty(hash, name);
3197        }
3198
3199      }
3200
3201      @Override
3202      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3203        switch (hash) {
3204        case 106079: /*key*/ return new String[] {"id"};
3205        case -1619874672: /*requirements*/ return new String[] {"string"};
3206        case 1478300413: /*severity*/ return new String[] {"code"};
3207        case 99639597: /*human*/ return new String[] {"string"};
3208        case -1795452264: /*expression*/ return new String[] {"string"};
3209        case 114256029: /*xpath*/ return new String[] {"string"};
3210        case -896505829: /*source*/ return new String[] {"canonical"};
3211        default: return super.getTypesForProperty(hash, name);
3212        }
3213
3214      }
3215
3216      @Override
3217      public Base addChild(String name) throws FHIRException {
3218        if (name.equals("key")) {
3219          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.key");
3220        }
3221        else if (name.equals("requirements")) {
3222          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.requirements");
3223        }
3224        else if (name.equals("severity")) {
3225          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.severity");
3226        }
3227        else if (name.equals("human")) {
3228          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.human");
3229        }
3230        else if (name.equals("expression")) {
3231          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.expression");
3232        }
3233        else if (name.equals("xpath")) {
3234          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.xpath");
3235        }
3236        else if (name.equals("source")) {
3237          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.source");
3238        }
3239        else
3240          return super.addChild(name);
3241      }
3242
3243      public ElementDefinitionConstraintComponent copy() {
3244        ElementDefinitionConstraintComponent dst = new ElementDefinitionConstraintComponent();
3245        copyValues(dst);
3246        dst.key = key == null ? null : key.copy();
3247        dst.requirements = requirements == null ? null : requirements.copy();
3248        dst.severity = severity == null ? null : severity.copy();
3249        dst.human = human == null ? null : human.copy();
3250        dst.expression = expression == null ? null : expression.copy();
3251        dst.xpath = xpath == null ? null : xpath.copy();
3252        dst.source = source == null ? null : source.copy();
3253        return dst;
3254      }
3255
3256      @Override
3257      public boolean equalsDeep(Base other_) {
3258        if (!super.equalsDeep(other_))
3259          return false;
3260        if (!(other_ instanceof ElementDefinitionConstraintComponent))
3261          return false;
3262        ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other_;
3263        return compareDeep(key, o.key, true) && compareDeep(requirements, o.requirements, true) && compareDeep(severity, o.severity, true)
3264           && compareDeep(human, o.human, true) && compareDeep(expression, o.expression, true) && compareDeep(xpath, o.xpath, true)
3265           && compareDeep(source, o.source, true);
3266      }
3267
3268      @Override
3269      public boolean equalsShallow(Base other_) {
3270        if (!super.equalsShallow(other_))
3271          return false;
3272        if (!(other_ instanceof ElementDefinitionConstraintComponent))
3273          return false;
3274        ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other_;
3275        return compareValues(key, o.key, true) && compareValues(requirements, o.requirements, true) && compareValues(severity, o.severity, true)
3276           && compareValues(human, o.human, true) && compareValues(expression, o.expression, true) && compareValues(xpath, o.xpath, true)
3277          ;
3278      }
3279
3280      public boolean isEmpty() {
3281        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(key, requirements, severity
3282          , human, expression, xpath, source);
3283      }
3284
3285  public String fhirType() {
3286    return "ElementDefinition.constraint";
3287
3288  }
3289
3290  }
3291
3292    @Block()
3293    public static class ElementDefinitionBindingComponent extends Element implements IBaseDatatypeElement {
3294        /**
3295         * 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.
3296         */
3297        @Child(name = "strength", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
3298        @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." )
3299        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/binding-strength")
3300        protected Enumeration<BindingStrength> strength;
3301
3302        /**
3303         * Describes the intended use of this particular set of codes.
3304         */
3305        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
3306        @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." )
3307        protected StringType description;
3308
3309        /**
3310         * Refers to the value set that identifies the set of codes the binding refers to.
3311         */
3312        @Child(name = "valueSet", type = {CanonicalType.class}, order=3, min=0, max=1, modifier=false, summary=true)
3313        @Description(shortDefinition="Source of value set", formalDefinition="Refers to the value set that identifies the set of codes the binding refers to." )
3314        protected CanonicalType valueSet;
3315
3316        private static final long serialVersionUID = -514477030L;
3317
3318    /**
3319     * Constructor
3320     */
3321      public ElementDefinitionBindingComponent() {
3322        super();
3323      }
3324
3325    /**
3326     * Constructor
3327     */
3328      public ElementDefinitionBindingComponent(Enumeration<BindingStrength> strength) {
3329        super();
3330        this.strength = strength;
3331      }
3332
3333        /**
3334         * @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
3335         */
3336        public Enumeration<BindingStrength> getStrengthElement() { 
3337          if (this.strength == null)
3338            if (Configuration.errorOnAutoCreate())
3339              throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.strength");
3340            else if (Configuration.doAutoCreate())
3341              this.strength = new Enumeration<BindingStrength>(new BindingStrengthEnumFactory()); // bb
3342          return this.strength;
3343        }
3344
3345        public boolean hasStrengthElement() { 
3346          return this.strength != null && !this.strength.isEmpty();
3347        }
3348
3349        public boolean hasStrength() { 
3350          return this.strength != null && !this.strength.isEmpty();
3351        }
3352
3353        /**
3354         * @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
3355         */
3356        public ElementDefinitionBindingComponent setStrengthElement(Enumeration<BindingStrength> value) { 
3357          this.strength = value;
3358          return this;
3359        }
3360
3361        /**
3362         * @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.
3363         */
3364        public BindingStrength getStrength() { 
3365          return this.strength == null ? null : this.strength.getValue();
3366        }
3367
3368        /**
3369         * @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.
3370         */
3371        public ElementDefinitionBindingComponent setStrength(BindingStrength value) { 
3372            if (this.strength == null)
3373              this.strength = new Enumeration<BindingStrength>(new BindingStrengthEnumFactory());
3374            this.strength.setValue(value);
3375          return this;
3376        }
3377
3378        /**
3379         * @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
3380         */
3381        public StringType getDescriptionElement() { 
3382          if (this.description == null)
3383            if (Configuration.errorOnAutoCreate())
3384              throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.description");
3385            else if (Configuration.doAutoCreate())
3386              this.description = new StringType(); // bb
3387          return this.description;
3388        }
3389
3390        public boolean hasDescriptionElement() { 
3391          return this.description != null && !this.description.isEmpty();
3392        }
3393
3394        public boolean hasDescription() { 
3395          return this.description != null && !this.description.isEmpty();
3396        }
3397
3398        /**
3399         * @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
3400         */
3401        public ElementDefinitionBindingComponent setDescriptionElement(StringType value) { 
3402          this.description = value;
3403          return this;
3404        }
3405
3406        /**
3407         * @return Describes the intended use of this particular set of codes.
3408         */
3409        public String getDescription() { 
3410          return this.description == null ? null : this.description.getValue();
3411        }
3412
3413        /**
3414         * @param value Describes the intended use of this particular set of codes.
3415         */
3416        public ElementDefinitionBindingComponent setDescription(String value) { 
3417          if (Utilities.noString(value))
3418            this.description = null;
3419          else {
3420            if (this.description == null)
3421              this.description = new StringType();
3422            this.description.setValue(value);
3423          }
3424          return this;
3425        }
3426
3427        /**
3428         * @return {@link #valueSet} (Refers to the value set that identifies the set of codes the binding refers to.). This is the underlying object with id, value and extensions. The accessor "getValueSet" gives direct access to the value
3429         */
3430        public CanonicalType getValueSetElement() { 
3431          if (this.valueSet == null)
3432            if (Configuration.errorOnAutoCreate())
3433              throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.valueSet");
3434            else if (Configuration.doAutoCreate())
3435              this.valueSet = new CanonicalType(); // bb
3436          return this.valueSet;
3437        }
3438
3439        public boolean hasValueSetElement() { 
3440          return this.valueSet != null && !this.valueSet.isEmpty();
3441        }
3442
3443        public boolean hasValueSet() { 
3444          return this.valueSet != null && !this.valueSet.isEmpty();
3445        }
3446
3447        /**
3448         * @param value {@link #valueSet} (Refers to the value set that identifies the set of codes the binding refers to.). This is the underlying object with id, value and extensions. The accessor "getValueSet" gives direct access to the value
3449         */
3450        public ElementDefinitionBindingComponent setValueSetElement(CanonicalType value) { 
3451          this.valueSet = value;
3452          return this;
3453        }
3454
3455        /**
3456         * @return Refers to the value set that identifies the set of codes the binding refers to.
3457         */
3458        public String getValueSet() { 
3459          return this.valueSet == null ? null : this.valueSet.getValue();
3460        }
3461
3462        /**
3463         * @param value Refers to the value set that identifies the set of codes the binding refers to.
3464         */
3465        public ElementDefinitionBindingComponent setValueSet(String value) { 
3466          if (Utilities.noString(value))
3467            this.valueSet = null;
3468          else {
3469            if (this.valueSet == null)
3470              this.valueSet = new CanonicalType();
3471            this.valueSet.setValue(value);
3472          }
3473          return this;
3474        }
3475
3476        protected void listChildren(List<Property> children) {
3477          super.listChildren(children);
3478          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));
3479          children.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, 1, description));
3480          children.add(new Property("valueSet", "canonical(ValueSet)", "Refers to the value set that identifies the set of codes the binding refers to.", 0, 1, valueSet));
3481        }
3482
3483        @Override
3484        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3485          switch (_hash) {
3486          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);
3487          case -1724546052: /*description*/  return new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, 1, description);
3488          case -1410174671: /*valueSet*/  return new Property("valueSet", "canonical(ValueSet)", "Refers to the value set that identifies the set of codes the binding refers to.", 0, 1, valueSet);
3489          default: return super.getNamedProperty(_hash, _name, _checkValid);
3490          }
3491
3492        }
3493
3494      @Override
3495      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3496        switch (hash) {
3497        case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : new Base[] {this.strength}; // Enumeration<BindingStrength>
3498        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
3499        case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // CanonicalType
3500        default: return super.getProperty(hash, name, checkValid);
3501        }
3502
3503      }
3504
3505      @Override
3506      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3507        switch (hash) {
3508        case 1791316033: // strength
3509          value = new BindingStrengthEnumFactory().fromType(castToCode(value));
3510          this.strength = (Enumeration) value; // Enumeration<BindingStrength>
3511          return value;
3512        case -1724546052: // description
3513          this.description = castToString(value); // StringType
3514          return value;
3515        case -1410174671: // valueSet
3516          this.valueSet = castToCanonical(value); // CanonicalType
3517          return value;
3518        default: return super.setProperty(hash, name, value);
3519        }
3520
3521      }
3522
3523      @Override
3524      public Base setProperty(String name, Base value) throws FHIRException {
3525        if (name.equals("strength")) {
3526          value = new BindingStrengthEnumFactory().fromType(castToCode(value));
3527          this.strength = (Enumeration) value; // Enumeration<BindingStrength>
3528        } else if (name.equals("description")) {
3529          this.description = castToString(value); // StringType
3530        } else if (name.equals("valueSet")) {
3531          this.valueSet = castToCanonical(value); // CanonicalType
3532        } else
3533          return super.setProperty(name, value);
3534        return value;
3535      }
3536
3537      @Override
3538      public Base makeProperty(int hash, String name) throws FHIRException {
3539        switch (hash) {
3540        case 1791316033:  return getStrengthElement();
3541        case -1724546052:  return getDescriptionElement();
3542        case -1410174671:  return getValueSetElement();
3543        default: return super.makeProperty(hash, name);
3544        }
3545
3546      }
3547
3548      @Override
3549      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3550        switch (hash) {
3551        case 1791316033: /*strength*/ return new String[] {"code"};
3552        case -1724546052: /*description*/ return new String[] {"string"};
3553        case -1410174671: /*valueSet*/ return new String[] {"canonical"};
3554        default: return super.getTypesForProperty(hash, name);
3555        }
3556
3557      }
3558
3559      @Override
3560      public Base addChild(String name) throws FHIRException {
3561        if (name.equals("strength")) {
3562          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.strength");
3563        }
3564        else if (name.equals("description")) {
3565          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.description");
3566        }
3567        else if (name.equals("valueSet")) {
3568          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.valueSet");
3569        }
3570        else
3571          return super.addChild(name);
3572      }
3573
3574      public ElementDefinitionBindingComponent copy() {
3575        ElementDefinitionBindingComponent dst = new ElementDefinitionBindingComponent();
3576        copyValues(dst);
3577        dst.strength = strength == null ? null : strength.copy();
3578        dst.description = description == null ? null : description.copy();
3579        dst.valueSet = valueSet == null ? null : valueSet.copy();
3580        return dst;
3581      }
3582
3583      @Override
3584      public boolean equalsDeep(Base other_) {
3585        if (!super.equalsDeep(other_))
3586          return false;
3587        if (!(other_ instanceof ElementDefinitionBindingComponent))
3588          return false;
3589        ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other_;
3590        return compareDeep(strength, o.strength, true) && compareDeep(description, o.description, true)
3591           && compareDeep(valueSet, o.valueSet, true);
3592      }
3593
3594      @Override
3595      public boolean equalsShallow(Base other_) {
3596        if (!super.equalsShallow(other_))
3597          return false;
3598        if (!(other_ instanceof ElementDefinitionBindingComponent))
3599          return false;
3600        ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other_;
3601        return compareValues(strength, o.strength, true) && compareValues(description, o.description, true)
3602          ;
3603      }
3604
3605      public boolean isEmpty() {
3606        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(strength, description, valueSet
3607          );
3608      }
3609
3610  public String fhirType() {
3611    return "ElementDefinition.binding";
3612
3613  }
3614
3615  }
3616
3617    @Block()
3618    public static class ElementDefinitionMappingComponent extends Element implements IBaseDatatypeElement {
3619        /**
3620         * An internal reference to the definition of a mapping.
3621         */
3622        @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
3623        @Description(shortDefinition="Reference to mapping declaration", formalDefinition="An internal reference to the definition of a mapping." )
3624        protected IdType identity;
3625
3626        /**
3627         * Identifies the computable language in which mapping.map is expressed.
3628         */
3629        @Child(name = "language", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
3630        @Description(shortDefinition="Computable language of mapping", formalDefinition="Identifies the computable language in which mapping.map is expressed." )
3631        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/mimetypes")
3632        protected CodeType language;
3633
3634        /**
3635         * Expresses what part of the target specification corresponds to this element.
3636         */
3637        @Child(name = "map", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true)
3638        @Description(shortDefinition="Details of the mapping", formalDefinition="Expresses what part of the target specification corresponds to this element." )
3639        protected StringType map;
3640
3641        /**
3642         * Comments that provide information about the mapping or its use.
3643         */
3644        @Child(name = "comment", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
3645        @Description(shortDefinition="Comments about the mapping or its use", formalDefinition="Comments that provide information about the mapping or its use." )
3646        protected StringType comment;
3647
3648        private static final long serialVersionUID = 1386816887L;
3649
3650    /**
3651     * Constructor
3652     */
3653      public ElementDefinitionMappingComponent() {
3654        super();
3655      }
3656
3657    /**
3658     * Constructor
3659     */
3660      public ElementDefinitionMappingComponent(IdType identity, StringType map) {
3661        super();
3662        this.identity = identity;
3663        this.map = map;
3664      }
3665
3666        /**
3667         * @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
3668         */
3669        public IdType getIdentityElement() { 
3670          if (this.identity == null)
3671            if (Configuration.errorOnAutoCreate())
3672              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.identity");
3673            else if (Configuration.doAutoCreate())
3674              this.identity = new IdType(); // bb
3675          return this.identity;
3676        }
3677
3678        public boolean hasIdentityElement() { 
3679          return this.identity != null && !this.identity.isEmpty();
3680        }
3681
3682        public boolean hasIdentity() { 
3683          return this.identity != null && !this.identity.isEmpty();
3684        }
3685
3686        /**
3687         * @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
3688         */
3689        public ElementDefinitionMappingComponent setIdentityElement(IdType value) { 
3690          this.identity = value;
3691          return this;
3692        }
3693
3694        /**
3695         * @return An internal reference to the definition of a mapping.
3696         */
3697        public String getIdentity() { 
3698          return this.identity == null ? null : this.identity.getValue();
3699        }
3700
3701        /**
3702         * @param value An internal reference to the definition of a mapping.
3703         */
3704        public ElementDefinitionMappingComponent setIdentity(String value) { 
3705            if (this.identity == null)
3706              this.identity = new IdType();
3707            this.identity.setValue(value);
3708          return this;
3709        }
3710
3711        /**
3712         * @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
3713         */
3714        public CodeType getLanguageElement() { 
3715          if (this.language == null)
3716            if (Configuration.errorOnAutoCreate())
3717              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.language");
3718            else if (Configuration.doAutoCreate())
3719              this.language = new CodeType(); // bb
3720          return this.language;
3721        }
3722
3723        public boolean hasLanguageElement() { 
3724          return this.language != null && !this.language.isEmpty();
3725        }
3726
3727        public boolean hasLanguage() { 
3728          return this.language != null && !this.language.isEmpty();
3729        }
3730
3731        /**
3732         * @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
3733         */
3734        public ElementDefinitionMappingComponent setLanguageElement(CodeType value) { 
3735          this.language = value;
3736          return this;
3737        }
3738
3739        /**
3740         * @return Identifies the computable language in which mapping.map is expressed.
3741         */
3742        public String getLanguage() { 
3743          return this.language == null ? null : this.language.getValue();
3744        }
3745
3746        /**
3747         * @param value Identifies the computable language in which mapping.map is expressed.
3748         */
3749        public ElementDefinitionMappingComponent setLanguage(String value) { 
3750          if (Utilities.noString(value))
3751            this.language = null;
3752          else {
3753            if (this.language == null)
3754              this.language = new CodeType();
3755            this.language.setValue(value);
3756          }
3757          return this;
3758        }
3759
3760        /**
3761         * @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
3762         */
3763        public StringType getMapElement() { 
3764          if (this.map == null)
3765            if (Configuration.errorOnAutoCreate())
3766              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.map");
3767            else if (Configuration.doAutoCreate())
3768              this.map = new StringType(); // bb
3769          return this.map;
3770        }
3771
3772        public boolean hasMapElement() { 
3773          return this.map != null && !this.map.isEmpty();
3774        }
3775
3776        public boolean hasMap() { 
3777          return this.map != null && !this.map.isEmpty();
3778        }
3779
3780        /**
3781         * @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
3782         */
3783        public ElementDefinitionMappingComponent setMapElement(StringType value) { 
3784          this.map = value;
3785          return this;
3786        }
3787
3788        /**
3789         * @return Expresses what part of the target specification corresponds to this element.
3790         */
3791        public String getMap() { 
3792          return this.map == null ? null : this.map.getValue();
3793        }
3794
3795        /**
3796         * @param value Expresses what part of the target specification corresponds to this element.
3797         */
3798        public ElementDefinitionMappingComponent setMap(String value) { 
3799            if (this.map == null)
3800              this.map = new StringType();
3801            this.map.setValue(value);
3802          return this;
3803        }
3804
3805        /**
3806         * @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
3807         */
3808        public StringType getCommentElement() { 
3809          if (this.comment == null)
3810            if (Configuration.errorOnAutoCreate())
3811              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.comment");
3812            else if (Configuration.doAutoCreate())
3813              this.comment = new StringType(); // bb
3814          return this.comment;
3815        }
3816
3817        public boolean hasCommentElement() { 
3818          return this.comment != null && !this.comment.isEmpty();
3819        }
3820
3821        public boolean hasComment() { 
3822          return this.comment != null && !this.comment.isEmpty();
3823        }
3824
3825        /**
3826         * @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
3827         */
3828        public ElementDefinitionMappingComponent setCommentElement(StringType value) { 
3829          this.comment = value;
3830          return this;
3831        }
3832
3833        /**
3834         * @return Comments that provide information about the mapping or its use.
3835         */
3836        public String getComment() { 
3837          return this.comment == null ? null : this.comment.getValue();
3838        }
3839
3840        /**
3841         * @param value Comments that provide information about the mapping or its use.
3842         */
3843        public ElementDefinitionMappingComponent setComment(String value) { 
3844          if (Utilities.noString(value))
3845            this.comment = null;
3846          else {
3847            if (this.comment == null)
3848              this.comment = new StringType();
3849            this.comment.setValue(value);
3850          }
3851          return this;
3852        }
3853
3854        protected void listChildren(List<Property> children) {
3855          super.listChildren(children);
3856          children.add(new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, 1, identity));
3857          children.add(new Property("language", "code", "Identifies the computable language in which mapping.map is expressed.", 0, 1, language));
3858          children.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, 1, map));
3859          children.add(new Property("comment", "string", "Comments that provide information about the mapping or its use.", 0, 1, comment));
3860        }
3861
3862        @Override
3863        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3864          switch (_hash) {
3865          case -135761730: /*identity*/  return new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, 1, identity);
3866          case -1613589672: /*language*/  return new Property("language", "code", "Identifies the computable language in which mapping.map is expressed.", 0, 1, language);
3867          case 107868: /*map*/  return new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, 1, map);
3868          case 950398559: /*comment*/  return new Property("comment", "string", "Comments that provide information about the mapping or its use.", 0, 1, comment);
3869          default: return super.getNamedProperty(_hash, _name, _checkValid);
3870          }
3871
3872        }
3873
3874      @Override
3875      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3876        switch (hash) {
3877        case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType
3878        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType
3879        case 107868: /*map*/ return this.map == null ? new Base[0] : new Base[] {this.map}; // StringType
3880        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
3881        default: return super.getProperty(hash, name, checkValid);
3882        }
3883
3884      }
3885
3886      @Override
3887      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3888        switch (hash) {
3889        case -135761730: // identity
3890          this.identity = castToId(value); // IdType
3891          return value;
3892        case -1613589672: // language
3893          this.language = castToCode(value); // CodeType
3894          return value;
3895        case 107868: // map
3896          this.map = castToString(value); // StringType
3897          return value;
3898        case 950398559: // comment
3899          this.comment = castToString(value); // StringType
3900          return value;
3901        default: return super.setProperty(hash, name, value);
3902        }
3903
3904      }
3905
3906      @Override
3907      public Base setProperty(String name, Base value) throws FHIRException {
3908        if (name.equals("identity")) {
3909          this.identity = castToId(value); // IdType
3910        } else if (name.equals("language")) {
3911          this.language = castToCode(value); // CodeType
3912        } else if (name.equals("map")) {
3913          this.map = castToString(value); // StringType
3914        } else if (name.equals("comment")) {
3915          this.comment = castToString(value); // StringType
3916        } else
3917          return super.setProperty(name, value);
3918        return value;
3919      }
3920
3921      @Override
3922      public Base makeProperty(int hash, String name) throws FHIRException {
3923        switch (hash) {
3924        case -135761730:  return getIdentityElement();
3925        case -1613589672:  return getLanguageElement();
3926        case 107868:  return getMapElement();
3927        case 950398559:  return getCommentElement();
3928        default: return super.makeProperty(hash, name);
3929        }
3930
3931      }
3932
3933      @Override
3934      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3935        switch (hash) {
3936        case -135761730: /*identity*/ return new String[] {"id"};
3937        case -1613589672: /*language*/ return new String[] {"code"};
3938        case 107868: /*map*/ return new String[] {"string"};
3939        case 950398559: /*comment*/ return new String[] {"string"};
3940        default: return super.getTypesForProperty(hash, name);
3941        }
3942
3943      }
3944
3945      @Override
3946      public Base addChild(String name) throws FHIRException {
3947        if (name.equals("identity")) {
3948          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.identity");
3949        }
3950        else if (name.equals("language")) {
3951          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.language");
3952        }
3953        else if (name.equals("map")) {
3954          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.map");
3955        }
3956        else if (name.equals("comment")) {
3957          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.comment");
3958        }
3959        else
3960          return super.addChild(name);
3961      }
3962
3963      public ElementDefinitionMappingComponent copy() {
3964        ElementDefinitionMappingComponent dst = new ElementDefinitionMappingComponent();
3965        copyValues(dst);
3966        dst.identity = identity == null ? null : identity.copy();
3967        dst.language = language == null ? null : language.copy();
3968        dst.map = map == null ? null : map.copy();
3969        dst.comment = comment == null ? null : comment.copy();
3970        return dst;
3971      }
3972
3973      @Override
3974      public boolean equalsDeep(Base other_) {
3975        if (!super.equalsDeep(other_))
3976          return false;
3977        if (!(other_ instanceof ElementDefinitionMappingComponent))
3978          return false;
3979        ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other_;
3980        return compareDeep(identity, o.identity, true) && compareDeep(language, o.language, true) && compareDeep(map, o.map, true)
3981           && compareDeep(comment, o.comment, true);
3982      }
3983
3984      @Override
3985      public boolean equalsShallow(Base other_) {
3986        if (!super.equalsShallow(other_))
3987          return false;
3988        if (!(other_ instanceof ElementDefinitionMappingComponent))
3989          return false;
3990        ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other_;
3991        return compareValues(identity, o.identity, true) && compareValues(language, o.language, true) && compareValues(map, o.map, true)
3992           && compareValues(comment, o.comment, true);
3993      }
3994
3995      public boolean isEmpty() {
3996        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identity, language, map
3997          , comment);
3998      }
3999
4000  public String fhirType() {
4001    return "ElementDefinition.mapping";
4002
4003  }
4004
4005  }
4006
4007    /**
4008     * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.
4009     */
4010    @Child(name = "path", type = {StringType.class}, order=0, min=1, max=1, modifier=false, summary=true)
4011    @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." )
4012    protected StringType path;
4013
4014    /**
4015     * Codes that define how this element is represented in instances, when the deviation varies from the normal case.
4016     */
4017    @Child(name = "representation", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4018    @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." )
4019    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/property-representation")
4020    protected List<Enumeration<PropertyRepresentation>> representation;
4021
4022    /**
4023     * 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.
4024     */
4025    @Child(name = "sliceName", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
4026    @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." )
4027    protected StringType sliceName;
4028
4029    /**
4030     * If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName.
4031     */
4032    @Child(name = "sliceIsConstraining", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true)
4033    @Description(shortDefinition="If this slice definition constrains an inherited slice definition (or not)", formalDefinition="If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName." )
4034    protected BooleanType sliceIsConstraining;
4035
4036    /**
4037     * 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.
4038     */
4039    @Child(name = "label", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
4040    @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." )
4041    protected StringType label;
4042
4043    /**
4044     * A code that has the same meaning as the element in a particular terminology.
4045     */
4046    @Child(name = "code", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4047    @Description(shortDefinition="Corresponding codes in terminologies", formalDefinition="A code that has the same meaning as the element in a particular terminology." )
4048    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-codes")
4049    protected List<Coding> code;
4050
4051    /**
4052     * 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).
4053     */
4054    @Child(name = "slicing", type = {}, order=6, min=0, max=1, modifier=false, summary=true)
4055    @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)." )
4056    protected ElementDefinitionSlicingComponent slicing;
4057
4058    /**
4059     * A concise description of what this element means (e.g. for use in autogenerated summaries).
4060     */
4061    @Child(name = "short", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
4062    @Description(shortDefinition="Concise definition for space-constrained presentation", formalDefinition="A concise description of what this element means (e.g. for use in autogenerated summaries)." )
4063    protected StringType short_;
4064
4065    /**
4066     * 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. (Note: The text you are reading is specified in ElementDefinition.definition).
4067     */
4068    @Child(name = "definition", type = {MarkdownType.class}, order=8, min=0, max=1, modifier=false, summary=true)
4069    @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. (Note: The text you are reading is specified in ElementDefinition.definition)." )
4070    protected MarkdownType definition;
4071
4072    /**
4073     * Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. (Note: The text you are reading is specified in ElementDefinition.comment).
4074     */
4075    @Child(name = "comment", type = {MarkdownType.class}, order=9, min=0, max=1, modifier=false, summary=true)
4076    @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. (Note: The text you are reading is specified in ElementDefinition.comment)." )
4077    protected MarkdownType comment;
4078
4079    /**
4080     * 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.
4081     */
4082    @Child(name = "requirements", type = {MarkdownType.class}, order=10, min=0, max=1, modifier=false, summary=true)
4083    @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." )
4084    protected MarkdownType requirements;
4085
4086    /**
4087     * Identifies additional names by which this element might also be known.
4088     */
4089    @Child(name = "alias", type = {StringType.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4090    @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." )
4091    protected List<StringType> alias;
4092
4093    /**
4094     * The minimum number of times this element SHALL appear in the instance.
4095     */
4096    @Child(name = "min", type = {UnsignedIntType.class}, order=12, min=0, max=1, modifier=false, summary=true)
4097    @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this element SHALL appear in the instance." )
4098    protected UnsignedIntType min;
4099
4100    /**
4101     * The maximum number of times this element is permitted to appear in the instance.
4102     */
4103    @Child(name = "max", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=true)
4104    @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the instance." )
4105    protected StringType max;
4106
4107    /**
4108     * 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.
4109     */
4110    @Child(name = "base", type = {}, order=14, min=0, max=1, modifier=false, summary=true)
4111    @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." )
4112    protected ElementDefinitionBaseComponent base;
4113
4114    /**
4115     * Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc.
4116     */
4117    @Child(name = "contentReference", type = {UriType.class}, order=15, min=0, max=1, modifier=false, summary=true)
4118    @Description(shortDefinition="Reference to definition of content for the element", formalDefinition="Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc." )
4119    protected UriType contentReference;
4120
4121    /**
4122     * The data type or resource that the value of this element is permitted to be.
4123     */
4124    @Child(name = "type", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4125    @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." )
4126    protected List<TypeRefComponent> type;
4127
4128    /**
4129     * 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').
4130     */
4131    @Child(name = "defaultValue", type = {}, order=17, min=0, max=1, modifier=false, summary=true)
4132    @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')." )
4133    protected org.hl7.fhir.r4.model.Type defaultValue;
4134
4135    /**
4136     * The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing').
4137     */
4138    @Child(name = "meaningWhenMissing", type = {MarkdownType.class}, order=18, min=0, max=1, modifier=false, summary=true)
4139    @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')." )
4140    protected MarkdownType meaningWhenMissing;
4141
4142    /**
4143     * 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.
4144     */
4145    @Child(name = "orderMeaning", type = {StringType.class}, order=19, min=0, max=1, modifier=false, summary=true)
4146    @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." )
4147    protected StringType orderMeaning;
4148
4149    /**
4150     * 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.
4151     */
4152    @Child(name = "fixed", type = {}, order=20, min=0, max=1, modifier=false, summary=true)
4153    @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." )
4154    protected org.hl7.fhir.r4.model.Type fixed;
4155
4156    /**
4157     * 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.).
4158     */
4159    @Child(name = "pattern", type = {}, order=21, min=0, max=1, modifier=false, summary=true)
4160    @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.)." )
4161    protected org.hl7.fhir.r4.model.Type pattern;
4162
4163    /**
4164     * A sample value for this element demonstrating the type of information that would typically be found in the element.
4165     */
4166    @Child(name = "example", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4167    @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." )
4168    protected List<ElementDefinitionExampleComponent> example;
4169
4170    /**
4171     * 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.
4172     */
4173    @Child(name = "minValue", 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)
4174    @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." )
4175    protected Type minValue;
4176
4177    /**
4178     * 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.
4179     */
4180    @Child(name = "maxValue", type = {DateType.class, DateTimeType.class, InstantType.class, TimeType.class, DecimalType.class, IntegerType.class, PositiveIntType.class, UnsignedIntType.class, Quantity.class}, order=24, min=0, max=1, modifier=false, summary=true)
4181    @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." )
4182    protected Type maxValue;
4183
4184    /**
4185     * 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.
4186     */
4187    @Child(name = "maxLength", type = {IntegerType.class}, order=25, min=0, max=1, modifier=false, summary=true)
4188    @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." )
4189    protected IntegerType maxLength;
4190
4191    /**
4192     * A reference to an invariant that may make additional statements about the cardinality or value in the instance.
4193     */
4194    @Child(name = "condition", type = {IdType.class}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4195    @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." )
4196    protected List<IdType> condition;
4197
4198    /**
4199     * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.
4200     */
4201    @Child(name = "constraint", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4202    @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." )
4203    protected List<ElementDefinitionConstraintComponent> constraint;
4204
4205    /**
4206     * 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. If false, whether to populate or use the data element in any way is at the discretion of the implementation.
4207     */
4208    @Child(name = "mustSupport", type = {BooleanType.class}, order=28, min=0, max=1, modifier=false, summary=true)
4209    @Description(shortDefinition="If the element must be 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. If false, whether to populate or use the data element in any way is at the discretion of the implementation." )
4210    protected BooleanType mustSupport;
4211
4212    /**
4213     * 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.
4214     */
4215    @Child(name = "isModifier", type = {BooleanType.class}, order=29, min=0, max=1, modifier=false, summary=true)
4216    @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." )
4217    protected BooleanType isModifier;
4218
4219    /**
4220     * Explains how that element affects the interpretation of the resource or element that contains it.
4221     */
4222    @Child(name = "isModifierReason", type = {StringType.class}, order=30, min=0, max=1, modifier=false, summary=true)
4223    @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." )
4224    protected StringType isModifierReason;
4225
4226    /**
4227     * Whether the element should be included if a client requests a search with the parameter _summary=true.
4228     */
4229    @Child(name = "isSummary", type = {BooleanType.class}, order=31, min=0, max=1, modifier=false, summary=true)
4230    @Description(shortDefinition="Include when _summary = true?", formalDefinition="Whether the element should be included if a client requests a search with the parameter _summary=true." )
4231    protected BooleanType isSummary;
4232
4233    /**
4234     * Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).
4235     */
4236    @Child(name = "binding", type = {}, order=32, min=0, max=1, modifier=false, summary=true)
4237    @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)." )
4238    protected ElementDefinitionBindingComponent binding;
4239
4240    /**
4241     * Identifies a concept from an external specification that roughly corresponds to this element.
4242     */
4243    @Child(name = "mapping", type = {}, order=33, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4244    @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." )
4245    protected List<ElementDefinitionMappingComponent> mapping;
4246
4247    private static final long serialVersionUID = 1482114790L;
4248
4249  /**
4250   * Constructor
4251   */
4252    public ElementDefinition() {
4253      super();
4254    }
4255
4256  /**
4257   * Constructor
4258   */
4259    public ElementDefinition(StringType path) {
4260      super();
4261      this.path = path;
4262    }
4263
4264    /**
4265     * @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
4266     */
4267    public StringType getPathElement() { 
4268      if (this.path == null)
4269        if (Configuration.errorOnAutoCreate())
4270          throw new Error("Attempt to auto-create ElementDefinition.path");
4271        else if (Configuration.doAutoCreate())
4272          this.path = new StringType(); // bb
4273      return this.path;
4274    }
4275
4276    public boolean hasPathElement() { 
4277      return this.path != null && !this.path.isEmpty();
4278    }
4279
4280    public boolean hasPath() { 
4281      return this.path != null && !this.path.isEmpty();
4282    }
4283
4284    /**
4285     * @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
4286     */
4287    public ElementDefinition setPathElement(StringType value) { 
4288      this.path = value;
4289      return this;
4290    }
4291
4292    /**
4293     * @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.
4294     */
4295    public String getPath() { 
4296      return this.path == null ? null : this.path.getValue();
4297    }
4298
4299    /**
4300     * @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.
4301     */
4302    public ElementDefinition setPath(String value) { 
4303        if (this.path == null)
4304          this.path = new StringType();
4305        this.path.setValue(value);
4306      return this;
4307    }
4308
4309    /**
4310     * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
4311     */
4312    public List<Enumeration<PropertyRepresentation>> getRepresentation() { 
4313      if (this.representation == null)
4314        this.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
4315      return this.representation;
4316    }
4317
4318    /**
4319     * @return Returns a reference to <code>this</code> for easy method chaining
4320     */
4321    public ElementDefinition setRepresentation(List<Enumeration<PropertyRepresentation>> theRepresentation) { 
4322      this.representation = theRepresentation;
4323      return this;
4324    }
4325
4326    public boolean hasRepresentation() { 
4327      if (this.representation == null)
4328        return false;
4329      for (Enumeration<PropertyRepresentation> item : this.representation)
4330        if (!item.isEmpty())
4331          return true;
4332      return false;
4333    }
4334
4335    /**
4336     * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
4337     */
4338    public Enumeration<PropertyRepresentation> addRepresentationElement() {//2 
4339      Enumeration<PropertyRepresentation> t = new Enumeration<PropertyRepresentation>(new PropertyRepresentationEnumFactory());
4340      if (this.representation == null)
4341        this.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
4342      this.representation.add(t);
4343      return t;
4344    }
4345
4346    /**
4347     * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
4348     */
4349    public ElementDefinition addRepresentation(PropertyRepresentation value) { //1
4350      Enumeration<PropertyRepresentation> t = new Enumeration<PropertyRepresentation>(new PropertyRepresentationEnumFactory());
4351      t.setValue(value);
4352      if (this.representation == null)
4353        this.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
4354      this.representation.add(t);
4355      return this;
4356    }
4357
4358    /**
4359     * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
4360     */
4361    public boolean hasRepresentation(PropertyRepresentation value) { 
4362      if (this.representation == null)
4363        return false;
4364      for (Enumeration<PropertyRepresentation> v : this.representation)
4365        if (v.getValue().equals(value)) // code
4366          return true;
4367      return false;
4368    }
4369
4370    /**
4371     * @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
4372     */
4373    public StringType getSliceNameElement() { 
4374      if (this.sliceName == null)
4375        if (Configuration.errorOnAutoCreate())
4376          throw new Error("Attempt to auto-create ElementDefinition.sliceName");
4377        else if (Configuration.doAutoCreate())
4378          this.sliceName = new StringType(); // bb
4379      return this.sliceName;
4380    }
4381
4382    public boolean hasSliceNameElement() { 
4383      return this.sliceName != null && !this.sliceName.isEmpty();
4384    }
4385
4386    public boolean hasSliceName() { 
4387      return this.sliceName != null && !this.sliceName.isEmpty();
4388    }
4389
4390    /**
4391     * @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
4392     */
4393    public ElementDefinition setSliceNameElement(StringType value) { 
4394      this.sliceName = value;
4395      return this;
4396    }
4397
4398    /**
4399     * @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.
4400     */
4401    public String getSliceName() { 
4402      return this.sliceName == null ? null : this.sliceName.getValue();
4403    }
4404
4405    /**
4406     * @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.
4407     */
4408    public ElementDefinition setSliceName(String value) { 
4409      if (Utilities.noString(value))
4410        this.sliceName = null;
4411      else {
4412        if (this.sliceName == null)
4413          this.sliceName = new StringType();
4414        this.sliceName.setValue(value);
4415      }
4416      return this;
4417    }
4418
4419    /**
4420     * @return {@link #sliceIsConstraining} (If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName.). This is the underlying object with id, value and extensions. The accessor "getSliceIsConstraining" gives direct access to the value
4421     */
4422    public BooleanType getSliceIsConstrainingElement() { 
4423      if (this.sliceIsConstraining == null)
4424        if (Configuration.errorOnAutoCreate())
4425          throw new Error("Attempt to auto-create ElementDefinition.sliceIsConstraining");
4426        else if (Configuration.doAutoCreate())
4427          this.sliceIsConstraining = new BooleanType(); // bb
4428      return this.sliceIsConstraining;
4429    }
4430
4431    public boolean hasSliceIsConstrainingElement() { 
4432      return this.sliceIsConstraining != null && !this.sliceIsConstraining.isEmpty();
4433    }
4434
4435    public boolean hasSliceIsConstraining() { 
4436      return this.sliceIsConstraining != null && !this.sliceIsConstraining.isEmpty();
4437    }
4438
4439    /**
4440     * @param value {@link #sliceIsConstraining} (If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName.). This is the underlying object with id, value and extensions. The accessor "getSliceIsConstraining" gives direct access to the value
4441     */
4442    public ElementDefinition setSliceIsConstrainingElement(BooleanType value) { 
4443      this.sliceIsConstraining = value;
4444      return this;
4445    }
4446
4447    /**
4448     * @return If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName.
4449     */
4450    public boolean getSliceIsConstraining() { 
4451      return this.sliceIsConstraining == null || this.sliceIsConstraining.isEmpty() ? false : this.sliceIsConstraining.getValue();
4452    }
4453
4454    /**
4455     * @param value If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName.
4456     */
4457    public ElementDefinition setSliceIsConstraining(boolean value) { 
4458        if (this.sliceIsConstraining == null)
4459          this.sliceIsConstraining = new BooleanType();
4460        this.sliceIsConstraining.setValue(value);
4461      return this;
4462    }
4463
4464    /**
4465     * @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
4466     */
4467    public StringType getLabelElement() { 
4468      if (this.label == null)
4469        if (Configuration.errorOnAutoCreate())
4470          throw new Error("Attempt to auto-create ElementDefinition.label");
4471        else if (Configuration.doAutoCreate())
4472          this.label = new StringType(); // bb
4473      return this.label;
4474    }
4475
4476    public boolean hasLabelElement() { 
4477      return this.label != null && !this.label.isEmpty();
4478    }
4479
4480    public boolean hasLabel() { 
4481      return this.label != null && !this.label.isEmpty();
4482    }
4483
4484    /**
4485     * @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
4486     */
4487    public ElementDefinition setLabelElement(StringType value) { 
4488      this.label = value;
4489      return this;
4490    }
4491
4492    /**
4493     * @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.
4494     */
4495    public String getLabel() { 
4496      return this.label == null ? null : this.label.getValue();
4497    }
4498
4499    /**
4500     * @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.
4501     */
4502    public ElementDefinition setLabel(String value) { 
4503      if (Utilities.noString(value))
4504        this.label = null;
4505      else {
4506        if (this.label == null)
4507          this.label = new StringType();
4508        this.label.setValue(value);
4509      }
4510      return this;
4511    }
4512
4513    /**
4514     * @return {@link #code} (A code that has the same meaning as the element in a particular terminology.)
4515     */
4516    public List<Coding> getCode() { 
4517      if (this.code == null)
4518        this.code = new ArrayList<Coding>();
4519      return this.code;
4520    }
4521
4522    /**
4523     * @return Returns a reference to <code>this</code> for easy method chaining
4524     */
4525    public ElementDefinition setCode(List<Coding> theCode) { 
4526      this.code = theCode;
4527      return this;
4528    }
4529
4530    public boolean hasCode() { 
4531      if (this.code == null)
4532        return false;
4533      for (Coding item : this.code)
4534        if (!item.isEmpty())
4535          return true;
4536      return false;
4537    }
4538
4539    public Coding addCode() { //3
4540      Coding t = new Coding();
4541      if (this.code == null)
4542        this.code = new ArrayList<Coding>();
4543      this.code.add(t);
4544      return t;
4545    }
4546
4547    public ElementDefinition addCode(Coding t) { //3
4548      if (t == null)
4549        return this;
4550      if (this.code == null)
4551        this.code = new ArrayList<Coding>();
4552      this.code.add(t);
4553      return this;
4554    }
4555
4556    /**
4557     * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist
4558     */
4559    public Coding getCodeFirstRep() { 
4560      if (getCode().isEmpty()) {
4561        addCode();
4562      }
4563      return getCode().get(0);
4564    }
4565
4566    /**
4567     * @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).)
4568     */
4569    public ElementDefinitionSlicingComponent getSlicing() { 
4570      if (this.slicing == null)
4571        if (Configuration.errorOnAutoCreate())
4572          throw new Error("Attempt to auto-create ElementDefinition.slicing");
4573        else if (Configuration.doAutoCreate())
4574          this.slicing = new ElementDefinitionSlicingComponent(); // cc
4575      return this.slicing;
4576    }
4577
4578    public boolean hasSlicing() { 
4579      return this.slicing != null && !this.slicing.isEmpty();
4580    }
4581
4582    /**
4583     * @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).)
4584     */
4585    public ElementDefinition setSlicing(ElementDefinitionSlicingComponent value) { 
4586      this.slicing = value;
4587      return this;
4588    }
4589
4590    /**
4591     * @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
4592     */
4593    public StringType getShortElement() { 
4594      if (this.short_ == null)
4595        if (Configuration.errorOnAutoCreate())
4596          throw new Error("Attempt to auto-create ElementDefinition.short_");
4597        else if (Configuration.doAutoCreate())
4598          this.short_ = new StringType(); // bb
4599      return this.short_;
4600    }
4601
4602    public boolean hasShortElement() { 
4603      return this.short_ != null && !this.short_.isEmpty();
4604    }
4605
4606    public boolean hasShort() { 
4607      return this.short_ != null && !this.short_.isEmpty();
4608    }
4609
4610    /**
4611     * @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
4612     */
4613    public ElementDefinition setShortElement(StringType value) { 
4614      this.short_ = value;
4615      return this;
4616    }
4617
4618    /**
4619     * @return A concise description of what this element means (e.g. for use in autogenerated summaries).
4620     */
4621    public String getShort() { 
4622      return this.short_ == null ? null : this.short_.getValue();
4623    }
4624
4625    /**
4626     * @param value A concise description of what this element means (e.g. for use in autogenerated summaries).
4627     */
4628    public ElementDefinition setShort(String value) { 
4629      if (Utilities.noString(value))
4630        this.short_ = null;
4631      else {
4632        if (this.short_ == null)
4633          this.short_ = new StringType();
4634        this.short_.setValue(value);
4635      }
4636      return this;
4637    }
4638
4639    /**
4640     * @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. (Note: The text you are reading is specified in ElementDefinition.definition).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
4641     */
4642    public MarkdownType getDefinitionElement() { 
4643      if (this.definition == null)
4644        if (Configuration.errorOnAutoCreate())
4645          throw new Error("Attempt to auto-create ElementDefinition.definition");
4646        else if (Configuration.doAutoCreate())
4647          this.definition = new MarkdownType(); // bb
4648      return this.definition;
4649    }
4650
4651    public boolean hasDefinitionElement() { 
4652      return this.definition != null && !this.definition.isEmpty();
4653    }
4654
4655    public boolean hasDefinition() { 
4656      return this.definition != null && !this.definition.isEmpty();
4657    }
4658
4659    /**
4660     * @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. (Note: The text you are reading is specified in ElementDefinition.definition).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
4661     */
4662    public ElementDefinition setDefinitionElement(MarkdownType value) { 
4663      this.definition = value;
4664      return this;
4665    }
4666
4667    /**
4668     * @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. (Note: The text you are reading is specified in ElementDefinition.definition).
4669     */
4670    public String getDefinition() { 
4671      return this.definition == null ? null : this.definition.getValue();
4672    }
4673
4674    /**
4675     * @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. (Note: The text you are reading is specified in ElementDefinition.definition).
4676     */
4677    public ElementDefinition setDefinition(String value) { 
4678      if (value == null)
4679        this.definition = null;
4680      else {
4681        if (this.definition == null)
4682          this.definition = new MarkdownType();
4683        this.definition.setValue(value);
4684      }
4685      return this;
4686    }
4687
4688    /**
4689     * @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. (Note: The text you are reading is specified in ElementDefinition.comment).). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
4690     */
4691    public MarkdownType getCommentElement() { 
4692      if (this.comment == null)
4693        if (Configuration.errorOnAutoCreate())
4694          throw new Error("Attempt to auto-create ElementDefinition.comment");
4695        else if (Configuration.doAutoCreate())
4696          this.comment = new MarkdownType(); // bb
4697      return this.comment;
4698    }
4699
4700    public boolean hasCommentElement() { 
4701      return this.comment != null && !this.comment.isEmpty();
4702    }
4703
4704    public boolean hasComment() { 
4705      return this.comment != null && !this.comment.isEmpty();
4706    }
4707
4708    /**
4709     * @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. (Note: The text you are reading is specified in ElementDefinition.comment).). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
4710     */
4711    public ElementDefinition setCommentElement(MarkdownType value) { 
4712      this.comment = value;
4713      return this;
4714    }
4715
4716    /**
4717     * @return Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. (Note: The text you are reading is specified in ElementDefinition.comment).
4718     */
4719    public String getComment() { 
4720      return this.comment == null ? null : this.comment.getValue();
4721    }
4722
4723    /**
4724     * @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. (Note: The text you are reading is specified in ElementDefinition.comment).
4725     */
4726    public ElementDefinition setComment(String value) { 
4727      if (value == null)
4728        this.comment = null;
4729      else {
4730        if (this.comment == null)
4731          this.comment = new MarkdownType();
4732        this.comment.setValue(value);
4733      }
4734      return this;
4735    }
4736
4737    /**
4738     * @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
4739     */
4740    public MarkdownType getRequirementsElement() { 
4741      if (this.requirements == null)
4742        if (Configuration.errorOnAutoCreate())
4743          throw new Error("Attempt to auto-create ElementDefinition.requirements");
4744        else if (Configuration.doAutoCreate())
4745          this.requirements = new MarkdownType(); // bb
4746      return this.requirements;
4747    }
4748
4749    public boolean hasRequirementsElement() { 
4750      return this.requirements != null && !this.requirements.isEmpty();
4751    }
4752
4753    public boolean hasRequirements() { 
4754      return this.requirements != null && !this.requirements.isEmpty();
4755    }
4756
4757    /**
4758     * @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
4759     */
4760    public ElementDefinition setRequirementsElement(MarkdownType value) { 
4761      this.requirements = value;
4762      return this;
4763    }
4764
4765    /**
4766     * @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.
4767     */
4768    public String getRequirements() { 
4769      return this.requirements == null ? null : this.requirements.getValue();
4770    }
4771
4772    /**
4773     * @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.
4774     */
4775    public ElementDefinition setRequirements(String value) { 
4776      if (value == null)
4777        this.requirements = null;
4778      else {
4779        if (this.requirements == null)
4780          this.requirements = new MarkdownType();
4781        this.requirements.setValue(value);
4782      }
4783      return this;
4784    }
4785
4786    /**
4787     * @return {@link #alias} (Identifies additional names by which this element might also be known.)
4788     */
4789    public List<StringType> getAlias() { 
4790      if (this.alias == null)
4791        this.alias = new ArrayList<StringType>();
4792      return this.alias;
4793    }
4794
4795    /**
4796     * @return Returns a reference to <code>this</code> for easy method chaining
4797     */
4798    public ElementDefinition setAlias(List<StringType> theAlias) { 
4799      this.alias = theAlias;
4800      return this;
4801    }
4802
4803    public boolean hasAlias() { 
4804      if (this.alias == null)
4805        return false;
4806      for (StringType item : this.alias)
4807        if (!item.isEmpty())
4808          return true;
4809      return false;
4810    }
4811
4812    /**
4813     * @return {@link #alias} (Identifies additional names by which this element might also be known.)
4814     */
4815    public StringType addAliasElement() {//2 
4816      StringType t = new StringType();
4817      if (this.alias == null)
4818        this.alias = new ArrayList<StringType>();
4819      this.alias.add(t);
4820      return t;
4821    }
4822
4823    /**
4824     * @param value {@link #alias} (Identifies additional names by which this element might also be known.)
4825     */
4826    public ElementDefinition addAlias(String value) { //1
4827      StringType t = new StringType();
4828      t.setValue(value);
4829      if (this.alias == null)
4830        this.alias = new ArrayList<StringType>();
4831      this.alias.add(t);
4832      return this;
4833    }
4834
4835    /**
4836     * @param value {@link #alias} (Identifies additional names by which this element might also be known.)
4837     */
4838    public boolean hasAlias(String value) { 
4839      if (this.alias == null)
4840        return false;
4841      for (StringType v : this.alias)
4842        if (v.getValue().equals(value)) // string
4843          return true;
4844      return false;
4845    }
4846
4847    /**
4848     * @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
4849     */
4850    public UnsignedIntType getMinElement() { 
4851      if (this.min == null)
4852        if (Configuration.errorOnAutoCreate())
4853          throw new Error("Attempt to auto-create ElementDefinition.min");
4854        else if (Configuration.doAutoCreate())
4855          this.min = new UnsignedIntType(); // bb
4856      return this.min;
4857    }
4858
4859    public boolean hasMinElement() { 
4860      return this.min != null && !this.min.isEmpty();
4861    }
4862
4863    public boolean hasMin() { 
4864      return this.min != null && !this.min.isEmpty();
4865    }
4866
4867    /**
4868     * @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
4869     */
4870    public ElementDefinition setMinElement(UnsignedIntType value) { 
4871      this.min = value;
4872      return this;
4873    }
4874
4875    /**
4876     * @return The minimum number of times this element SHALL appear in the instance.
4877     */
4878    public int getMin() { 
4879      return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue();
4880    }
4881
4882    /**
4883     * @param value The minimum number of times this element SHALL appear in the instance.
4884     */
4885    public ElementDefinition setMin(int value) { 
4886        if (this.min == null)
4887          this.min = new UnsignedIntType();
4888        this.min.setValue(value);
4889      return this;
4890    }
4891
4892    /**
4893     * @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
4894     */
4895    public StringType getMaxElement() { 
4896      if (this.max == null)
4897        if (Configuration.errorOnAutoCreate())
4898          throw new Error("Attempt to auto-create ElementDefinition.max");
4899        else if (Configuration.doAutoCreate())
4900          this.max = new StringType(); // bb
4901      return this.max;
4902    }
4903
4904    public boolean hasMaxElement() { 
4905      return this.max != null && !this.max.isEmpty();
4906    }
4907
4908    public boolean hasMax() { 
4909      return this.max != null && !this.max.isEmpty();
4910    }
4911
4912    /**
4913     * @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
4914     */
4915    public ElementDefinition setMaxElement(StringType value) { 
4916      this.max = value;
4917      return this;
4918    }
4919
4920    /**
4921     * @return The maximum number of times this element is permitted to appear in the instance.
4922     */
4923    public String getMax() { 
4924      return this.max == null ? null : this.max.getValue();
4925    }
4926
4927    /**
4928     * @param value The maximum number of times this element is permitted to appear in the instance.
4929     */
4930    public ElementDefinition setMax(String value) { 
4931      if (Utilities.noString(value))
4932        this.max = null;
4933      else {
4934        if (this.max == null)
4935          this.max = new StringType();
4936        this.max.setValue(value);
4937      }
4938      return this;
4939    }
4940
4941    /**
4942     * @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.)
4943     */
4944    public ElementDefinitionBaseComponent getBase() { 
4945      if (this.base == null)
4946        if (Configuration.errorOnAutoCreate())
4947          throw new Error("Attempt to auto-create ElementDefinition.base");
4948        else if (Configuration.doAutoCreate())
4949          this.base = new ElementDefinitionBaseComponent(); // cc
4950      return this.base;
4951    }
4952
4953    public boolean hasBase() { 
4954      return this.base != null && !this.base.isEmpty();
4955    }
4956
4957    /**
4958     * @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.)
4959     */
4960    public ElementDefinition setBase(ElementDefinitionBaseComponent value) { 
4961      this.base = value;
4962      return this;
4963    }
4964
4965    /**
4966     * @return {@link #contentReference} (Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc.). This is the underlying object with id, value and extensions. The accessor "getContentReference" gives direct access to the value
4967     */
4968    public UriType getContentReferenceElement() { 
4969      if (this.contentReference == null)
4970        if (Configuration.errorOnAutoCreate())
4971          throw new Error("Attempt to auto-create ElementDefinition.contentReference");
4972        else if (Configuration.doAutoCreate())
4973          this.contentReference = new UriType(); // bb
4974      return this.contentReference;
4975    }
4976
4977    public boolean hasContentReferenceElement() { 
4978      return this.contentReference != null && !this.contentReference.isEmpty();
4979    }
4980
4981    public boolean hasContentReference() { 
4982      return this.contentReference != null && !this.contentReference.isEmpty();
4983    }
4984
4985    /**
4986     * @param value {@link #contentReference} (Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc.). This is the underlying object with id, value and extensions. The accessor "getContentReference" gives direct access to the value
4987     */
4988    public ElementDefinition setContentReferenceElement(UriType value) { 
4989      this.contentReference = value;
4990      return this;
4991    }
4992
4993    /**
4994     * @return Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc.
4995     */
4996    public String getContentReference() { 
4997      return this.contentReference == null ? null : this.contentReference.getValue();
4998    }
4999
5000    /**
5001     * @param value Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc.
5002     */
5003    public ElementDefinition setContentReference(String value) { 
5004      if (Utilities.noString(value))
5005        this.contentReference = null;
5006      else {
5007        if (this.contentReference == null)
5008          this.contentReference = new UriType();
5009        this.contentReference.setValue(value);
5010      }
5011      return this;
5012    }
5013
5014    /**
5015     * @return {@link #type} (The data type or resource that the value of this element is permitted to be.)
5016     */
5017    public List<TypeRefComponent> getType() { 
5018      if (this.type == null)
5019        this.type = new ArrayList<TypeRefComponent>();
5020      return this.type;
5021    }
5022
5023    /**
5024     * @return Returns a reference to <code>this</code> for easy method chaining
5025     */
5026    public ElementDefinition setType(List<TypeRefComponent> theType) { 
5027      this.type = theType;
5028      return this;
5029    }
5030
5031    public boolean hasType() { 
5032      if (this.type == null)
5033        return false;
5034      for (TypeRefComponent item : this.type)
5035        if (!item.isEmpty())
5036          return true;
5037      return false;
5038    }
5039
5040    public TypeRefComponent addType() { //3
5041      TypeRefComponent t = new TypeRefComponent();
5042      if (this.type == null)
5043        this.type = new ArrayList<TypeRefComponent>();
5044      this.type.add(t);
5045      return t;
5046    }
5047
5048    public ElementDefinition addType(TypeRefComponent t) { //3
5049      if (t == null)
5050        return this;
5051      if (this.type == null)
5052        this.type = new ArrayList<TypeRefComponent>();
5053      this.type.add(t);
5054      return this;
5055    }
5056
5057    /**
5058     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist
5059     */
5060    public TypeRefComponent getTypeFirstRep() { 
5061      if (getType().isEmpty()) {
5062        addType();
5063      }
5064      return getType().get(0);
5065    }
5066
5067    /**
5068     * @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').)
5069     */
5070    public org.hl7.fhir.r4.model.Type getDefaultValue() { 
5071      return this.defaultValue;
5072    }
5073
5074    public boolean hasDefaultValue() { 
5075      return this.defaultValue != null && !this.defaultValue.isEmpty();
5076    }
5077
5078    /**
5079     * @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').)
5080     */
5081    public ElementDefinition setDefaultValue(org.hl7.fhir.r4.model.Type value) { 
5082      this.defaultValue = value;
5083      return this;
5084    }
5085
5086    /**
5087     * @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
5088     */
5089    public MarkdownType getMeaningWhenMissingElement() { 
5090      if (this.meaningWhenMissing == null)
5091        if (Configuration.errorOnAutoCreate())
5092          throw new Error("Attempt to auto-create ElementDefinition.meaningWhenMissing");
5093        else if (Configuration.doAutoCreate())
5094          this.meaningWhenMissing = new MarkdownType(); // bb
5095      return this.meaningWhenMissing;
5096    }
5097
5098    public boolean hasMeaningWhenMissingElement() { 
5099      return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty();
5100    }
5101
5102    public boolean hasMeaningWhenMissing() { 
5103      return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty();
5104    }
5105
5106    /**
5107     * @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
5108     */
5109    public ElementDefinition setMeaningWhenMissingElement(MarkdownType value) { 
5110      this.meaningWhenMissing = value;
5111      return this;
5112    }
5113
5114    /**
5115     * @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').
5116     */
5117    public String getMeaningWhenMissing() { 
5118      return this.meaningWhenMissing == null ? null : this.meaningWhenMissing.getValue();
5119    }
5120
5121    /**
5122     * @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').
5123     */
5124    public ElementDefinition setMeaningWhenMissing(String value) { 
5125      if (value == null)
5126        this.meaningWhenMissing = null;
5127      else {
5128        if (this.meaningWhenMissing == null)
5129          this.meaningWhenMissing = new MarkdownType();
5130        this.meaningWhenMissing.setValue(value);
5131      }
5132      return this;
5133    }
5134
5135    /**
5136     * @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
5137     */
5138    public StringType getOrderMeaningElement() { 
5139      if (this.orderMeaning == null)
5140        if (Configuration.errorOnAutoCreate())
5141          throw new Error("Attempt to auto-create ElementDefinition.orderMeaning");
5142        else if (Configuration.doAutoCreate())
5143          this.orderMeaning = new StringType(); // bb
5144      return this.orderMeaning;
5145    }
5146
5147    public boolean hasOrderMeaningElement() { 
5148      return this.orderMeaning != null && !this.orderMeaning.isEmpty();
5149    }
5150
5151    public boolean hasOrderMeaning() { 
5152      return this.orderMeaning != null && !this.orderMeaning.isEmpty();
5153    }
5154
5155    /**
5156     * @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
5157     */
5158    public ElementDefinition setOrderMeaningElement(StringType value) { 
5159      this.orderMeaning = value;
5160      return this;
5161    }
5162
5163    /**
5164     * @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.
5165     */
5166    public String getOrderMeaning() { 
5167      return this.orderMeaning == null ? null : this.orderMeaning.getValue();
5168    }
5169
5170    /**
5171     * @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.
5172     */
5173    public ElementDefinition setOrderMeaning(String value) { 
5174      if (Utilities.noString(value))
5175        this.orderMeaning = null;
5176      else {
5177        if (this.orderMeaning == null)
5178          this.orderMeaning = new StringType();
5179        this.orderMeaning.setValue(value);
5180      }
5181      return this;
5182    }
5183
5184    /**
5185     * @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.)
5186     */
5187    public org.hl7.fhir.r4.model.Type getFixed() { 
5188      return this.fixed;
5189    }
5190
5191    public boolean hasFixed() { 
5192      return this.fixed != null && !this.fixed.isEmpty();
5193    }
5194
5195    /**
5196     * @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.)
5197     */
5198    public ElementDefinition setFixed(org.hl7.fhir.r4.model.Type value) { 
5199      this.fixed = value;
5200      return this;
5201    }
5202
5203    /**
5204     * @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.).)
5205     */
5206    public org.hl7.fhir.r4.model.Type getPattern() { 
5207      return this.pattern;
5208    }
5209
5210    public boolean hasPattern() { 
5211      return this.pattern != null && !this.pattern.isEmpty();
5212    }
5213
5214    /**
5215     * @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.).)
5216     */
5217    public ElementDefinition setPattern(org.hl7.fhir.r4.model.Type value) { 
5218      this.pattern = value;
5219      return this;
5220    }
5221
5222    /**
5223     * @return {@link #example} (A sample value for this element demonstrating the type of information that would typically be found in the element.)
5224     */
5225    public List<ElementDefinitionExampleComponent> getExample() { 
5226      if (this.example == null)
5227        this.example = new ArrayList<ElementDefinitionExampleComponent>();
5228      return this.example;
5229    }
5230
5231    /**
5232     * @return Returns a reference to <code>this</code> for easy method chaining
5233     */
5234    public ElementDefinition setExample(List<ElementDefinitionExampleComponent> theExample) { 
5235      this.example = theExample;
5236      return this;
5237    }
5238
5239    public boolean hasExample() { 
5240      if (this.example == null)
5241        return false;
5242      for (ElementDefinitionExampleComponent item : this.example)
5243        if (!item.isEmpty())
5244          return true;
5245      return false;
5246    }
5247
5248    public ElementDefinitionExampleComponent addExample() { //3
5249      ElementDefinitionExampleComponent t = new ElementDefinitionExampleComponent();
5250      if (this.example == null)
5251        this.example = new ArrayList<ElementDefinitionExampleComponent>();
5252      this.example.add(t);
5253      return t;
5254    }
5255
5256    public ElementDefinition addExample(ElementDefinitionExampleComponent t) { //3
5257      if (t == null)
5258        return this;
5259      if (this.example == null)
5260        this.example = new ArrayList<ElementDefinitionExampleComponent>();
5261      this.example.add(t);
5262      return this;
5263    }
5264
5265    /**
5266     * @return The first repetition of repeating field {@link #example}, creating it if it does not already exist
5267     */
5268    public ElementDefinitionExampleComponent getExampleFirstRep() { 
5269      if (getExample().isEmpty()) {
5270        addExample();
5271      }
5272      return getExample().get(0);
5273    }
5274
5275    /**
5276     * @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.)
5277     */
5278    public Type getMinValue() { 
5279      return this.minValue;
5280    }
5281
5282    /**
5283     * @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.)
5284     */
5285    public DateType getMinValueDateType() throws FHIRException { 
5286      if (this.minValue == null)
5287        return null;
5288      if (!(this.minValue instanceof DateType))
5289        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5290      return (DateType) this.minValue;
5291    }
5292
5293    public boolean hasMinValueDateType() { 
5294      return this != null && this.minValue instanceof DateType;
5295    }
5296
5297    /**
5298     * @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.)
5299     */
5300    public DateTimeType getMinValueDateTimeType() throws FHIRException { 
5301      if (this.minValue == null)
5302        return null;
5303      if (!(this.minValue instanceof DateTimeType))
5304        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5305      return (DateTimeType) this.minValue;
5306    }
5307
5308    public boolean hasMinValueDateTimeType() { 
5309      return this != null && this.minValue instanceof DateTimeType;
5310    }
5311
5312    /**
5313     * @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.)
5314     */
5315    public InstantType getMinValueInstantType() throws FHIRException { 
5316      if (this.minValue == null)
5317        return null;
5318      if (!(this.minValue instanceof InstantType))
5319        throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5320      return (InstantType) this.minValue;
5321    }
5322
5323    public boolean hasMinValueInstantType() { 
5324      return this != null && this.minValue instanceof InstantType;
5325    }
5326
5327    /**
5328     * @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.)
5329     */
5330    public TimeType getMinValueTimeType() throws FHIRException { 
5331      if (this.minValue == null)
5332        return null;
5333      if (!(this.minValue instanceof TimeType))
5334        throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5335      return (TimeType) this.minValue;
5336    }
5337
5338    public boolean hasMinValueTimeType() { 
5339      return this != null && this.minValue instanceof TimeType;
5340    }
5341
5342    /**
5343     * @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.)
5344     */
5345    public DecimalType getMinValueDecimalType() throws FHIRException { 
5346      if (this.minValue == null)
5347        return null;
5348      if (!(this.minValue instanceof DecimalType))
5349        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5350      return (DecimalType) this.minValue;
5351    }
5352
5353    public boolean hasMinValueDecimalType() { 
5354      return this != null && this.minValue instanceof DecimalType;
5355    }
5356
5357    /**
5358     * @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.)
5359     */
5360    public IntegerType getMinValueIntegerType() throws FHIRException { 
5361      if (this.minValue == null)
5362        return null;
5363      if (!(this.minValue instanceof IntegerType))
5364        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5365      return (IntegerType) this.minValue;
5366    }
5367
5368    public boolean hasMinValueIntegerType() { 
5369      return this != null && this.minValue instanceof IntegerType;
5370    }
5371
5372    /**
5373     * @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.)
5374     */
5375    public PositiveIntType getMinValuePositiveIntType() throws FHIRException { 
5376      if (this.minValue == null)
5377        return null;
5378      if (!(this.minValue instanceof PositiveIntType))
5379        throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5380      return (PositiveIntType) this.minValue;
5381    }
5382
5383    public boolean hasMinValuePositiveIntType() { 
5384      return this != null && this.minValue instanceof PositiveIntType;
5385    }
5386
5387    /**
5388     * @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.)
5389     */
5390    public UnsignedIntType getMinValueUnsignedIntType() throws FHIRException { 
5391      if (this.minValue == null)
5392        return null;
5393      if (!(this.minValue instanceof UnsignedIntType))
5394        throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.minValue.getClass().getName()+" was encountered");
5395      return (UnsignedIntType) this.minValue;
5396    }
5397
5398    public boolean hasMinValueUnsignedIntType() { 
5399      return this != null && this.minValue instanceof UnsignedIntType;
5400    }
5401
5402    /**
5403     * @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.)
5404     */
5405    public Quantity getMinValueQuantity() throws FHIRException { 
5406      if (this.minValue == null)
5407        return null;
5408      if (!(this.minValue instanceof Quantity))
5409        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.minValue.getClass().getName()+" was encountered");
5410      return (Quantity) this.minValue;
5411    }
5412
5413    public boolean hasMinValueQuantity() { 
5414      return this != null && this.minValue instanceof Quantity;
5415    }
5416
5417    public boolean hasMinValue() { 
5418      return this.minValue != null && !this.minValue.isEmpty();
5419    }
5420
5421    /**
5422     * @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.)
5423     */
5424    public ElementDefinition setMinValue(Type value) { 
5425      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))
5426        throw new Error("Not the right type for ElementDefinition.minValue[x]: "+value.fhirType());
5427      this.minValue = value;
5428      return this;
5429    }
5430
5431    /**
5432     * @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.)
5433     */
5434    public Type getMaxValue() { 
5435      return this.maxValue;
5436    }
5437
5438    /**
5439     * @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.)
5440     */
5441    public DateType getMaxValueDateType() throws FHIRException { 
5442      if (this.maxValue == null)
5443        return null;
5444      if (!(this.maxValue instanceof DateType))
5445        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5446      return (DateType) this.maxValue;
5447    }
5448
5449    public boolean hasMaxValueDateType() { 
5450      return this != null && this.maxValue instanceof DateType;
5451    }
5452
5453    /**
5454     * @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.)
5455     */
5456    public DateTimeType getMaxValueDateTimeType() throws FHIRException { 
5457      if (this.maxValue == null)
5458        return null;
5459      if (!(this.maxValue instanceof DateTimeType))
5460        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5461      return (DateTimeType) this.maxValue;
5462    }
5463
5464    public boolean hasMaxValueDateTimeType() { 
5465      return this != null && this.maxValue instanceof DateTimeType;
5466    }
5467
5468    /**
5469     * @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.)
5470     */
5471    public InstantType getMaxValueInstantType() throws FHIRException { 
5472      if (this.maxValue == null)
5473        return null;
5474      if (!(this.maxValue instanceof InstantType))
5475        throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5476      return (InstantType) this.maxValue;
5477    }
5478
5479    public boolean hasMaxValueInstantType() { 
5480      return this != null && this.maxValue instanceof InstantType;
5481    }
5482
5483    /**
5484     * @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.)
5485     */
5486    public TimeType getMaxValueTimeType() throws FHIRException { 
5487      if (this.maxValue == null)
5488        return null;
5489      if (!(this.maxValue instanceof TimeType))
5490        throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5491      return (TimeType) this.maxValue;
5492    }
5493
5494    public boolean hasMaxValueTimeType() { 
5495      return this != null && this.maxValue instanceof TimeType;
5496    }
5497
5498    /**
5499     * @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.)
5500     */
5501    public DecimalType getMaxValueDecimalType() throws FHIRException { 
5502      if (this.maxValue == null)
5503        return null;
5504      if (!(this.maxValue instanceof DecimalType))
5505        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5506      return (DecimalType) this.maxValue;
5507    }
5508
5509    public boolean hasMaxValueDecimalType() { 
5510      return this != null && this.maxValue instanceof DecimalType;
5511    }
5512
5513    /**
5514     * @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.)
5515     */
5516    public IntegerType getMaxValueIntegerType() throws FHIRException { 
5517      if (this.maxValue == null)
5518        return null;
5519      if (!(this.maxValue instanceof IntegerType))
5520        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5521      return (IntegerType) this.maxValue;
5522    }
5523
5524    public boolean hasMaxValueIntegerType() { 
5525      return this != null && this.maxValue instanceof IntegerType;
5526    }
5527
5528    /**
5529     * @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.)
5530     */
5531    public PositiveIntType getMaxValuePositiveIntType() throws FHIRException { 
5532      if (this.maxValue == null)
5533        return null;
5534      if (!(this.maxValue instanceof PositiveIntType))
5535        throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5536      return (PositiveIntType) this.maxValue;
5537    }
5538
5539    public boolean hasMaxValuePositiveIntType() { 
5540      return this != null && this.maxValue instanceof PositiveIntType;
5541    }
5542
5543    /**
5544     * @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.)
5545     */
5546    public UnsignedIntType getMaxValueUnsignedIntType() throws FHIRException { 
5547      if (this.maxValue == null)
5548        return null;
5549      if (!(this.maxValue instanceof UnsignedIntType))
5550        throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5551      return (UnsignedIntType) this.maxValue;
5552    }
5553
5554    public boolean hasMaxValueUnsignedIntType() { 
5555      return this != null && this.maxValue instanceof UnsignedIntType;
5556    }
5557
5558    /**
5559     * @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.)
5560     */
5561    public Quantity getMaxValueQuantity() throws FHIRException { 
5562      if (this.maxValue == null)
5563        return null;
5564      if (!(this.maxValue instanceof Quantity))
5565        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.maxValue.getClass().getName()+" was encountered");
5566      return (Quantity) this.maxValue;
5567    }
5568
5569    public boolean hasMaxValueQuantity() { 
5570      return this != null && this.maxValue instanceof Quantity;
5571    }
5572
5573    public boolean hasMaxValue() { 
5574      return this.maxValue != null && !this.maxValue.isEmpty();
5575    }
5576
5577    /**
5578     * @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.)
5579     */
5580    public ElementDefinition setMaxValue(Type value) { 
5581      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))
5582        throw new Error("Not the right type for ElementDefinition.maxValue[x]: "+value.fhirType());
5583      this.maxValue = value;
5584      return this;
5585    }
5586
5587    /**
5588     * @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
5589     */
5590    public IntegerType getMaxLengthElement() { 
5591      if (this.maxLength == null)
5592        if (Configuration.errorOnAutoCreate())
5593          throw new Error("Attempt to auto-create ElementDefinition.maxLength");
5594        else if (Configuration.doAutoCreate())
5595          this.maxLength = new IntegerType(); // bb
5596      return this.maxLength;
5597    }
5598
5599    public boolean hasMaxLengthElement() { 
5600      return this.maxLength != null && !this.maxLength.isEmpty();
5601    }
5602
5603    public boolean hasMaxLength() { 
5604      return this.maxLength != null && !this.maxLength.isEmpty();
5605    }
5606
5607    /**
5608     * @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
5609     */
5610    public ElementDefinition setMaxLengthElement(IntegerType value) { 
5611      this.maxLength = value;
5612      return this;
5613    }
5614
5615    /**
5616     * @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.
5617     */
5618    public int getMaxLength() { 
5619      return this.maxLength == null || this.maxLength.isEmpty() ? 0 : this.maxLength.getValue();
5620    }
5621
5622    /**
5623     * @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.
5624     */
5625    public ElementDefinition setMaxLength(int value) { 
5626        if (this.maxLength == null)
5627          this.maxLength = new IntegerType();
5628        this.maxLength.setValue(value);
5629      return this;
5630    }
5631
5632    /**
5633     * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
5634     */
5635    public List<IdType> getCondition() { 
5636      if (this.condition == null)
5637        this.condition = new ArrayList<IdType>();
5638      return this.condition;
5639    }
5640
5641    /**
5642     * @return Returns a reference to <code>this</code> for easy method chaining
5643     */
5644    public ElementDefinition setCondition(List<IdType> theCondition) { 
5645      this.condition = theCondition;
5646      return this;
5647    }
5648
5649    public boolean hasCondition() { 
5650      if (this.condition == null)
5651        return false;
5652      for (IdType item : this.condition)
5653        if (!item.isEmpty())
5654          return true;
5655      return false;
5656    }
5657
5658    /**
5659     * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
5660     */
5661    public IdType addConditionElement() {//2 
5662      IdType t = new IdType();
5663      if (this.condition == null)
5664        this.condition = new ArrayList<IdType>();
5665      this.condition.add(t);
5666      return t;
5667    }
5668
5669    /**
5670     * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
5671     */
5672    public ElementDefinition addCondition(String value) { //1
5673      IdType t = new IdType();
5674      t.setValue(value);
5675      if (this.condition == null)
5676        this.condition = new ArrayList<IdType>();
5677      this.condition.add(t);
5678      return this;
5679    }
5680
5681    /**
5682     * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
5683     */
5684    public boolean hasCondition(String value) { 
5685      if (this.condition == null)
5686        return false;
5687      for (IdType v : this.condition)
5688        if (v.getValue().equals(value)) // id
5689          return true;
5690      return false;
5691    }
5692
5693    /**
5694     * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.)
5695     */
5696    public List<ElementDefinitionConstraintComponent> getConstraint() { 
5697      if (this.constraint == null)
5698        this.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
5699      return this.constraint;
5700    }
5701
5702    /**
5703     * @return Returns a reference to <code>this</code> for easy method chaining
5704     */
5705    public ElementDefinition setConstraint(List<ElementDefinitionConstraintComponent> theConstraint) { 
5706      this.constraint = theConstraint;
5707      return this;
5708    }
5709
5710    public boolean hasConstraint() { 
5711      if (this.constraint == null)
5712        return false;
5713      for (ElementDefinitionConstraintComponent item : this.constraint)
5714        if (!item.isEmpty())
5715          return true;
5716      return false;
5717    }
5718
5719    public ElementDefinitionConstraintComponent addConstraint() { //3
5720      ElementDefinitionConstraintComponent t = new ElementDefinitionConstraintComponent();
5721      if (this.constraint == null)
5722        this.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
5723      this.constraint.add(t);
5724      return t;
5725    }
5726
5727    public ElementDefinition addConstraint(ElementDefinitionConstraintComponent t) { //3
5728      if (t == null)
5729        return this;
5730      if (this.constraint == null)
5731        this.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
5732      this.constraint.add(t);
5733      return this;
5734    }
5735
5736    /**
5737     * @return The first repetition of repeating field {@link #constraint}, creating it if it does not already exist
5738     */
5739    public ElementDefinitionConstraintComponent getConstraintFirstRep() { 
5740      if (getConstraint().isEmpty()) {
5741        addConstraint();
5742      }
5743      return getConstraint().get(0);
5744    }
5745
5746    /**
5747     * @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. If false, whether to populate or use the data element in any way is at the discretion of the implementation.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value
5748     */
5749    public BooleanType getMustSupportElement() { 
5750      if (this.mustSupport == null)
5751        if (Configuration.errorOnAutoCreate())
5752          throw new Error("Attempt to auto-create ElementDefinition.mustSupport");
5753        else if (Configuration.doAutoCreate())
5754          this.mustSupport = new BooleanType(); // bb
5755      return this.mustSupport;
5756    }
5757
5758    public boolean hasMustSupportElement() { 
5759      return this.mustSupport != null && !this.mustSupport.isEmpty();
5760    }
5761
5762    public boolean hasMustSupport() { 
5763      return this.mustSupport != null && !this.mustSupport.isEmpty();
5764    }
5765
5766    /**
5767     * @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. If false, whether to populate or use the data element in any way is at the discretion of the implementation.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value
5768     */
5769    public ElementDefinition setMustSupportElement(BooleanType value) { 
5770      this.mustSupport = value;
5771      return this;
5772    }
5773
5774    /**
5775     * @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. If false, whether to populate or use the data element in any way is at the discretion of the implementation.
5776     */
5777    public boolean getMustSupport() { 
5778      return this.mustSupport == null || this.mustSupport.isEmpty() ? false : this.mustSupport.getValue();
5779    }
5780
5781    /**
5782     * @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. If false, whether to populate or use the data element in any way is at the discretion of the implementation.
5783     */
5784    public ElementDefinition setMustSupport(boolean value) { 
5785        if (this.mustSupport == null)
5786          this.mustSupport = new BooleanType();
5787        this.mustSupport.setValue(value);
5788      return this;
5789    }
5790
5791    /**
5792     * @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
5793     */
5794    public BooleanType getIsModifierElement() { 
5795      if (this.isModifier == null)
5796        if (Configuration.errorOnAutoCreate())
5797          throw new Error("Attempt to auto-create ElementDefinition.isModifier");
5798        else if (Configuration.doAutoCreate())
5799          this.isModifier = new BooleanType(); // bb
5800      return this.isModifier;
5801    }
5802
5803    public boolean hasIsModifierElement() { 
5804      return this.isModifier != null && !this.isModifier.isEmpty();
5805    }
5806
5807    public boolean hasIsModifier() { 
5808      return this.isModifier != null && !this.isModifier.isEmpty();
5809    }
5810
5811    /**
5812     * @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
5813     */
5814    public ElementDefinition setIsModifierElement(BooleanType value) { 
5815      this.isModifier = value;
5816      return this;
5817    }
5818
5819    /**
5820     * @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.
5821     */
5822    public boolean getIsModifier() { 
5823      return this.isModifier == null || this.isModifier.isEmpty() ? false : this.isModifier.getValue();
5824    }
5825
5826    /**
5827     * @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.
5828     */
5829    public ElementDefinition setIsModifier(boolean value) { 
5830        if (this.isModifier == null)
5831          this.isModifier = new BooleanType();
5832        this.isModifier.setValue(value);
5833      return this;
5834    }
5835
5836    /**
5837     * @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
5838     */
5839    public StringType getIsModifierReasonElement() { 
5840      if (this.isModifierReason == null)
5841        if (Configuration.errorOnAutoCreate())
5842          throw new Error("Attempt to auto-create ElementDefinition.isModifierReason");
5843        else if (Configuration.doAutoCreate())
5844          this.isModifierReason = new StringType(); // bb
5845      return this.isModifierReason;
5846    }
5847
5848    public boolean hasIsModifierReasonElement() { 
5849      return this.isModifierReason != null && !this.isModifierReason.isEmpty();
5850    }
5851
5852    public boolean hasIsModifierReason() { 
5853      return this.isModifierReason != null && !this.isModifierReason.isEmpty();
5854    }
5855
5856    /**
5857     * @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
5858     */
5859    public ElementDefinition setIsModifierReasonElement(StringType value) { 
5860      this.isModifierReason = value;
5861      return this;
5862    }
5863
5864    /**
5865     * @return Explains how that element affects the interpretation of the resource or element that contains it.
5866     */
5867    public String getIsModifierReason() { 
5868      return this.isModifierReason == null ? null : this.isModifierReason.getValue();
5869    }
5870
5871    /**
5872     * @param value Explains how that element affects the interpretation of the resource or element that contains it.
5873     */
5874    public ElementDefinition setIsModifierReason(String value) { 
5875      if (Utilities.noString(value))
5876        this.isModifierReason = null;
5877      else {
5878        if (this.isModifierReason == null)
5879          this.isModifierReason = new StringType();
5880        this.isModifierReason.setValue(value);
5881      }
5882      return this;
5883    }
5884
5885    /**
5886     * @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
5887     */
5888    public BooleanType getIsSummaryElement() { 
5889      if (this.isSummary == null)
5890        if (Configuration.errorOnAutoCreate())
5891          throw new Error("Attempt to auto-create ElementDefinition.isSummary");
5892        else if (Configuration.doAutoCreate())
5893          this.isSummary = new BooleanType(); // bb
5894      return this.isSummary;
5895    }
5896
5897    public boolean hasIsSummaryElement() { 
5898      return this.isSummary != null && !this.isSummary.isEmpty();
5899    }
5900
5901    public boolean hasIsSummary() { 
5902      return this.isSummary != null && !this.isSummary.isEmpty();
5903    }
5904
5905    /**
5906     * @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
5907     */
5908    public ElementDefinition setIsSummaryElement(BooleanType value) { 
5909      this.isSummary = value;
5910      return this;
5911    }
5912
5913    /**
5914     * @return Whether the element should be included if a client requests a search with the parameter _summary=true.
5915     */
5916    public boolean getIsSummary() { 
5917      return this.isSummary == null || this.isSummary.isEmpty() ? false : this.isSummary.getValue();
5918    }
5919
5920    /**
5921     * @param value Whether the element should be included if a client requests a search with the parameter _summary=true.
5922     */
5923    public ElementDefinition setIsSummary(boolean value) { 
5924        if (this.isSummary == null)
5925          this.isSummary = new BooleanType();
5926        this.isSummary.setValue(value);
5927      return this;
5928    }
5929
5930    /**
5931     * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).)
5932     */
5933    public ElementDefinitionBindingComponent getBinding() { 
5934      if (this.binding == null)
5935        if (Configuration.errorOnAutoCreate())
5936          throw new Error("Attempt to auto-create ElementDefinition.binding");
5937        else if (Configuration.doAutoCreate())
5938          this.binding = new ElementDefinitionBindingComponent(); // cc
5939      return this.binding;
5940    }
5941
5942    public boolean hasBinding() { 
5943      return this.binding != null && !this.binding.isEmpty();
5944    }
5945
5946    /**
5947     * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).)
5948     */
5949    public ElementDefinition setBinding(ElementDefinitionBindingComponent value) { 
5950      this.binding = value;
5951      return this;
5952    }
5953
5954    /**
5955     * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.)
5956     */
5957    public List<ElementDefinitionMappingComponent> getMapping() { 
5958      if (this.mapping == null)
5959        this.mapping = new ArrayList<ElementDefinitionMappingComponent>();
5960      return this.mapping;
5961    }
5962
5963    /**
5964     * @return Returns a reference to <code>this</code> for easy method chaining
5965     */
5966    public ElementDefinition setMapping(List<ElementDefinitionMappingComponent> theMapping) { 
5967      this.mapping = theMapping;
5968      return this;
5969    }
5970
5971    public boolean hasMapping() { 
5972      if (this.mapping == null)
5973        return false;
5974      for (ElementDefinitionMappingComponent item : this.mapping)
5975        if (!item.isEmpty())
5976          return true;
5977      return false;
5978    }
5979
5980    public ElementDefinitionMappingComponent addMapping() { //3
5981      ElementDefinitionMappingComponent t = new ElementDefinitionMappingComponent();
5982      if (this.mapping == null)
5983        this.mapping = new ArrayList<ElementDefinitionMappingComponent>();
5984      this.mapping.add(t);
5985      return t;
5986    }
5987
5988    public ElementDefinition addMapping(ElementDefinitionMappingComponent t) { //3
5989      if (t == null)
5990        return this;
5991      if (this.mapping == null)
5992        this.mapping = new ArrayList<ElementDefinitionMappingComponent>();
5993      this.mapping.add(t);
5994      return this;
5995    }
5996
5997    /**
5998     * @return The first repetition of repeating field {@link #mapping}, creating it if it does not already exist
5999     */
6000    public ElementDefinitionMappingComponent getMappingFirstRep() { 
6001      if (getMapping().isEmpty()) {
6002        addMapping();
6003      }
6004      return getMapping().get(0);
6005    }
6006
6007      protected void listChildren(List<Property> children) {
6008        super.listChildren(children);
6009        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));
6010        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));
6011        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));
6012        children.add(new Property("sliceIsConstraining", "boolean", "If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName.", 0, 1, sliceIsConstraining));
6013        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));
6014        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));
6015        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));
6016        children.add(new Property("short", "string", "A concise description of what this element means (e.g. for use in autogenerated summaries).", 0, 1, short_));
6017        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. (Note: The text you are reading is specified in ElementDefinition.definition).", 0, 1, definition));
6018        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. (Note: The text you are reading is specified in ElementDefinition.comment).", 0, 1, comment));
6019        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));
6020        children.add(new Property("alias", "string", "Identifies additional names by which this element might also be known.", 0, java.lang.Integer.MAX_VALUE, alias));
6021        children.add(new Property("min", "unsignedInt", "The minimum number of times this element SHALL appear in the instance.", 0, 1, min));
6022        children.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the instance.", 0, 1, max));
6023        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));
6024        children.add(new Property("contentReference", "uri", "Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc.", 0, 1, contentReference));
6025        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));
6026        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));
6027        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));
6028        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));
6029        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));
6030        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));
6031        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));
6032        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));
6033        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));
6034        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));
6035        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));
6036        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));
6037        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. If false, whether to populate or use the data element in any way is at the discretion of the implementation.", 0, 1, mustSupport));
6038        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));
6039        children.add(new Property("isModifierReason", "string", "Explains how that element affects the interpretation of the resource or element that contains it.", 0, 1, isModifierReason));
6040        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));
6041        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));
6042        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));
6043      }
6044
6045      @Override
6046      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6047        switch (_hash) {
6048        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);
6049        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);
6050        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);
6051        case 333040519: /*sliceIsConstraining*/  return new Property("sliceIsConstraining", "boolean", "If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName.", 0, 1, sliceIsConstraining);
6052        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);
6053        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);
6054        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);
6055        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_);
6056        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. (Note: The text you are reading is specified in ElementDefinition.definition).", 0, 1, definition);
6057        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. (Note: The text you are reading is specified in ElementDefinition.comment).", 0, 1, comment);
6058        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);
6059        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);
6060        case 108114: /*min*/  return new Property("min", "unsignedInt", "The minimum number of times this element SHALL appear in the instance.", 0, 1, min);
6061        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);
6062        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);
6063        case 1193747154: /*contentReference*/  return new Property("contentReference", "uri", "Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc.", 0, 1, contentReference);
6064        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);
6065        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);
6066        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);
6067        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);
6068        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);
6069        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);
6070        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);
6071        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);
6072        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);
6073        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);
6074        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);
6075        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);
6076        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);
6077        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);
6078        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);
6079        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);
6080        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);
6081        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);
6082        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);
6083        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);
6084        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);
6085        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);
6086        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);
6087        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);
6088        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);
6089        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);
6090        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);
6091        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);
6092        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);
6093        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);
6094        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);
6095        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);
6096        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);
6097        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);
6098        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);
6099        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);
6100        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);
6101        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);
6102        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);
6103        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);
6104        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);
6105        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);
6106        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);
6107        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);
6108        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);
6109        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);
6110        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);
6111        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);
6112        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);
6113        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);
6114        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);
6115        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);
6116        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);
6117        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);
6118        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);
6119        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);
6120        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);
6121        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);
6122        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);
6123        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);
6124        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);
6125        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);
6126        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);
6127        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);
6128        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);
6129        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);
6130        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);
6131        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);
6132        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);
6133        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);
6134        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);
6135        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);
6136        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);
6137        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);
6138        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);
6139        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);
6140        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);
6141        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);
6142        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);
6143        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);
6144        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);
6145        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);
6146        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);
6147        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);
6148        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);
6149        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);
6150        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);
6151        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);
6152        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);
6153        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);
6154        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);
6155        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);
6156        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);
6157        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);
6158        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);
6159        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);
6160        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);
6161        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);
6162        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);
6163        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);
6164        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);
6165        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);
6166        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);
6167        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);
6168        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);
6169        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);
6170        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);
6171        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);
6172        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);
6173        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);
6174        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);
6175        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);
6176        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);
6177        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);
6178        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);
6179        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);
6180        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);
6181        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);
6182        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);
6183        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);
6184        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);
6185        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);
6186        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);
6187        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);
6188        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);
6189        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);
6190        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);
6191        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);
6192        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);
6193        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);
6194        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);
6195        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);
6196        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);
6197        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);
6198        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);
6199        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);
6200        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);
6201        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);
6202        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);
6203        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);
6204        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);
6205        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);
6206        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);
6207        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. If false, whether to populate or use the data element in any way is at the discretion of the implementation.", 0, 1, mustSupport);
6208        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);
6209        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);
6210        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);
6211        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);
6212        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);
6213        default: return super.getNamedProperty(_hash, _name, _checkValid);
6214        }
6215
6216      }
6217
6218      @Override
6219      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6220        switch (hash) {
6221        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
6222        case -671065907: /*representation*/ return this.representation == null ? new Base[0] : this.representation.toArray(new Base[this.representation.size()]); // Enumeration<PropertyRepresentation>
6223        case -825289923: /*sliceName*/ return this.sliceName == null ? new Base[0] : new Base[] {this.sliceName}; // StringType
6224        case 333040519: /*sliceIsConstraining*/ return this.sliceIsConstraining == null ? new Base[0] : new Base[] {this.sliceIsConstraining}; // BooleanType
6225        case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType
6226        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // Coding
6227        case -2119287345: /*slicing*/ return this.slicing == null ? new Base[0] : new Base[] {this.slicing}; // ElementDefinitionSlicingComponent
6228        case 109413500: /*short*/ return this.short_ == null ? new Base[0] : new Base[] {this.short_}; // StringType
6229        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // MarkdownType
6230        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // MarkdownType
6231        case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // MarkdownType
6232        case 92902992: /*alias*/ return this.alias == null ? new Base[0] : this.alias.toArray(new Base[this.alias.size()]); // StringType
6233        case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // UnsignedIntType
6234        case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType
6235        case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // ElementDefinitionBaseComponent
6236        case 1193747154: /*contentReference*/ return this.contentReference == null ? new Base[0] : new Base[] {this.contentReference}; // UriType
6237        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // TypeRefComponent
6238        case -659125328: /*defaultValue*/ return this.defaultValue == null ? new Base[0] : new Base[] {this.defaultValue}; // org.hl7.fhir.r4.model.Type
6239        case 1857257103: /*meaningWhenMissing*/ return this.meaningWhenMissing == null ? new Base[0] : new Base[] {this.meaningWhenMissing}; // MarkdownType
6240        case 1828196047: /*orderMeaning*/ return this.orderMeaning == null ? new Base[0] : new Base[] {this.orderMeaning}; // StringType
6241        case 97445748: /*fixed*/ return this.fixed == null ? new Base[0] : new Base[] {this.fixed}; // org.hl7.fhir.r4.model.Type
6242        case -791090288: /*pattern*/ return this.pattern == null ? new Base[0] : new Base[] {this.pattern}; // org.hl7.fhir.r4.model.Type
6243        case -1322970774: /*example*/ return this.example == null ? new Base[0] : this.example.toArray(new Base[this.example.size()]); // ElementDefinitionExampleComponent
6244        case -1376969153: /*minValue*/ return this.minValue == null ? new Base[0] : new Base[] {this.minValue}; // Type
6245        case 399227501: /*maxValue*/ return this.maxValue == null ? new Base[0] : new Base[] {this.maxValue}; // Type
6246        case -791400086: /*maxLength*/ return this.maxLength == null ? new Base[0] : new Base[] {this.maxLength}; // IntegerType
6247        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // IdType
6248        case -190376483: /*constraint*/ return this.constraint == null ? new Base[0] : this.constraint.toArray(new Base[this.constraint.size()]); // ElementDefinitionConstraintComponent
6249        case -1402857082: /*mustSupport*/ return this.mustSupport == null ? new Base[0] : new Base[] {this.mustSupport}; // BooleanType
6250        case -1408783839: /*isModifier*/ return this.isModifier == null ? new Base[0] : new Base[] {this.isModifier}; // BooleanType
6251        case -1854387259: /*isModifierReason*/ return this.isModifierReason == null ? new Base[0] : new Base[] {this.isModifierReason}; // StringType
6252        case 1857548060: /*isSummary*/ return this.isSummary == null ? new Base[0] : new Base[] {this.isSummary}; // BooleanType
6253        case -108220795: /*binding*/ return this.binding == null ? new Base[0] : new Base[] {this.binding}; // ElementDefinitionBindingComponent
6254        case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // ElementDefinitionMappingComponent
6255        default: return super.getProperty(hash, name, checkValid);
6256        }
6257
6258      }
6259
6260      @Override
6261      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6262        switch (hash) {
6263        case 3433509: // path
6264          this.path = castToString(value); // StringType
6265          return value;
6266        case -671065907: // representation
6267          value = new PropertyRepresentationEnumFactory().fromType(castToCode(value));
6268          this.getRepresentation().add((Enumeration) value); // Enumeration<PropertyRepresentation>
6269          return value;
6270        case -825289923: // sliceName
6271          this.sliceName = castToString(value); // StringType
6272          return value;
6273        case 333040519: // sliceIsConstraining
6274          this.sliceIsConstraining = castToBoolean(value); // BooleanType
6275          return value;
6276        case 102727412: // label
6277          this.label = castToString(value); // StringType
6278          return value;
6279        case 3059181: // code
6280          this.getCode().add(castToCoding(value)); // Coding
6281          return value;
6282        case -2119287345: // slicing
6283          this.slicing = (ElementDefinitionSlicingComponent) value; // ElementDefinitionSlicingComponent
6284          return value;
6285        case 109413500: // short
6286          this.short_ = castToString(value); // StringType
6287          return value;
6288        case -1014418093: // definition
6289          this.definition = castToMarkdown(value); // MarkdownType
6290          return value;
6291        case 950398559: // comment
6292          this.comment = castToMarkdown(value); // MarkdownType
6293          return value;
6294        case -1619874672: // requirements
6295          this.requirements = castToMarkdown(value); // MarkdownType
6296          return value;
6297        case 92902992: // alias
6298          this.getAlias().add(castToString(value)); // StringType
6299          return value;
6300        case 108114: // min
6301          this.min = castToUnsignedInt(value); // UnsignedIntType
6302          return value;
6303        case 107876: // max
6304          this.max = castToString(value); // StringType
6305          return value;
6306        case 3016401: // base
6307          this.base = (ElementDefinitionBaseComponent) value; // ElementDefinitionBaseComponent
6308          return value;
6309        case 1193747154: // contentReference
6310          this.contentReference = castToUri(value); // UriType
6311          return value;
6312        case 3575610: // type
6313          this.getType().add((TypeRefComponent) value); // TypeRefComponent
6314          return value;
6315        case -659125328: // defaultValue
6316          this.defaultValue = castToType(value); // org.hl7.fhir.r4.model.Type
6317          return value;
6318        case 1857257103: // meaningWhenMissing
6319          this.meaningWhenMissing = castToMarkdown(value); // MarkdownType
6320          return value;
6321        case 1828196047: // orderMeaning
6322          this.orderMeaning = castToString(value); // StringType
6323          return value;
6324        case 97445748: // fixed
6325          this.fixed = castToType(value); // org.hl7.fhir.r4.model.Type
6326          return value;
6327        case -791090288: // pattern
6328          this.pattern = castToType(value); // org.hl7.fhir.r4.model.Type
6329          return value;
6330        case -1322970774: // example
6331          this.getExample().add((ElementDefinitionExampleComponent) value); // ElementDefinitionExampleComponent
6332          return value;
6333        case -1376969153: // minValue
6334          this.minValue = castToType(value); // Type
6335          return value;
6336        case 399227501: // maxValue
6337          this.maxValue = castToType(value); // Type
6338          return value;
6339        case -791400086: // maxLength
6340          this.maxLength = castToInteger(value); // IntegerType
6341          return value;
6342        case -861311717: // condition
6343          this.getCondition().add(castToId(value)); // IdType
6344          return value;
6345        case -190376483: // constraint
6346          this.getConstraint().add((ElementDefinitionConstraintComponent) value); // ElementDefinitionConstraintComponent
6347          return value;
6348        case -1402857082: // mustSupport
6349          this.mustSupport = castToBoolean(value); // BooleanType
6350          return value;
6351        case -1408783839: // isModifier
6352          this.isModifier = castToBoolean(value); // BooleanType
6353          return value;
6354        case -1854387259: // isModifierReason
6355          this.isModifierReason = castToString(value); // StringType
6356          return value;
6357        case 1857548060: // isSummary
6358          this.isSummary = castToBoolean(value); // BooleanType
6359          return value;
6360        case -108220795: // binding
6361          this.binding = (ElementDefinitionBindingComponent) value; // ElementDefinitionBindingComponent
6362          return value;
6363        case 837556430: // mapping
6364          this.getMapping().add((ElementDefinitionMappingComponent) value); // ElementDefinitionMappingComponent
6365          return value;
6366        default: return super.setProperty(hash, name, value);
6367        }
6368
6369      }
6370
6371      @Override
6372      public Base setProperty(String name, Base value) throws FHIRException {
6373        if (name.equals("path")) {
6374          this.path = castToString(value); // StringType
6375        } else if (name.equals("representation")) {
6376          value = new PropertyRepresentationEnumFactory().fromType(castToCode(value));
6377          this.getRepresentation().add((Enumeration) value);
6378        } else if (name.equals("sliceName")) {
6379          this.sliceName = castToString(value); // StringType
6380        } else if (name.equals("sliceIsConstraining")) {
6381          this.sliceIsConstraining = castToBoolean(value); // BooleanType
6382        } else if (name.equals("label")) {
6383          this.label = castToString(value); // StringType
6384        } else if (name.equals("code")) {
6385          this.getCode().add(castToCoding(value));
6386        } else if (name.equals("slicing")) {
6387          this.slicing = (ElementDefinitionSlicingComponent) value; // ElementDefinitionSlicingComponent
6388        } else if (name.equals("short")) {
6389          this.short_ = castToString(value); // StringType
6390        } else if (name.equals("definition")) {
6391          this.definition = castToMarkdown(value); // MarkdownType
6392        } else if (name.equals("comment")) {
6393          this.comment = castToMarkdown(value); // MarkdownType
6394        } else if (name.equals("requirements")) {
6395          this.requirements = castToMarkdown(value); // MarkdownType
6396        } else if (name.equals("alias")) {
6397          this.getAlias().add(castToString(value));
6398        } else if (name.equals("min")) {
6399          this.min = castToUnsignedInt(value); // UnsignedIntType
6400        } else if (name.equals("max")) {
6401          this.max = castToString(value); // StringType
6402        } else if (name.equals("base")) {
6403          this.base = (ElementDefinitionBaseComponent) value; // ElementDefinitionBaseComponent
6404        } else if (name.equals("contentReference")) {
6405          this.contentReference = castToUri(value); // UriType
6406        } else if (name.equals("type")) {
6407          this.getType().add((TypeRefComponent) value);
6408        } else if (name.equals("defaultValue[x]")) {
6409          this.defaultValue = castToType(value); // org.hl7.fhir.r4.model.Type
6410        } else if (name.equals("meaningWhenMissing")) {
6411          this.meaningWhenMissing = castToMarkdown(value); // MarkdownType
6412        } else if (name.equals("orderMeaning")) {
6413          this.orderMeaning = castToString(value); // StringType
6414        } else if (name.equals("fixed[x]")) {
6415          this.fixed = castToType(value); // org.hl7.fhir.r4.model.Type
6416        } else if (name.equals("pattern[x]")) {
6417          this.pattern = castToType(value); // org.hl7.fhir.r4.model.Type
6418        } else if (name.equals("example")) {
6419          this.getExample().add((ElementDefinitionExampleComponent) value);
6420        } else if (name.equals("minValue[x]")) {
6421          this.minValue = castToType(value); // Type
6422        } else if (name.equals("maxValue[x]")) {
6423          this.maxValue = castToType(value); // Type
6424        } else if (name.equals("maxLength")) {
6425          this.maxLength = castToInteger(value); // IntegerType
6426        } else if (name.equals("condition")) {
6427          this.getCondition().add(castToId(value));
6428        } else if (name.equals("constraint")) {
6429          this.getConstraint().add((ElementDefinitionConstraintComponent) value);
6430        } else if (name.equals("mustSupport")) {
6431          this.mustSupport = castToBoolean(value); // BooleanType
6432        } else if (name.equals("isModifier")) {
6433          this.isModifier = castToBoolean(value); // BooleanType
6434        } else if (name.equals("isModifierReason")) {
6435          this.isModifierReason = castToString(value); // StringType
6436        } else if (name.equals("isSummary")) {
6437          this.isSummary = castToBoolean(value); // BooleanType
6438        } else if (name.equals("binding")) {
6439          this.binding = (ElementDefinitionBindingComponent) value; // ElementDefinitionBindingComponent
6440        } else if (name.equals("mapping")) {
6441          this.getMapping().add((ElementDefinitionMappingComponent) value);
6442        } else
6443          return super.setProperty(name, value);
6444        return value;
6445      }
6446
6447      @Override
6448      public Base makeProperty(int hash, String name) throws FHIRException {
6449        switch (hash) {
6450        case 3433509:  return getPathElement();
6451        case -671065907:  return addRepresentationElement();
6452        case -825289923:  return getSliceNameElement();
6453        case 333040519:  return getSliceIsConstrainingElement();
6454        case 102727412:  return getLabelElement();
6455        case 3059181:  return addCode(); 
6456        case -2119287345:  return getSlicing(); 
6457        case 109413500:  return getShortElement();
6458        case -1014418093:  return getDefinitionElement();
6459        case 950398559:  return getCommentElement();
6460        case -1619874672:  return getRequirementsElement();
6461        case 92902992:  return addAliasElement();
6462        case 108114:  return getMinElement();
6463        case 107876:  return getMaxElement();
6464        case 3016401:  return getBase(); 
6465        case 1193747154:  return getContentReferenceElement();
6466        case 3575610:  return addType(); 
6467        case 587922128:  return getDefaultValue(); 
6468        case -659125328:  return getDefaultValue(); 
6469        case 1857257103:  return getMeaningWhenMissingElement();
6470        case 1828196047:  return getOrderMeaningElement();
6471        case -391522164:  return getFixed(); 
6472        case 97445748:  return getFixed(); 
6473        case -885125392:  return getPattern(); 
6474        case -791090288:  return getPattern(); 
6475        case -1322970774:  return addExample(); 
6476        case -55301663:  return getMinValue(); 
6477        case -1376969153:  return getMinValue(); 
6478        case 622130931:  return getMaxValue(); 
6479        case 399227501:  return getMaxValue(); 
6480        case -791400086:  return getMaxLengthElement();
6481        case -861311717:  return addConditionElement();
6482        case -190376483:  return addConstraint(); 
6483        case -1402857082:  return getMustSupportElement();
6484        case -1408783839:  return getIsModifierElement();
6485        case -1854387259:  return getIsModifierReasonElement();
6486        case 1857548060:  return getIsSummaryElement();
6487        case -108220795:  return getBinding(); 
6488        case 837556430:  return addMapping(); 
6489        default: return super.makeProperty(hash, name);
6490        }
6491
6492      }
6493
6494      @Override
6495      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6496        switch (hash) {
6497        case 3433509: /*path*/ return new String[] {"string"};
6498        case -671065907: /*representation*/ return new String[] {"code"};
6499        case -825289923: /*sliceName*/ return new String[] {"string"};
6500        case 333040519: /*sliceIsConstraining*/ return new String[] {"boolean"};
6501        case 102727412: /*label*/ return new String[] {"string"};
6502        case 3059181: /*code*/ return new String[] {"Coding"};
6503        case -2119287345: /*slicing*/ return new String[] {};
6504        case 109413500: /*short*/ return new String[] {"string"};
6505        case -1014418093: /*definition*/ return new String[] {"markdown"};
6506        case 950398559: /*comment*/ return new String[] {"markdown"};
6507        case -1619874672: /*requirements*/ return new String[] {"markdown"};
6508        case 92902992: /*alias*/ return new String[] {"string"};
6509        case 108114: /*min*/ return new String[] {"unsignedInt"};
6510        case 107876: /*max*/ return new String[] {"string"};
6511        case 3016401: /*base*/ return new String[] {};
6512        case 1193747154: /*contentReference*/ return new String[] {"uri"};
6513        case 3575610: /*type*/ return new String[] {};
6514        case -659125328: /*defaultValue*/ return new String[] {"*"};
6515        case 1857257103: /*meaningWhenMissing*/ return new String[] {"markdown"};
6516        case 1828196047: /*orderMeaning*/ return new String[] {"string"};
6517        case 97445748: /*fixed*/ return new String[] {"*"};
6518        case -791090288: /*pattern*/ return new String[] {"*"};
6519        case -1322970774: /*example*/ return new String[] {};
6520        case -1376969153: /*minValue*/ return new String[] {"date", "dateTime", "instant", "time", "decimal", "integer", "positiveInt", "unsignedInt", "Quantity"};
6521        case 399227501: /*maxValue*/ return new String[] {"date", "dateTime", "instant", "time", "decimal", "integer", "positiveInt", "unsignedInt", "Quantity"};
6522        case -791400086: /*maxLength*/ return new String[] {"integer"};
6523        case -861311717: /*condition*/ return new String[] {"id"};
6524        case -190376483: /*constraint*/ return new String[] {};
6525        case -1402857082: /*mustSupport*/ return new String[] {"boolean"};
6526        case -1408783839: /*isModifier*/ return new String[] {"boolean"};
6527        case -1854387259: /*isModifierReason*/ return new String[] {"string"};
6528        case 1857548060: /*isSummary*/ return new String[] {"boolean"};
6529        case -108220795: /*binding*/ return new String[] {};
6530        case 837556430: /*mapping*/ return new String[] {};
6531        default: return super.getTypesForProperty(hash, name);
6532        }
6533
6534      }
6535
6536      @Override
6537      public Base addChild(String name) throws FHIRException {
6538        if (name.equals("path")) {
6539          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.path");
6540        }
6541        else if (name.equals("representation")) {
6542          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.representation");
6543        }
6544        else if (name.equals("sliceName")) {
6545          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.sliceName");
6546        }
6547        else if (name.equals("sliceIsConstraining")) {
6548          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.sliceIsConstraining");
6549        }
6550        else if (name.equals("label")) {
6551          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.label");
6552        }
6553        else if (name.equals("code")) {
6554          return addCode();
6555        }
6556        else if (name.equals("slicing")) {
6557          this.slicing = new ElementDefinitionSlicingComponent();
6558          return this.slicing;
6559        }
6560        else if (name.equals("short")) {
6561          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.short");
6562        }
6563        else if (name.equals("definition")) {
6564          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.definition");
6565        }
6566        else if (name.equals("comment")) {
6567          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.comment");
6568        }
6569        else if (name.equals("requirements")) {
6570          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.requirements");
6571        }
6572        else if (name.equals("alias")) {
6573          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.alias");
6574        }
6575        else if (name.equals("min")) {
6576          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.min");
6577        }
6578        else if (name.equals("max")) {
6579          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.max");
6580        }
6581        else if (name.equals("base")) {
6582          this.base = new ElementDefinitionBaseComponent();
6583          return this.base;
6584        }
6585        else if (name.equals("contentReference")) {
6586          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.contentReference");
6587        }
6588        else if (name.equals("type")) {
6589          return addType();
6590        }
6591        else if (name.equals("defaultValueBase64Binary")) {
6592          this.defaultValue = new Base64BinaryType();
6593          return this.defaultValue;
6594        }
6595        else if (name.equals("defaultValueBoolean")) {
6596          this.defaultValue = new BooleanType();
6597          return this.defaultValue;
6598        }
6599        else if (name.equals("defaultValueCanonical")) {
6600          this.defaultValue = new CanonicalType();
6601          return this.defaultValue;
6602        }
6603        else if (name.equals("defaultValueCode")) {
6604          this.defaultValue = new CodeType();
6605          return this.defaultValue;
6606        }
6607        else if (name.equals("defaultValueDate")) {
6608          this.defaultValue = new DateType();
6609          return this.defaultValue;
6610        }
6611        else if (name.equals("defaultValueDateTime")) {
6612          this.defaultValue = new DateTimeType();
6613          return this.defaultValue;
6614        }
6615        else if (name.equals("defaultValueDecimal")) {
6616          this.defaultValue = new DecimalType();
6617          return this.defaultValue;
6618        }
6619        else if (name.equals("defaultValueId")) {
6620          this.defaultValue = new IdType();
6621          return this.defaultValue;
6622        }
6623        else if (name.equals("defaultValueInstant")) {
6624          this.defaultValue = new InstantType();
6625          return this.defaultValue;
6626        }
6627        else if (name.equals("defaultValueInteger")) {
6628          this.defaultValue = new IntegerType();
6629          return this.defaultValue;
6630        }
6631        else if (name.equals("defaultValueMarkdown")) {
6632          this.defaultValue = new MarkdownType();
6633          return this.defaultValue;
6634        }
6635        else if (name.equals("defaultValueOid")) {
6636          this.defaultValue = new OidType();
6637          return this.defaultValue;
6638        }
6639        else if (name.equals("defaultValuePositiveInt")) {
6640          this.defaultValue = new PositiveIntType();
6641          return this.defaultValue;
6642        }
6643        else if (name.equals("defaultValueString")) {
6644          this.defaultValue = new StringType();
6645          return this.defaultValue;
6646        }
6647        else if (name.equals("defaultValueTime")) {
6648          this.defaultValue = new TimeType();
6649          return this.defaultValue;
6650        }
6651        else if (name.equals("defaultValueUnsignedInt")) {
6652          this.defaultValue = new UnsignedIntType();
6653          return this.defaultValue;
6654        }
6655        else if (name.equals("defaultValueUri")) {
6656          this.defaultValue = new UriType();
6657          return this.defaultValue;
6658        }
6659        else if (name.equals("defaultValueUrl")) {
6660          this.defaultValue = new UrlType();
6661          return this.defaultValue;
6662        }
6663        else if (name.equals("defaultValueUuid")) {
6664          this.defaultValue = new UuidType();
6665          return this.defaultValue;
6666        }
6667        else if (name.equals("defaultValueAddress")) {
6668          this.defaultValue = new Address();
6669          return this.defaultValue;
6670        }
6671        else if (name.equals("defaultValueAge")) {
6672          this.defaultValue = new Age();
6673          return this.defaultValue;
6674        }
6675        else if (name.equals("defaultValueAnnotation")) {
6676          this.defaultValue = new Annotation();
6677          return this.defaultValue;
6678        }
6679        else if (name.equals("defaultValueAttachment")) {
6680          this.defaultValue = new Attachment();
6681          return this.defaultValue;
6682        }
6683        else if (name.equals("defaultValueCodeableConcept")) {
6684          this.defaultValue = new CodeableConcept();
6685          return this.defaultValue;
6686        }
6687        else if (name.equals("defaultValueCoding")) {
6688          this.defaultValue = new Coding();
6689          return this.defaultValue;
6690        }
6691        else if (name.equals("defaultValueContactPoint")) {
6692          this.defaultValue = new ContactPoint();
6693          return this.defaultValue;
6694        }
6695        else if (name.equals("defaultValueCount")) {
6696          this.defaultValue = new Count();
6697          return this.defaultValue;
6698        }
6699        else if (name.equals("defaultValueDistance")) {
6700          this.defaultValue = new Distance();
6701          return this.defaultValue;
6702        }
6703        else if (name.equals("defaultValueDuration")) {
6704          this.defaultValue = new Duration();
6705          return this.defaultValue;
6706        }
6707        else if (name.equals("defaultValueHumanName")) {
6708          this.defaultValue = new HumanName();
6709          return this.defaultValue;
6710        }
6711        else if (name.equals("defaultValueIdentifier")) {
6712          this.defaultValue = new Identifier();
6713          return this.defaultValue;
6714        }
6715        else if (name.equals("defaultValueMoney")) {
6716          this.defaultValue = new Money();
6717          return this.defaultValue;
6718        }
6719        else if (name.equals("defaultValuePeriod")) {
6720          this.defaultValue = new Period();
6721          return this.defaultValue;
6722        }
6723        else if (name.equals("defaultValueQuantity")) {
6724          this.defaultValue = new Quantity();
6725          return this.defaultValue;
6726        }
6727        else if (name.equals("defaultValueRange")) {
6728          this.defaultValue = new Range();
6729          return this.defaultValue;
6730        }
6731        else if (name.equals("defaultValueRatio")) {
6732          this.defaultValue = new Ratio();
6733          return this.defaultValue;
6734        }
6735        else if (name.equals("defaultValueReference")) {
6736          this.defaultValue = new Reference();
6737          return this.defaultValue;
6738        }
6739        else if (name.equals("defaultValueSampledData")) {
6740          this.defaultValue = new SampledData();
6741          return this.defaultValue;
6742        }
6743        else if (name.equals("defaultValueSignature")) {
6744          this.defaultValue = new Signature();
6745          return this.defaultValue;
6746        }
6747        else if (name.equals("defaultValueTiming")) {
6748          this.defaultValue = new Timing();
6749          return this.defaultValue;
6750        }
6751        else if (name.equals("defaultValueParameterDefinition")) {
6752          this.defaultValue = new ParameterDefinition();
6753          return this.defaultValue;
6754        }
6755        else if (name.equals("defaultValueDataRequirement")) {
6756          this.defaultValue = new DataRequirement();
6757          return this.defaultValue;
6758        }
6759        else if (name.equals("defaultValueRelatedArtifact")) {
6760          this.defaultValue = new RelatedArtifact();
6761          return this.defaultValue;
6762        }
6763        else if (name.equals("defaultValueContactDetail")) {
6764          this.defaultValue = new ContactDetail();
6765          return this.defaultValue;
6766        }
6767        else if (name.equals("defaultValueContributor")) {
6768          this.defaultValue = new Contributor();
6769          return this.defaultValue;
6770        }
6771        else if (name.equals("defaultValueTriggerDefinition")) {
6772          this.defaultValue = new TriggerDefinition();
6773          return this.defaultValue;
6774        }
6775        else if (name.equals("defaultValueExpression")) {
6776          this.defaultValue = new Expression();
6777          return this.defaultValue;
6778        }
6779        else if (name.equals("defaultValueUsageContext")) {
6780          this.defaultValue = new UsageContext();
6781          return this.defaultValue;
6782        }
6783        else if (name.equals("defaultValueDosage")) {
6784          this.defaultValue = new Dosage();
6785          return this.defaultValue;
6786        }
6787        else if (name.equals("meaningWhenMissing")) {
6788          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.meaningWhenMissing");
6789        }
6790        else if (name.equals("orderMeaning")) {
6791          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.orderMeaning");
6792        }
6793        else if (name.equals("fixedBase64Binary")) {
6794          this.fixed = new Base64BinaryType();
6795          return this.fixed;
6796        }
6797        else if (name.equals("fixedBoolean")) {
6798          this.fixed = new BooleanType();
6799          return this.fixed;
6800        }
6801        else if (name.equals("fixedCanonical")) {
6802          this.fixed = new CanonicalType();
6803          return this.fixed;
6804        }
6805        else if (name.equals("fixedCode")) {
6806          this.fixed = new CodeType();
6807          return this.fixed;
6808        }
6809        else if (name.equals("fixedDate")) {
6810          this.fixed = new DateType();
6811          return this.fixed;
6812        }
6813        else if (name.equals("fixedDateTime")) {
6814          this.fixed = new DateTimeType();
6815          return this.fixed;
6816        }
6817        else if (name.equals("fixedDecimal")) {
6818          this.fixed = new DecimalType();
6819          return this.fixed;
6820        }
6821        else if (name.equals("fixedId")) {
6822          this.fixed = new IdType();
6823          return this.fixed;
6824        }
6825        else if (name.equals("fixedInstant")) {
6826          this.fixed = new InstantType();
6827          return this.fixed;
6828        }
6829        else if (name.equals("fixedInteger")) {
6830          this.fixed = new IntegerType();
6831          return this.fixed;
6832        }
6833        else if (name.equals("fixedMarkdown")) {
6834          this.fixed = new MarkdownType();
6835          return this.fixed;
6836        }
6837        else if (name.equals("fixedOid")) {
6838          this.fixed = new OidType();
6839          return this.fixed;
6840        }
6841        else if (name.equals("fixedPositiveInt")) {
6842          this.fixed = new PositiveIntType();
6843          return this.fixed;
6844        }
6845        else if (name.equals("fixedString")) {
6846          this.fixed = new StringType();
6847          return this.fixed;
6848        }
6849        else if (name.equals("fixedTime")) {
6850          this.fixed = new TimeType();
6851          return this.fixed;
6852        }
6853        else if (name.equals("fixedUnsignedInt")) {
6854          this.fixed = new UnsignedIntType();
6855          return this.fixed;
6856        }
6857        else if (name.equals("fixedUri")) {
6858          this.fixed = new UriType();
6859          return this.fixed;
6860        }
6861        else if (name.equals("fixedUrl")) {
6862          this.fixed = new UrlType();
6863          return this.fixed;
6864        }
6865        else if (name.equals("fixedUuid")) {
6866          this.fixed = new UuidType();
6867          return this.fixed;
6868        }
6869        else if (name.equals("fixedAddress")) {
6870          this.fixed = new Address();
6871          return this.fixed;
6872        }
6873        else if (name.equals("fixedAge")) {
6874          this.fixed = new Age();
6875          return this.fixed;
6876        }
6877        else if (name.equals("fixedAnnotation")) {
6878          this.fixed = new Annotation();
6879          return this.fixed;
6880        }
6881        else if (name.equals("fixedAttachment")) {
6882          this.fixed = new Attachment();
6883          return this.fixed;
6884        }
6885        else if (name.equals("fixedCodeableConcept")) {
6886          this.fixed = new CodeableConcept();
6887          return this.fixed;
6888        }
6889        else if (name.equals("fixedCoding")) {
6890          this.fixed = new Coding();
6891          return this.fixed;
6892        }
6893        else if (name.equals("fixedContactPoint")) {
6894          this.fixed = new ContactPoint();
6895          return this.fixed;
6896        }
6897        else if (name.equals("fixedCount")) {
6898          this.fixed = new Count();
6899          return this.fixed;
6900        }
6901        else if (name.equals("fixedDistance")) {
6902          this.fixed = new Distance();
6903          return this.fixed;
6904        }
6905        else if (name.equals("fixedDuration")) {
6906          this.fixed = new Duration();
6907          return this.fixed;
6908        }
6909        else if (name.equals("fixedHumanName")) {
6910          this.fixed = new HumanName();
6911          return this.fixed;
6912        }
6913        else if (name.equals("fixedIdentifier")) {
6914          this.fixed = new Identifier();
6915          return this.fixed;
6916        }
6917        else if (name.equals("fixedMoney")) {
6918          this.fixed = new Money();
6919          return this.fixed;
6920        }
6921        else if (name.equals("fixedPeriod")) {
6922          this.fixed = new Period();
6923          return this.fixed;
6924        }
6925        else if (name.equals("fixedQuantity")) {
6926          this.fixed = new Quantity();
6927          return this.fixed;
6928        }
6929        else if (name.equals("fixedRange")) {
6930          this.fixed = new Range();
6931          return this.fixed;
6932        }
6933        else if (name.equals("fixedRatio")) {
6934          this.fixed = new Ratio();
6935          return this.fixed;
6936        }
6937        else if (name.equals("fixedReference")) {
6938          this.fixed = new Reference();
6939          return this.fixed;
6940        }
6941        else if (name.equals("fixedSampledData")) {
6942          this.fixed = new SampledData();
6943          return this.fixed;
6944        }
6945        else if (name.equals("fixedSignature")) {
6946          this.fixed = new Signature();
6947          return this.fixed;
6948        }
6949        else if (name.equals("fixedTiming")) {
6950          this.fixed = new Timing();
6951          return this.fixed;
6952        }
6953        else if (name.equals("fixedParameterDefinition")) {
6954          this.fixed = new ParameterDefinition();
6955          return this.fixed;
6956        }
6957        else if (name.equals("fixedDataRequirement")) {
6958          this.fixed = new DataRequirement();
6959          return this.fixed;
6960        }
6961        else if (name.equals("fixedRelatedArtifact")) {
6962          this.fixed = new RelatedArtifact();
6963          return this.fixed;
6964        }
6965        else if (name.equals("fixedContactDetail")) {
6966          this.fixed = new ContactDetail();
6967          return this.fixed;
6968        }
6969        else if (name.equals("fixedContributor")) {
6970          this.fixed = new Contributor();
6971          return this.fixed;
6972        }
6973        else if (name.equals("fixedTriggerDefinition")) {
6974          this.fixed = new TriggerDefinition();
6975          return this.fixed;
6976        }
6977        else if (name.equals("fixedExpression")) {
6978          this.fixed = new Expression();
6979          return this.fixed;
6980        }
6981        else if (name.equals("fixedUsageContext")) {
6982          this.fixed = new UsageContext();
6983          return this.fixed;
6984        }
6985        else if (name.equals("fixedDosage")) {
6986          this.fixed = new Dosage();
6987          return this.fixed;
6988        }
6989        else if (name.equals("patternBase64Binary")) {
6990          this.pattern = new Base64BinaryType();
6991          return this.pattern;
6992        }
6993        else if (name.equals("patternBoolean")) {
6994          this.pattern = new BooleanType();
6995          return this.pattern;
6996        }
6997        else if (name.equals("patternCanonical")) {
6998          this.pattern = new CanonicalType();
6999          return this.pattern;
7000        }
7001        else if (name.equals("patternCode")) {
7002          this.pattern = new CodeType();
7003          return this.pattern;
7004        }
7005        else if (name.equals("patternDate")) {
7006          this.pattern = new DateType();
7007          return this.pattern;
7008        }
7009        else if (name.equals("patternDateTime")) {
7010          this.pattern = new DateTimeType();
7011          return this.pattern;
7012        }
7013        else if (name.equals("patternDecimal")) {
7014          this.pattern = new DecimalType();
7015          return this.pattern;
7016        }
7017        else if (name.equals("patternId")) {
7018          this.pattern = new IdType();
7019          return this.pattern;
7020        }
7021        else if (name.equals("patternInstant")) {
7022          this.pattern = new InstantType();
7023          return this.pattern;
7024        }
7025        else if (name.equals("patternInteger")) {
7026          this.pattern = new IntegerType();
7027          return this.pattern;
7028        }
7029        else if (name.equals("patternMarkdown")) {
7030          this.pattern = new MarkdownType();
7031          return this.pattern;
7032        }
7033        else if (name.equals("patternOid")) {
7034          this.pattern = new OidType();
7035          return this.pattern;
7036        }
7037        else if (name.equals("patternPositiveInt")) {
7038          this.pattern = new PositiveIntType();
7039          return this.pattern;
7040        }
7041        else if (name.equals("patternString")) {
7042          this.pattern = new StringType();
7043          return this.pattern;
7044        }
7045        else if (name.equals("patternTime")) {
7046          this.pattern = new TimeType();
7047          return this.pattern;
7048        }
7049        else if (name.equals("patternUnsignedInt")) {
7050          this.pattern = new UnsignedIntType();
7051          return this.pattern;
7052        }
7053        else if (name.equals("patternUri")) {
7054          this.pattern = new UriType();
7055          return this.pattern;
7056        }
7057        else if (name.equals("patternUrl")) {
7058          this.pattern = new UrlType();
7059          return this.pattern;
7060        }
7061        else if (name.equals("patternUuid")) {
7062          this.pattern = new UuidType();
7063          return this.pattern;
7064        }
7065        else if (name.equals("patternAddress")) {
7066          this.pattern = new Address();
7067          return this.pattern;
7068        }
7069        else if (name.equals("patternAge")) {
7070          this.pattern = new Age();
7071          return this.pattern;
7072        }
7073        else if (name.equals("patternAnnotation")) {
7074          this.pattern = new Annotation();
7075          return this.pattern;
7076        }
7077        else if (name.equals("patternAttachment")) {
7078          this.pattern = new Attachment();
7079          return this.pattern;
7080        }
7081        else if (name.equals("patternCodeableConcept")) {
7082          this.pattern = new CodeableConcept();
7083          return this.pattern;
7084        }
7085        else if (name.equals("patternCoding")) {
7086          this.pattern = new Coding();
7087          return this.pattern;
7088        }
7089        else if (name.equals("patternContactPoint")) {
7090          this.pattern = new ContactPoint();
7091          return this.pattern;
7092        }
7093        else if (name.equals("patternCount")) {
7094          this.pattern = new Count();
7095          return this.pattern;
7096        }
7097        else if (name.equals("patternDistance")) {
7098          this.pattern = new Distance();
7099          return this.pattern;
7100        }
7101        else if (name.equals("patternDuration")) {
7102          this.pattern = new Duration();
7103          return this.pattern;
7104        }
7105        else if (name.equals("patternHumanName")) {
7106          this.pattern = new HumanName();
7107          return this.pattern;
7108        }
7109        else if (name.equals("patternIdentifier")) {
7110          this.pattern = new Identifier();
7111          return this.pattern;
7112        }
7113        else if (name.equals("patternMoney")) {
7114          this.pattern = new Money();
7115          return this.pattern;
7116        }
7117        else if (name.equals("patternPeriod")) {
7118          this.pattern = new Period();
7119          return this.pattern;
7120        }
7121        else if (name.equals("patternQuantity")) {
7122          this.pattern = new Quantity();
7123          return this.pattern;
7124        }
7125        else if (name.equals("patternRange")) {
7126          this.pattern = new Range();
7127          return this.pattern;
7128        }
7129        else if (name.equals("patternRatio")) {
7130          this.pattern = new Ratio();
7131          return this.pattern;
7132        }
7133        else if (name.equals("patternReference")) {
7134          this.pattern = new Reference();
7135          return this.pattern;
7136        }
7137        else if (name.equals("patternSampledData")) {
7138          this.pattern = new SampledData();
7139          return this.pattern;
7140        }
7141        else if (name.equals("patternSignature")) {
7142          this.pattern = new Signature();
7143          return this.pattern;
7144        }
7145        else if (name.equals("patternTiming")) {
7146          this.pattern = new Timing();
7147          return this.pattern;
7148        }
7149        else if (name.equals("patternParameterDefinition")) {
7150          this.pattern = new ParameterDefinition();
7151          return this.pattern;
7152        }
7153        else if (name.equals("patternDataRequirement")) {
7154          this.pattern = new DataRequirement();
7155          return this.pattern;
7156        }
7157        else if (name.equals("patternRelatedArtifact")) {
7158          this.pattern = new RelatedArtifact();
7159          return this.pattern;
7160        }
7161        else if (name.equals("patternContactDetail")) {
7162          this.pattern = new ContactDetail();
7163          return this.pattern;
7164        }
7165        else if (name.equals("patternContributor")) {
7166          this.pattern = new Contributor();
7167          return this.pattern;
7168        }
7169        else if (name.equals("patternTriggerDefinition")) {
7170          this.pattern = new TriggerDefinition();
7171          return this.pattern;
7172        }
7173        else if (name.equals("patternExpression")) {
7174          this.pattern = new Expression();
7175          return this.pattern;
7176        }
7177        else if (name.equals("patternUsageContext")) {
7178          this.pattern = new UsageContext();
7179          return this.pattern;
7180        }
7181        else if (name.equals("patternDosage")) {
7182          this.pattern = new Dosage();
7183          return this.pattern;
7184        }
7185        else if (name.equals("example")) {
7186          return addExample();
7187        }
7188        else if (name.equals("minValueDate")) {
7189          this.minValue = new DateType();
7190          return this.minValue;
7191        }
7192        else if (name.equals("minValueDateTime")) {
7193          this.minValue = new DateTimeType();
7194          return this.minValue;
7195        }
7196        else if (name.equals("minValueInstant")) {
7197          this.minValue = new InstantType();
7198          return this.minValue;
7199        }
7200        else if (name.equals("minValueTime")) {
7201          this.minValue = new TimeType();
7202          return this.minValue;
7203        }
7204        else if (name.equals("minValueDecimal")) {
7205          this.minValue = new DecimalType();
7206          return this.minValue;
7207        }
7208        else if (name.equals("minValueInteger")) {
7209          this.minValue = new IntegerType();
7210          return this.minValue;
7211        }
7212        else if (name.equals("minValuePositiveInt")) {
7213          this.minValue = new PositiveIntType();
7214          return this.minValue;
7215        }
7216        else if (name.equals("minValueUnsignedInt")) {
7217          this.minValue = new UnsignedIntType();
7218          return this.minValue;
7219        }
7220        else if (name.equals("minValueQuantity")) {
7221          this.minValue = new Quantity();
7222          return this.minValue;
7223        }
7224        else if (name.equals("maxValueDate")) {
7225          this.maxValue = new DateType();
7226          return this.maxValue;
7227        }
7228        else if (name.equals("maxValueDateTime")) {
7229          this.maxValue = new DateTimeType();
7230          return this.maxValue;
7231        }
7232        else if (name.equals("maxValueInstant")) {
7233          this.maxValue = new InstantType();
7234          return this.maxValue;
7235        }
7236        else if (name.equals("maxValueTime")) {
7237          this.maxValue = new TimeType();
7238          return this.maxValue;
7239        }
7240        else if (name.equals("maxValueDecimal")) {
7241          this.maxValue = new DecimalType();
7242          return this.maxValue;
7243        }
7244        else if (name.equals("maxValueInteger")) {
7245          this.maxValue = new IntegerType();
7246          return this.maxValue;
7247        }
7248        else if (name.equals("maxValuePositiveInt")) {
7249          this.maxValue = new PositiveIntType();
7250          return this.maxValue;
7251        }
7252        else if (name.equals("maxValueUnsignedInt")) {
7253          this.maxValue = new UnsignedIntType();
7254          return this.maxValue;
7255        }
7256        else if (name.equals("maxValueQuantity")) {
7257          this.maxValue = new Quantity();
7258          return this.maxValue;
7259        }
7260        else if (name.equals("maxLength")) {
7261          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.maxLength");
7262        }
7263        else if (name.equals("condition")) {
7264          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.condition");
7265        }
7266        else if (name.equals("constraint")) {
7267          return addConstraint();
7268        }
7269        else if (name.equals("mustSupport")) {
7270          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.mustSupport");
7271        }
7272        else if (name.equals("isModifier")) {
7273          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isModifier");
7274        }
7275        else if (name.equals("isModifierReason")) {
7276          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isModifierReason");
7277        }
7278        else if (name.equals("isSummary")) {
7279          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isSummary");
7280        }
7281        else if (name.equals("binding")) {
7282          this.binding = new ElementDefinitionBindingComponent();
7283          return this.binding;
7284        }
7285        else if (name.equals("mapping")) {
7286          return addMapping();
7287        }
7288        else
7289          return super.addChild(name);
7290      }
7291
7292  public String fhirType() {
7293    return "ElementDefinition";
7294
7295  }
7296
7297      public ElementDefinition copy() {
7298        ElementDefinition dst = new ElementDefinition();
7299        copyValues(dst);
7300        dst.path = path == null ? null : path.copy();
7301        if (representation != null) {
7302          dst.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
7303          for (Enumeration<PropertyRepresentation> i : representation)
7304            dst.representation.add(i.copy());
7305        };
7306        dst.sliceName = sliceName == null ? null : sliceName.copy();
7307        dst.sliceIsConstraining = sliceIsConstraining == null ? null : sliceIsConstraining.copy();
7308        dst.label = label == null ? null : label.copy();
7309        if (code != null) {
7310          dst.code = new ArrayList<Coding>();
7311          for (Coding i : code)
7312            dst.code.add(i.copy());
7313        };
7314        dst.slicing = slicing == null ? null : slicing.copy();
7315        dst.short_ = short_ == null ? null : short_.copy();
7316        dst.definition = definition == null ? null : definition.copy();
7317        dst.comment = comment == null ? null : comment.copy();
7318        dst.requirements = requirements == null ? null : requirements.copy();
7319        if (alias != null) {
7320          dst.alias = new ArrayList<StringType>();
7321          for (StringType i : alias)
7322            dst.alias.add(i.copy());
7323        };
7324        dst.min = min == null ? null : min.copy();
7325        dst.max = max == null ? null : max.copy();
7326        dst.base = base == null ? null : base.copy();
7327        dst.contentReference = contentReference == null ? null : contentReference.copy();
7328        if (type != null) {
7329          dst.type = new ArrayList<TypeRefComponent>();
7330          for (TypeRefComponent i : type)
7331            dst.type.add(i.copy());
7332        };
7333        dst.defaultValue = defaultValue == null ? null : defaultValue.copy();
7334        dst.meaningWhenMissing = meaningWhenMissing == null ? null : meaningWhenMissing.copy();
7335        dst.orderMeaning = orderMeaning == null ? null : orderMeaning.copy();
7336        dst.fixed = fixed == null ? null : fixed.copy();
7337        dst.pattern = pattern == null ? null : pattern.copy();
7338        if (example != null) {
7339          dst.example = new ArrayList<ElementDefinitionExampleComponent>();
7340          for (ElementDefinitionExampleComponent i : example)
7341            dst.example.add(i.copy());
7342        };
7343        dst.minValue = minValue == null ? null : minValue.copy();
7344        dst.maxValue = maxValue == null ? null : maxValue.copy();
7345        dst.maxLength = maxLength == null ? null : maxLength.copy();
7346        if (condition != null) {
7347          dst.condition = new ArrayList<IdType>();
7348          for (IdType i : condition)
7349            dst.condition.add(i.copy());
7350        };
7351        if (constraint != null) {
7352          dst.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
7353          for (ElementDefinitionConstraintComponent i : constraint)
7354            dst.constraint.add(i.copy());
7355        };
7356        dst.mustSupport = mustSupport == null ? null : mustSupport.copy();
7357        dst.isModifier = isModifier == null ? null : isModifier.copy();
7358        dst.isModifierReason = isModifierReason == null ? null : isModifierReason.copy();
7359        dst.isSummary = isSummary == null ? null : isSummary.copy();
7360        dst.binding = binding == null ? null : binding.copy();
7361        if (mapping != null) {
7362          dst.mapping = new ArrayList<ElementDefinitionMappingComponent>();
7363          for (ElementDefinitionMappingComponent i : mapping)
7364            dst.mapping.add(i.copy());
7365        };
7366        return dst;
7367      }
7368
7369      protected ElementDefinition typedCopy() {
7370        return copy();
7371      }
7372
7373      @Override
7374      public boolean equalsDeep(Base other_) {
7375        if (!super.equalsDeep(other_))
7376          return false;
7377        if (!(other_ instanceof ElementDefinition))
7378          return false;
7379        ElementDefinition o = (ElementDefinition) other_;
7380        return compareDeep(path, o.path, true) && compareDeep(representation, o.representation, true) && compareDeep(sliceName, o.sliceName, true)
7381           && compareDeep(sliceIsConstraining, o.sliceIsConstraining, true) && compareDeep(label, o.label, true)
7382           && compareDeep(code, o.code, true) && compareDeep(slicing, o.slicing, true) && compareDeep(short_, o.short_, true)
7383           && compareDeep(definition, o.definition, true) && compareDeep(comment, o.comment, true) && compareDeep(requirements, o.requirements, true)
7384           && compareDeep(alias, o.alias, true) && compareDeep(min, o.min, true) && compareDeep(max, o.max, true)
7385           && compareDeep(base, o.base, true) && compareDeep(contentReference, o.contentReference, true) && compareDeep(type, o.type, true)
7386           && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(meaningWhenMissing, o.meaningWhenMissing, true)
7387           && compareDeep(orderMeaning, o.orderMeaning, true) && compareDeep(fixed, o.fixed, true) && compareDeep(pattern, o.pattern, true)
7388           && compareDeep(example, o.example, true) && compareDeep(minValue, o.minValue, true) && compareDeep(maxValue, o.maxValue, true)
7389           && compareDeep(maxLength, o.maxLength, true) && compareDeep(condition, o.condition, true) && compareDeep(constraint, o.constraint, true)
7390           && compareDeep(mustSupport, o.mustSupport, true) && compareDeep(isModifier, o.isModifier, true)
7391           && compareDeep(isModifierReason, o.isModifierReason, true) && compareDeep(isSummary, o.isSummary, true)
7392           && compareDeep(binding, o.binding, true) && compareDeep(mapping, o.mapping, true);
7393      }
7394
7395      @Override
7396      public boolean equalsShallow(Base other_) {
7397        if (!super.equalsShallow(other_))
7398          return false;
7399        if (!(other_ instanceof ElementDefinition))
7400          return false;
7401        ElementDefinition o = (ElementDefinition) other_;
7402        return compareValues(path, o.path, true) && compareValues(representation, o.representation, true) && compareValues(sliceName, o.sliceName, true)
7403           && compareValues(sliceIsConstraining, o.sliceIsConstraining, true) && compareValues(label, o.label, true)
7404           && compareValues(short_, o.short_, true) && compareValues(definition, o.definition, true) && compareValues(comment, o.comment, true)
7405           && compareValues(requirements, o.requirements, true) && compareValues(alias, o.alias, true) && compareValues(min, o.min, true)
7406           && compareValues(max, o.max, true) && compareValues(contentReference, o.contentReference, true) && compareValues(meaningWhenMissing, o.meaningWhenMissing, true)
7407           && compareValues(orderMeaning, o.orderMeaning, true) && compareValues(maxLength, o.maxLength, true)
7408           && compareValues(condition, o.condition, true) && compareValues(mustSupport, o.mustSupport, true) && compareValues(isModifier, o.isModifier, true)
7409           && compareValues(isModifierReason, o.isModifierReason, true) && compareValues(isSummary, o.isSummary, true)
7410          ;
7411      }
7412
7413      public boolean isEmpty() {
7414        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(path, representation, sliceName
7415          , sliceIsConstraining, label, code, slicing, short_, definition, comment, requirements
7416          , alias, min, max, base, contentReference, type, defaultValue, meaningWhenMissing
7417          , orderMeaning, fixed, pattern, example, minValue, maxValue, maxLength, condition
7418          , constraint, mustSupport, isModifier, isModifierReason, isSummary, binding, mapping
7419          );
7420      }
7421
7422// added from java-adornments.txt:
7423  
7424  public String toString() {
7425    if (hasId())
7426      return getId();
7427    if (hasSliceName())
7428      return getPath()+":"+getSliceName();
7429    else
7430      return getPath();
7431  }
7432    
7433  public void makeBase(String path, int min, String max) {
7434    ElementDefinitionBaseComponent self = getBase();
7435    self.setPath(path);
7436    self.setMin(min);
7437    self.setMax(max);
7438  }
7439  
7440  public void makeBase() {
7441    ElementDefinitionBaseComponent self = getBase();
7442    self.setPath(getPath());
7443    self.setMin(getMin());
7444    self.setMax(getMax());
7445  }
7446  
7447  
7448  
7449  public String typeSummary() {
7450    CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
7451    for (TypeRefComponent tr : type) {
7452      if (tr.hasCode())
7453        b.append(tr.getCode());
7454    }
7455    return b.toString();
7456   }
7457  
7458  public TypeRefComponent getType(String code) {
7459    for (TypeRefComponent tr : getType()) 
7460      if (tr.getCode().equals(code))
7461        return tr;
7462    TypeRefComponent tr = new TypeRefComponent();
7463    tr.setCode(code);
7464    type.add(tr);
7465    return tr;
7466  }
7467
7468  public static final boolean NOT_MODIFIER = false;
7469  public static final boolean NOT_IN_SUMMARY = false;
7470  public static final boolean IS_MODIFIER = true;
7471  public static final boolean IS_IN_SUMMARY = true;
7472  public ElementDefinition(boolean defaults, boolean modifier, boolean inSummary) {
7473    super();
7474    if (defaults) {
7475      setIsModifier(modifier);
7476      setIsSummary(inSummary);
7477    }
7478  }  
7479
7480
7481// end addition
7482
7483}
7484