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