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