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