001package org.hl7.fhir.r5.model;
002
003
004/*
005 * #%L
006 * org.hl7.fhir.r5
007 * %%
008 * Copyright (C) 2014 - 2019 Health Level 7
009 * %%
010 * Licensed under the Apache License, Version 2.0 (the \"License\");
011 * you may not use this file except in compliance with the License.
012 * You may obtain a copy of the License at
013 * 
014 *      http://www.apache.org/licenses/LICENSE-2.0
015 * 
016 * Unless required by applicable law or agreed to in writing, software
017 * distributed under the License is distributed on an \"AS IS\" BASIS,
018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
019 * See the License for the specific language governing permissions and
020 * limitations under the License.
021 * #L%
022 */
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, \
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this \
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, \
034     this list of conditions and the following disclaimer in the documentation \
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
049  POSSIBILITY OF SUCH DAMAGE.
050  */
051
052// Generated on Tue, Dec 31, 2019 12:12+1100 for FHIR vcurrent
053
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057import org.hl7.fhir.utilities.Utilities;
058import org.hl7.fhir.r5.model.Enumerations.*;
059import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
060import org.hl7.fhir.exceptions.FHIRException;
061import org.hl7.fhir.instance.model.api.ICompositeType;
062import ca.uhn.fhir.model.api.annotation.Child;
063import ca.uhn.fhir.model.api.annotation.ChildOrder;
064import ca.uhn.fhir.model.api.annotation.DatatypeDef;
065import ca.uhn.fhir.model.api.annotation.Description;
066import ca.uhn.fhir.model.api.annotation.Block;
067
068import org.hl7.fhir.instance.model.api.ICompositeType;
069import  org.hl7.fhir.r5.model.Enumerations.BindingStrength;
070import  org.hl7.fhir.r5.model.Enumerations.BindingStrengthEnumFactory;
071import  org.hl7.fhir.r5.utils.ToolingExtensions;
072import  org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
073import  org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
074/**
075 * Base StructureDefinition for ElementDefinition Type: Captures constraints on each element within the resource, profile, or extension.
076 */
077@DatatypeDef(name="ElementDefinition")
078public class ElementDefinition extends BackboneType implements ICompositeType {
079
080    public enum AggregationMode {
081        /**
082         * The reference is a local reference to a contained resource.
083         */
084        CONTAINED, 
085        /**
086         * The reference to a resource that has to be resolved externally to the resource that includes the reference.
087         */
088        REFERENCED, 
089        /**
090         * The resource the reference points to will be found in the same bundle as the resource that includes the reference.
091         */
092        BUNDLED, 
093        /**
094         * added to help the parsers with the generic types
095         */
096        NULL;
097        public static AggregationMode fromCode(String codeString) throws FHIRException {
098            if (codeString == null || "".equals(codeString))
099                return null;
100        if ("contained".equals(codeString))
101          return CONTAINED;
102        if ("referenced".equals(codeString))
103          return REFERENCED;
104        if ("bundled".equals(codeString))
105          return BUNDLED;
106        if (Configuration.isAcceptInvalidEnums())
107          return null;
108        else
109          throw new FHIRException("Unknown AggregationMode code '"+codeString+"'");
110        }
111        public String toCode() {
112          switch (this) {
113            case CONTAINED: return "contained";
114            case REFERENCED: return "referenced";
115            case BUNDLED: return "bundled";
116            default: return "?";
117          }
118        }
119        public String getSystem() {
120          switch (this) {
121            case CONTAINED: return "http://hl7.org/fhir/resource-aggregation-mode";
122            case REFERENCED: return "http://hl7.org/fhir/resource-aggregation-mode";
123            case BUNDLED: return "http://hl7.org/fhir/resource-aggregation-mode";
124            default: return "?";
125          }
126        }
127        public String getDefinition() {
128          switch (this) {
129            case CONTAINED: return "The reference is a local reference to a contained resource.";
130            case REFERENCED: return "The reference to a resource that has to be resolved externally to the resource that includes the reference.";
131            case BUNDLED: return "The resource the reference points to will be found in the same bundle as the resource that includes the reference.";
132            default: return "?";
133          }
134        }
135        public String getDisplay() {
136          switch (this) {
137            case CONTAINED: return "Contained";
138            case REFERENCED: return "Referenced";
139            case BUNDLED: return "Bundled";
140            default: return "?";
141          }
142        }
143    }
144
145  public static class AggregationModeEnumFactory implements EnumFactory<AggregationMode> {
146    public AggregationMode fromCode(String codeString) throws IllegalArgumentException {
147      if (codeString == null || "".equals(codeString))
148            if (codeString == null || "".equals(codeString))
149                return null;
150        if ("contained".equals(codeString))
151          return AggregationMode.CONTAINED;
152        if ("referenced".equals(codeString))
153          return AggregationMode.REFERENCED;
154        if ("bundled".equals(codeString))
155          return AggregationMode.BUNDLED;
156        throw new IllegalArgumentException("Unknown AggregationMode code '"+codeString+"'");
157        }
158        public Enumeration<AggregationMode> fromType(Base code) throws FHIRException {
159          if (code == null)
160            return null;
161          if (code.isEmpty())
162            return new Enumeration<AggregationMode>(this);
163          String codeString = ((PrimitiveType) code).asStringValue();
164          if (codeString == null || "".equals(codeString))
165            return null;
166        if ("contained".equals(codeString))
167          return new Enumeration<AggregationMode>(this, AggregationMode.CONTAINED);
168        if ("referenced".equals(codeString))
169          return new Enumeration<AggregationMode>(this, AggregationMode.REFERENCED);
170        if ("bundled".equals(codeString))
171          return new Enumeration<AggregationMode>(this, AggregationMode.BUNDLED);
172        throw new FHIRException("Unknown AggregationMode code '"+codeString+"'");
173        }
174    public String toCode(AggregationMode code) {
175      if (code == AggregationMode.CONTAINED)
176        return "contained";
177      if (code == AggregationMode.REFERENCED)
178        return "referenced";
179      if (code == AggregationMode.BUNDLED)
180        return "bundled";
181      return "?";
182      }
183    public String toSystem(AggregationMode code) {
184      return code.getSystem();
185      }
186    }
187
188    public enum ConstraintSeverity {
189        /**
190         * If the constraint is violated, the resource is not conformant.
191         */
192        ERROR, 
193        /**
194         * If the constraint is violated, the resource is conformant, but it is not necessarily following best practice.
195         */
196        WARNING, 
197        /**
198         * added to help the parsers with the generic types
199         */
200        NULL;
201        public static ConstraintSeverity fromCode(String codeString) throws FHIRException {
202            if (codeString == null || "".equals(codeString))
203                return null;
204        if ("error".equals(codeString))
205          return ERROR;
206        if ("warning".equals(codeString))
207          return WARNING;
208        if (Configuration.isAcceptInvalidEnums())
209          return null;
210        else
211          throw new FHIRException("Unknown ConstraintSeverity code '"+codeString+"'");
212        }
213        public String toCode() {
214          switch (this) {
215            case ERROR: return "error";
216            case WARNING: return "warning";
217            default: return "?";
218          }
219        }
220        public String getSystem() {
221          switch (this) {
222            case ERROR: return "http://hl7.org/fhir/constraint-severity";
223            case WARNING: return "http://hl7.org/fhir/constraint-severity";
224            default: return "?";
225          }
226        }
227        public String getDefinition() {
228          switch (this) {
229            case ERROR: return "If the constraint is violated, the resource is not conformant.";
230            case WARNING: return "If the constraint is violated, the resource is conformant, but it is not necessarily following best practice.";
231            default: return "?";
232          }
233        }
234        public String getDisplay() {
235          switch (this) {
236            case ERROR: return "Error";
237            case WARNING: return "Warning";
238            default: return "?";
239          }
240        }
241    }
242
243  public static class ConstraintSeverityEnumFactory implements EnumFactory<ConstraintSeverity> {
244    public ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException {
245      if (codeString == null || "".equals(codeString))
246            if (codeString == null || "".equals(codeString))
247                return null;
248        if ("error".equals(codeString))
249          return ConstraintSeverity.ERROR;
250        if ("warning".equals(codeString))
251          return ConstraintSeverity.WARNING;
252        throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'");
253        }
254        public Enumeration<ConstraintSeverity> fromType(Base code) throws FHIRException {
255          if (code == null)
256            return null;
257          if (code.isEmpty())
258            return new Enumeration<ConstraintSeverity>(this);
259          String codeString = ((PrimitiveType) code).asStringValue();
260          if (codeString == null || "".equals(codeString))
261            return null;
262        if ("error".equals(codeString))
263          return new Enumeration<ConstraintSeverity>(this, ConstraintSeverity.ERROR);
264        if ("warning".equals(codeString))
265          return new Enumeration<ConstraintSeverity>(this, ConstraintSeverity.WARNING);
266        throw new FHIRException("Unknown ConstraintSeverity code '"+codeString+"'");
267        }
268    public String toCode(ConstraintSeverity code) {
269      if (code == ConstraintSeverity.ERROR)
270        return "error";
271      if (code == ConstraintSeverity.WARNING)
272        return "warning";
273      return "?";
274      }
275    public String toSystem(ConstraintSeverity code) {
276      return code.getSystem();
277      }
278    }
279
280    public enum DiscriminatorType {
281        /**
282         * The slices have different values in the nominated element.
283         */
284        VALUE, 
285        /**
286         * The slices are differentiated by the presence or absence of the nominated element.
287         */
288        EXISTS, 
289        /**
290         * The slices have different values in the nominated element, as determined by testing them against the applicable ElementDefinition.pattern[x].
291         */
292        PATTERN, 
293        /**
294         * The slices are differentiated by type of the nominated element.
295         */
296        TYPE, 
297        /**
298         * 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.
299         */
300        PROFILE, 
301        /**
302         * added to help the parsers with the generic types
303         */
304        NULL;
305        public static DiscriminatorType fromCode(String codeString) throws FHIRException {
306            if (codeString == null || "".equals(codeString))
307                return null;
308        if ("value".equals(codeString))
309          return VALUE;
310        if ("exists".equals(codeString))
311          return EXISTS;
312        if ("pattern".equals(codeString))
313          return PATTERN;
314        if ("type".equals(codeString))
315          return TYPE;
316        if ("profile".equals(codeString))
317          return PROFILE;
318        if (Configuration.isAcceptInvalidEnums())
319          return null;
320        else
321          throw new FHIRException("Unknown DiscriminatorType code '"+codeString+"'");
322        }
323        public String toCode() {
324          switch (this) {
325            case VALUE: return "value";
326            case EXISTS: return "exists";
327            case PATTERN: return "pattern";
328            case TYPE: return "type";
329            case PROFILE: return "profile";
330            default: return "?";
331          }
332        }
333        public String getSystem() {
334          switch (this) {
335            case VALUE: return "http://hl7.org/fhir/discriminator-type";
336            case EXISTS: return "http://hl7.org/fhir/discriminator-type";
337            case PATTERN: return "http://hl7.org/fhir/discriminator-type";
338            case TYPE: return "http://hl7.org/fhir/discriminator-type";
339            case PROFILE: return "http://hl7.org/fhir/discriminator-type";
340            default: return "?";
341          }
342        }
343        public String getDefinition() {
344          switch (this) {
345            case VALUE: return "The slices have different values in the nominated element.";
346            case EXISTS: return "The slices are differentiated by the presence or absence of the nominated element.";
347            case PATTERN: return "The slices have different values in the nominated element, as determined by testing them against the applicable ElementDefinition.pattern[x].";
348            case TYPE: return "The slices are differentiated by type of the nominated element.";
349            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.";
350            default: return "?";
351          }
352        }
353        public String getDisplay() {
354          switch (this) {
355            case VALUE: return "Value";
356            case EXISTS: return "Exists";
357            case PATTERN: return "Pattern";
358            case TYPE: return "Type";
359            case PROFILE: return "Profile";
360            default: return "?";
361          }
362        }
363    }
364
365  public static class DiscriminatorTypeEnumFactory implements EnumFactory<DiscriminatorType> {
366    public DiscriminatorType fromCode(String codeString) throws IllegalArgumentException {
367      if (codeString == null || "".equals(codeString))
368            if (codeString == null || "".equals(codeString))
369                return null;
370        if ("value".equals(codeString))
371          return DiscriminatorType.VALUE;
372        if ("exists".equals(codeString))
373          return DiscriminatorType.EXISTS;
374        if ("pattern".equals(codeString))
375          return DiscriminatorType.PATTERN;
376        if ("type".equals(codeString))
377          return DiscriminatorType.TYPE;
378        if ("profile".equals(codeString))
379          return DiscriminatorType.PROFILE;
380        throw new IllegalArgumentException("Unknown DiscriminatorType code '"+codeString+"'");
381        }
382        public Enumeration<DiscriminatorType> fromType(Base code) throws FHIRException {
383          if (code == null)
384            return null;
385          if (code.isEmpty())
386            return new Enumeration<DiscriminatorType>(this);
387          String codeString = ((PrimitiveType) code).asStringValue();
388          if (codeString == null || "".equals(codeString))
389            return null;
390        if ("value".equals(codeString))
391          return new Enumeration<DiscriminatorType>(this, DiscriminatorType.VALUE);
392        if ("exists".equals(codeString))
393          return new Enumeration<DiscriminatorType>(this, DiscriminatorType.EXISTS);
394        if ("pattern".equals(codeString))
395          return new Enumeration<DiscriminatorType>(this, DiscriminatorType.PATTERN);
396        if ("type".equals(codeString))
397          return new Enumeration<DiscriminatorType>(this, DiscriminatorType.TYPE);
398        if ("profile".equals(codeString))
399          return new Enumeration<DiscriminatorType>(this, DiscriminatorType.PROFILE);
400        throw new FHIRException("Unknown DiscriminatorType code '"+codeString+"'");
401        }
402    public String toCode(DiscriminatorType code) {
403      if (code == DiscriminatorType.VALUE)
404        return "value";
405      if (code == DiscriminatorType.EXISTS)
406        return "exists";
407      if (code == DiscriminatorType.PATTERN)
408        return "pattern";
409      if (code == DiscriminatorType.TYPE)
410        return "type";
411      if (code == DiscriminatorType.PROFILE)
412        return "profile";
413      return "?";
414      }
415    public String toSystem(DiscriminatorType code) {
416      return code.getSystem();
417      }
418    }
419
420    public enum PropertyRepresentation {
421        /**
422         * In XML, this property is represented as an attribute not an element.
423         */
424        XMLATTR, 
425        /**
426         * This element is represented using the XML text attribute (primitives only).
427         */
428        XMLTEXT, 
429        /**
430         * The type of this element is indicated using xsi:type.
431         */
432        TYPEATTR, 
433        /**
434         * Use CDA narrative instead of XHTML.
435         */
436        CDATEXT, 
437        /**
438         * The property is represented using XHTML.
439         */
440        XHTML, 
441        /**
442         * added to help the parsers with the generic types
443         */
444        NULL;
445        public static PropertyRepresentation fromCode(String codeString) throws FHIRException {
446            if (codeString == null || "".equals(codeString))
447                return null;
448        if ("xmlAttr".equals(codeString))
449          return XMLATTR;
450        if ("xmlText".equals(codeString))
451          return XMLTEXT;
452        if ("typeAttr".equals(codeString))
453          return TYPEATTR;
454        if ("cdaText".equals(codeString))
455          return CDATEXT;
456        if ("xhtml".equals(codeString))
457          return XHTML;
458        if (Configuration.isAcceptInvalidEnums())
459          return null;
460        else
461          throw new FHIRException("Unknown PropertyRepresentation code '"+codeString+"'");
462        }
463        public String toCode() {
464          switch (this) {
465            case XMLATTR: return "xmlAttr";
466            case XMLTEXT: return "xmlText";
467            case TYPEATTR: return "typeAttr";
468            case CDATEXT: return "cdaText";
469            case XHTML: return "xhtml";
470            default: return "?";
471          }
472        }
473        public String getSystem() {
474          switch (this) {
475            case XMLATTR: return "http://hl7.org/fhir/property-representation";
476            case XMLTEXT: return "http://hl7.org/fhir/property-representation";
477            case TYPEATTR: return "http://hl7.org/fhir/property-representation";
478            case CDATEXT: return "http://hl7.org/fhir/property-representation";
479            case XHTML: return "http://hl7.org/fhir/property-representation";
480            default: return "?";
481          }
482        }
483        public String getDefinition() {
484          switch (this) {
485            case XMLATTR: return "In XML, this property is represented as an attribute not an element.";
486            case XMLTEXT: return "This element is represented using the XML text attribute (primitives only).";
487            case TYPEATTR: return "The type of this element is indicated using xsi:type.";
488            case CDATEXT: return "Use CDA narrative instead of XHTML.";
489            case XHTML: return "The property is represented using XHTML.";
490            default: return "?";
491          }
492        }
493        public String getDisplay() {
494          switch (this) {
495            case XMLATTR: return "XML Attribute";
496            case XMLTEXT: return "XML Text";
497            case TYPEATTR: return "Type Attribute";
498            case CDATEXT: return "CDA Text Format";
499            case XHTML: return "XHTML";
500            default: return "?";
501          }
502        }
503    }
504
505  public static class PropertyRepresentationEnumFactory implements EnumFactory<PropertyRepresentation> {
506    public PropertyRepresentation fromCode(String codeString) throws IllegalArgumentException {
507      if (codeString == null || "".equals(codeString))
508            if (codeString == null || "".equals(codeString))
509                return null;
510        if ("xmlAttr".equals(codeString))
511          return PropertyRepresentation.XMLATTR;
512        if ("xmlText".equals(codeString))
513          return PropertyRepresentation.XMLTEXT;
514        if ("typeAttr".equals(codeString))
515          return PropertyRepresentation.TYPEATTR;
516        if ("cdaText".equals(codeString))
517          return PropertyRepresentation.CDATEXT;
518        if ("xhtml".equals(codeString))
519          return PropertyRepresentation.XHTML;
520        throw new IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'");
521        }
522        public Enumeration<PropertyRepresentation> fromType(Base code) throws FHIRException {
523          if (code == null)
524            return null;
525          if (code.isEmpty())
526            return new Enumeration<PropertyRepresentation>(this);
527          String codeString = ((PrimitiveType) code).asStringValue();
528          if (codeString == null || "".equals(codeString))
529            return null;
530        if ("xmlAttr".equals(codeString))
531          return new Enumeration<PropertyRepresentation>(this, PropertyRepresentation.XMLATTR);
532        if ("xmlText".equals(codeString))
533          return new Enumeration<PropertyRepresentation>(this, PropertyRepresentation.XMLTEXT);
534        if ("typeAttr".equals(codeString))
535          return new Enumeration<PropertyRepresentation>(this, PropertyRepresentation.TYPEATTR);
536        if ("cdaText".equals(codeString))
537          return new Enumeration<PropertyRepresentation>(this, PropertyRepresentation.CDATEXT);
538        if ("xhtml".equals(codeString))
539          return new Enumeration<PropertyRepresentation>(this, PropertyRepresentation.XHTML);
540        throw new FHIRException("Unknown PropertyRepresentation code '"+codeString+"'");
541        }
542    public String toCode(PropertyRepresentation code) {
543      if (code == PropertyRepresentation.XMLATTR)
544        return "xmlAttr";
545      if (code == PropertyRepresentation.XMLTEXT)
546        return "xmlText";
547      if (code == PropertyRepresentation.TYPEATTR)
548        return "typeAttr";
549      if (code == PropertyRepresentation.CDATEXT)
550        return "cdaText";
551      if (code == PropertyRepresentation.XHTML)
552        return "xhtml";
553      return "?";
554      }
555    public String toSystem(PropertyRepresentation code) {
556      return code.getSystem();
557      }
558    }
559
560    public enum ReferenceVersionRules {
561        /**
562         * The reference may be either version independent or version specific.
563         */
564        EITHER, 
565        /**
566         * The reference must be version independent.
567         */
568        INDEPENDENT, 
569        /**
570         * The reference must be version specific.
571         */
572        SPECIFIC, 
573        /**
574         * added to help the parsers with the generic types
575         */
576        NULL;
577        public static ReferenceVersionRules fromCode(String codeString) throws FHIRException {
578            if (codeString == null || "".equals(codeString))
579                return null;
580        if ("either".equals(codeString))
581          return EITHER;
582        if ("independent".equals(codeString))
583          return INDEPENDENT;
584        if ("specific".equals(codeString))
585          return SPECIFIC;
586        if (Configuration.isAcceptInvalidEnums())
587          return null;
588        else
589          throw new FHIRException("Unknown ReferenceVersionRules code '"+codeString+"'");
590        }
591        public String toCode() {
592          switch (this) {
593            case EITHER: return "either";
594            case INDEPENDENT: return "independent";
595            case SPECIFIC: return "specific";
596            default: return "?";
597          }
598        }
599        public String getSystem() {
600          switch (this) {
601            case EITHER: return "http://hl7.org/fhir/reference-version-rules";
602            case INDEPENDENT: return "http://hl7.org/fhir/reference-version-rules";
603            case SPECIFIC: return "http://hl7.org/fhir/reference-version-rules";
604            default: return "?";
605          }
606        }
607        public String getDefinition() {
608          switch (this) {
609            case EITHER: return "The reference may be either version independent or version specific.";
610            case INDEPENDENT: return "The reference must be version independent.";
611            case SPECIFIC: return "The reference must be version specific.";
612            default: return "?";
613          }
614        }
615        public String getDisplay() {
616          switch (this) {
617            case EITHER: return "Either Specific or independent";
618            case INDEPENDENT: return "Version independent";
619            case SPECIFIC: return "Version Specific";
620            default: return "?";
621          }
622        }
623    }
624
625  public static class ReferenceVersionRulesEnumFactory implements EnumFactory<ReferenceVersionRules> {
626    public ReferenceVersionRules fromCode(String codeString) throws IllegalArgumentException {
627      if (codeString == null || "".equals(codeString))
628            if (codeString == null || "".equals(codeString))
629                return null;
630        if ("either".equals(codeString))
631          return ReferenceVersionRules.EITHER;
632        if ("independent".equals(codeString))
633          return ReferenceVersionRules.INDEPENDENT;
634        if ("specific".equals(codeString))
635          return ReferenceVersionRules.SPECIFIC;
636        throw new IllegalArgumentException("Unknown ReferenceVersionRules code '"+codeString+"'");
637        }
638        public Enumeration<ReferenceVersionRules> fromType(Base code) throws FHIRException {
639          if (code == null)
640            return null;
641          if (code.isEmpty())
642            return new Enumeration<ReferenceVersionRules>(this);
643          String codeString = ((PrimitiveType) code).asStringValue();
644          if (codeString == null || "".equals(codeString))
645            return null;
646        if ("either".equals(codeString))
647          return new Enumeration<ReferenceVersionRules>(this, ReferenceVersionRules.EITHER);
648        if ("independent".equals(codeString))
649          return new Enumeration<ReferenceVersionRules>(this, ReferenceVersionRules.INDEPENDENT);
650        if ("specific".equals(codeString))
651          return new Enumeration<ReferenceVersionRules>(this, ReferenceVersionRules.SPECIFIC);
652        throw new FHIRException("Unknown ReferenceVersionRules code '"+codeString+"'");
653        }
654    public String toCode(ReferenceVersionRules code) {
655      if (code == ReferenceVersionRules.EITHER)
656        return "either";
657      if (code == ReferenceVersionRules.INDEPENDENT)
658        return "independent";
659      if (code == ReferenceVersionRules.SPECIFIC)
660        return "specific";
661      return "?";
662      }
663    public String toSystem(ReferenceVersionRules code) {
664      return code.getSystem();
665      }
666    }
667
668    public enum SlicingRules {
669        /**
670         * No additional content is allowed other than that described by the slices in this profile.
671         */
672        CLOSED, 
673        /**
674         * Additional content is allowed anywhere in the list.
675         */
676        OPEN, 
677        /**
678         * 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.
679         */
680        OPENATEND, 
681        /**
682         * added to help the parsers with the generic types
683         */
684        NULL;
685        public static SlicingRules fromCode(String codeString) throws FHIRException {
686            if (codeString == null || "".equals(codeString))
687                return null;
688        if ("closed".equals(codeString))
689          return CLOSED;
690        if ("open".equals(codeString))
691          return OPEN;
692        if ("openAtEnd".equals(codeString))
693          return OPENATEND;
694        if (Configuration.isAcceptInvalidEnums())
695          return null;
696        else
697          throw new FHIRException("Unknown SlicingRules code '"+codeString+"'");
698        }
699        public String toCode() {
700          switch (this) {
701            case CLOSED: return "closed";
702            case OPEN: return "open";
703            case OPENATEND: return "openAtEnd";
704            default: return "?";
705          }
706        }
707        public String getSystem() {
708          switch (this) {
709            case CLOSED: return "http://hl7.org/fhir/resource-slicing-rules";
710            case OPEN: return "http://hl7.org/fhir/resource-slicing-rules";
711            case OPENATEND: return "http://hl7.org/fhir/resource-slicing-rules";
712            default: return "?";
713          }
714        }
715        public String getDefinition() {
716          switch (this) {
717            case CLOSED: return "No additional content is allowed other than that described by the slices in this profile.";
718            case OPEN: return "Additional content is allowed anywhere in the list.";
719            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.";
720            default: return "?";
721          }
722        }
723        public String getDisplay() {
724          switch (this) {
725            case CLOSED: return "Closed";
726            case OPEN: return "Open";
727            case OPENATEND: return "Open at End";
728            default: return "?";
729          }
730        }
731    }
732
733  public static class SlicingRulesEnumFactory implements EnumFactory<SlicingRules> {
734    public SlicingRules fromCode(String codeString) throws IllegalArgumentException {
735      if (codeString == null || "".equals(codeString))
736            if (codeString == null || "".equals(codeString))
737                return null;
738        if ("closed".equals(codeString))
739          return SlicingRules.CLOSED;
740        if ("open".equals(codeString))
741          return SlicingRules.OPEN;
742        if ("openAtEnd".equals(codeString))
743          return SlicingRules.OPENATEND;
744        throw new IllegalArgumentException("Unknown SlicingRules code '"+codeString+"'");
745        }
746        public Enumeration<SlicingRules> fromType(Base code) throws FHIRException {
747          if (code == null)
748            return null;
749          if (code.isEmpty())
750            return new Enumeration<SlicingRules>(this);
751          String codeString = ((PrimitiveType) code).asStringValue();
752          if (codeString == null || "".equals(codeString))
753            return null;
754        if ("closed".equals(codeString))
755          return new Enumeration<SlicingRules>(this, SlicingRules.CLOSED);
756        if ("open".equals(codeString))
757          return new Enumeration<SlicingRules>(this, SlicingRules.OPEN);
758        if ("openAtEnd".equals(codeString))
759          return new Enumeration<SlicingRules>(this, SlicingRules.OPENATEND);
760        throw new FHIRException("Unknown SlicingRules code '"+codeString+"'");
761        }
762    public String toCode(SlicingRules code) {
763      if (code == SlicingRules.CLOSED)
764        return "closed";
765      if (code == SlicingRules.OPEN)
766        return "open";
767      if (code == SlicingRules.OPENATEND)
768        return "openAtEnd";
769      return "?";
770      }
771    public String toSystem(SlicingRules code) {
772      return code.getSystem();
773      }
774    }
775
776    @Block()
777    public static class ElementDefinitionSlicingComponent extends Element implements IBaseDatatypeElement {
778        /**
779         * 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.
780         */
781        @Child(name = "discriminator", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
782        @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." )
783        protected List<ElementDefinitionSlicingDiscriminatorComponent> discriminator;
784
785        /**
786         * 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.
787         */
788        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
789        @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." )
790        protected StringType description;
791
792        /**
793         * If the matching elements have to occur in the same order as defined in the profile.
794         */
795        @Child(name = "ordered", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true)
796        @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." )
797        protected BooleanType ordered;
798
799        /**
800         * 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.
801         */
802        @Child(name = "rules", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true)
803        @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." )
804        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-slicing-rules")
805        protected Enumeration<SlicingRules> rules;
806
807        private static final long serialVersionUID = -311635839L;
808
809    /**
810     * Constructor
811     */
812      public ElementDefinitionSlicingComponent() {
813        super();
814      }
815
816    /**
817     * Constructor
818     */
819      public ElementDefinitionSlicingComponent(SlicingRules rules) {
820        super();
821        this.setRules(rules);
822      }
823
824        /**
825         * @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.)
826         */
827        public List<ElementDefinitionSlicingDiscriminatorComponent> getDiscriminator() { 
828          if (this.discriminator == null)
829            this.discriminator = new ArrayList<ElementDefinitionSlicingDiscriminatorComponent>();
830          return this.discriminator;
831        }
832
833        /**
834         * @return Returns a reference to <code>this</code> for easy method chaining
835         */
836        public ElementDefinitionSlicingComponent setDiscriminator(List<ElementDefinitionSlicingDiscriminatorComponent> theDiscriminator) { 
837          this.discriminator = theDiscriminator;
838          return this;
839        }
840
841        public boolean hasDiscriminator() { 
842          if (this.discriminator == null)
843            return false;
844          for (ElementDefinitionSlicingDiscriminatorComponent item : this.discriminator)
845            if (!item.isEmpty())
846              return true;
847          return false;
848        }
849
850        public ElementDefinitionSlicingDiscriminatorComponent addDiscriminator() { //3
851          ElementDefinitionSlicingDiscriminatorComponent t = new ElementDefinitionSlicingDiscriminatorComponent();
852          if (this.discriminator == null)
853            this.discriminator = new ArrayList<ElementDefinitionSlicingDiscriminatorComponent>();
854          this.discriminator.add(t);
855          return t;
856        }
857
858        public ElementDefinitionSlicingComponent addDiscriminator(ElementDefinitionSlicingDiscriminatorComponent t) { //3
859          if (t == null)
860            return this;
861          if (this.discriminator == null)
862            this.discriminator = new ArrayList<ElementDefinitionSlicingDiscriminatorComponent>();
863          this.discriminator.add(t);
864          return this;
865        }
866
867        /**
868         * @return The first repetition of repeating field {@link #discriminator}, creating it if it does not already exist {3}
869         */
870        public ElementDefinitionSlicingDiscriminatorComponent getDiscriminatorFirstRep() { 
871          if (getDiscriminator().isEmpty()) {
872            addDiscriminator();
873          }
874          return getDiscriminator().get(0);
875        }
876
877        /**
878         * @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
879         */
880        public StringType getDescriptionElement() { 
881          if (this.description == null)
882            if (Configuration.errorOnAutoCreate())
883              throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.description");
884            else if (Configuration.doAutoCreate())
885              this.description = new StringType(); // bb
886          return this.description;
887        }
888
889        public boolean hasDescriptionElement() { 
890          return this.description != null && !this.description.isEmpty();
891        }
892
893        public boolean hasDescription() { 
894          return this.description != null && !this.description.isEmpty();
895        }
896
897        /**
898         * @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
899         */
900        public ElementDefinitionSlicingComponent setDescriptionElement(StringType value) { 
901          this.description = value;
902          return this;
903        }
904
905        /**
906         * @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.
907         */
908        public String getDescription() { 
909          return this.description == null ? null : this.description.getValue();
910        }
911
912        /**
913         * @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.
914         */
915        public ElementDefinitionSlicingComponent setDescription(String value) { 
916          if (Utilities.noString(value))
917            this.description = null;
918          else {
919            if (this.description == null)
920              this.description = new StringType();
921            this.description.setValue(value);
922          }
923          return this;
924        }
925
926        /**
927         * @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
928         */
929        public BooleanType getOrderedElement() { 
930          if (this.ordered == null)
931            if (Configuration.errorOnAutoCreate())
932              throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.ordered");
933            else if (Configuration.doAutoCreate())
934              this.ordered = new BooleanType(); // bb
935          return this.ordered;
936        }
937
938        public boolean hasOrderedElement() { 
939          return this.ordered != null && !this.ordered.isEmpty();
940        }
941
942        public boolean hasOrdered() { 
943          return this.ordered != null && !this.ordered.isEmpty();
944        }
945
946        /**
947         * @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
948         */
949        public ElementDefinitionSlicingComponent setOrderedElement(BooleanType value) { 
950          this.ordered = value;
951          return this;
952        }
953
954        /**
955         * @return If the matching elements have to occur in the same order as defined in the profile.
956         */
957        public boolean getOrdered() { 
958          return this.ordered == null || this.ordered.isEmpty() ? false : this.ordered.getValue();
959        }
960
961        /**
962         * @param value If the matching elements have to occur in the same order as defined in the profile.
963         */
964        public ElementDefinitionSlicingComponent setOrdered(boolean value) { 
965            if (this.ordered == null)
966              this.ordered = new BooleanType();
967            this.ordered.setValue(value);
968          return this;
969        }
970
971        /**
972         * @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
973         */
974        public Enumeration<SlicingRules> getRulesElement() { 
975          if (this.rules == null)
976            if (Configuration.errorOnAutoCreate())
977              throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.rules");
978            else if (Configuration.doAutoCreate())
979              this.rules = new Enumeration<SlicingRules>(new SlicingRulesEnumFactory()); // bb
980          return this.rules;
981        }
982
983        public boolean hasRulesElement() { 
984          return this.rules != null && !this.rules.isEmpty();
985        }
986
987        public boolean hasRules() { 
988          return this.rules != null && !this.rules.isEmpty();
989        }
990
991        /**
992         * @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
993         */
994        public ElementDefinitionSlicingComponent setRulesElement(Enumeration<SlicingRules> value) { 
995          this.rules = value;
996          return this;
997        }
998
999        /**
1000         * @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.
1001         */
1002        public SlicingRules getRules() { 
1003          return this.rules == null ? null : this.rules.getValue();
1004        }
1005
1006        /**
1007         * @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.
1008         */
1009        public ElementDefinitionSlicingComponent setRules(SlicingRules value) { 
1010            if (this.rules == null)
1011              this.rules = new Enumeration<SlicingRules>(new SlicingRulesEnumFactory());
1012            this.rules.setValue(value);
1013          return this;
1014        }
1015
1016        protected void listChildren(List<Property> children) {
1017          super.listChildren(children);
1018          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));
1019          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));
1020          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));
1021          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));
1022        }
1023
1024        @Override
1025        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1026          switch (_hash) {
1027          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);
1028          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);
1029          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);
1030          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);
1031          default: return super.getNamedProperty(_hash, _name, _checkValid);
1032          }
1033
1034        }
1035
1036      @Override
1037      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1038        switch (hash) {
1039        case -1888270692: /*discriminator*/ return this.discriminator == null ? new Base[0] : this.discriminator.toArray(new Base[this.discriminator.size()]); // ElementDefinitionSlicingDiscriminatorComponent
1040        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1041        case -1207109523: /*ordered*/ return this.ordered == null ? new Base[0] : new Base[] {this.ordered}; // BooleanType
1042        case 108873975: /*rules*/ return this.rules == null ? new Base[0] : new Base[] {this.rules}; // Enumeration<SlicingRules>
1043        default: return super.getProperty(hash, name, checkValid);
1044        }
1045
1046      }
1047
1048      @Override
1049      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1050        switch (hash) {
1051        case -1888270692: // discriminator
1052          this.getDiscriminator().add((ElementDefinitionSlicingDiscriminatorComponent) value); // ElementDefinitionSlicingDiscriminatorComponent
1053          return value;
1054        case -1724546052: // description
1055          this.description = TypeConvertor.castToString(value); // StringType
1056          return value;
1057        case -1207109523: // ordered
1058          this.ordered = TypeConvertor.castToBoolean(value); // BooleanType
1059          return value;
1060        case 108873975: // rules
1061          value = new SlicingRulesEnumFactory().fromType(TypeConvertor.castToCode(value));
1062          this.rules = (Enumeration) value; // Enumeration<SlicingRules>
1063          return value;
1064        default: return super.setProperty(hash, name, value);
1065        }
1066
1067      }
1068
1069      @Override
1070      public Base setProperty(String name, Base value) throws FHIRException {
1071        if (name.equals("discriminator")) {
1072          this.getDiscriminator().add((ElementDefinitionSlicingDiscriminatorComponent) value);
1073        } else if (name.equals("description")) {
1074          this.description = TypeConvertor.castToString(value); // StringType
1075        } else if (name.equals("ordered")) {
1076          this.ordered = TypeConvertor.castToBoolean(value); // BooleanType
1077        } else if (name.equals("rules")) {
1078          value = new SlicingRulesEnumFactory().fromType(TypeConvertor.castToCode(value));
1079          this.rules = (Enumeration) value; // Enumeration<SlicingRules>
1080        } else
1081          return super.setProperty(name, value);
1082        return value;
1083      }
1084
1085      @Override
1086      public Base makeProperty(int hash, String name) throws FHIRException {
1087        switch (hash) {
1088        case -1888270692:  return addDiscriminator(); 
1089        case -1724546052:  return getDescriptionElement();
1090        case -1207109523:  return getOrderedElement();
1091        case 108873975:  return getRulesElement();
1092        default: return super.makeProperty(hash, name);
1093        }
1094
1095      }
1096
1097      @Override
1098      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1099        switch (hash) {
1100        case -1888270692: /*discriminator*/ return new String[] {};
1101        case -1724546052: /*description*/ return new String[] {"string"};
1102        case -1207109523: /*ordered*/ return new String[] {"boolean"};
1103        case 108873975: /*rules*/ return new String[] {"code"};
1104        default: return super.getTypesForProperty(hash, name);
1105        }
1106
1107      }
1108
1109      @Override
1110      public Base addChild(String name) throws FHIRException {
1111        if (name.equals("discriminator")) {
1112          return addDiscriminator();
1113        }
1114        else if (name.equals("description")) {
1115          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.slicing.description");
1116        }
1117        else if (name.equals("ordered")) {
1118          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.slicing.ordered");
1119        }
1120        else if (name.equals("rules")) {
1121          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.slicing.rules");
1122        }
1123        else
1124          return super.addChild(name);
1125      }
1126
1127      public ElementDefinitionSlicingComponent copy() {
1128        ElementDefinitionSlicingComponent dst = new ElementDefinitionSlicingComponent();
1129        copyValues(dst);
1130        return dst;
1131      }
1132
1133      public void copyValues(ElementDefinitionSlicingComponent dst) {
1134        super.copyValues(dst);
1135        if (discriminator != null) {
1136          dst.discriminator = new ArrayList<ElementDefinitionSlicingDiscriminatorComponent>();
1137          for (ElementDefinitionSlicingDiscriminatorComponent i : discriminator)
1138            dst.discriminator.add(i.copy());
1139        };
1140        dst.description = description == null ? null : description.copy();
1141        dst.ordered = ordered == null ? null : ordered.copy();
1142        dst.rules = rules == null ? null : rules.copy();
1143      }
1144
1145      @Override
1146      public boolean equalsDeep(Base other_) {
1147        if (!super.equalsDeep(other_))
1148          return false;
1149        if (!(other_ instanceof ElementDefinitionSlicingComponent))
1150          return false;
1151        ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other_;
1152        return compareDeep(discriminator, o.discriminator, true) && compareDeep(description, o.description, true)
1153           && compareDeep(ordered, o.ordered, true) && compareDeep(rules, o.rules, true);
1154      }
1155
1156      @Override
1157      public boolean equalsShallow(Base other_) {
1158        if (!super.equalsShallow(other_))
1159          return false;
1160        if (!(other_ instanceof ElementDefinitionSlicingComponent))
1161          return false;
1162        ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other_;
1163        return compareValues(description, o.description, true) && compareValues(ordered, o.ordered, true) && compareValues(rules, o.rules, true)
1164          ;
1165      }
1166
1167      public boolean isEmpty() {
1168        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(discriminator, description
1169          , ordered, rules);
1170      }
1171
1172  public String fhirType() {
1173    return "ElementDefinition.slicing";
1174
1175  }
1176
1177  }
1178
1179    @Block()
1180    public static class ElementDefinitionSlicingDiscriminatorComponent extends Element implements IBaseDatatypeElement {
1181        /**
1182         * How the element value is interpreted when discrimination is evaluated.
1183         */
1184        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1185        @Description(shortDefinition="value | exists | pattern | type | profile", formalDefinition="How the element value is interpreted when discrimination is evaluated." )
1186        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/discriminator-type")
1187        protected Enumeration<DiscriminatorType> type;
1188
1189        /**
1190         * A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.
1191         */
1192        @Child(name = "path", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1193        @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." )
1194        protected StringType path;
1195
1196        private static final long serialVersionUID = 1151159293L;
1197
1198    /**
1199     * Constructor
1200     */
1201      public ElementDefinitionSlicingDiscriminatorComponent() {
1202        super();
1203      }
1204
1205    /**
1206     * Constructor
1207     */
1208      public ElementDefinitionSlicingDiscriminatorComponent(DiscriminatorType type, String path) {
1209        super();
1210        this.setType(type);
1211        this.setPath(path);
1212      }
1213
1214        /**
1215         * @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
1216         */
1217        public Enumeration<DiscriminatorType> getTypeElement() { 
1218          if (this.type == null)
1219            if (Configuration.errorOnAutoCreate())
1220              throw new Error("Attempt to auto-create ElementDefinitionSlicingDiscriminatorComponent.type");
1221            else if (Configuration.doAutoCreate())
1222              this.type = new Enumeration<DiscriminatorType>(new DiscriminatorTypeEnumFactory()); // bb
1223          return this.type;
1224        }
1225
1226        public boolean hasTypeElement() { 
1227          return this.type != null && !this.type.isEmpty();
1228        }
1229
1230        public boolean hasType() { 
1231          return this.type != null && !this.type.isEmpty();
1232        }
1233
1234        /**
1235         * @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
1236         */
1237        public ElementDefinitionSlicingDiscriminatorComponent setTypeElement(Enumeration<DiscriminatorType> value) { 
1238          this.type = value;
1239          return this;
1240        }
1241
1242        /**
1243         * @return How the element value is interpreted when discrimination is evaluated.
1244         */
1245        public DiscriminatorType getType() { 
1246          return this.type == null ? null : this.type.getValue();
1247        }
1248
1249        /**
1250         * @param value How the element value is interpreted when discrimination is evaluated.
1251         */
1252        public ElementDefinitionSlicingDiscriminatorComponent setType(DiscriminatorType value) { 
1253            if (this.type == null)
1254              this.type = new Enumeration<DiscriminatorType>(new DiscriminatorTypeEnumFactory());
1255            this.type.setValue(value);
1256          return this;
1257        }
1258
1259        /**
1260         * @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
1261         */
1262        public StringType getPathElement() { 
1263          if (this.path == null)
1264            if (Configuration.errorOnAutoCreate())
1265              throw new Error("Attempt to auto-create ElementDefinitionSlicingDiscriminatorComponent.path");
1266            else if (Configuration.doAutoCreate())
1267              this.path = new StringType(); // bb
1268          return this.path;
1269        }
1270
1271        public boolean hasPathElement() { 
1272          return this.path != null && !this.path.isEmpty();
1273        }
1274
1275        public boolean hasPath() { 
1276          return this.path != null && !this.path.isEmpty();
1277        }
1278
1279        /**
1280         * @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
1281         */
1282        public ElementDefinitionSlicingDiscriminatorComponent setPathElement(StringType value) { 
1283          this.path = value;
1284          return this;
1285        }
1286
1287        /**
1288         * @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.
1289         */
1290        public String getPath() { 
1291          return this.path == null ? null : this.path.getValue();
1292        }
1293
1294        /**
1295         * @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.
1296         */
1297        public ElementDefinitionSlicingDiscriminatorComponent setPath(String value) { 
1298            if (this.path == null)
1299              this.path = new StringType();
1300            this.path.setValue(value);
1301          return this;
1302        }
1303
1304        protected void listChildren(List<Property> children) {
1305          super.listChildren(children);
1306          children.add(new Property("type", "code", "How the element value is interpreted when discrimination is evaluated.", 0, 1, type));
1307          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));
1308        }
1309
1310        @Override
1311        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1312          switch (_hash) {
1313          case 3575610: /*type*/  return new Property("type", "code", "How the element value is interpreted when discrimination is evaluated.", 0, 1, type);
1314          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);
1315          default: return super.getNamedProperty(_hash, _name, _checkValid);
1316          }
1317
1318        }
1319
1320      @Override
1321      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1322        switch (hash) {
1323        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<DiscriminatorType>
1324        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
1325        default: return super.getProperty(hash, name, checkValid);
1326        }
1327
1328      }
1329
1330      @Override
1331      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1332        switch (hash) {
1333        case 3575610: // type
1334          value = new DiscriminatorTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1335          this.type = (Enumeration) value; // Enumeration<DiscriminatorType>
1336          return value;
1337        case 3433509: // path
1338          this.path = TypeConvertor.castToString(value); // StringType
1339          return value;
1340        default: return super.setProperty(hash, name, value);
1341        }
1342
1343      }
1344
1345      @Override
1346      public Base setProperty(String name, Base value) throws FHIRException {
1347        if (name.equals("type")) {
1348          value = new DiscriminatorTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1349          this.type = (Enumeration) value; // Enumeration<DiscriminatorType>
1350        } else if (name.equals("path")) {
1351          this.path = TypeConvertor.castToString(value); // StringType
1352        } else
1353          return super.setProperty(name, value);
1354        return value;
1355      }
1356
1357      @Override
1358      public Base makeProperty(int hash, String name) throws FHIRException {
1359        switch (hash) {
1360        case 3575610:  return getTypeElement();
1361        case 3433509:  return getPathElement();
1362        default: return super.makeProperty(hash, name);
1363        }
1364
1365      }
1366
1367      @Override
1368      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1369        switch (hash) {
1370        case 3575610: /*type*/ return new String[] {"code"};
1371        case 3433509: /*path*/ return new String[] {"string"};
1372        default: return super.getTypesForProperty(hash, name);
1373        }
1374
1375      }
1376
1377      @Override
1378      public Base addChild(String name) throws FHIRException {
1379        if (name.equals("type")) {
1380          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.slicing.discriminator.type");
1381        }
1382        else if (name.equals("path")) {
1383          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.slicing.discriminator.path");
1384        }
1385        else
1386          return super.addChild(name);
1387      }
1388
1389      public ElementDefinitionSlicingDiscriminatorComponent copy() {
1390        ElementDefinitionSlicingDiscriminatorComponent dst = new ElementDefinitionSlicingDiscriminatorComponent();
1391        copyValues(dst);
1392        return dst;
1393      }
1394
1395      public void copyValues(ElementDefinitionSlicingDiscriminatorComponent dst) {
1396        super.copyValues(dst);
1397        dst.type = type == null ? null : type.copy();
1398        dst.path = path == null ? null : path.copy();
1399      }
1400
1401      @Override
1402      public boolean equalsDeep(Base other_) {
1403        if (!super.equalsDeep(other_))
1404          return false;
1405        if (!(other_ instanceof ElementDefinitionSlicingDiscriminatorComponent))
1406          return false;
1407        ElementDefinitionSlicingDiscriminatorComponent o = (ElementDefinitionSlicingDiscriminatorComponent) other_;
1408        return compareDeep(type, o.type, true) && compareDeep(path, o.path, true);
1409      }
1410
1411      @Override
1412      public boolean equalsShallow(Base other_) {
1413        if (!super.equalsShallow(other_))
1414          return false;
1415        if (!(other_ instanceof ElementDefinitionSlicingDiscriminatorComponent))
1416          return false;
1417        ElementDefinitionSlicingDiscriminatorComponent o = (ElementDefinitionSlicingDiscriminatorComponent) other_;
1418        return compareValues(type, o.type, true) && compareValues(path, o.path, true);
1419      }
1420
1421      public boolean isEmpty() {
1422        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, path);
1423      }
1424
1425  public String fhirType() {
1426    return "ElementDefinition.slicing.discriminator";
1427
1428  }
1429
1430  }
1431
1432    @Block()
1433    public static class ElementDefinitionBaseComponent extends Element implements IBaseDatatypeElement {
1434        /**
1435         * 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](structuredefinition.html#) without a StructureDefinition.base.
1436         */
1437        @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1438        @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](structuredefinition.html#) without a StructureDefinition.base." )
1439        protected StringType path;
1440
1441        /**
1442         * Minimum cardinality of the base element identified by the path.
1443         */
1444        @Child(name = "min", type = {UnsignedIntType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1445        @Description(shortDefinition="Min cardinality of the base element", formalDefinition="Minimum cardinality of the base element identified by the path." )
1446        protected UnsignedIntType min;
1447
1448        /**
1449         * Maximum cardinality of the base element identified by the path.
1450         */
1451        @Child(name = "max", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true)
1452        @Description(shortDefinition="Max cardinality of the base element", formalDefinition="Maximum cardinality of the base element identified by the path." )
1453        protected StringType max;
1454
1455        private static final long serialVersionUID = -1412704221L;
1456
1457    /**
1458     * Constructor
1459     */
1460      public ElementDefinitionBaseComponent() {
1461        super();
1462      }
1463
1464    /**
1465     * Constructor
1466     */
1467      public ElementDefinitionBaseComponent(String path, int min, String max) {
1468        super();
1469        this.setPath(path);
1470        this.setMin(min);
1471        this.setMax(max);
1472      }
1473
1474        /**
1475         * @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](structuredefinition.html#) without a StructureDefinition.base.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
1476         */
1477        public StringType getPathElement() { 
1478          if (this.path == null)
1479            if (Configuration.errorOnAutoCreate())
1480              throw new Error("Attempt to auto-create ElementDefinitionBaseComponent.path");
1481            else if (Configuration.doAutoCreate())
1482              this.path = new StringType(); // bb
1483          return this.path;
1484        }
1485
1486        public boolean hasPathElement() { 
1487          return this.path != null && !this.path.isEmpty();
1488        }
1489
1490        public boolean hasPath() { 
1491          return this.path != null && !this.path.isEmpty();
1492        }
1493
1494        /**
1495         * @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](structuredefinition.html#) without a StructureDefinition.base.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
1496         */
1497        public ElementDefinitionBaseComponent setPathElement(StringType value) { 
1498          this.path = value;
1499          return this;
1500        }
1501
1502        /**
1503         * @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](structuredefinition.html#) without a StructureDefinition.base.
1504         */
1505        public String getPath() { 
1506          return this.path == null ? null : this.path.getValue();
1507        }
1508
1509        /**
1510         * @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](structuredefinition.html#) without a StructureDefinition.base.
1511         */
1512        public ElementDefinitionBaseComponent setPath(String value) { 
1513            if (this.path == null)
1514              this.path = new StringType();
1515            this.path.setValue(value);
1516          return this;
1517        }
1518
1519        /**
1520         * @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
1521         */
1522        public UnsignedIntType getMinElement() { 
1523          if (this.min == null)
1524            if (Configuration.errorOnAutoCreate())
1525              throw new Error("Attempt to auto-create ElementDefinitionBaseComponent.min");
1526            else if (Configuration.doAutoCreate())
1527              this.min = new UnsignedIntType(); // bb
1528          return this.min;
1529        }
1530
1531        public boolean hasMinElement() { 
1532          return this.min != null && !this.min.isEmpty();
1533        }
1534
1535        public boolean hasMin() { 
1536          return this.min != null && !this.min.isEmpty();
1537        }
1538
1539        /**
1540         * @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
1541         */
1542        public ElementDefinitionBaseComponent setMinElement(UnsignedIntType value) { 
1543          this.min = value;
1544          return this;
1545        }
1546
1547        /**
1548         * @return Minimum cardinality of the base element identified by the path.
1549         */
1550        public int getMin() { 
1551          return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue();
1552        }
1553
1554        /**
1555         * @param value Minimum cardinality of the base element identified by the path.
1556         */
1557        public ElementDefinitionBaseComponent setMin(int value) { 
1558            if (this.min == null)
1559              this.min = new UnsignedIntType();
1560            this.min.setValue(value);
1561          return this;
1562        }
1563
1564        /**
1565         * @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
1566         */
1567        public StringType getMaxElement() { 
1568          if (this.max == null)
1569            if (Configuration.errorOnAutoCreate())
1570              throw new Error("Attempt to auto-create ElementDefinitionBaseComponent.max");
1571            else if (Configuration.doAutoCreate())
1572              this.max = new StringType(); // bb
1573          return this.max;
1574        }
1575
1576        public boolean hasMaxElement() { 
1577          return this.max != null && !this.max.isEmpty();
1578        }
1579
1580        public boolean hasMax() { 
1581          return this.max != null && !this.max.isEmpty();
1582        }
1583
1584        /**
1585         * @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
1586         */
1587        public ElementDefinitionBaseComponent setMaxElement(StringType value) { 
1588          this.max = value;
1589          return this;
1590        }
1591
1592        /**
1593         * @return Maximum cardinality of the base element identified by the path.
1594         */
1595        public String getMax() { 
1596          return this.max == null ? null : this.max.getValue();
1597        }
1598
1599        /**
1600         * @param value Maximum cardinality of the base element identified by the path.
1601         */
1602        public ElementDefinitionBaseComponent setMax(String value) { 
1603            if (this.max == null)
1604              this.max = new StringType();
1605            this.max.setValue(value);
1606          return this;
1607        }
1608
1609        protected void listChildren(List<Property> children) {
1610          super.listChildren(children);
1611          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](structuredefinition.html#) without a StructureDefinition.base.", 0, 1, path));
1612          children.add(new Property("min", "unsignedInt", "Minimum cardinality of the base element identified by the path.", 0, 1, min));
1613          children.add(new Property("max", "string", "Maximum cardinality of the base element identified by the path.", 0, 1, max));
1614        }
1615
1616        @Override
1617        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1618          switch (_hash) {
1619          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](structuredefinition.html#) without a StructureDefinition.base.", 0, 1, path);
1620          case 108114: /*min*/  return new Property("min", "unsignedInt", "Minimum cardinality of the base element identified by the path.", 0, 1, min);
1621          case 107876: /*max*/  return new Property("max", "string", "Maximum cardinality of the base element identified by the path.", 0, 1, max);
1622          default: return super.getNamedProperty(_hash, _name, _checkValid);
1623          }
1624
1625        }
1626
1627      @Override
1628      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1629        switch (hash) {
1630        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
1631        case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // UnsignedIntType
1632        case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType
1633        default: return super.getProperty(hash, name, checkValid);
1634        }
1635
1636      }
1637
1638      @Override
1639      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1640        switch (hash) {
1641        case 3433509: // path
1642          this.path = TypeConvertor.castToString(value); // StringType
1643          return value;
1644        case 108114: // min
1645          this.min = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1646          return value;
1647        case 107876: // max
1648          this.max = TypeConvertor.castToString(value); // StringType
1649          return value;
1650        default: return super.setProperty(hash, name, value);
1651        }
1652
1653      }
1654
1655      @Override
1656      public Base setProperty(String name, Base value) throws FHIRException {
1657        if (name.equals("path")) {
1658          this.path = TypeConvertor.castToString(value); // StringType
1659        } else if (name.equals("min")) {
1660          this.min = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1661        } else if (name.equals("max")) {
1662          this.max = TypeConvertor.castToString(value); // StringType
1663        } else
1664          return super.setProperty(name, value);
1665        return value;
1666      }
1667
1668      @Override
1669      public Base makeProperty(int hash, String name) throws FHIRException {
1670        switch (hash) {
1671        case 3433509:  return getPathElement();
1672        case 108114:  return getMinElement();
1673        case 107876:  return getMaxElement();
1674        default: return super.makeProperty(hash, name);
1675        }
1676
1677      }
1678
1679      @Override
1680      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1681        switch (hash) {
1682        case 3433509: /*path*/ return new String[] {"string"};
1683        case 108114: /*min*/ return new String[] {"unsignedInt"};
1684        case 107876: /*max*/ return new String[] {"string"};
1685        default: return super.getTypesForProperty(hash, name);
1686        }
1687
1688      }
1689
1690      @Override
1691      public Base addChild(String name) throws FHIRException {
1692        if (name.equals("path")) {
1693          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.base.path");
1694        }
1695        else if (name.equals("min")) {
1696          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.base.min");
1697        }
1698        else if (name.equals("max")) {
1699          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.base.max");
1700        }
1701        else
1702          return super.addChild(name);
1703      }
1704
1705      public ElementDefinitionBaseComponent copy() {
1706        ElementDefinitionBaseComponent dst = new ElementDefinitionBaseComponent();
1707        copyValues(dst);
1708        return dst;
1709      }
1710
1711      public void copyValues(ElementDefinitionBaseComponent dst) {
1712        super.copyValues(dst);
1713        dst.path = path == null ? null : path.copy();
1714        dst.min = min == null ? null : min.copy();
1715        dst.max = max == null ? null : max.copy();
1716      }
1717
1718      @Override
1719      public boolean equalsDeep(Base other_) {
1720        if (!super.equalsDeep(other_))
1721          return false;
1722        if (!(other_ instanceof ElementDefinitionBaseComponent))
1723          return false;
1724        ElementDefinitionBaseComponent o = (ElementDefinitionBaseComponent) other_;
1725        return compareDeep(path, o.path, true) && compareDeep(min, o.min, true) && compareDeep(max, o.max, true)
1726          ;
1727      }
1728
1729      @Override
1730      public boolean equalsShallow(Base other_) {
1731        if (!super.equalsShallow(other_))
1732          return false;
1733        if (!(other_ instanceof ElementDefinitionBaseComponent))
1734          return false;
1735        ElementDefinitionBaseComponent o = (ElementDefinitionBaseComponent) other_;
1736        return compareValues(path, o.path, true) && compareValues(min, o.min, true) && compareValues(max, o.max, true)
1737          ;
1738      }
1739
1740      public boolean isEmpty() {
1741        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(path, min, max);
1742      }
1743
1744  public String fhirType() {
1745    return "ElementDefinition.base";
1746
1747  }
1748
1749  }
1750
1751    @Block()
1752    public static class TypeRefComponent extends Element implements IBaseDatatypeElement {
1753        /**
1754         * 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.
1755         */
1756        @Child(name = "code", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1757        @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." )
1758        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
1759        protected UriType code;
1760
1761        /**
1762         * 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.
1763         */
1764        @Child(name = "profile", type = {CanonicalType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1765        @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." )
1766        protected List<CanonicalType> profile;
1767
1768        /**
1769         * 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.
1770         */
1771        @Child(name = "targetProfile", type = {CanonicalType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1772        @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." )
1773        protected List<CanonicalType> targetProfile;
1774
1775        /**
1776         * 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.
1777         */
1778        @Child(name = "aggregation", type = {CodeType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1779        @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." )
1780        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-aggregation-mode")
1781        protected List<Enumeration<AggregationMode>> aggregation;
1782
1783        /**
1784         * Whether this reference needs to be version specific or version independent, or whether either can be used.
1785         */
1786        @Child(name = "versioning", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
1787        @Description(shortDefinition="either | independent | specific", formalDefinition="Whether this reference needs to be version specific or version independent, or whether either can be used." )
1788        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/reference-version-rules")
1789        protected Enumeration<ReferenceVersionRules> versioning;
1790
1791        private static final long serialVersionUID = 957891653L;
1792
1793    /**
1794     * Constructor
1795     */
1796      public TypeRefComponent() {
1797        super();
1798      }
1799
1800    /**
1801     * Constructor
1802     */
1803      public TypeRefComponent(String code) {
1804        super();
1805        this.setCode(code);
1806      }
1807
1808        /**
1809         * @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
1810         */
1811        public UriType getCodeElement() { 
1812          if (this.code == null)
1813            if (Configuration.errorOnAutoCreate())
1814              throw new Error("Attempt to auto-create TypeRefComponent.code");
1815            else if (Configuration.doAutoCreate())
1816              this.code = new UriType(); // bb
1817          return this.code;
1818        }
1819
1820        public boolean hasCodeElement() { 
1821          return this.code != null && !this.code.isEmpty();
1822        }
1823
1824        public boolean hasCode() { 
1825          return this.code != null && !this.code.isEmpty();
1826        }
1827
1828        /**
1829         * @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
1830         */
1831        public TypeRefComponent setCodeElement(UriType value) { 
1832          this.code = value;
1833          return this;
1834        }
1835
1836        /**
1837         * @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.
1838         */
1839        public String getCode() { 
1840          return this.code == null ? null : this.code.getValue();
1841        }
1842
1843        /**
1844         * @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.
1845         */
1846        public TypeRefComponent setCode(String value) { 
1847            if (this.code == null)
1848              this.code = new UriType();
1849            this.code.setValue(value);
1850          return this;
1851        }
1852
1853        /**
1854         * @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.)
1855         */
1856        public List<CanonicalType> getProfile() { 
1857          if (this.profile == null)
1858            this.profile = new ArrayList<CanonicalType>();
1859          return this.profile;
1860        }
1861
1862        /**
1863         * @return Returns a reference to <code>this</code> for easy method chaining
1864         */
1865        public TypeRefComponent setProfile(List<CanonicalType> theProfile) { 
1866          this.profile = theProfile;
1867          return this;
1868        }
1869
1870        public boolean hasProfile() { 
1871          if (this.profile == null)
1872            return false;
1873          for (CanonicalType item : this.profile)
1874            if (!item.isEmpty())
1875              return true;
1876          return false;
1877        }
1878
1879        /**
1880         * @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.)
1881         */
1882        public CanonicalType addProfileElement() {//2 
1883          CanonicalType t = new CanonicalType();
1884          if (this.profile == null)
1885            this.profile = new ArrayList<CanonicalType>();
1886          this.profile.add(t);
1887          return t;
1888        }
1889
1890        /**
1891         * @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.)
1892         */
1893        public TypeRefComponent addProfile(String value) { //1
1894          CanonicalType t = new CanonicalType();
1895          t.setValue(value);
1896          if (this.profile == null)
1897            this.profile = new ArrayList<CanonicalType>();
1898          this.profile.add(t);
1899          return this;
1900        }
1901
1902        /**
1903         * @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.)
1904         */
1905        public boolean hasProfile(String value) { 
1906          if (this.profile == null)
1907            return false;
1908          for (CanonicalType v : this.profile)
1909            if (v.getValue().equals(value)) // canonical
1910              return true;
1911          return false;
1912        }
1913
1914        /**
1915         * @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.)
1916         */
1917        public List<CanonicalType> getTargetProfile() { 
1918          if (this.targetProfile == null)
1919            this.targetProfile = new ArrayList<CanonicalType>();
1920          return this.targetProfile;
1921        }
1922
1923        /**
1924         * @return Returns a reference to <code>this</code> for easy method chaining
1925         */
1926        public TypeRefComponent setTargetProfile(List<CanonicalType> theTargetProfile) { 
1927          this.targetProfile = theTargetProfile;
1928          return this;
1929        }
1930
1931        public boolean hasTargetProfile() { 
1932          if (this.targetProfile == null)
1933            return false;
1934          for (CanonicalType item : this.targetProfile)
1935            if (!item.isEmpty())
1936              return true;
1937          return false;
1938        }
1939
1940        /**
1941         * @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.)
1942         */
1943        public CanonicalType addTargetProfileElement() {//2 
1944          CanonicalType t = new CanonicalType();
1945          if (this.targetProfile == null)
1946            this.targetProfile = new ArrayList<CanonicalType>();
1947          this.targetProfile.add(t);
1948          return t;
1949        }
1950
1951        /**
1952         * @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.)
1953         */
1954        public TypeRefComponent addTargetProfile(String value) { //1
1955          CanonicalType t = new CanonicalType();
1956          t.setValue(value);
1957          if (this.targetProfile == null)
1958            this.targetProfile = new ArrayList<CanonicalType>();
1959          this.targetProfile.add(t);
1960          return this;
1961        }
1962
1963        /**
1964         * @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.)
1965         */
1966        public boolean hasTargetProfile(String value) { 
1967          if (this.targetProfile == null)
1968            return false;
1969          for (CanonicalType v : this.targetProfile)
1970            if (v.getValue().equals(value)) // canonical
1971              return true;
1972          return false;
1973        }
1974
1975        /**
1976         * @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.)
1977         */
1978        public List<Enumeration<AggregationMode>> getAggregation() { 
1979          if (this.aggregation == null)
1980            this.aggregation = new ArrayList<Enumeration<AggregationMode>>();
1981          return this.aggregation;
1982        }
1983
1984        /**
1985         * @return Returns a reference to <code>this</code> for easy method chaining
1986         */
1987        public TypeRefComponent setAggregation(List<Enumeration<AggregationMode>> theAggregation) { 
1988          this.aggregation = theAggregation;
1989          return this;
1990        }
1991
1992        public boolean hasAggregation() { 
1993          if (this.aggregation == null)
1994            return false;
1995          for (Enumeration<AggregationMode> item : this.aggregation)
1996            if (!item.isEmpty())
1997              return true;
1998          return false;
1999        }
2000
2001        /**
2002         * @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.)
2003         */
2004        public Enumeration<AggregationMode> addAggregationElement() {//2 
2005          Enumeration<AggregationMode> t = new Enumeration<AggregationMode>(new AggregationModeEnumFactory());
2006          if (this.aggregation == null)
2007            this.aggregation = new ArrayList<Enumeration<AggregationMode>>();
2008          this.aggregation.add(t);
2009          return t;
2010        }
2011
2012        /**
2013         * @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.)
2014         */
2015        public TypeRefComponent addAggregation(AggregationMode value) { //1
2016          Enumeration<AggregationMode> t = new Enumeration<AggregationMode>(new AggregationModeEnumFactory());
2017          t.setValue(value);
2018          if (this.aggregation == null)
2019            this.aggregation = new ArrayList<Enumeration<AggregationMode>>();
2020          this.aggregation.add(t);
2021          return this;
2022        }
2023
2024        /**
2025         * @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.)
2026         */
2027        public boolean hasAggregation(AggregationMode value) { 
2028          if (this.aggregation == null)
2029            return false;
2030          for (Enumeration<AggregationMode> v : this.aggregation)
2031            if (v.getValue().equals(value)) // code
2032              return true;
2033          return false;
2034        }
2035
2036        /**
2037         * @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
2038         */
2039        public Enumeration<ReferenceVersionRules> getVersioningElement() { 
2040          if (this.versioning == null)
2041            if (Configuration.errorOnAutoCreate())
2042              throw new Error("Attempt to auto-create TypeRefComponent.versioning");
2043            else if (Configuration.doAutoCreate())
2044              this.versioning = new Enumeration<ReferenceVersionRules>(new ReferenceVersionRulesEnumFactory()); // bb
2045          return this.versioning;
2046        }
2047
2048        public boolean hasVersioningElement() { 
2049          return this.versioning != null && !this.versioning.isEmpty();
2050        }
2051
2052        public boolean hasVersioning() { 
2053          return this.versioning != null && !this.versioning.isEmpty();
2054        }
2055
2056        /**
2057         * @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
2058         */
2059        public TypeRefComponent setVersioningElement(Enumeration<ReferenceVersionRules> value) { 
2060          this.versioning = value;
2061          return this;
2062        }
2063
2064        /**
2065         * @return Whether this reference needs to be version specific or version independent, or whether either can be used.
2066         */
2067        public ReferenceVersionRules getVersioning() { 
2068          return this.versioning == null ? null : this.versioning.getValue();
2069        }
2070
2071        /**
2072         * @param value Whether this reference needs to be version specific or version independent, or whether either can be used.
2073         */
2074        public TypeRefComponent setVersioning(ReferenceVersionRules value) { 
2075          if (value == null)
2076            this.versioning = null;
2077          else {
2078            if (this.versioning == null)
2079              this.versioning = new Enumeration<ReferenceVersionRules>(new ReferenceVersionRulesEnumFactory());
2080            this.versioning.setValue(value);
2081          }
2082          return this;
2083        }
2084
2085        protected void listChildren(List<Property> children) {
2086          super.listChildren(children);
2087          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));
2088          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));
2089          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));
2090          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));
2091          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));
2092        }
2093
2094        @Override
2095        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2096          switch (_hash) {
2097          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);
2098          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);
2099          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);
2100          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);
2101          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);
2102          default: return super.getNamedProperty(_hash, _name, _checkValid);
2103          }
2104
2105        }
2106
2107      @Override
2108      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2109        switch (hash) {
2110        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // UriType
2111        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // CanonicalType
2112        case 1994521304: /*targetProfile*/ return this.targetProfile == null ? new Base[0] : this.targetProfile.toArray(new Base[this.targetProfile.size()]); // CanonicalType
2113        case 841524962: /*aggregation*/ return this.aggregation == null ? new Base[0] : this.aggregation.toArray(new Base[this.aggregation.size()]); // Enumeration<AggregationMode>
2114        case -670487542: /*versioning*/ return this.versioning == null ? new Base[0] : new Base[] {this.versioning}; // Enumeration<ReferenceVersionRules>
2115        default: return super.getProperty(hash, name, checkValid);
2116        }
2117
2118      }
2119
2120      @Override
2121      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2122        switch (hash) {
2123        case 3059181: // code
2124          this.code = TypeConvertor.castToUri(value); // UriType
2125          return value;
2126        case -309425751: // profile
2127          this.getProfile().add(TypeConvertor.castToCanonical(value)); // CanonicalType
2128          return value;
2129        case 1994521304: // targetProfile
2130          this.getTargetProfile().add(TypeConvertor.castToCanonical(value)); // CanonicalType
2131          return value;
2132        case 841524962: // aggregation
2133          value = new AggregationModeEnumFactory().fromType(TypeConvertor.castToCode(value));
2134          this.getAggregation().add((Enumeration) value); // Enumeration<AggregationMode>
2135          return value;
2136        case -670487542: // versioning
2137          value = new ReferenceVersionRulesEnumFactory().fromType(TypeConvertor.castToCode(value));
2138          this.versioning = (Enumeration) value; // Enumeration<ReferenceVersionRules>
2139          return value;
2140        default: return super.setProperty(hash, name, value);
2141        }
2142
2143      }
2144
2145      @Override
2146      public Base setProperty(String name, Base value) throws FHIRException {
2147        if (name.equals("code")) {
2148          this.code = TypeConvertor.castToUri(value); // UriType
2149        } else if (name.equals("profile")) {
2150          this.getProfile().add(TypeConvertor.castToCanonical(value));
2151        } else if (name.equals("targetProfile")) {
2152          this.getTargetProfile().add(TypeConvertor.castToCanonical(value));
2153        } else if (name.equals("aggregation")) {
2154          value = new AggregationModeEnumFactory().fromType(TypeConvertor.castToCode(value));
2155          this.getAggregation().add((Enumeration) value);
2156        } else if (name.equals("versioning")) {
2157          value = new ReferenceVersionRulesEnumFactory().fromType(TypeConvertor.castToCode(value));
2158          this.versioning = (Enumeration) value; // Enumeration<ReferenceVersionRules>
2159        } else
2160          return super.setProperty(name, value);
2161        return value;
2162      }
2163
2164      @Override
2165      public Base makeProperty(int hash, String name) throws FHIRException {
2166        switch (hash) {
2167        case 3059181:  return getCodeElement();
2168        case -309425751:  return addProfileElement();
2169        case 1994521304:  return addTargetProfileElement();
2170        case 841524962:  return addAggregationElement();
2171        case -670487542:  return getVersioningElement();
2172        default: return super.makeProperty(hash, name);
2173        }
2174
2175      }
2176
2177      @Override
2178      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2179        switch (hash) {
2180        case 3059181: /*code*/ return new String[] {"uri"};
2181        case -309425751: /*profile*/ return new String[] {"canonical"};
2182        case 1994521304: /*targetProfile*/ return new String[] {"canonical"};
2183        case 841524962: /*aggregation*/ return new String[] {"code"};
2184        case -670487542: /*versioning*/ return new String[] {"code"};
2185        default: return super.getTypesForProperty(hash, name);
2186        }
2187
2188      }
2189
2190      @Override
2191      public Base addChild(String name) throws FHIRException {
2192        if (name.equals("code")) {
2193          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.type.code");
2194        }
2195        else if (name.equals("profile")) {
2196          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.type.profile");
2197        }
2198        else if (name.equals("targetProfile")) {
2199          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.type.targetProfile");
2200        }
2201        else if (name.equals("aggregation")) {
2202          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.type.aggregation");
2203        }
2204        else if (name.equals("versioning")) {
2205          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.type.versioning");
2206        }
2207        else
2208          return super.addChild(name);
2209      }
2210
2211      public TypeRefComponent copy() {
2212        TypeRefComponent dst = new TypeRefComponent();
2213        copyValues(dst);
2214        return dst;
2215      }
2216
2217      public void copyValues(TypeRefComponent dst) {
2218        super.copyValues(dst);
2219        dst.code = code == null ? null : code.copy();
2220        if (profile != null) {
2221          dst.profile = new ArrayList<CanonicalType>();
2222          for (CanonicalType i : profile)
2223            dst.profile.add(i.copy());
2224        };
2225        if (targetProfile != null) {
2226          dst.targetProfile = new ArrayList<CanonicalType>();
2227          for (CanonicalType i : targetProfile)
2228            dst.targetProfile.add(i.copy());
2229        };
2230        if (aggregation != null) {
2231          dst.aggregation = new ArrayList<Enumeration<AggregationMode>>();
2232          for (Enumeration<AggregationMode> i : aggregation)
2233            dst.aggregation.add(i.copy());
2234        };
2235        dst.versioning = versioning == null ? null : versioning.copy();
2236      }
2237
2238      @Override
2239      public boolean equalsDeep(Base other_) {
2240        if (!super.equalsDeep(other_))
2241          return false;
2242        if (!(other_ instanceof TypeRefComponent))
2243          return false;
2244        TypeRefComponent o = (TypeRefComponent) other_;
2245        return compareDeep(code, o.code, true) && compareDeep(profile, o.profile, true) && compareDeep(targetProfile, o.targetProfile, true)
2246           && compareDeep(aggregation, o.aggregation, true) && compareDeep(versioning, o.versioning, true)
2247          ;
2248      }
2249
2250      @Override
2251      public boolean equalsShallow(Base other_) {
2252        if (!super.equalsShallow(other_))
2253          return false;
2254        if (!(other_ instanceof TypeRefComponent))
2255          return false;
2256        TypeRefComponent o = (TypeRefComponent) other_;
2257        return compareValues(code, o.code, true) && compareValues(profile, o.profile, true) && compareValues(targetProfile, o.targetProfile, true)
2258           && compareValues(aggregation, o.aggregation, true) && compareValues(versioning, o.versioning, true)
2259          ;
2260      }
2261
2262      public boolean isEmpty() {
2263        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, profile, targetProfile
2264          , aggregation, versioning);
2265      }
2266
2267  public String fhirType() {
2268    return "ElementDefinition.type";
2269
2270  }
2271
2272// added from java-adornments.txt:
2273
2274  public boolean hasTarget() {
2275    return Utilities.existsInList(getCode(), "Reference", "canonical", "CodeableReference");
2276  }
2277  
2278    /**
2279   * This code checks for the system prefix and returns the FHIR type
2280   * 
2281   * @return
2282   */
2283  public String getWorkingCode() {
2284    if (hasExtension(ToolingExtensions.EXT_FHIR_TYPE))
2285      return getExtensionString(ToolingExtensions.EXT_FHIR_TYPE);
2286    if (!hasCodeElement()) 
2287      return null;
2288    if (getCodeElement().hasExtension(ToolingExtensions.EXT_XML_TYPE)) {
2289      String s = getCodeElement().getExtensionString(ToolingExtensions.EXT_XML_TYPE);
2290      if ("xsd:gYear OR xsd:gYearMonth OR xsd:date OR xsd:dateTime".equalsIgnoreCase(s))
2291        return "dateTime";
2292      if ("xsd:gYear OR xsd:gYearMonth OR xsd:date".equalsIgnoreCase(s))
2293        return "date";
2294      if ("xsd:dateTime".equalsIgnoreCase(s))
2295        return "instant";
2296      if ("xsd:token".equals(s))
2297        return "code";
2298      if ("xsd:boolean".equals(s))
2299        return "boolean";
2300      if ("xsd:string".equals(s))
2301        return "string";
2302      if ("xsd:time".equals(s))
2303        return "time";
2304      if ("xsd:int".equals(s))
2305        return "integer";
2306      if ("xsd:decimal OR xsd:double".equals(s))
2307        return "decimal";
2308      if ("xsd:decimal".equalsIgnoreCase(s))
2309        return "decimal";
2310      if ("xsd:base64Binary".equalsIgnoreCase(s))
2311        return "base64Binary";
2312      if ("xsd:positiveInteger".equalsIgnoreCase(s))
2313        return "positiveInt";
2314      if ("xsd:nonNegativeInteger".equalsIgnoreCase(s))
2315        return "unsignedInt";
2316      if ("xsd:anyURI".equalsIgnoreCase(s))
2317        return "uri";
2318      
2319      throw new Error("Unknown xml type '"+s+"'");
2320    }
2321    return getCode();
2322  }
2323
2324  @Override
2325  public String toString() {
2326    String res = getCode();
2327    if (hasProfile()) {
2328      res = res + "{";
2329      boolean first = true;
2330      for (CanonicalType s : getProfile()) {
2331        if (first) first = false; else res = res + "|";
2332        res = res + s.getValue();
2333      }
2334      res = res + "}";
2335    }
2336    if (hasTargetProfile()) {
2337      res = res + "->(";
2338      boolean first = true;
2339      for (CanonicalType s : getProfile()) {
2340        if (first) first = false; else res = res + "|";
2341        res = res + s.getValue();
2342      }
2343      res = res + ")";
2344    }    
2345    return res;
2346  }
2347
2348  public String getName() {
2349    return getWorkingCode();
2350  }
2351
2352  public boolean isResourceReference() {
2353    return "Reference".equals(getCode()) && hasTargetProfile();
2354  }
2355// end addition
2356  }
2357
2358    @Block()
2359    public static class ElementDefinitionExampleComponent extends Element implements IBaseDatatypeElement {
2360        /**
2361         * Describes the purpose of this example amoung the set of examples.
2362         */
2363        @Child(name = "label", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2364        @Description(shortDefinition="Describes the purpose of this example", formalDefinition="Describes the purpose of this example amoung the set of examples." )
2365        protected StringType label;
2366
2367        /**
2368         * The actual value for the element, which must be one of the types allowed for this element.
2369         */
2370        @Child(name = "value", type = {Base64BinaryType.class, BooleanType.class, CanonicalType.class, CodeType.class, DateType.class, DateTimeType.class, DecimalType.class, IdType.class, InstantType.class, IntegerType.class, Integer64Type.class, MarkdownType.class, OidType.class, PositiveIntType.class, StringType.class, TimeType.class, UnsignedIntType.class, UriType.class, UrlType.class, UuidType.class, Address.class, Age.class, Annotation.class, Attachment.class, CodeableConcept.class, Coding.class, ContactPoint.class, Count.class, Distance.class, Duration.class, HumanName.class, Identifier.class, Money.class, Period.class, Quantity.class, Range.class, Ratio.class, Reference.class, SampledData.class, Signature.class, Timing.class, ContactDetail.class, Contributor.class, DataRequirement.class, Expression.class, ParameterDefinition.class, RelatedArtifact.class, TriggerDefinition.class, UsageContext.class, Dosage.class, Meta.class}, order=2, min=1, max=1, modifier=false, summary=true)
2371        @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." )
2372        protected DataType value;
2373
2374        private static final long serialVersionUID = 463190922L;
2375
2376    /**
2377     * Constructor
2378     */
2379      public ElementDefinitionExampleComponent() {
2380        super();
2381      }
2382
2383    /**
2384     * Constructor
2385     */
2386      public ElementDefinitionExampleComponent(String label, DataType value) {
2387        super();
2388        this.setLabel(label);
2389        this.setValue(value);
2390      }
2391
2392        /**
2393         * @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
2394         */
2395        public StringType getLabelElement() { 
2396          if (this.label == null)
2397            if (Configuration.errorOnAutoCreate())
2398              throw new Error("Attempt to auto-create ElementDefinitionExampleComponent.label");
2399            else if (Configuration.doAutoCreate())
2400              this.label = new StringType(); // bb
2401          return this.label;
2402        }
2403
2404        public boolean hasLabelElement() { 
2405          return this.label != null && !this.label.isEmpty();
2406        }
2407
2408        public boolean hasLabel() { 
2409          return this.label != null && !this.label.isEmpty();
2410        }
2411
2412        /**
2413         * @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
2414         */
2415        public ElementDefinitionExampleComponent setLabelElement(StringType value) { 
2416          this.label = value;
2417          return this;
2418        }
2419
2420        /**
2421         * @return Describes the purpose of this example amoung the set of examples.
2422         */
2423        public String getLabel() { 
2424          return this.label == null ? null : this.label.getValue();
2425        }
2426
2427        /**
2428         * @param value Describes the purpose of this example amoung the set of examples.
2429         */
2430        public ElementDefinitionExampleComponent setLabel(String value) { 
2431            if (this.label == null)
2432              this.label = new StringType();
2433            this.label.setValue(value);
2434          return this;
2435        }
2436
2437        /**
2438         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2439         */
2440        public DataType getValue() { 
2441          return this.value;
2442        }
2443
2444        /**
2445         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2446         */
2447        public Base64BinaryType getValueBase64BinaryType() throws FHIRException { 
2448          if (this.value == null)
2449            this.value = new Base64BinaryType();
2450          if (!(this.value instanceof Base64BinaryType))
2451            throw new FHIRException("Type mismatch: the type Base64BinaryType was expected, but "+this.value.getClass().getName()+" was encountered");
2452          return (Base64BinaryType) this.value;
2453        }
2454
2455        public boolean hasValueBase64BinaryType() { 
2456          return this != null && this.value instanceof Base64BinaryType;
2457        }
2458
2459        /**
2460         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2461         */
2462        public BooleanType getValueBooleanType() throws FHIRException { 
2463          if (this.value == null)
2464            this.value = new BooleanType();
2465          if (!(this.value instanceof BooleanType))
2466            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
2467          return (BooleanType) this.value;
2468        }
2469
2470        public boolean hasValueBooleanType() { 
2471          return this != null && this.value instanceof BooleanType;
2472        }
2473
2474        /**
2475         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2476         */
2477        public CanonicalType getValueCanonicalType() throws FHIRException { 
2478          if (this.value == null)
2479            this.value = new CanonicalType();
2480          if (!(this.value instanceof CanonicalType))
2481            throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.value.getClass().getName()+" was encountered");
2482          return (CanonicalType) this.value;
2483        }
2484
2485        public boolean hasValueCanonicalType() { 
2486          return this != null && this.value instanceof CanonicalType;
2487        }
2488
2489        /**
2490         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2491         */
2492        public CodeType getValueCodeType() throws FHIRException { 
2493          if (this.value == null)
2494            this.value = new CodeType();
2495          if (!(this.value instanceof CodeType))
2496            throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered");
2497          return (CodeType) this.value;
2498        }
2499
2500        public boolean hasValueCodeType() { 
2501          return this != null && this.value instanceof CodeType;
2502        }
2503
2504        /**
2505         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2506         */
2507        public DateType getValueDateType() throws FHIRException { 
2508          if (this.value == null)
2509            this.value = new DateType();
2510          if (!(this.value instanceof DateType))
2511            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
2512          return (DateType) this.value;
2513        }
2514
2515        public boolean hasValueDateType() { 
2516          return this != null && this.value instanceof DateType;
2517        }
2518
2519        /**
2520         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2521         */
2522        public DateTimeType getValueDateTimeType() throws FHIRException { 
2523          if (this.value == null)
2524            this.value = new DateTimeType();
2525          if (!(this.value instanceof DateTimeType))
2526            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
2527          return (DateTimeType) this.value;
2528        }
2529
2530        public boolean hasValueDateTimeType() { 
2531          return this != null && this.value instanceof DateTimeType;
2532        }
2533
2534        /**
2535         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2536         */
2537        public DecimalType getValueDecimalType() throws FHIRException { 
2538          if (this.value == null)
2539            this.value = new DecimalType();
2540          if (!(this.value instanceof DecimalType))
2541            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered");
2542          return (DecimalType) this.value;
2543        }
2544
2545        public boolean hasValueDecimalType() { 
2546          return this != null && this.value instanceof DecimalType;
2547        }
2548
2549        /**
2550         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2551         */
2552        public IdType getValueIdType() throws FHIRException { 
2553          if (this.value == null)
2554            this.value = new IdType();
2555          if (!(this.value instanceof IdType))
2556            throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.value.getClass().getName()+" was encountered");
2557          return (IdType) this.value;
2558        }
2559
2560        public boolean hasValueIdType() { 
2561          return this != null && this.value instanceof IdType;
2562        }
2563
2564        /**
2565         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2566         */
2567        public InstantType getValueInstantType() throws FHIRException { 
2568          if (this.value == null)
2569            this.value = new InstantType();
2570          if (!(this.value instanceof InstantType))
2571            throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered");
2572          return (InstantType) this.value;
2573        }
2574
2575        public boolean hasValueInstantType() { 
2576          return this != null && this.value instanceof InstantType;
2577        }
2578
2579        /**
2580         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2581         */
2582        public IntegerType getValueIntegerType() throws FHIRException { 
2583          if (this.value == null)
2584            this.value = new IntegerType();
2585          if (!(this.value instanceof IntegerType))
2586            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
2587          return (IntegerType) this.value;
2588        }
2589
2590        public boolean hasValueIntegerType() { 
2591          return this != null && this.value instanceof IntegerType;
2592        }
2593
2594        /**
2595         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2596         */
2597        public Integer64Type getValueInteger64Type() throws FHIRException { 
2598          if (this.value == null)
2599            this.value = new Integer64Type();
2600          if (!(this.value instanceof Integer64Type))
2601            throw new FHIRException("Type mismatch: the type Integer64Type was expected, but "+this.value.getClass().getName()+" was encountered");
2602          return (Integer64Type) this.value;
2603        }
2604
2605        public boolean hasValueInteger64Type() { 
2606          return this != null && this.value instanceof Integer64Type;
2607        }
2608
2609        /**
2610         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2611         */
2612        public MarkdownType getValueMarkdownType() throws FHIRException { 
2613          if (this.value == null)
2614            this.value = new MarkdownType();
2615          if (!(this.value instanceof MarkdownType))
2616            throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.value.getClass().getName()+" was encountered");
2617          return (MarkdownType) this.value;
2618        }
2619
2620        public boolean hasValueMarkdownType() { 
2621          return this != null && this.value instanceof MarkdownType;
2622        }
2623
2624        /**
2625         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2626         */
2627        public OidType getValueOidType() throws FHIRException { 
2628          if (this.value == null)
2629            this.value = new OidType();
2630          if (!(this.value instanceof OidType))
2631            throw new FHIRException("Type mismatch: the type OidType was expected, but "+this.value.getClass().getName()+" was encountered");
2632          return (OidType) this.value;
2633        }
2634
2635        public boolean hasValueOidType() { 
2636          return this != null && this.value instanceof OidType;
2637        }
2638
2639        /**
2640         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2641         */
2642        public PositiveIntType getValuePositiveIntType() throws FHIRException { 
2643          if (this.value == null)
2644            this.value = new PositiveIntType();
2645          if (!(this.value instanceof PositiveIntType))
2646            throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.value.getClass().getName()+" was encountered");
2647          return (PositiveIntType) this.value;
2648        }
2649
2650        public boolean hasValuePositiveIntType() { 
2651          return this != null && this.value instanceof PositiveIntType;
2652        }
2653
2654        /**
2655         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2656         */
2657        public StringType getValueStringType() throws FHIRException { 
2658          if (this.value == null)
2659            this.value = new StringType();
2660          if (!(this.value instanceof StringType))
2661            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
2662          return (StringType) this.value;
2663        }
2664
2665        public boolean hasValueStringType() { 
2666          return this != null && this.value instanceof StringType;
2667        }
2668
2669        /**
2670         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2671         */
2672        public TimeType getValueTimeType() throws FHIRException { 
2673          if (this.value == null)
2674            this.value = new TimeType();
2675          if (!(this.value instanceof TimeType))
2676            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
2677          return (TimeType) this.value;
2678        }
2679
2680        public boolean hasValueTimeType() { 
2681          return this != null && this.value instanceof TimeType;
2682        }
2683
2684        /**
2685         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2686         */
2687        public UnsignedIntType getValueUnsignedIntType() throws FHIRException { 
2688          if (this.value == null)
2689            this.value = new UnsignedIntType();
2690          if (!(this.value instanceof UnsignedIntType))
2691            throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.value.getClass().getName()+" was encountered");
2692          return (UnsignedIntType) this.value;
2693        }
2694
2695        public boolean hasValueUnsignedIntType() { 
2696          return this != null && this.value instanceof UnsignedIntType;
2697        }
2698
2699        /**
2700         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2701         */
2702        public UriType getValueUriType() throws FHIRException { 
2703          if (this.value == null)
2704            this.value = new UriType();
2705          if (!(this.value instanceof UriType))
2706            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered");
2707          return (UriType) this.value;
2708        }
2709
2710        public boolean hasValueUriType() { 
2711          return this != null && this.value instanceof UriType;
2712        }
2713
2714        /**
2715         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2716         */
2717        public UrlType getValueUrlType() throws FHIRException { 
2718          if (this.value == null)
2719            this.value = new UrlType();
2720          if (!(this.value instanceof UrlType))
2721            throw new FHIRException("Type mismatch: the type UrlType was expected, but "+this.value.getClass().getName()+" was encountered");
2722          return (UrlType) this.value;
2723        }
2724
2725        public boolean hasValueUrlType() { 
2726          return this != null && this.value instanceof UrlType;
2727        }
2728
2729        /**
2730         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2731         */
2732        public UuidType getValueUuidType() throws FHIRException { 
2733          if (this.value == null)
2734            this.value = new UuidType();
2735          if (!(this.value instanceof UuidType))
2736            throw new FHIRException("Type mismatch: the type UuidType was expected, but "+this.value.getClass().getName()+" was encountered");
2737          return (UuidType) this.value;
2738        }
2739
2740        public boolean hasValueUuidType() { 
2741          return this != null && this.value instanceof UuidType;
2742        }
2743
2744        /**
2745         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2746         */
2747        public Address getValueAddress() throws FHIRException { 
2748          if (this.value == null)
2749            this.value = new Address();
2750          if (!(this.value instanceof Address))
2751            throw new FHIRException("Type mismatch: the type Address was expected, but "+this.value.getClass().getName()+" was encountered");
2752          return (Address) this.value;
2753        }
2754
2755        public boolean hasValueAddress() { 
2756          return this != null && this.value instanceof Address;
2757        }
2758
2759        /**
2760         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2761         */
2762        public Age getValueAge() throws FHIRException { 
2763          if (this.value == null)
2764            this.value = new Age();
2765          if (!(this.value instanceof Age))
2766            throw new FHIRException("Type mismatch: the type Age was expected, but "+this.value.getClass().getName()+" was encountered");
2767          return (Age) this.value;
2768        }
2769
2770        public boolean hasValueAge() { 
2771          return this != null && this.value instanceof Age;
2772        }
2773
2774        /**
2775         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2776         */
2777        public Annotation getValueAnnotation() throws FHIRException { 
2778          if (this.value == null)
2779            this.value = new Annotation();
2780          if (!(this.value instanceof Annotation))
2781            throw new FHIRException("Type mismatch: the type Annotation was expected, but "+this.value.getClass().getName()+" was encountered");
2782          return (Annotation) this.value;
2783        }
2784
2785        public boolean hasValueAnnotation() { 
2786          return this != null && this.value instanceof Annotation;
2787        }
2788
2789        /**
2790         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2791         */
2792        public Attachment getValueAttachment() throws FHIRException { 
2793          if (this.value == null)
2794            this.value = new Attachment();
2795          if (!(this.value instanceof Attachment))
2796            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
2797          return (Attachment) this.value;
2798        }
2799
2800        public boolean hasValueAttachment() { 
2801          return this != null && this.value instanceof Attachment;
2802        }
2803
2804        /**
2805         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2806         */
2807        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
2808          if (this.value == null)
2809            this.value = new CodeableConcept();
2810          if (!(this.value instanceof CodeableConcept))
2811            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
2812          return (CodeableConcept) this.value;
2813        }
2814
2815        public boolean hasValueCodeableConcept() { 
2816          return this != null && this.value instanceof CodeableConcept;
2817        }
2818
2819        /**
2820         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2821         */
2822        public Coding getValueCoding() throws FHIRException { 
2823          if (this.value == null)
2824            this.value = new Coding();
2825          if (!(this.value instanceof Coding))
2826            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
2827          return (Coding) this.value;
2828        }
2829
2830        public boolean hasValueCoding() { 
2831          return this != null && this.value instanceof Coding;
2832        }
2833
2834        /**
2835         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2836         */
2837        public ContactPoint getValueContactPoint() throws FHIRException { 
2838          if (this.value == null)
2839            this.value = new ContactPoint();
2840          if (!(this.value instanceof ContactPoint))
2841            throw new FHIRException("Type mismatch: the type ContactPoint was expected, but "+this.value.getClass().getName()+" was encountered");
2842          return (ContactPoint) this.value;
2843        }
2844
2845        public boolean hasValueContactPoint() { 
2846          return this != null && this.value instanceof ContactPoint;
2847        }
2848
2849        /**
2850         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2851         */
2852        public Count getValueCount() throws FHIRException { 
2853          if (this.value == null)
2854            this.value = new Count();
2855          if (!(this.value instanceof Count))
2856            throw new FHIRException("Type mismatch: the type Count was expected, but "+this.value.getClass().getName()+" was encountered");
2857          return (Count) this.value;
2858        }
2859
2860        public boolean hasValueCount() { 
2861          return this != null && this.value instanceof Count;
2862        }
2863
2864        /**
2865         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2866         */
2867        public Distance getValueDistance() throws FHIRException { 
2868          if (this.value == null)
2869            this.value = new Distance();
2870          if (!(this.value instanceof Distance))
2871            throw new FHIRException("Type mismatch: the type Distance was expected, but "+this.value.getClass().getName()+" was encountered");
2872          return (Distance) this.value;
2873        }
2874
2875        public boolean hasValueDistance() { 
2876          return this != null && this.value instanceof Distance;
2877        }
2878
2879        /**
2880         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2881         */
2882        public Duration getValueDuration() throws FHIRException { 
2883          if (this.value == null)
2884            this.value = new Duration();
2885          if (!(this.value instanceof Duration))
2886            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.value.getClass().getName()+" was encountered");
2887          return (Duration) this.value;
2888        }
2889
2890        public boolean hasValueDuration() { 
2891          return this != null && this.value instanceof Duration;
2892        }
2893
2894        /**
2895         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2896         */
2897        public HumanName getValueHumanName() throws FHIRException { 
2898          if (this.value == null)
2899            this.value = new HumanName();
2900          if (!(this.value instanceof HumanName))
2901            throw new FHIRException("Type mismatch: the type HumanName was expected, but "+this.value.getClass().getName()+" was encountered");
2902          return (HumanName) this.value;
2903        }
2904
2905        public boolean hasValueHumanName() { 
2906          return this != null && this.value instanceof HumanName;
2907        }
2908
2909        /**
2910         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2911         */
2912        public Identifier getValueIdentifier() throws FHIRException { 
2913          if (this.value == null)
2914            this.value = new Identifier();
2915          if (!(this.value instanceof Identifier))
2916            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.value.getClass().getName()+" was encountered");
2917          return (Identifier) this.value;
2918        }
2919
2920        public boolean hasValueIdentifier() { 
2921          return this != null && this.value instanceof Identifier;
2922        }
2923
2924        /**
2925         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2926         */
2927        public Money getValueMoney() throws FHIRException { 
2928          if (this.value == null)
2929            this.value = new Money();
2930          if (!(this.value instanceof Money))
2931            throw new FHIRException("Type mismatch: the type Money was expected, but "+this.value.getClass().getName()+" was encountered");
2932          return (Money) this.value;
2933        }
2934
2935        public boolean hasValueMoney() { 
2936          return this != null && this.value instanceof Money;
2937        }
2938
2939        /**
2940         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2941         */
2942        public Period getValuePeriod() throws FHIRException { 
2943          if (this.value == null)
2944            this.value = new Period();
2945          if (!(this.value instanceof Period))
2946            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered");
2947          return (Period) this.value;
2948        }
2949
2950        public boolean hasValuePeriod() { 
2951          return this != null && this.value instanceof Period;
2952        }
2953
2954        /**
2955         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2956         */
2957        public Quantity getValueQuantity() throws FHIRException { 
2958          if (this.value == null)
2959            this.value = new Quantity();
2960          if (!(this.value instanceof Quantity))
2961            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
2962          return (Quantity) this.value;
2963        }
2964
2965        public boolean hasValueQuantity() { 
2966          return this != null && this.value instanceof Quantity;
2967        }
2968
2969        /**
2970         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2971         */
2972        public Range getValueRange() throws FHIRException { 
2973          if (this.value == null)
2974            this.value = new Range();
2975          if (!(this.value instanceof Range))
2976            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
2977          return (Range) this.value;
2978        }
2979
2980        public boolean hasValueRange() { 
2981          return this != null && this.value instanceof Range;
2982        }
2983
2984        /**
2985         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
2986         */
2987        public Ratio getValueRatio() throws FHIRException { 
2988          if (this.value == null)
2989            this.value = new Ratio();
2990          if (!(this.value instanceof Ratio))
2991            throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered");
2992          return (Ratio) this.value;
2993        }
2994
2995        public boolean hasValueRatio() { 
2996          return this != null && this.value instanceof Ratio;
2997        }
2998
2999        /**
3000         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3001         */
3002        public Reference getValueReference() throws FHIRException { 
3003          if (this.value == null)
3004            this.value = new Reference();
3005          if (!(this.value instanceof Reference))
3006            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
3007          return (Reference) this.value;
3008        }
3009
3010        public boolean hasValueReference() { 
3011          return this != null && this.value instanceof Reference;
3012        }
3013
3014        /**
3015         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3016         */
3017        public SampledData getValueSampledData() throws FHIRException { 
3018          if (this.value == null)
3019            this.value = new SampledData();
3020          if (!(this.value instanceof SampledData))
3021            throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered");
3022          return (SampledData) this.value;
3023        }
3024
3025        public boolean hasValueSampledData() { 
3026          return this != null && this.value instanceof SampledData;
3027        }
3028
3029        /**
3030         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3031         */
3032        public Signature getValueSignature() throws FHIRException { 
3033          if (this.value == null)
3034            this.value = new Signature();
3035          if (!(this.value instanceof Signature))
3036            throw new FHIRException("Type mismatch: the type Signature was expected, but "+this.value.getClass().getName()+" was encountered");
3037          return (Signature) this.value;
3038        }
3039
3040        public boolean hasValueSignature() { 
3041          return this != null && this.value instanceof Signature;
3042        }
3043
3044        /**
3045         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3046         */
3047        public Timing getValueTiming() throws FHIRException { 
3048          if (this.value == null)
3049            this.value = new Timing();
3050          if (!(this.value instanceof Timing))
3051            throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.value.getClass().getName()+" was encountered");
3052          return (Timing) this.value;
3053        }
3054
3055        public boolean hasValueTiming() { 
3056          return this != null && this.value instanceof Timing;
3057        }
3058
3059        /**
3060         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3061         */
3062        public ContactDetail getValueContactDetail() throws FHIRException { 
3063          if (this.value == null)
3064            this.value = new ContactDetail();
3065          if (!(this.value instanceof ContactDetail))
3066            throw new FHIRException("Type mismatch: the type ContactDetail was expected, but "+this.value.getClass().getName()+" was encountered");
3067          return (ContactDetail) this.value;
3068        }
3069
3070        public boolean hasValueContactDetail() { 
3071          return this != null && this.value instanceof ContactDetail;
3072        }
3073
3074        /**
3075         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3076         */
3077        public Contributor getValueContributor() throws FHIRException { 
3078          if (this.value == null)
3079            this.value = new Contributor();
3080          if (!(this.value instanceof Contributor))
3081            throw new FHIRException("Type mismatch: the type Contributor was expected, but "+this.value.getClass().getName()+" was encountered");
3082          return (Contributor) this.value;
3083        }
3084
3085        public boolean hasValueContributor() { 
3086          return this != null && this.value instanceof Contributor;
3087        }
3088
3089        /**
3090         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3091         */
3092        public DataRequirement getValueDataRequirement() throws FHIRException { 
3093          if (this.value == null)
3094            this.value = new DataRequirement();
3095          if (!(this.value instanceof DataRequirement))
3096            throw new FHIRException("Type mismatch: the type DataRequirement was expected, but "+this.value.getClass().getName()+" was encountered");
3097          return (DataRequirement) this.value;
3098        }
3099
3100        public boolean hasValueDataRequirement() { 
3101          return this != null && this.value instanceof DataRequirement;
3102        }
3103
3104        /**
3105         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3106         */
3107        public Expression getValueExpression() throws FHIRException { 
3108          if (this.value == null)
3109            this.value = new Expression();
3110          if (!(this.value instanceof Expression))
3111            throw new FHIRException("Type mismatch: the type Expression was expected, but "+this.value.getClass().getName()+" was encountered");
3112          return (Expression) this.value;
3113        }
3114
3115        public boolean hasValueExpression() { 
3116          return this != null && this.value instanceof Expression;
3117        }
3118
3119        /**
3120         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3121         */
3122        public ParameterDefinition getValueParameterDefinition() throws FHIRException { 
3123          if (this.value == null)
3124            this.value = new ParameterDefinition();
3125          if (!(this.value instanceof ParameterDefinition))
3126            throw new FHIRException("Type mismatch: the type ParameterDefinition was expected, but "+this.value.getClass().getName()+" was encountered");
3127          return (ParameterDefinition) this.value;
3128        }
3129
3130        public boolean hasValueParameterDefinition() { 
3131          return this != null && this.value instanceof ParameterDefinition;
3132        }
3133
3134        /**
3135         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3136         */
3137        public RelatedArtifact getValueRelatedArtifact() throws FHIRException { 
3138          if (this.value == null)
3139            this.value = new RelatedArtifact();
3140          if (!(this.value instanceof RelatedArtifact))
3141            throw new FHIRException("Type mismatch: the type RelatedArtifact was expected, but "+this.value.getClass().getName()+" was encountered");
3142          return (RelatedArtifact) this.value;
3143        }
3144
3145        public boolean hasValueRelatedArtifact() { 
3146          return this != null && this.value instanceof RelatedArtifact;
3147        }
3148
3149        /**
3150         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3151         */
3152        public TriggerDefinition getValueTriggerDefinition() throws FHIRException { 
3153          if (this.value == null)
3154            this.value = new TriggerDefinition();
3155          if (!(this.value instanceof TriggerDefinition))
3156            throw new FHIRException("Type mismatch: the type TriggerDefinition was expected, but "+this.value.getClass().getName()+" was encountered");
3157          return (TriggerDefinition) this.value;
3158        }
3159
3160        public boolean hasValueTriggerDefinition() { 
3161          return this != null && this.value instanceof TriggerDefinition;
3162        }
3163
3164        /**
3165         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3166         */
3167        public UsageContext getValueUsageContext() throws FHIRException { 
3168          if (this.value == null)
3169            this.value = new UsageContext();
3170          if (!(this.value instanceof UsageContext))
3171            throw new FHIRException("Type mismatch: the type UsageContext was expected, but "+this.value.getClass().getName()+" was encountered");
3172          return (UsageContext) this.value;
3173        }
3174
3175        public boolean hasValueUsageContext() { 
3176          return this != null && this.value instanceof UsageContext;
3177        }
3178
3179        /**
3180         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3181         */
3182        public Dosage getValueDosage() throws FHIRException { 
3183          if (this.value == null)
3184            this.value = new Dosage();
3185          if (!(this.value instanceof Dosage))
3186            throw new FHIRException("Type mismatch: the type Dosage was expected, but "+this.value.getClass().getName()+" was encountered");
3187          return (Dosage) this.value;
3188        }
3189
3190        public boolean hasValueDosage() { 
3191          return this != null && this.value instanceof Dosage;
3192        }
3193
3194        /**
3195         * @return {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3196         */
3197        public Meta getValueMeta() throws FHIRException { 
3198          if (this.value == null)
3199            this.value = new Meta();
3200          if (!(this.value instanceof Meta))
3201            throw new FHIRException("Type mismatch: the type Meta was expected, but "+this.value.getClass().getName()+" was encountered");
3202          return (Meta) this.value;
3203        }
3204
3205        public boolean hasValueMeta() { 
3206          return this != null && this.value instanceof Meta;
3207        }
3208
3209        public boolean hasValue() { 
3210          return this.value != null && !this.value.isEmpty();
3211        }
3212
3213        /**
3214         * @param value {@link #value} (The actual value for the element, which must be one of the types allowed for this element.)
3215         */
3216        public ElementDefinitionExampleComponent setValue(DataType value) { 
3217          if (value != null && !(value instanceof Base64BinaryType || value instanceof BooleanType || value instanceof CanonicalType || value instanceof CodeType || value instanceof DateType || value instanceof DateTimeType || value instanceof DecimalType || value instanceof IdType || value instanceof InstantType || value instanceof IntegerType || value instanceof Integer64Type || value instanceof MarkdownType || value instanceof OidType || value instanceof PositiveIntType || value instanceof StringType || value instanceof TimeType || value instanceof UnsignedIntType || value instanceof UriType || value instanceof UrlType || value instanceof UuidType || value instanceof Address || value instanceof Age || value instanceof Annotation || value instanceof Attachment || value instanceof CodeableConcept || value instanceof Coding || value instanceof ContactPoint || value instanceof Count || value instanceof Distance || value instanceof Duration || value instanceof HumanName || value instanceof Identifier || value instanceof Money || value instanceof Period || value instanceof Quantity || value instanceof Range || value instanceof Ratio || value instanceof Reference || value instanceof SampledData || value instanceof Signature || value instanceof Timing || value instanceof ContactDetail || value instanceof Contributor || value instanceof DataRequirement || value instanceof Expression || value instanceof ParameterDefinition || value instanceof RelatedArtifact || value instanceof TriggerDefinition || value instanceof UsageContext || value instanceof Dosage || value instanceof Meta))
3218            throw new Error("Not the right type for ElementDefinition.example.value[x]: "+value.fhirType());
3219          this.value = value;
3220          return this;
3221        }
3222
3223        protected void listChildren(List<Property> children) {
3224          super.listChildren(children);
3225          children.add(new Property("label", "string", "Describes the purpose of this example amoung the set of examples.", 0, 1, label));
3226          children.add(new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value));
3227        }
3228
3229        @Override
3230        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3231          switch (_hash) {
3232          case 102727412: /*label*/  return new Property("label", "string", "Describes the purpose of this example amoung the set of examples.", 0, 1, label);
3233          case -1410166417: /*value[x]*/  return new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3234          case 111972721: /*value*/  return new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3235          case -1535024575: /*valueBase64Binary*/  return new Property("value[x]", "base64Binary", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3236          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3237          case -786218365: /*valueCanonical*/  return new Property("value[x]", "canonical", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3238          case -766209282: /*valueCode*/  return new Property("value[x]", "code", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3239          case -766192449: /*valueDate*/  return new Property("value[x]", "date", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3240          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "dateTime", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3241          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "decimal", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3242          case 231604844: /*valueId*/  return new Property("value[x]", "id", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3243          case -1668687056: /*valueInstant*/  return new Property("value[x]", "instant", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3244          case -1668204915: /*valueInteger*/  return new Property("value[x]", "integer", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3245          case -1122120181: /*valueInteger64*/  return new Property("value[x]", "integer64", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3246          case -497880704: /*valueMarkdown*/  return new Property("value[x]", "markdown", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3247          case -1410178407: /*valueOid*/  return new Property("value[x]", "oid", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3248          case -1249932027: /*valuePositiveInt*/  return new Property("value[x]", "positiveInt", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3249          case -1424603934: /*valueString*/  return new Property("value[x]", "string", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3250          case -765708322: /*valueTime*/  return new Property("value[x]", "time", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3251          case 26529417: /*valueUnsignedInt*/  return new Property("value[x]", "unsignedInt", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3252          case -1410172357: /*valueUri*/  return new Property("value[x]", "uri", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3253          case -1410172354: /*valueUrl*/  return new Property("value[x]", "url", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3254          case -765667124: /*valueUuid*/  return new Property("value[x]", "uuid", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3255          case -478981821: /*valueAddress*/  return new Property("value[x]", "Address", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3256          case -1410191922: /*valueAge*/  return new Property("value[x]", "Age", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3257          case -67108992: /*valueAnnotation*/  return new Property("value[x]", "Annotation", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3258          case -475566732: /*valueAttachment*/  return new Property("value[x]", "Attachment", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3259          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3260          case -1887705029: /*valueCoding*/  return new Property("value[x]", "Coding", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3261          case 944904545: /*valueContactPoint*/  return new Property("value[x]", "ContactPoint", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3262          case 2017332766: /*valueCount*/  return new Property("value[x]", "Count", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3263          case -456359802: /*valueDistance*/  return new Property("value[x]", "Distance", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3264          case 1558135333: /*valueDuration*/  return new Property("value[x]", "Duration", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3265          case -2026205465: /*valueHumanName*/  return new Property("value[x]", "HumanName", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3266          case -130498310: /*valueIdentifier*/  return new Property("value[x]", "Identifier", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3267          case 2026560975: /*valueMoney*/  return new Property("value[x]", "Money", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3268          case -1524344174: /*valuePeriod*/  return new Property("value[x]", "Period", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3269          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3270          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3271          case 2030767386: /*valueRatio*/  return new Property("value[x]", "Ratio", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3272          case 1755241690: /*valueReference*/  return new Property("value[x]", "Reference", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3273          case -962229101: /*valueSampledData*/  return new Property("value[x]", "SampledData", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3274          case -540985785: /*valueSignature*/  return new Property("value[x]", "Signature", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3275          case -1406282469: /*valueTiming*/  return new Property("value[x]", "Timing", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3276          case -1125200224: /*valueContactDetail*/  return new Property("value[x]", "ContactDetail", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3277          case 1281021610: /*valueContributor*/  return new Property("value[x]", "Contributor", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3278          case 1710554248: /*valueDataRequirement*/  return new Property("value[x]", "DataRequirement", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3279          case -307517719: /*valueExpression*/  return new Property("value[x]", "Expression", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3280          case 1387478187: /*valueParameterDefinition*/  return new Property("value[x]", "ParameterDefinition", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3281          case 1748214124: /*valueRelatedArtifact*/  return new Property("value[x]", "RelatedArtifact", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3282          case 976830394: /*valueTriggerDefinition*/  return new Property("value[x]", "TriggerDefinition", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3283          case 588000479: /*valueUsageContext*/  return new Property("value[x]", "UsageContext", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3284          case -1858636920: /*valueDosage*/  return new Property("value[x]", "Dosage", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3285          case -765920490: /*valueMeta*/  return new Property("value[x]", "Meta", "The actual value for the element, which must be one of the types allowed for this element.", 0, 1, value);
3286          default: return super.getNamedProperty(_hash, _name, _checkValid);
3287          }
3288
3289        }
3290
3291      @Override
3292      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3293        switch (hash) {
3294        case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType
3295        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
3296        default: return super.getProperty(hash, name, checkValid);
3297        }
3298
3299      }
3300
3301      @Override
3302      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3303        switch (hash) {
3304        case 102727412: // label
3305          this.label = TypeConvertor.castToString(value); // StringType
3306          return value;
3307        case 111972721: // value
3308          this.value = TypeConvertor.castToType(value); // DataType
3309          return value;
3310        default: return super.setProperty(hash, name, value);
3311        }
3312
3313      }
3314
3315      @Override
3316      public Base setProperty(String name, Base value) throws FHIRException {
3317        if (name.equals("label")) {
3318          this.label = TypeConvertor.castToString(value); // StringType
3319        } else if (name.equals("value[x]")) {
3320          this.value = TypeConvertor.castToType(value); // DataType
3321        } else
3322          return super.setProperty(name, value);
3323        return value;
3324      }
3325
3326      @Override
3327      public Base makeProperty(int hash, String name) throws FHIRException {
3328        switch (hash) {
3329        case 102727412:  return getLabelElement();
3330        case -1410166417:  return getValue();
3331        case 111972721:  return getValue();
3332        default: return super.makeProperty(hash, name);
3333        }
3334
3335      }
3336
3337      @Override
3338      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3339        switch (hash) {
3340        case 102727412: /*label*/ return new String[] {"string"};
3341        case 111972721: /*value*/ return new String[] {"base64Binary", "boolean", "canonical", "code", "date", "dateTime", "decimal", "id", "instant", "integer", "integer64", "markdown", "oid", "positiveInt", "string", "time", "unsignedInt", "uri", "url", "uuid", "Address", "Age", "Annotation", "Attachment", "CodeableConcept", "Coding", "ContactPoint", "Count", "Distance", "Duration", "HumanName", "Identifier", "Money", "Period", "Quantity", "Range", "Ratio", "Reference", "SampledData", "Signature", "Timing", "ContactDetail", "Contributor", "DataRequirement", "Expression", "ParameterDefinition", "RelatedArtifact", "TriggerDefinition", "UsageContext", "Dosage", "Meta"};
3342        default: return super.getTypesForProperty(hash, name);
3343        }
3344
3345      }
3346
3347      @Override
3348      public Base addChild(String name) throws FHIRException {
3349        if (name.equals("label")) {
3350          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.example.label");
3351        }
3352        else if (name.equals("valueBase64Binary")) {
3353          this.value = new Base64BinaryType();
3354          return this.value;
3355        }
3356        else if (name.equals("valueBoolean")) {
3357          this.value = new BooleanType();
3358          return this.value;
3359        }
3360        else if (name.equals("valueCanonical")) {
3361          this.value = new CanonicalType();
3362          return this.value;
3363        }
3364        else if (name.equals("valueCode")) {
3365          this.value = new CodeType();
3366          return this.value;
3367        }
3368        else if (name.equals("valueDate")) {
3369          this.value = new DateType();
3370          return this.value;
3371        }
3372        else if (name.equals("valueDateTime")) {
3373          this.value = new DateTimeType();
3374          return this.value;
3375        }
3376        else if (name.equals("valueDecimal")) {
3377          this.value = new DecimalType();
3378          return this.value;
3379        }
3380        else if (name.equals("valueId")) {
3381          this.value = new IdType();
3382          return this.value;
3383        }
3384        else if (name.equals("valueInstant")) {
3385          this.value = new InstantType();
3386          return this.value;
3387        }
3388        else if (name.equals("valueInteger")) {
3389          this.value = new IntegerType();
3390          return this.value;
3391        }
3392        else if (name.equals("valueInteger64")) {
3393          this.value = new Integer64Type();
3394          return this.value;
3395        }
3396        else if (name.equals("valueMarkdown")) {
3397          this.value = new MarkdownType();
3398          return this.value;
3399        }
3400        else if (name.equals("valueOid")) {
3401          this.value = new OidType();
3402          return this.value;
3403        }
3404        else if (name.equals("valuePositiveInt")) {
3405          this.value = new PositiveIntType();
3406          return this.value;
3407        }
3408        else if (name.equals("valueString")) {
3409          this.value = new StringType();
3410          return this.value;
3411        }
3412        else if (name.equals("valueTime")) {
3413          this.value = new TimeType();
3414          return this.value;
3415        }
3416        else if (name.equals("valueUnsignedInt")) {
3417          this.value = new UnsignedIntType();
3418          return this.value;
3419        }
3420        else if (name.equals("valueUri")) {
3421          this.value = new UriType();
3422          return this.value;
3423        }
3424        else if (name.equals("valueUrl")) {
3425          this.value = new UrlType();
3426          return this.value;
3427        }
3428        else if (name.equals("valueUuid")) {
3429          this.value = new UuidType();
3430          return this.value;
3431        }
3432        else if (name.equals("valueAddress")) {
3433          this.value = new Address();
3434          return this.value;
3435        }
3436        else if (name.equals("valueAge")) {
3437          this.value = new Age();
3438          return this.value;
3439        }
3440        else if (name.equals("valueAnnotation")) {
3441          this.value = new Annotation();
3442          return this.value;
3443        }
3444        else if (name.equals("valueAttachment")) {
3445          this.value = new Attachment();
3446          return this.value;
3447        }
3448        else if (name.equals("valueCodeableConcept")) {
3449          this.value = new CodeableConcept();
3450          return this.value;
3451        }
3452        else if (name.equals("valueCoding")) {
3453          this.value = new Coding();
3454          return this.value;
3455        }
3456        else if (name.equals("valueContactPoint")) {
3457          this.value = new ContactPoint();
3458          return this.value;
3459        }
3460        else if (name.equals("valueCount")) {
3461          this.value = new Count();
3462          return this.value;
3463        }
3464        else if (name.equals("valueDistance")) {
3465          this.value = new Distance();
3466          return this.value;
3467        }
3468        else if (name.equals("valueDuration")) {
3469          this.value = new Duration();
3470          return this.value;
3471        }
3472        else if (name.equals("valueHumanName")) {
3473          this.value = new HumanName();
3474          return this.value;
3475        }
3476        else if (name.equals("valueIdentifier")) {
3477          this.value = new Identifier();
3478          return this.value;
3479        }
3480        else if (name.equals("valueMoney")) {
3481          this.value = new Money();
3482          return this.value;
3483        }
3484        else if (name.equals("valuePeriod")) {
3485          this.value = new Period();
3486          return this.value;
3487        }
3488        else if (name.equals("valueQuantity")) {
3489          this.value = new Quantity();
3490          return this.value;
3491        }
3492        else if (name.equals("valueRange")) {
3493          this.value = new Range();
3494          return this.value;
3495        }
3496        else if (name.equals("valueRatio")) {
3497          this.value = new Ratio();
3498          return this.value;
3499        }
3500        else if (name.equals("valueReference")) {
3501          this.value = new Reference();
3502          return this.value;
3503        }
3504        else if (name.equals("valueSampledData")) {
3505          this.value = new SampledData();
3506          return this.value;
3507        }
3508        else if (name.equals("valueSignature")) {
3509          this.value = new Signature();
3510          return this.value;
3511        }
3512        else if (name.equals("valueTiming")) {
3513          this.value = new Timing();
3514          return this.value;
3515        }
3516        else if (name.equals("valueContactDetail")) {
3517          this.value = new ContactDetail();
3518          return this.value;
3519        }
3520        else if (name.equals("valueContributor")) {
3521          this.value = new Contributor();
3522          return this.value;
3523        }
3524        else if (name.equals("valueDataRequirement")) {
3525          this.value = new DataRequirement();
3526          return this.value;
3527        }
3528        else if (name.equals("valueExpression")) {
3529          this.value = new Expression();
3530          return this.value;
3531        }
3532        else if (name.equals("valueParameterDefinition")) {
3533          this.value = new ParameterDefinition();
3534          return this.value;
3535        }
3536        else if (name.equals("valueRelatedArtifact")) {
3537          this.value = new RelatedArtifact();
3538          return this.value;
3539        }
3540        else if (name.equals("valueTriggerDefinition")) {
3541          this.value = new TriggerDefinition();
3542          return this.value;
3543        }
3544        else if (name.equals("valueUsageContext")) {
3545          this.value = new UsageContext();
3546          return this.value;
3547        }
3548        else if (name.equals("valueDosage")) {
3549          this.value = new Dosage();
3550          return this.value;
3551        }
3552        else if (name.equals("valueMeta")) {
3553          this.value = new Meta();
3554          return this.value;
3555        }
3556        else
3557          return super.addChild(name);
3558      }
3559
3560      public ElementDefinitionExampleComponent copy() {
3561        ElementDefinitionExampleComponent dst = new ElementDefinitionExampleComponent();
3562        copyValues(dst);
3563        return dst;
3564      }
3565
3566      public void copyValues(ElementDefinitionExampleComponent dst) {
3567        super.copyValues(dst);
3568        dst.label = label == null ? null : label.copy();
3569        dst.value = value == null ? null : value.copy();
3570      }
3571
3572      @Override
3573      public boolean equalsDeep(Base other_) {
3574        if (!super.equalsDeep(other_))
3575          return false;
3576        if (!(other_ instanceof ElementDefinitionExampleComponent))
3577          return false;
3578        ElementDefinitionExampleComponent o = (ElementDefinitionExampleComponent) other_;
3579        return compareDeep(label, o.label, true) && compareDeep(value, o.value, true);
3580      }
3581
3582      @Override
3583      public boolean equalsShallow(Base other_) {
3584        if (!super.equalsShallow(other_))
3585          return false;
3586        if (!(other_ instanceof ElementDefinitionExampleComponent))
3587          return false;
3588        ElementDefinitionExampleComponent o = (ElementDefinitionExampleComponent) other_;
3589        return compareValues(label, o.label, true);
3590      }
3591
3592      public boolean isEmpty() {
3593        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(label, value);
3594      }
3595
3596  public String fhirType() {
3597    return "ElementDefinition.example";
3598
3599  }
3600
3601  }
3602
3603    @Block()
3604    public static class ElementDefinitionConstraintComponent extends Element implements IBaseDatatypeElement {
3605        /**
3606         * Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.
3607         */
3608        @Child(name = "key", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
3609        @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." )
3610        protected IdType key;
3611
3612        /**
3613         * Description of why this constraint is necessary or appropriate.
3614         */
3615        @Child(name = "requirements", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
3616        @Description(shortDefinition="Why this constraint is necessary or appropriate", formalDefinition="Description of why this constraint is necessary or appropriate." )
3617        protected StringType requirements;
3618
3619        /**
3620         * Identifies the impact constraint violation has on the conformance of the instance.
3621         */
3622        @Child(name = "severity", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true)
3623        @Description(shortDefinition="error | warning", formalDefinition="Identifies the impact constraint violation has on the conformance of the instance." )
3624        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/constraint-severity")
3625        protected Enumeration<ConstraintSeverity> severity;
3626
3627        /**
3628         * Text that can be used to describe the constraint in messages identifying that the constraint has been violated.
3629         */
3630        @Child(name = "human", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=true)
3631        @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." )
3632        protected StringType human;
3633
3634        /**
3635         * A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.
3636         */
3637        @Child(name = "expression", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
3638        @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." )
3639        protected StringType expression;
3640
3641        /**
3642         * An XPath expression of constraint that can be executed to see if this constraint is met.
3643         */
3644        @Child(name = "xpath", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
3645        @Description(shortDefinition="XPath expression of constraint", formalDefinition="An XPath expression of constraint that can be executed to see if this constraint is met." )
3646        protected StringType xpath;
3647
3648        /**
3649         * A reference to the original source of the constraint, for traceability purposes.
3650         */
3651        @Child(name = "source", type = {CanonicalType.class}, order=7, min=0, max=1, modifier=false, summary=true)
3652        @Description(shortDefinition="Reference to original source of constraint", formalDefinition="A reference to the original source of the constraint, for traceability purposes." )
3653        protected CanonicalType source;
3654
3655        private static final long serialVersionUID = 1048354565L;
3656
3657    /**
3658     * Constructor
3659     */
3660      public ElementDefinitionConstraintComponent() {
3661        super();
3662      }
3663
3664    /**
3665     * Constructor
3666     */
3667      public ElementDefinitionConstraintComponent(String key, ConstraintSeverity severity, String human) {
3668        super();
3669        this.setKey(key);
3670        this.setSeverity(severity);
3671        this.setHuman(human);
3672      }
3673
3674        /**
3675         * @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
3676         */
3677        public IdType getKeyElement() { 
3678          if (this.key == null)
3679            if (Configuration.errorOnAutoCreate())
3680              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.key");
3681            else if (Configuration.doAutoCreate())
3682              this.key = new IdType(); // bb
3683          return this.key;
3684        }
3685
3686        public boolean hasKeyElement() { 
3687          return this.key != null && !this.key.isEmpty();
3688        }
3689
3690        public boolean hasKey() { 
3691          return this.key != null && !this.key.isEmpty();
3692        }
3693
3694        /**
3695         * @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
3696         */
3697        public ElementDefinitionConstraintComponent setKeyElement(IdType value) { 
3698          this.key = value;
3699          return this;
3700        }
3701
3702        /**
3703         * @return Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.
3704         */
3705        public String getKey() { 
3706          return this.key == null ? null : this.key.getValue();
3707        }
3708
3709        /**
3710         * @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.
3711         */
3712        public ElementDefinitionConstraintComponent setKey(String value) { 
3713            if (this.key == null)
3714              this.key = new IdType();
3715            this.key.setValue(value);
3716          return this;
3717        }
3718
3719        /**
3720         * @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
3721         */
3722        public StringType getRequirementsElement() { 
3723          if (this.requirements == null)
3724            if (Configuration.errorOnAutoCreate())
3725              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.requirements");
3726            else if (Configuration.doAutoCreate())
3727              this.requirements = new StringType(); // bb
3728          return this.requirements;
3729        }
3730
3731        public boolean hasRequirementsElement() { 
3732          return this.requirements != null && !this.requirements.isEmpty();
3733        }
3734
3735        public boolean hasRequirements() { 
3736          return this.requirements != null && !this.requirements.isEmpty();
3737        }
3738
3739        /**
3740         * @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
3741         */
3742        public ElementDefinitionConstraintComponent setRequirementsElement(StringType value) { 
3743          this.requirements = value;
3744          return this;
3745        }
3746
3747        /**
3748         * @return Description of why this constraint is necessary or appropriate.
3749         */
3750        public String getRequirements() { 
3751          return this.requirements == null ? null : this.requirements.getValue();
3752        }
3753
3754        /**
3755         * @param value Description of why this constraint is necessary or appropriate.
3756         */
3757        public ElementDefinitionConstraintComponent setRequirements(String value) { 
3758          if (Utilities.noString(value))
3759            this.requirements = null;
3760          else {
3761            if (this.requirements == null)
3762              this.requirements = new StringType();
3763            this.requirements.setValue(value);
3764          }
3765          return this;
3766        }
3767
3768        /**
3769         * @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
3770         */
3771        public Enumeration<ConstraintSeverity> getSeverityElement() { 
3772          if (this.severity == null)
3773            if (Configuration.errorOnAutoCreate())
3774              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.severity");
3775            else if (Configuration.doAutoCreate())
3776              this.severity = new Enumeration<ConstraintSeverity>(new ConstraintSeverityEnumFactory()); // bb
3777          return this.severity;
3778        }
3779
3780        public boolean hasSeverityElement() { 
3781          return this.severity != null && !this.severity.isEmpty();
3782        }
3783
3784        public boolean hasSeverity() { 
3785          return this.severity != null && !this.severity.isEmpty();
3786        }
3787
3788        /**
3789         * @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
3790         */
3791        public ElementDefinitionConstraintComponent setSeverityElement(Enumeration<ConstraintSeverity> value) { 
3792          this.severity = value;
3793          return this;
3794        }
3795
3796        /**
3797         * @return Identifies the impact constraint violation has on the conformance of the instance.
3798         */
3799        public ConstraintSeverity getSeverity() { 
3800          return this.severity == null ? null : this.severity.getValue();
3801        }
3802
3803        /**
3804         * @param value Identifies the impact constraint violation has on the conformance of the instance.
3805         */
3806        public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) { 
3807            if (this.severity == null)
3808              this.severity = new Enumeration<ConstraintSeverity>(new ConstraintSeverityEnumFactory());
3809            this.severity.setValue(value);
3810          return this;
3811        }
3812
3813        /**
3814         * @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
3815         */
3816        public StringType getHumanElement() { 
3817          if (this.human == null)
3818            if (Configuration.errorOnAutoCreate())
3819              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.human");
3820            else if (Configuration.doAutoCreate())
3821              this.human = new StringType(); // bb
3822          return this.human;
3823        }
3824
3825        public boolean hasHumanElement() { 
3826          return this.human != null && !this.human.isEmpty();
3827        }
3828
3829        public boolean hasHuman() { 
3830          return this.human != null && !this.human.isEmpty();
3831        }
3832
3833        /**
3834         * @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
3835         */
3836        public ElementDefinitionConstraintComponent setHumanElement(StringType value) { 
3837          this.human = value;
3838          return this;
3839        }
3840
3841        /**
3842         * @return Text that can be used to describe the constraint in messages identifying that the constraint has been violated.
3843         */
3844        public String getHuman() { 
3845          return this.human == null ? null : this.human.getValue();
3846        }
3847
3848        /**
3849         * @param value Text that can be used to describe the constraint in messages identifying that the constraint has been violated.
3850         */
3851        public ElementDefinitionConstraintComponent setHuman(String value) { 
3852            if (this.human == null)
3853              this.human = new StringType();
3854            this.human.setValue(value);
3855          return this;
3856        }
3857
3858        /**
3859         * @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
3860         */
3861        public StringType getExpressionElement() { 
3862          if (this.expression == null)
3863            if (Configuration.errorOnAutoCreate())
3864              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.expression");
3865            else if (Configuration.doAutoCreate())
3866              this.expression = new StringType(); // bb
3867          return this.expression;
3868        }
3869
3870        public boolean hasExpressionElement() { 
3871          return this.expression != null && !this.expression.isEmpty();
3872        }
3873
3874        public boolean hasExpression() { 
3875          return this.expression != null && !this.expression.isEmpty();
3876        }
3877
3878        /**
3879         * @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
3880         */
3881        public ElementDefinitionConstraintComponent setExpressionElement(StringType value) { 
3882          this.expression = value;
3883          return this;
3884        }
3885
3886        /**
3887         * @return A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.
3888         */
3889        public String getExpression() { 
3890          return this.expression == null ? null : this.expression.getValue();
3891        }
3892
3893        /**
3894         * @param value A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.
3895         */
3896        public ElementDefinitionConstraintComponent setExpression(String value) { 
3897          if (Utilities.noString(value))
3898            this.expression = null;
3899          else {
3900            if (this.expression == null)
3901              this.expression = new StringType();
3902            this.expression.setValue(value);
3903          }
3904          return this;
3905        }
3906
3907        /**
3908         * @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
3909         */
3910        public StringType getXpathElement() { 
3911          if (this.xpath == null)
3912            if (Configuration.errorOnAutoCreate())
3913              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.xpath");
3914            else if (Configuration.doAutoCreate())
3915              this.xpath = new StringType(); // bb
3916          return this.xpath;
3917        }
3918
3919        public boolean hasXpathElement() { 
3920          return this.xpath != null && !this.xpath.isEmpty();
3921        }
3922
3923        public boolean hasXpath() { 
3924          return this.xpath != null && !this.xpath.isEmpty();
3925        }
3926
3927        /**
3928         * @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
3929         */
3930        public ElementDefinitionConstraintComponent setXpathElement(StringType value) { 
3931          this.xpath = value;
3932          return this;
3933        }
3934
3935        /**
3936         * @return An XPath expression of constraint that can be executed to see if this constraint is met.
3937         */
3938        public String getXpath() { 
3939          return this.xpath == null ? null : this.xpath.getValue();
3940        }
3941
3942        /**
3943         * @param value An XPath expression of constraint that can be executed to see if this constraint is met.
3944         */
3945        public ElementDefinitionConstraintComponent setXpath(String value) { 
3946          if (Utilities.noString(value))
3947            this.xpath = null;
3948          else {
3949            if (this.xpath == null)
3950              this.xpath = new StringType();
3951            this.xpath.setValue(value);
3952          }
3953          return this;
3954        }
3955
3956        /**
3957         * @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
3958         */
3959        public CanonicalType getSourceElement() { 
3960          if (this.source == null)
3961            if (Configuration.errorOnAutoCreate())
3962              throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.source");
3963            else if (Configuration.doAutoCreate())
3964              this.source = new CanonicalType(); // bb
3965          return this.source;
3966        }
3967
3968        public boolean hasSourceElement() { 
3969          return this.source != null && !this.source.isEmpty();
3970        }
3971
3972        public boolean hasSource() { 
3973          return this.source != null && !this.source.isEmpty();
3974        }
3975
3976        /**
3977         * @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
3978         */
3979        public ElementDefinitionConstraintComponent setSourceElement(CanonicalType value) { 
3980          this.source = value;
3981          return this;
3982        }
3983
3984        /**
3985         * @return A reference to the original source of the constraint, for traceability purposes.
3986         */
3987        public String getSource() { 
3988          return this.source == null ? null : this.source.getValue();
3989        }
3990
3991        /**
3992         * @param value A reference to the original source of the constraint, for traceability purposes.
3993         */
3994        public ElementDefinitionConstraintComponent setSource(String value) { 
3995          if (Utilities.noString(value))
3996            this.source = null;
3997          else {
3998            if (this.source == null)
3999              this.source = new CanonicalType();
4000            this.source.setValue(value);
4001          }
4002          return this;
4003        }
4004
4005        protected void listChildren(List<Property> children) {
4006          super.listChildren(children);
4007          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));
4008          children.add(new Property("requirements", "string", "Description of why this constraint is necessary or appropriate.", 0, 1, requirements));
4009          children.add(new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, 1, severity));
4010          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));
4011          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));
4012          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));
4013          children.add(new Property("source", "canonical(StructureDefinition)", "A reference to the original source of the constraint, for traceability purposes.", 0, 1, source));
4014        }
4015
4016        @Override
4017        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4018          switch (_hash) {
4019          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);
4020          case -1619874672: /*requirements*/  return new Property("requirements", "string", "Description of why this constraint is necessary or appropriate.", 0, 1, requirements);
4021          case 1478300413: /*severity*/  return new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, 1, severity);
4022          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);
4023          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);
4024          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);
4025          case -896505829: /*source*/  return new Property("source", "canonical(StructureDefinition)", "A reference to the original source of the constraint, for traceability purposes.", 0, 1, source);
4026          default: return super.getNamedProperty(_hash, _name, _checkValid);
4027          }
4028
4029        }
4030
4031      @Override
4032      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4033        switch (hash) {
4034        case 106079: /*key*/ return this.key == null ? new Base[0] : new Base[] {this.key}; // IdType
4035        case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType
4036        case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration<ConstraintSeverity>
4037        case 99639597: /*human*/ return this.human == null ? new Base[0] : new Base[] {this.human}; // StringType
4038        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType
4039        case 114256029: /*xpath*/ return this.xpath == null ? new Base[0] : new Base[] {this.xpath}; // StringType
4040        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // CanonicalType
4041        default: return super.getProperty(hash, name, checkValid);
4042        }
4043
4044      }
4045
4046      @Override
4047      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4048        switch (hash) {
4049        case 106079: // key
4050          this.key = TypeConvertor.castToId(value); // IdType
4051          return value;
4052        case -1619874672: // requirements
4053          this.requirements = TypeConvertor.castToString(value); // StringType
4054          return value;
4055        case 1478300413: // severity
4056          value = new ConstraintSeverityEnumFactory().fromType(TypeConvertor.castToCode(value));
4057          this.severity = (Enumeration) value; // Enumeration<ConstraintSeverity>
4058          return value;
4059        case 99639597: // human
4060          this.human = TypeConvertor.castToString(value); // StringType
4061          return value;
4062        case -1795452264: // expression
4063          this.expression = TypeConvertor.castToString(value); // StringType
4064          return value;
4065        case 114256029: // xpath
4066          this.xpath = TypeConvertor.castToString(value); // StringType
4067          return value;
4068        case -896505829: // source
4069          this.source = TypeConvertor.castToCanonical(value); // CanonicalType
4070          return value;
4071        default: return super.setProperty(hash, name, value);
4072        }
4073
4074      }
4075
4076      @Override
4077      public Base setProperty(String name, Base value) throws FHIRException {
4078        if (name.equals("key")) {
4079          this.key = TypeConvertor.castToId(value); // IdType
4080        } else if (name.equals("requirements")) {
4081          this.requirements = TypeConvertor.castToString(value); // StringType
4082        } else if (name.equals("severity")) {
4083          value = new ConstraintSeverityEnumFactory().fromType(TypeConvertor.castToCode(value));
4084          this.severity = (Enumeration) value; // Enumeration<ConstraintSeverity>
4085        } else if (name.equals("human")) {
4086          this.human = TypeConvertor.castToString(value); // StringType
4087        } else if (name.equals("expression")) {
4088          this.expression = TypeConvertor.castToString(value); // StringType
4089        } else if (name.equals("xpath")) {
4090          this.xpath = TypeConvertor.castToString(value); // StringType
4091        } else if (name.equals("source")) {
4092          this.source = TypeConvertor.castToCanonical(value); // CanonicalType
4093        } else
4094          return super.setProperty(name, value);
4095        return value;
4096      }
4097
4098      @Override
4099      public Base makeProperty(int hash, String name) throws FHIRException {
4100        switch (hash) {
4101        case 106079:  return getKeyElement();
4102        case -1619874672:  return getRequirementsElement();
4103        case 1478300413:  return getSeverityElement();
4104        case 99639597:  return getHumanElement();
4105        case -1795452264:  return getExpressionElement();
4106        case 114256029:  return getXpathElement();
4107        case -896505829:  return getSourceElement();
4108        default: return super.makeProperty(hash, name);
4109        }
4110
4111      }
4112
4113      @Override
4114      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4115        switch (hash) {
4116        case 106079: /*key*/ return new String[] {"id"};
4117        case -1619874672: /*requirements*/ return new String[] {"string"};
4118        case 1478300413: /*severity*/ return new String[] {"code"};
4119        case 99639597: /*human*/ return new String[] {"string"};
4120        case -1795452264: /*expression*/ return new String[] {"string"};
4121        case 114256029: /*xpath*/ return new String[] {"string"};
4122        case -896505829: /*source*/ return new String[] {"canonical"};
4123        default: return super.getTypesForProperty(hash, name);
4124        }
4125
4126      }
4127
4128      @Override
4129      public Base addChild(String name) throws FHIRException {
4130        if (name.equals("key")) {
4131          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.constraint.key");
4132        }
4133        else if (name.equals("requirements")) {
4134          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.constraint.requirements");
4135        }
4136        else if (name.equals("severity")) {
4137          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.constraint.severity");
4138        }
4139        else if (name.equals("human")) {
4140          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.constraint.human");
4141        }
4142        else if (name.equals("expression")) {
4143          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.constraint.expression");
4144        }
4145        else if (name.equals("xpath")) {
4146          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.constraint.xpath");
4147        }
4148        else if (name.equals("source")) {
4149          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.constraint.source");
4150        }
4151        else
4152          return super.addChild(name);
4153      }
4154
4155      public ElementDefinitionConstraintComponent copy() {
4156        ElementDefinitionConstraintComponent dst = new ElementDefinitionConstraintComponent();
4157        copyValues(dst);
4158        return dst;
4159      }
4160
4161      public void copyValues(ElementDefinitionConstraintComponent dst) {
4162        super.copyValues(dst);
4163        dst.key = key == null ? null : key.copy();
4164        dst.requirements = requirements == null ? null : requirements.copy();
4165        dst.severity = severity == null ? null : severity.copy();
4166        dst.human = human == null ? null : human.copy();
4167        dst.expression = expression == null ? null : expression.copy();
4168        dst.xpath = xpath == null ? null : xpath.copy();
4169        dst.source = source == null ? null : source.copy();
4170      }
4171
4172      @Override
4173      public boolean equalsDeep(Base other_) {
4174        if (!super.equalsDeep(other_))
4175          return false;
4176        if (!(other_ instanceof ElementDefinitionConstraintComponent))
4177          return false;
4178        ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other_;
4179        return compareDeep(key, o.key, true) && compareDeep(requirements, o.requirements, true) && compareDeep(severity, o.severity, true)
4180           && compareDeep(human, o.human, true) && compareDeep(expression, o.expression, true) && compareDeep(xpath, o.xpath, true)
4181           && compareDeep(source, o.source, true);
4182      }
4183
4184      @Override
4185      public boolean equalsShallow(Base other_) {
4186        if (!super.equalsShallow(other_))
4187          return false;
4188        if (!(other_ instanceof ElementDefinitionConstraintComponent))
4189          return false;
4190        ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other_;
4191        return compareValues(key, o.key, true) && compareValues(requirements, o.requirements, true) && compareValues(severity, o.severity, true)
4192           && compareValues(human, o.human, true) && compareValues(expression, o.expression, true) && compareValues(xpath, o.xpath, true)
4193           && compareValues(source, o.source, true);
4194      }
4195
4196      public boolean isEmpty() {
4197        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(key, requirements, severity
4198          , human, expression, xpath, source);
4199      }
4200
4201  public String fhirType() {
4202    return "ElementDefinition.constraint";
4203
4204  }
4205
4206  }
4207
4208    @Block()
4209    public static class ElementDefinitionBindingComponent extends Element implements IBaseDatatypeElement {
4210        /**
4211         * 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.
4212         */
4213        @Child(name = "strength", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
4214        @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." )
4215        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/binding-strength")
4216        protected Enumeration<BindingStrength> strength;
4217
4218        /**
4219         * Describes the intended use of this particular set of codes.
4220         */
4221        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
4222        @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." )
4223        protected StringType description;
4224
4225        /**
4226         * Refers to the value set that identifies the set of codes the binding refers to.
4227         */
4228        @Child(name = "valueSet", type = {CanonicalType.class}, order=3, min=0, max=1, modifier=false, summary=true)
4229        @Description(shortDefinition="Source of value set", formalDefinition="Refers to the value set that identifies the set of codes the binding refers to." )
4230        protected CanonicalType valueSet;
4231
4232        private static final long serialVersionUID = -514477030L;
4233
4234    /**
4235     * Constructor
4236     */
4237      public ElementDefinitionBindingComponent() {
4238        super();
4239      }
4240
4241    /**
4242     * Constructor
4243     */
4244      public ElementDefinitionBindingComponent(BindingStrength strength) {
4245        super();
4246        this.setStrength(strength);
4247      }
4248
4249        /**
4250         * @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
4251         */
4252        public Enumeration<BindingStrength> getStrengthElement() { 
4253          if (this.strength == null)
4254            if (Configuration.errorOnAutoCreate())
4255              throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.strength");
4256            else if (Configuration.doAutoCreate())
4257              this.strength = new Enumeration<BindingStrength>(new BindingStrengthEnumFactory()); // bb
4258          return this.strength;
4259        }
4260
4261        public boolean hasStrengthElement() { 
4262          return this.strength != null && !this.strength.isEmpty();
4263        }
4264
4265        public boolean hasStrength() { 
4266          return this.strength != null && !this.strength.isEmpty();
4267        }
4268
4269        /**
4270         * @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
4271         */
4272        public ElementDefinitionBindingComponent setStrengthElement(Enumeration<BindingStrength> value) { 
4273          this.strength = value;
4274          return this;
4275        }
4276
4277        /**
4278         * @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.
4279         */
4280        public BindingStrength getStrength() { 
4281          return this.strength == null ? null : this.strength.getValue();
4282        }
4283
4284        /**
4285         * @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.
4286         */
4287        public ElementDefinitionBindingComponent setStrength(BindingStrength value) { 
4288            if (this.strength == null)
4289              this.strength = new Enumeration<BindingStrength>(new BindingStrengthEnumFactory());
4290            this.strength.setValue(value);
4291          return this;
4292        }
4293
4294        /**
4295         * @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
4296         */
4297        public StringType getDescriptionElement() { 
4298          if (this.description == null)
4299            if (Configuration.errorOnAutoCreate())
4300              throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.description");
4301            else if (Configuration.doAutoCreate())
4302              this.description = new StringType(); // bb
4303          return this.description;
4304        }
4305
4306        public boolean hasDescriptionElement() { 
4307          return this.description != null && !this.description.isEmpty();
4308        }
4309
4310        public boolean hasDescription() { 
4311          return this.description != null && !this.description.isEmpty();
4312        }
4313
4314        /**
4315         * @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
4316         */
4317        public ElementDefinitionBindingComponent setDescriptionElement(StringType value) { 
4318          this.description = value;
4319          return this;
4320        }
4321
4322        /**
4323         * @return Describes the intended use of this particular set of codes.
4324         */
4325        public String getDescription() { 
4326          return this.description == null ? null : this.description.getValue();
4327        }
4328
4329        /**
4330         * @param value Describes the intended use of this particular set of codes.
4331         */
4332        public ElementDefinitionBindingComponent setDescription(String value) { 
4333          if (Utilities.noString(value))
4334            this.description = null;
4335          else {
4336            if (this.description == null)
4337              this.description = new StringType();
4338            this.description.setValue(value);
4339          }
4340          return this;
4341        }
4342
4343        /**
4344         * @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
4345         */
4346        public CanonicalType getValueSetElement() { 
4347          if (this.valueSet == null)
4348            if (Configuration.errorOnAutoCreate())
4349              throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.valueSet");
4350            else if (Configuration.doAutoCreate())
4351              this.valueSet = new CanonicalType(); // bb
4352          return this.valueSet;
4353        }
4354
4355        public boolean hasValueSetElement() { 
4356          return this.valueSet != null && !this.valueSet.isEmpty();
4357        }
4358
4359        public boolean hasValueSet() { 
4360          return this.valueSet != null && !this.valueSet.isEmpty();
4361        }
4362
4363        /**
4364         * @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
4365         */
4366        public ElementDefinitionBindingComponent setValueSetElement(CanonicalType value) { 
4367          this.valueSet = value;
4368          return this;
4369        }
4370
4371        /**
4372         * @return Refers to the value set that identifies the set of codes the binding refers to.
4373         */
4374        public String getValueSet() { 
4375          return this.valueSet == null ? null : this.valueSet.getValue();
4376        }
4377
4378        /**
4379         * @param value Refers to the value set that identifies the set of codes the binding refers to.
4380         */
4381        public ElementDefinitionBindingComponent setValueSet(String value) { 
4382          if (Utilities.noString(value))
4383            this.valueSet = null;
4384          else {
4385            if (this.valueSet == null)
4386              this.valueSet = new CanonicalType();
4387            this.valueSet.setValue(value);
4388          }
4389          return this;
4390        }
4391
4392        protected void listChildren(List<Property> children) {
4393          super.listChildren(children);
4394          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));
4395          children.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, 1, description));
4396          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));
4397        }
4398
4399        @Override
4400        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4401          switch (_hash) {
4402          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);
4403          case -1724546052: /*description*/  return new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, 1, description);
4404          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);
4405          default: return super.getNamedProperty(_hash, _name, _checkValid);
4406          }
4407
4408        }
4409
4410      @Override
4411      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4412        switch (hash) {
4413        case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : new Base[] {this.strength}; // Enumeration<BindingStrength>
4414        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
4415        case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // CanonicalType
4416        default: return super.getProperty(hash, name, checkValid);
4417        }
4418
4419      }
4420
4421      @Override
4422      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4423        switch (hash) {
4424        case 1791316033: // strength
4425          value = new BindingStrengthEnumFactory().fromType(TypeConvertor.castToCode(value));
4426          this.strength = (Enumeration) value; // Enumeration<BindingStrength>
4427          return value;
4428        case -1724546052: // description
4429          this.description = TypeConvertor.castToString(value); // StringType
4430          return value;
4431        case -1410174671: // valueSet
4432          this.valueSet = TypeConvertor.castToCanonical(value); // CanonicalType
4433          return value;
4434        default: return super.setProperty(hash, name, value);
4435        }
4436
4437      }
4438
4439      @Override
4440      public Base setProperty(String name, Base value) throws FHIRException {
4441        if (name.equals("strength")) {
4442          value = new BindingStrengthEnumFactory().fromType(TypeConvertor.castToCode(value));
4443          this.strength = (Enumeration) value; // Enumeration<BindingStrength>
4444        } else if (name.equals("description")) {
4445          this.description = TypeConvertor.castToString(value); // StringType
4446        } else if (name.equals("valueSet")) {
4447          this.valueSet = TypeConvertor.castToCanonical(value); // CanonicalType
4448        } else
4449          return super.setProperty(name, value);
4450        return value;
4451      }
4452
4453      @Override
4454      public Base makeProperty(int hash, String name) throws FHIRException {
4455        switch (hash) {
4456        case 1791316033:  return getStrengthElement();
4457        case -1724546052:  return getDescriptionElement();
4458        case -1410174671:  return getValueSetElement();
4459        default: return super.makeProperty(hash, name);
4460        }
4461
4462      }
4463
4464      @Override
4465      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4466        switch (hash) {
4467        case 1791316033: /*strength*/ return new String[] {"code"};
4468        case -1724546052: /*description*/ return new String[] {"string"};
4469        case -1410174671: /*valueSet*/ return new String[] {"canonical"};
4470        default: return super.getTypesForProperty(hash, name);
4471        }
4472
4473      }
4474
4475      @Override
4476      public Base addChild(String name) throws FHIRException {
4477        if (name.equals("strength")) {
4478          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.binding.strength");
4479        }
4480        else if (name.equals("description")) {
4481          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.binding.description");
4482        }
4483        else if (name.equals("valueSet")) {
4484          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.binding.valueSet");
4485        }
4486        else
4487          return super.addChild(name);
4488      }
4489
4490      public ElementDefinitionBindingComponent copy() {
4491        ElementDefinitionBindingComponent dst = new ElementDefinitionBindingComponent();
4492        copyValues(dst);
4493        return dst;
4494      }
4495
4496      public void copyValues(ElementDefinitionBindingComponent dst) {
4497        super.copyValues(dst);
4498        dst.strength = strength == null ? null : strength.copy();
4499        dst.description = description == null ? null : description.copy();
4500        dst.valueSet = valueSet == null ? null : valueSet.copy();
4501      }
4502
4503      @Override
4504      public boolean equalsDeep(Base other_) {
4505        if (!super.equalsDeep(other_))
4506          return false;
4507        if (!(other_ instanceof ElementDefinitionBindingComponent))
4508          return false;
4509        ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other_;
4510        return compareDeep(strength, o.strength, true) && compareDeep(description, o.description, true)
4511           && compareDeep(valueSet, o.valueSet, true);
4512      }
4513
4514      @Override
4515      public boolean equalsShallow(Base other_) {
4516        if (!super.equalsShallow(other_))
4517          return false;
4518        if (!(other_ instanceof ElementDefinitionBindingComponent))
4519          return false;
4520        ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other_;
4521        return compareValues(strength, o.strength, true) && compareValues(description, o.description, true)
4522           && compareValues(valueSet, o.valueSet, true);
4523      }
4524
4525      public boolean isEmpty() {
4526        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(strength, description, valueSet
4527          );
4528      }
4529
4530  public String fhirType() {
4531    return "ElementDefinition.binding";
4532
4533  }
4534
4535  }
4536
4537    @Block()
4538    public static class ElementDefinitionMappingComponent extends Element implements IBaseDatatypeElement {
4539        /**
4540         * An internal reference to the definition of a mapping.
4541         */
4542        @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
4543        @Description(shortDefinition="Reference to mapping declaration", formalDefinition="An internal reference to the definition of a mapping." )
4544        protected IdType identity;
4545
4546        /**
4547         * Identifies the computable language in which mapping.map is expressed.
4548         */
4549        @Child(name = "language", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
4550        @Description(shortDefinition="Computable language of mapping", formalDefinition="Identifies the computable language in which mapping.map is expressed." )
4551        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/mimetypes")
4552        protected CodeType language;
4553
4554        /**
4555         * Expresses what part of the target specification corresponds to this element.
4556         */
4557        @Child(name = "map", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true)
4558        @Description(shortDefinition="Details of the mapping", formalDefinition="Expresses what part of the target specification corresponds to this element." )
4559        protected StringType map;
4560
4561        /**
4562         * Comments that provide information about the mapping or its use.
4563         */
4564        @Child(name = "comment", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
4565        @Description(shortDefinition="Comments about the mapping or its use", formalDefinition="Comments that provide information about the mapping or its use." )
4566        protected StringType comment;
4567
4568        private static final long serialVersionUID = 1386816887L;
4569
4570    /**
4571     * Constructor
4572     */
4573      public ElementDefinitionMappingComponent() {
4574        super();
4575      }
4576
4577    /**
4578     * Constructor
4579     */
4580      public ElementDefinitionMappingComponent(String identity, String map) {
4581        super();
4582        this.setIdentity(identity);
4583        this.setMap(map);
4584      }
4585
4586        /**
4587         * @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
4588         */
4589        public IdType getIdentityElement() { 
4590          if (this.identity == null)
4591            if (Configuration.errorOnAutoCreate())
4592              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.identity");
4593            else if (Configuration.doAutoCreate())
4594              this.identity = new IdType(); // bb
4595          return this.identity;
4596        }
4597
4598        public boolean hasIdentityElement() { 
4599          return this.identity != null && !this.identity.isEmpty();
4600        }
4601
4602        public boolean hasIdentity() { 
4603          return this.identity != null && !this.identity.isEmpty();
4604        }
4605
4606        /**
4607         * @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
4608         */
4609        public ElementDefinitionMappingComponent setIdentityElement(IdType value) { 
4610          this.identity = value;
4611          return this;
4612        }
4613
4614        /**
4615         * @return An internal reference to the definition of a mapping.
4616         */
4617        public String getIdentity() { 
4618          return this.identity == null ? null : this.identity.getValue();
4619        }
4620
4621        /**
4622         * @param value An internal reference to the definition of a mapping.
4623         */
4624        public ElementDefinitionMappingComponent setIdentity(String value) { 
4625            if (this.identity == null)
4626              this.identity = new IdType();
4627            this.identity.setValue(value);
4628          return this;
4629        }
4630
4631        /**
4632         * @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
4633         */
4634        public CodeType getLanguageElement() { 
4635          if (this.language == null)
4636            if (Configuration.errorOnAutoCreate())
4637              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.language");
4638            else if (Configuration.doAutoCreate())
4639              this.language = new CodeType(); // bb
4640          return this.language;
4641        }
4642
4643        public boolean hasLanguageElement() { 
4644          return this.language != null && !this.language.isEmpty();
4645        }
4646
4647        public boolean hasLanguage() { 
4648          return this.language != null && !this.language.isEmpty();
4649        }
4650
4651        /**
4652         * @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
4653         */
4654        public ElementDefinitionMappingComponent setLanguageElement(CodeType value) { 
4655          this.language = value;
4656          return this;
4657        }
4658
4659        /**
4660         * @return Identifies the computable language in which mapping.map is expressed.
4661         */
4662        public String getLanguage() { 
4663          return this.language == null ? null : this.language.getValue();
4664        }
4665
4666        /**
4667         * @param value Identifies the computable language in which mapping.map is expressed.
4668         */
4669        public ElementDefinitionMappingComponent setLanguage(String value) { 
4670          if (Utilities.noString(value))
4671            this.language = null;
4672          else {
4673            if (this.language == null)
4674              this.language = new CodeType();
4675            this.language.setValue(value);
4676          }
4677          return this;
4678        }
4679
4680        /**
4681         * @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
4682         */
4683        public StringType getMapElement() { 
4684          if (this.map == null)
4685            if (Configuration.errorOnAutoCreate())
4686              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.map");
4687            else if (Configuration.doAutoCreate())
4688              this.map = new StringType(); // bb
4689          return this.map;
4690        }
4691
4692        public boolean hasMapElement() { 
4693          return this.map != null && !this.map.isEmpty();
4694        }
4695
4696        public boolean hasMap() { 
4697          return this.map != null && !this.map.isEmpty();
4698        }
4699
4700        /**
4701         * @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
4702         */
4703        public ElementDefinitionMappingComponent setMapElement(StringType value) { 
4704          this.map = value;
4705          return this;
4706        }
4707
4708        /**
4709         * @return Expresses what part of the target specification corresponds to this element.
4710         */
4711        public String getMap() { 
4712          return this.map == null ? null : this.map.getValue();
4713        }
4714
4715        /**
4716         * @param value Expresses what part of the target specification corresponds to this element.
4717         */
4718        public ElementDefinitionMappingComponent setMap(String value) { 
4719            if (this.map == null)
4720              this.map = new StringType();
4721            this.map.setValue(value);
4722          return this;
4723        }
4724
4725        /**
4726         * @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
4727         */
4728        public StringType getCommentElement() { 
4729          if (this.comment == null)
4730            if (Configuration.errorOnAutoCreate())
4731              throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.comment");
4732            else if (Configuration.doAutoCreate())
4733              this.comment = new StringType(); // bb
4734          return this.comment;
4735        }
4736
4737        public boolean hasCommentElement() { 
4738          return this.comment != null && !this.comment.isEmpty();
4739        }
4740
4741        public boolean hasComment() { 
4742          return this.comment != null && !this.comment.isEmpty();
4743        }
4744
4745        /**
4746         * @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
4747         */
4748        public ElementDefinitionMappingComponent setCommentElement(StringType value) { 
4749          this.comment = value;
4750          return this;
4751        }
4752
4753        /**
4754         * @return Comments that provide information about the mapping or its use.
4755         */
4756        public String getComment() { 
4757          return this.comment == null ? null : this.comment.getValue();
4758        }
4759
4760        /**
4761         * @param value Comments that provide information about the mapping or its use.
4762         */
4763        public ElementDefinitionMappingComponent setComment(String value) { 
4764          if (Utilities.noString(value))
4765            this.comment = null;
4766          else {
4767            if (this.comment == null)
4768              this.comment = new StringType();
4769            this.comment.setValue(value);
4770          }
4771          return this;
4772        }
4773
4774        protected void listChildren(List<Property> children) {
4775          super.listChildren(children);
4776          children.add(new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, 1, identity));
4777          children.add(new Property("language", "code", "Identifies the computable language in which mapping.map is expressed.", 0, 1, language));
4778          children.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, 1, map));
4779          children.add(new Property("comment", "string", "Comments that provide information about the mapping or its use.", 0, 1, comment));
4780        }
4781
4782        @Override
4783        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4784          switch (_hash) {
4785          case -135761730: /*identity*/  return new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, 1, identity);
4786          case -1613589672: /*language*/  return new Property("language", "code", "Identifies the computable language in which mapping.map is expressed.", 0, 1, language);
4787          case 107868: /*map*/  return new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, 1, map);
4788          case 950398559: /*comment*/  return new Property("comment", "string", "Comments that provide information about the mapping or its use.", 0, 1, comment);
4789          default: return super.getNamedProperty(_hash, _name, _checkValid);
4790          }
4791
4792        }
4793
4794      @Override
4795      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4796        switch (hash) {
4797        case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType
4798        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType
4799        case 107868: /*map*/ return this.map == null ? new Base[0] : new Base[] {this.map}; // StringType
4800        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
4801        default: return super.getProperty(hash, name, checkValid);
4802        }
4803
4804      }
4805
4806      @Override
4807      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4808        switch (hash) {
4809        case -135761730: // identity
4810          this.identity = TypeConvertor.castToId(value); // IdType
4811          return value;
4812        case -1613589672: // language
4813          this.language = TypeConvertor.castToCode(value); // CodeType
4814          return value;
4815        case 107868: // map
4816          this.map = TypeConvertor.castToString(value); // StringType
4817          return value;
4818        case 950398559: // comment
4819          this.comment = TypeConvertor.castToString(value); // StringType
4820          return value;
4821        default: return super.setProperty(hash, name, value);
4822        }
4823
4824      }
4825
4826      @Override
4827      public Base setProperty(String name, Base value) throws FHIRException {
4828        if (name.equals("identity")) {
4829          this.identity = TypeConvertor.castToId(value); // IdType
4830        } else if (name.equals("language")) {
4831          this.language = TypeConvertor.castToCode(value); // CodeType
4832        } else if (name.equals("map")) {
4833          this.map = TypeConvertor.castToString(value); // StringType
4834        } else if (name.equals("comment")) {
4835          this.comment = TypeConvertor.castToString(value); // StringType
4836        } else
4837          return super.setProperty(name, value);
4838        return value;
4839      }
4840
4841      @Override
4842      public Base makeProperty(int hash, String name) throws FHIRException {
4843        switch (hash) {
4844        case -135761730:  return getIdentityElement();
4845        case -1613589672:  return getLanguageElement();
4846        case 107868:  return getMapElement();
4847        case 950398559:  return getCommentElement();
4848        default: return super.makeProperty(hash, name);
4849        }
4850
4851      }
4852
4853      @Override
4854      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4855        switch (hash) {
4856        case -135761730: /*identity*/ return new String[] {"id"};
4857        case -1613589672: /*language*/ return new String[] {"code"};
4858        case 107868: /*map*/ return new String[] {"string"};
4859        case 950398559: /*comment*/ return new String[] {"string"};
4860        default: return super.getTypesForProperty(hash, name);
4861        }
4862
4863      }
4864
4865      @Override
4866      public Base addChild(String name) throws FHIRException {
4867        if (name.equals("identity")) {
4868          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.mapping.identity");
4869        }
4870        else if (name.equals("language")) {
4871          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.mapping.language");
4872        }
4873        else if (name.equals("map")) {
4874          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.mapping.map");
4875        }
4876        else if (name.equals("comment")) {
4877          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.mapping.comment");
4878        }
4879        else
4880          return super.addChild(name);
4881      }
4882
4883      public ElementDefinitionMappingComponent copy() {
4884        ElementDefinitionMappingComponent dst = new ElementDefinitionMappingComponent();
4885        copyValues(dst);
4886        return dst;
4887      }
4888
4889      public void copyValues(ElementDefinitionMappingComponent dst) {
4890        super.copyValues(dst);
4891        dst.identity = identity == null ? null : identity.copy();
4892        dst.language = language == null ? null : language.copy();
4893        dst.map = map == null ? null : map.copy();
4894        dst.comment = comment == null ? null : comment.copy();
4895      }
4896
4897      @Override
4898      public boolean equalsDeep(Base other_) {
4899        if (!super.equalsDeep(other_))
4900          return false;
4901        if (!(other_ instanceof ElementDefinitionMappingComponent))
4902          return false;
4903        ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other_;
4904        return compareDeep(identity, o.identity, true) && compareDeep(language, o.language, true) && compareDeep(map, o.map, true)
4905           && compareDeep(comment, o.comment, true);
4906      }
4907
4908      @Override
4909      public boolean equalsShallow(Base other_) {
4910        if (!super.equalsShallow(other_))
4911          return false;
4912        if (!(other_ instanceof ElementDefinitionMappingComponent))
4913          return false;
4914        ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other_;
4915        return compareValues(identity, o.identity, true) && compareValues(language, o.language, true) && compareValues(map, o.map, true)
4916           && compareValues(comment, o.comment, true);
4917      }
4918
4919      public boolean isEmpty() {
4920        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identity, language, map
4921          , comment);
4922      }
4923
4924  public String fhirType() {
4925    return "ElementDefinition.mapping";
4926
4927  }
4928
4929  }
4930
4931    /**
4932     * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.
4933     */
4934    @Child(name = "path", type = {StringType.class}, order=0, min=1, max=1, modifier=false, summary=true)
4935    @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." )
4936    protected StringType path;
4937
4938    /**
4939     * Codes that define how this element is represented in instances, when the deviation varies from the normal case.
4940     */
4941    @Child(name = "representation", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4942    @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." )
4943    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/property-representation")
4944    protected List<Enumeration<PropertyRepresentation>> representation;
4945
4946    /**
4947     * 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.
4948     */
4949    @Child(name = "sliceName", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
4950    @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." )
4951    protected StringType sliceName;
4952
4953    /**
4954     * 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.
4955     */
4956    @Child(name = "sliceIsConstraining", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true)
4957    @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." )
4958    protected BooleanType sliceIsConstraining;
4959
4960    /**
4961     * 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.
4962     */
4963    @Child(name = "label", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
4964    @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." )
4965    protected StringType label;
4966
4967    /**
4968     * A code that has the same meaning as the element in a particular terminology.
4969     */
4970    @Child(name = "code", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4971    @Description(shortDefinition="Corresponding codes in terminologies", formalDefinition="A code that has the same meaning as the element in a particular terminology." )
4972    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-codes")
4973    protected List<Coding> code;
4974
4975    /**
4976     * 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).
4977     */
4978    @Child(name = "slicing", type = {}, order=6, min=0, max=1, modifier=false, summary=true)
4979    @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)." )
4980    protected ElementDefinitionSlicingComponent slicing;
4981
4982    /**
4983     * A concise description of what this element means (e.g. for use in autogenerated summaries).
4984     */
4985    @Child(name = "short", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
4986    @Description(shortDefinition="Concise definition for space-constrained presentation", formalDefinition="A concise description of what this element means (e.g. for use in autogenerated summaries)." )
4987    protected StringType short_;
4988
4989    /**
4990     * 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).
4991     */
4992    @Child(name = "definition", type = {MarkdownType.class}, order=8, min=0, max=1, modifier=false, summary=true)
4993    @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)." )
4994    protected MarkdownType definition;
4995
4996    /**
4997     * 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).
4998     */
4999    @Child(name = "comment", type = {MarkdownType.class}, order=9, min=0, max=1, modifier=false, summary=true)
5000    @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)." )
5001    protected MarkdownType comment;
5002
5003    /**
5004     * 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.
5005     */
5006    @Child(name = "requirements", type = {MarkdownType.class}, order=10, min=0, max=1, modifier=false, summary=true)
5007    @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." )
5008    protected MarkdownType requirements;
5009
5010    /**
5011     * Identifies additional names by which this element might also be known.
5012     */
5013    @Child(name = "alias", type = {StringType.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5014    @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." )
5015    protected List<StringType> alias;
5016
5017    /**
5018     * The minimum number of times this element SHALL appear in the instance.
5019     */
5020    @Child(name = "min", type = {UnsignedIntType.class}, order=12, min=0, max=1, modifier=false, summary=true)
5021    @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this element SHALL appear in the instance." )
5022    protected UnsignedIntType min;
5023
5024    /**
5025     * The maximum number of times this element is permitted to appear in the instance.
5026     */
5027    @Child(name = "max", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=true)
5028    @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the instance." )
5029    protected StringType max;
5030
5031    /**
5032     * 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.
5033     */
5034    @Child(name = "base", type = {}, order=14, min=0, max=1, modifier=false, summary=true)
5035    @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." )
5036    protected ElementDefinitionBaseComponent base;
5037
5038    /**
5039     * 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.
5040     */
5041    @Child(name = "contentReference", type = {UriType.class}, order=15, min=0, max=1, modifier=false, summary=true)
5042    @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." )
5043    protected UriType contentReference;
5044
5045    /**
5046     * The data type or resource that the value of this element is permitted to be.
5047     */
5048    @Child(name = "type", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5049    @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." )
5050    protected List<TypeRefComponent> type;
5051
5052    /**
5053     * 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').
5054     */
5055    @Child(name = "defaultValue", type = {Base64BinaryType.class, BooleanType.class, CanonicalType.class, CodeType.class, DateType.class, DateTimeType.class, DecimalType.class, IdType.class, InstantType.class, IntegerType.class, Integer64Type.class, MarkdownType.class, OidType.class, PositiveIntType.class, StringType.class, TimeType.class, UnsignedIntType.class, UriType.class, UrlType.class, UuidType.class, Address.class, Age.class, Annotation.class, Attachment.class, CodeableConcept.class, Coding.class, ContactPoint.class, Count.class, Distance.class, Duration.class, HumanName.class, Identifier.class, Money.class, Period.class, Quantity.class, Range.class, Ratio.class, Reference.class, SampledData.class, Signature.class, Timing.class, ContactDetail.class, Contributor.class, DataRequirement.class, Expression.class, ParameterDefinition.class, RelatedArtifact.class, TriggerDefinition.class, UsageContext.class, Dosage.class, Meta.class}, order=17, min=0, max=1, modifier=false, summary=true)
5056    @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')." )
5057    protected DataType defaultValue;
5058
5059    /**
5060     * The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing').
5061     */
5062    @Child(name = "meaningWhenMissing", type = {MarkdownType.class}, order=18, min=0, max=1, modifier=false, summary=true)
5063    @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')." )
5064    protected MarkdownType meaningWhenMissing;
5065
5066    /**
5067     * 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.
5068     */
5069    @Child(name = "orderMeaning", type = {StringType.class}, order=19, min=0, max=1, modifier=false, summary=true)
5070    @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." )
5071    protected StringType orderMeaning;
5072
5073    /**
5074     * 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.
5075     */
5076    @Child(name = "fixed", type = {Base64BinaryType.class, BooleanType.class, CanonicalType.class, CodeType.class, DateType.class, DateTimeType.class, DecimalType.class, IdType.class, InstantType.class, IntegerType.class, Integer64Type.class, MarkdownType.class, OidType.class, PositiveIntType.class, StringType.class, TimeType.class, UnsignedIntType.class, UriType.class, UrlType.class, UuidType.class, Address.class, Age.class, Annotation.class, Attachment.class, CodeableConcept.class, Coding.class, ContactPoint.class, Count.class, Distance.class, Duration.class, HumanName.class, Identifier.class, Money.class, Period.class, Quantity.class, Range.class, Ratio.class, Reference.class, SampledData.class, Signature.class, Timing.class, ContactDetail.class, Contributor.class, DataRequirement.class, Expression.class, ParameterDefinition.class, RelatedArtifact.class, TriggerDefinition.class, UsageContext.class, Dosage.class, Meta.class}, order=20, min=0, max=1, modifier=false, summary=true)
5077    @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." )
5078    protected DataType fixed;
5079
5080    /**
5081     * 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.  
5082
5083When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
5084
5085When 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.
5086
5087When 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.,
5088
50891. If primitive: it must match exactly the pattern value
50902. If a complex object: it must match (recursively) the pattern value
50913. If an array: it must match (recursively) the pattern value.
5092     */
5093    @Child(name = "pattern", type = {Base64BinaryType.class, BooleanType.class, CanonicalType.class, CodeType.class, DateType.class, DateTimeType.class, DecimalType.class, IdType.class, InstantType.class, IntegerType.class, Integer64Type.class, MarkdownType.class, OidType.class, PositiveIntType.class, StringType.class, TimeType.class, UnsignedIntType.class, UriType.class, UrlType.class, UuidType.class, Address.class, Age.class, Annotation.class, Attachment.class, CodeableConcept.class, Coding.class, ContactPoint.class, Count.class, Distance.class, Duration.class, HumanName.class, Identifier.class, Money.class, Period.class, Quantity.class, Range.class, Ratio.class, Reference.class, SampledData.class, Signature.class, Timing.class, ContactDetail.class, Contributor.class, DataRequirement.class, Expression.class, ParameterDefinition.class, RelatedArtifact.class, TriggerDefinition.class, UsageContext.class, Dosage.class, Meta.class}, order=21, min=0, max=1, modifier=false, summary=true)
5094    @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." )
5095    protected DataType pattern;
5096
5097    /**
5098     * A sample value for this element demonstrating the type of information that would typically be found in the element.
5099     */
5100    @Child(name = "example", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5101    @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." )
5102    protected List<ElementDefinitionExampleComponent> example;
5103
5104    /**
5105     * 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.
5106     */
5107    @Child(name = "minValue", type = {DateType.class, DateTimeType.class, InstantType.class, TimeType.class, DecimalType.class, IntegerType.class, Integer64Type.class, PositiveIntType.class, UnsignedIntType.class, Quantity.class}, order=23, min=0, max=1, modifier=false, summary=true)
5108    @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." )
5109    protected DataType minValue;
5110
5111    /**
5112     * 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.
5113     */
5114    @Child(name = "maxValue", type = {DateType.class, DateTimeType.class, InstantType.class, TimeType.class, DecimalType.class, IntegerType.class, Integer64Type.class, PositiveIntType.class, UnsignedIntType.class, Quantity.class}, order=24, min=0, max=1, modifier=false, summary=true)
5115    @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." )
5116    protected DataType maxValue;
5117
5118    /**
5119     * 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.
5120     */
5121    @Child(name = "maxLength", type = {IntegerType.class}, order=25, min=0, max=1, modifier=false, summary=true)
5122    @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." )
5123    protected IntegerType maxLength;
5124
5125    /**
5126     * A reference to an invariant that may make additional statements about the cardinality or value in the instance.
5127     */
5128    @Child(name = "condition", type = {IdType.class}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5129    @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." )
5130    protected List<IdType> condition;
5131
5132    /**
5133     * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.
5134     */
5135    @Child(name = "constraint", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5136    @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." )
5137    protected List<ElementDefinitionConstraintComponent> constraint;
5138
5139    /**
5140     * 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.
5141     */
5142    @Child(name = "mustSupport", type = {BooleanType.class}, order=28, min=0, max=1, modifier=false, summary=true)
5143    @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." )
5144    protected BooleanType mustSupport;
5145
5146    /**
5147     * 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.
5148     */
5149    @Child(name = "isModifier", type = {BooleanType.class}, order=29, min=0, max=1, modifier=false, summary=true)
5150    @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." )
5151    protected BooleanType isModifier;
5152
5153    /**
5154     * Explains how that element affects the interpretation of the resource or element that contains it.
5155     */
5156    @Child(name = "isModifierReason", type = {StringType.class}, order=30, min=0, max=1, modifier=false, summary=true)
5157    @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." )
5158    protected StringType isModifierReason;
5159
5160    /**
5161     * Whether the element should be included if a client requests a search with the parameter _summary=true.
5162     */
5163    @Child(name = "isSummary", type = {BooleanType.class}, order=31, min=0, max=1, modifier=false, summary=true)
5164    @Description(shortDefinition="Include when _summary = true?", formalDefinition="Whether the element should be included if a client requests a search with the parameter _summary=true." )
5165    protected BooleanType isSummary;
5166
5167    /**
5168     * Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).
5169     */
5170    @Child(name = "binding", type = {}, order=32, min=0, max=1, modifier=false, summary=true)
5171    @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)." )
5172    protected ElementDefinitionBindingComponent binding;
5173
5174    /**
5175     * Identifies a concept from an external specification that roughly corresponds to this element.
5176     */
5177    @Child(name = "mapping", type = {}, order=33, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5178    @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." )
5179    protected List<ElementDefinitionMappingComponent> mapping;
5180
5181    private static final long serialVersionUID = 821951601L;
5182
5183  /**
5184   * Constructor
5185   */
5186    public ElementDefinition() {
5187      super();
5188    }
5189
5190  /**
5191   * Constructor
5192   */
5193    public ElementDefinition(String path) {
5194      super();
5195      this.setPath(path);
5196    }
5197
5198    /**
5199     * @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
5200     */
5201    public StringType getPathElement() { 
5202      if (this.path == null)
5203        if (Configuration.errorOnAutoCreate())
5204          throw new Error("Attempt to auto-create ElementDefinition.path");
5205        else if (Configuration.doAutoCreate())
5206          this.path = new StringType(); // bb
5207      return this.path;
5208    }
5209
5210    public boolean hasPathElement() { 
5211      return this.path != null && !this.path.isEmpty();
5212    }
5213
5214    public boolean hasPath() { 
5215      return this.path != null && !this.path.isEmpty();
5216    }
5217
5218    /**
5219     * @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
5220     */
5221    public ElementDefinition setPathElement(StringType value) { 
5222      this.path = value;
5223      return this;
5224    }
5225
5226    /**
5227     * @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.
5228     */
5229    public String getPath() { 
5230      return this.path == null ? null : this.path.getValue();
5231    }
5232
5233    /**
5234     * @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.
5235     */
5236    public ElementDefinition setPath(String value) { 
5237        if (this.path == null)
5238          this.path = new StringType();
5239        this.path.setValue(value);
5240      return this;
5241    }
5242
5243    /**
5244     * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
5245     */
5246    public List<Enumeration<PropertyRepresentation>> getRepresentation() { 
5247      if (this.representation == null)
5248        this.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
5249      return this.representation;
5250    }
5251
5252    /**
5253     * @return Returns a reference to <code>this</code> for easy method chaining
5254     */
5255    public ElementDefinition setRepresentation(List<Enumeration<PropertyRepresentation>> theRepresentation) { 
5256      this.representation = theRepresentation;
5257      return this;
5258    }
5259
5260    public boolean hasRepresentation() { 
5261      if (this.representation == null)
5262        return false;
5263      for (Enumeration<PropertyRepresentation> item : this.representation)
5264        if (!item.isEmpty())
5265          return true;
5266      return false;
5267    }
5268
5269    /**
5270     * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
5271     */
5272    public Enumeration<PropertyRepresentation> addRepresentationElement() {//2 
5273      Enumeration<PropertyRepresentation> t = new Enumeration<PropertyRepresentation>(new PropertyRepresentationEnumFactory());
5274      if (this.representation == null)
5275        this.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
5276      this.representation.add(t);
5277      return t;
5278    }
5279
5280    /**
5281     * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
5282     */
5283    public ElementDefinition addRepresentation(PropertyRepresentation value) { //1
5284      Enumeration<PropertyRepresentation> t = new Enumeration<PropertyRepresentation>(new PropertyRepresentationEnumFactory());
5285      t.setValue(value);
5286      if (this.representation == null)
5287        this.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
5288      this.representation.add(t);
5289      return this;
5290    }
5291
5292    /**
5293     * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.)
5294     */
5295    public boolean hasRepresentation(PropertyRepresentation value) { 
5296      if (this.representation == null)
5297        return false;
5298      for (Enumeration<PropertyRepresentation> v : this.representation)
5299        if (v.getValue().equals(value)) // code
5300          return true;
5301      return false;
5302    }
5303
5304    /**
5305     * @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
5306     */
5307    public StringType getSliceNameElement() { 
5308      if (this.sliceName == null)
5309        if (Configuration.errorOnAutoCreate())
5310          throw new Error("Attempt to auto-create ElementDefinition.sliceName");
5311        else if (Configuration.doAutoCreate())
5312          this.sliceName = new StringType(); // bb
5313      return this.sliceName;
5314    }
5315
5316    public boolean hasSliceNameElement() { 
5317      return this.sliceName != null && !this.sliceName.isEmpty();
5318    }
5319
5320    public boolean hasSliceName() { 
5321      return this.sliceName != null && !this.sliceName.isEmpty();
5322    }
5323
5324    /**
5325     * @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
5326     */
5327    public ElementDefinition setSliceNameElement(StringType value) { 
5328      this.sliceName = value;
5329      return this;
5330    }
5331
5332    /**
5333     * @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.
5334     */
5335    public String getSliceName() { 
5336      return this.sliceName == null ? null : this.sliceName.getValue();
5337    }
5338
5339    /**
5340     * @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.
5341     */
5342    public ElementDefinition setSliceName(String value) { 
5343      if (Utilities.noString(value))
5344        this.sliceName = null;
5345      else {
5346        if (this.sliceName == null)
5347          this.sliceName = new StringType();
5348        this.sliceName.setValue(value);
5349      }
5350      return this;
5351    }
5352
5353    /**
5354     * @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
5355     */
5356    public BooleanType getSliceIsConstrainingElement() { 
5357      if (this.sliceIsConstraining == null)
5358        if (Configuration.errorOnAutoCreate())
5359          throw new Error("Attempt to auto-create ElementDefinition.sliceIsConstraining");
5360        else if (Configuration.doAutoCreate())
5361          this.sliceIsConstraining = new BooleanType(); // bb
5362      return this.sliceIsConstraining;
5363    }
5364
5365    public boolean hasSliceIsConstrainingElement() { 
5366      return this.sliceIsConstraining != null && !this.sliceIsConstraining.isEmpty();
5367    }
5368
5369    public boolean hasSliceIsConstraining() { 
5370      return this.sliceIsConstraining != null && !this.sliceIsConstraining.isEmpty();
5371    }
5372
5373    /**
5374     * @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
5375     */
5376    public ElementDefinition setSliceIsConstrainingElement(BooleanType value) { 
5377      this.sliceIsConstraining = value;
5378      return this;
5379    }
5380
5381    /**
5382     * @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.
5383     */
5384    public boolean getSliceIsConstraining() { 
5385      return this.sliceIsConstraining == null || this.sliceIsConstraining.isEmpty() ? false : this.sliceIsConstraining.getValue();
5386    }
5387
5388    /**
5389     * @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.
5390     */
5391    public ElementDefinition setSliceIsConstraining(boolean value) { 
5392        if (this.sliceIsConstraining == null)
5393          this.sliceIsConstraining = new BooleanType();
5394        this.sliceIsConstraining.setValue(value);
5395      return this;
5396    }
5397
5398    /**
5399     * @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
5400     */
5401    public StringType getLabelElement() { 
5402      if (this.label == null)
5403        if (Configuration.errorOnAutoCreate())
5404          throw new Error("Attempt to auto-create ElementDefinition.label");
5405        else if (Configuration.doAutoCreate())
5406          this.label = new StringType(); // bb
5407      return this.label;
5408    }
5409
5410    public boolean hasLabelElement() { 
5411      return this.label != null && !this.label.isEmpty();
5412    }
5413
5414    public boolean hasLabel() { 
5415      return this.label != null && !this.label.isEmpty();
5416    }
5417
5418    /**
5419     * @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
5420     */
5421    public ElementDefinition setLabelElement(StringType value) { 
5422      this.label = value;
5423      return this;
5424    }
5425
5426    /**
5427     * @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.
5428     */
5429    public String getLabel() { 
5430      return this.label == null ? null : this.label.getValue();
5431    }
5432
5433    /**
5434     * @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.
5435     */
5436    public ElementDefinition setLabel(String value) { 
5437      if (Utilities.noString(value))
5438        this.label = null;
5439      else {
5440        if (this.label == null)
5441          this.label = new StringType();
5442        this.label.setValue(value);
5443      }
5444      return this;
5445    }
5446
5447    /**
5448     * @return {@link #code} (A code that has the same meaning as the element in a particular terminology.)
5449     */
5450    public List<Coding> getCode() { 
5451      if (this.code == null)
5452        this.code = new ArrayList<Coding>();
5453      return this.code;
5454    }
5455
5456    /**
5457     * @return Returns a reference to <code>this</code> for easy method chaining
5458     */
5459    public ElementDefinition setCode(List<Coding> theCode) { 
5460      this.code = theCode;
5461      return this;
5462    }
5463
5464    public boolean hasCode() { 
5465      if (this.code == null)
5466        return false;
5467      for (Coding item : this.code)
5468        if (!item.isEmpty())
5469          return true;
5470      return false;
5471    }
5472
5473    public Coding addCode() { //3
5474      Coding t = new Coding();
5475      if (this.code == null)
5476        this.code = new ArrayList<Coding>();
5477      this.code.add(t);
5478      return t;
5479    }
5480
5481    public ElementDefinition addCode(Coding t) { //3
5482      if (t == null)
5483        return this;
5484      if (this.code == null)
5485        this.code = new ArrayList<Coding>();
5486      this.code.add(t);
5487      return this;
5488    }
5489
5490    /**
5491     * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist {3}
5492     */
5493    public Coding getCodeFirstRep() { 
5494      if (getCode().isEmpty()) {
5495        addCode();
5496      }
5497      return getCode().get(0);
5498    }
5499
5500    /**
5501     * @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).)
5502     */
5503    public ElementDefinitionSlicingComponent getSlicing() { 
5504      if (this.slicing == null)
5505        if (Configuration.errorOnAutoCreate())
5506          throw new Error("Attempt to auto-create ElementDefinition.slicing");
5507        else if (Configuration.doAutoCreate())
5508          this.slicing = new ElementDefinitionSlicingComponent(); // cc
5509      return this.slicing;
5510    }
5511
5512    public boolean hasSlicing() { 
5513      return this.slicing != null && !this.slicing.isEmpty();
5514    }
5515
5516    /**
5517     * @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).)
5518     */
5519    public ElementDefinition setSlicing(ElementDefinitionSlicingComponent value) { 
5520      this.slicing = value;
5521      return this;
5522    }
5523
5524    /**
5525     * @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
5526     */
5527    public StringType getShortElement() { 
5528      if (this.short_ == null)
5529        if (Configuration.errorOnAutoCreate())
5530          throw new Error("Attempt to auto-create ElementDefinition.short_");
5531        else if (Configuration.doAutoCreate())
5532          this.short_ = new StringType(); // bb
5533      return this.short_;
5534    }
5535
5536    public boolean hasShortElement() { 
5537      return this.short_ != null && !this.short_.isEmpty();
5538    }
5539
5540    public boolean hasShort() { 
5541      return this.short_ != null && !this.short_.isEmpty();
5542    }
5543
5544    /**
5545     * @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
5546     */
5547    public ElementDefinition setShortElement(StringType value) { 
5548      this.short_ = value;
5549      return this;
5550    }
5551
5552    /**
5553     * @return A concise description of what this element means (e.g. for use in autogenerated summaries).
5554     */
5555    public String getShort() { 
5556      return this.short_ == null ? null : this.short_.getValue();
5557    }
5558
5559    /**
5560     * @param value A concise description of what this element means (e.g. for use in autogenerated summaries).
5561     */
5562    public ElementDefinition setShort(String value) { 
5563      if (Utilities.noString(value))
5564        this.short_ = null;
5565      else {
5566        if (this.short_ == null)
5567          this.short_ = new StringType();
5568        this.short_.setValue(value);
5569      }
5570      return this;
5571    }
5572
5573    /**
5574     * @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
5575     */
5576    public MarkdownType getDefinitionElement() { 
5577      if (this.definition == null)
5578        if (Configuration.errorOnAutoCreate())
5579          throw new Error("Attempt to auto-create ElementDefinition.definition");
5580        else if (Configuration.doAutoCreate())
5581          this.definition = new MarkdownType(); // bb
5582      return this.definition;
5583    }
5584
5585    public boolean hasDefinitionElement() { 
5586      return this.definition != null && !this.definition.isEmpty();
5587    }
5588
5589    public boolean hasDefinition() { 
5590      return this.definition != null && !this.definition.isEmpty();
5591    }
5592
5593    /**
5594     * @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
5595     */
5596    public ElementDefinition setDefinitionElement(MarkdownType value) { 
5597      this.definition = value;
5598      return this;
5599    }
5600
5601    /**
5602     * @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).
5603     */
5604    public String getDefinition() { 
5605      return this.definition == null ? null : this.definition.getValue();
5606    }
5607
5608    /**
5609     * @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).
5610     */
5611    public ElementDefinition setDefinition(String value) { 
5612      if (value == null)
5613        this.definition = null;
5614      else {
5615        if (this.definition == null)
5616          this.definition = new MarkdownType();
5617        this.definition.setValue(value);
5618      }
5619      return this;
5620    }
5621
5622    /**
5623     * @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
5624     */
5625    public MarkdownType getCommentElement() { 
5626      if (this.comment == null)
5627        if (Configuration.errorOnAutoCreate())
5628          throw new Error("Attempt to auto-create ElementDefinition.comment");
5629        else if (Configuration.doAutoCreate())
5630          this.comment = new MarkdownType(); // bb
5631      return this.comment;
5632    }
5633
5634    public boolean hasCommentElement() { 
5635      return this.comment != null && !this.comment.isEmpty();
5636    }
5637
5638    public boolean hasComment() { 
5639      return this.comment != null && !this.comment.isEmpty();
5640    }
5641
5642    /**
5643     * @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
5644     */
5645    public ElementDefinition setCommentElement(MarkdownType value) { 
5646      this.comment = value;
5647      return this;
5648    }
5649
5650    /**
5651     * @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).
5652     */
5653    public String getComment() { 
5654      return this.comment == null ? null : this.comment.getValue();
5655    }
5656
5657    /**
5658     * @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).
5659     */
5660    public ElementDefinition setComment(String value) { 
5661      if (value == null)
5662        this.comment = null;
5663      else {
5664        if (this.comment == null)
5665          this.comment = new MarkdownType();
5666        this.comment.setValue(value);
5667      }
5668      return this;
5669    }
5670
5671    /**
5672     * @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
5673     */
5674    public MarkdownType getRequirementsElement() { 
5675      if (this.requirements == null)
5676        if (Configuration.errorOnAutoCreate())
5677          throw new Error("Attempt to auto-create ElementDefinition.requirements");
5678        else if (Configuration.doAutoCreate())
5679          this.requirements = new MarkdownType(); // bb
5680      return this.requirements;
5681    }
5682
5683    public boolean hasRequirementsElement() { 
5684      return this.requirements != null && !this.requirements.isEmpty();
5685    }
5686
5687    public boolean hasRequirements() { 
5688      return this.requirements != null && !this.requirements.isEmpty();
5689    }
5690
5691    /**
5692     * @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
5693     */
5694    public ElementDefinition setRequirementsElement(MarkdownType value) { 
5695      this.requirements = value;
5696      return this;
5697    }
5698
5699    /**
5700     * @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.
5701     */
5702    public String getRequirements() { 
5703      return this.requirements == null ? null : this.requirements.getValue();
5704    }
5705
5706    /**
5707     * @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.
5708     */
5709    public ElementDefinition setRequirements(String value) { 
5710      if (value == null)
5711        this.requirements = null;
5712      else {
5713        if (this.requirements == null)
5714          this.requirements = new MarkdownType();
5715        this.requirements.setValue(value);
5716      }
5717      return this;
5718    }
5719
5720    /**
5721     * @return {@link #alias} (Identifies additional names by which this element might also be known.)
5722     */
5723    public List<StringType> getAlias() { 
5724      if (this.alias == null)
5725        this.alias = new ArrayList<StringType>();
5726      return this.alias;
5727    }
5728
5729    /**
5730     * @return Returns a reference to <code>this</code> for easy method chaining
5731     */
5732    public ElementDefinition setAlias(List<StringType> theAlias) { 
5733      this.alias = theAlias;
5734      return this;
5735    }
5736
5737    public boolean hasAlias() { 
5738      if (this.alias == null)
5739        return false;
5740      for (StringType item : this.alias)
5741        if (!item.isEmpty())
5742          return true;
5743      return false;
5744    }
5745
5746    /**
5747     * @return {@link #alias} (Identifies additional names by which this element might also be known.)
5748     */
5749    public StringType addAliasElement() {//2 
5750      StringType t = new StringType();
5751      if (this.alias == null)
5752        this.alias = new ArrayList<StringType>();
5753      this.alias.add(t);
5754      return t;
5755    }
5756
5757    /**
5758     * @param value {@link #alias} (Identifies additional names by which this element might also be known.)
5759     */
5760    public ElementDefinition addAlias(String value) { //1
5761      StringType t = new StringType();
5762      t.setValue(value);
5763      if (this.alias == null)
5764        this.alias = new ArrayList<StringType>();
5765      this.alias.add(t);
5766      return this;
5767    }
5768
5769    /**
5770     * @param value {@link #alias} (Identifies additional names by which this element might also be known.)
5771     */
5772    public boolean hasAlias(String value) { 
5773      if (this.alias == null)
5774        return false;
5775      for (StringType v : this.alias)
5776        if (v.getValue().equals(value)) // string
5777          return true;
5778      return false;
5779    }
5780
5781    /**
5782     * @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
5783     */
5784    public UnsignedIntType getMinElement() { 
5785      if (this.min == null)
5786        if (Configuration.errorOnAutoCreate())
5787          throw new Error("Attempt to auto-create ElementDefinition.min");
5788        else if (Configuration.doAutoCreate())
5789          this.min = new UnsignedIntType(); // bb
5790      return this.min;
5791    }
5792
5793    public boolean hasMinElement() { 
5794      return this.min != null && !this.min.isEmpty();
5795    }
5796
5797    public boolean hasMin() { 
5798      return this.min != null && !this.min.isEmpty();
5799    }
5800
5801    /**
5802     * @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
5803     */
5804    public ElementDefinition setMinElement(UnsignedIntType value) { 
5805      this.min = value;
5806      return this;
5807    }
5808
5809    /**
5810     * @return The minimum number of times this element SHALL appear in the instance.
5811     */
5812    public int getMin() { 
5813      return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue();
5814    }
5815
5816    /**
5817     * @param value The minimum number of times this element SHALL appear in the instance.
5818     */
5819    public ElementDefinition setMin(int value) { 
5820        if (this.min == null)
5821          this.min = new UnsignedIntType();
5822        this.min.setValue(value);
5823      return this;
5824    }
5825
5826    /**
5827     * @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
5828     */
5829    public StringType getMaxElement() { 
5830      if (this.max == null)
5831        if (Configuration.errorOnAutoCreate())
5832          throw new Error("Attempt to auto-create ElementDefinition.max");
5833        else if (Configuration.doAutoCreate())
5834          this.max = new StringType(); // bb
5835      return this.max;
5836    }
5837
5838    public boolean hasMaxElement() { 
5839      return this.max != null && !this.max.isEmpty();
5840    }
5841
5842    public boolean hasMax() { 
5843      return this.max != null && !this.max.isEmpty();
5844    }
5845
5846    /**
5847     * @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
5848     */
5849    public ElementDefinition setMaxElement(StringType value) { 
5850      this.max = value;
5851      return this;
5852    }
5853
5854    /**
5855     * @return The maximum number of times this element is permitted to appear in the instance.
5856     */
5857    public String getMax() { 
5858      return this.max == null ? null : this.max.getValue();
5859    }
5860
5861    /**
5862     * @param value The maximum number of times this element is permitted to appear in the instance.
5863     */
5864    public ElementDefinition setMax(String value) { 
5865      if (Utilities.noString(value))
5866        this.max = null;
5867      else {
5868        if (this.max == null)
5869          this.max = new StringType();
5870        this.max.setValue(value);
5871      }
5872      return this;
5873    }
5874
5875    /**
5876     * @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.)
5877     */
5878    public ElementDefinitionBaseComponent getBase() { 
5879      if (this.base == null)
5880        if (Configuration.errorOnAutoCreate())
5881          throw new Error("Attempt to auto-create ElementDefinition.base");
5882        else if (Configuration.doAutoCreate())
5883          this.base = new ElementDefinitionBaseComponent(); // cc
5884      return this.base;
5885    }
5886
5887    public boolean hasBase() { 
5888      return this.base != null && !this.base.isEmpty();
5889    }
5890
5891    /**
5892     * @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.)
5893     */
5894    public ElementDefinition setBase(ElementDefinitionBaseComponent value) { 
5895      this.base = value;
5896      return this;
5897    }
5898
5899    /**
5900     * @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
5901     */
5902    public UriType getContentReferenceElement() { 
5903      if (this.contentReference == null)
5904        if (Configuration.errorOnAutoCreate())
5905          throw new Error("Attempt to auto-create ElementDefinition.contentReference");
5906        else if (Configuration.doAutoCreate())
5907          this.contentReference = new UriType(); // bb
5908      return this.contentReference;
5909    }
5910
5911    public boolean hasContentReferenceElement() { 
5912      return this.contentReference != null && !this.contentReference.isEmpty();
5913    }
5914
5915    public boolean hasContentReference() { 
5916      return this.contentReference != null && !this.contentReference.isEmpty();
5917    }
5918
5919    /**
5920     * @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
5921     */
5922    public ElementDefinition setContentReferenceElement(UriType value) { 
5923      this.contentReference = value;
5924      return this;
5925    }
5926
5927    /**
5928     * @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.
5929     */
5930    public String getContentReference() { 
5931      return this.contentReference == null ? null : this.contentReference.getValue();
5932    }
5933
5934    /**
5935     * @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.
5936     */
5937    public ElementDefinition setContentReference(String value) { 
5938      if (Utilities.noString(value))
5939        this.contentReference = null;
5940      else {
5941        if (this.contentReference == null)
5942          this.contentReference = new UriType();
5943        this.contentReference.setValue(value);
5944      }
5945      return this;
5946    }
5947
5948    /**
5949     * @return {@link #type} (The data type or resource that the value of this element is permitted to be.)
5950     */
5951    public List<TypeRefComponent> getType() { 
5952      if (this.type == null)
5953        this.type = new ArrayList<TypeRefComponent>();
5954      return this.type;
5955    }
5956
5957    /**
5958     * @return Returns a reference to <code>this</code> for easy method chaining
5959     */
5960    public ElementDefinition setType(List<TypeRefComponent> theType) { 
5961      this.type = theType;
5962      return this;
5963    }
5964
5965    public boolean hasType() { 
5966      if (this.type == null)
5967        return false;
5968      for (TypeRefComponent item : this.type)
5969        if (!item.isEmpty())
5970          return true;
5971      return false;
5972    }
5973
5974    public TypeRefComponent addType() { //3
5975      TypeRefComponent t = new TypeRefComponent();
5976      if (this.type == null)
5977        this.type = new ArrayList<TypeRefComponent>();
5978      this.type.add(t);
5979      return t;
5980    }
5981
5982    public ElementDefinition addType(TypeRefComponent t) { //3
5983      if (t == null)
5984        return this;
5985      if (this.type == null)
5986        this.type = new ArrayList<TypeRefComponent>();
5987      this.type.add(t);
5988      return this;
5989    }
5990
5991    /**
5992     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
5993     */
5994    public TypeRefComponent getTypeFirstRep() { 
5995      if (getType().isEmpty()) {
5996        addType();
5997      }
5998      return getType().get(0);
5999    }
6000
6001    /**
6002     * @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').)
6003     */
6004    public DataType getDefaultValue() { 
6005      return this.defaultValue;
6006    }
6007
6008    /**
6009     * @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').)
6010     */
6011    public Base64BinaryType getDefaultValueBase64BinaryType() throws FHIRException { 
6012      if (this.defaultValue == null)
6013        this.defaultValue = new Base64BinaryType();
6014      if (!(this.defaultValue instanceof Base64BinaryType))
6015        throw new FHIRException("Type mismatch: the type Base64BinaryType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6016      return (Base64BinaryType) this.defaultValue;
6017    }
6018
6019    public boolean hasDefaultValueBase64BinaryType() { 
6020      return this != null && this.defaultValue instanceof Base64BinaryType;
6021    }
6022
6023    /**
6024     * @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').)
6025     */
6026    public BooleanType getDefaultValueBooleanType() throws FHIRException { 
6027      if (this.defaultValue == null)
6028        this.defaultValue = new BooleanType();
6029      if (!(this.defaultValue instanceof BooleanType))
6030        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6031      return (BooleanType) this.defaultValue;
6032    }
6033
6034    public boolean hasDefaultValueBooleanType() { 
6035      return this != null && this.defaultValue instanceof BooleanType;
6036    }
6037
6038    /**
6039     * @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').)
6040     */
6041    public CanonicalType getDefaultValueCanonicalType() throws FHIRException { 
6042      if (this.defaultValue == null)
6043        this.defaultValue = new CanonicalType();
6044      if (!(this.defaultValue instanceof CanonicalType))
6045        throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6046      return (CanonicalType) this.defaultValue;
6047    }
6048
6049    public boolean hasDefaultValueCanonicalType() { 
6050      return this != null && this.defaultValue instanceof CanonicalType;
6051    }
6052
6053    /**
6054     * @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').)
6055     */
6056    public CodeType getDefaultValueCodeType() throws FHIRException { 
6057      if (this.defaultValue == null)
6058        this.defaultValue = new CodeType();
6059      if (!(this.defaultValue instanceof CodeType))
6060        throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6061      return (CodeType) this.defaultValue;
6062    }
6063
6064    public boolean hasDefaultValueCodeType() { 
6065      return this != null && this.defaultValue instanceof CodeType;
6066    }
6067
6068    /**
6069     * @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').)
6070     */
6071    public DateType getDefaultValueDateType() throws FHIRException { 
6072      if (this.defaultValue == null)
6073        this.defaultValue = new DateType();
6074      if (!(this.defaultValue instanceof DateType))
6075        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6076      return (DateType) this.defaultValue;
6077    }
6078
6079    public boolean hasDefaultValueDateType() { 
6080      return this != null && this.defaultValue instanceof DateType;
6081    }
6082
6083    /**
6084     * @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').)
6085     */
6086    public DateTimeType getDefaultValueDateTimeType() throws FHIRException { 
6087      if (this.defaultValue == null)
6088        this.defaultValue = new DateTimeType();
6089      if (!(this.defaultValue instanceof DateTimeType))
6090        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6091      return (DateTimeType) this.defaultValue;
6092    }
6093
6094    public boolean hasDefaultValueDateTimeType() { 
6095      return this != null && this.defaultValue instanceof DateTimeType;
6096    }
6097
6098    /**
6099     * @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').)
6100     */
6101    public DecimalType getDefaultValueDecimalType() throws FHIRException { 
6102      if (this.defaultValue == null)
6103        this.defaultValue = new DecimalType();
6104      if (!(this.defaultValue instanceof DecimalType))
6105        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6106      return (DecimalType) this.defaultValue;
6107    }
6108
6109    public boolean hasDefaultValueDecimalType() { 
6110      return this != null && this.defaultValue instanceof DecimalType;
6111    }
6112
6113    /**
6114     * @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').)
6115     */
6116    public IdType getDefaultValueIdType() throws FHIRException { 
6117      if (this.defaultValue == null)
6118        this.defaultValue = new IdType();
6119      if (!(this.defaultValue instanceof IdType))
6120        throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6121      return (IdType) this.defaultValue;
6122    }
6123
6124    public boolean hasDefaultValueIdType() { 
6125      return this != null && this.defaultValue instanceof IdType;
6126    }
6127
6128    /**
6129     * @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').)
6130     */
6131    public InstantType getDefaultValueInstantType() throws FHIRException { 
6132      if (this.defaultValue == null)
6133        this.defaultValue = new InstantType();
6134      if (!(this.defaultValue instanceof InstantType))
6135        throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6136      return (InstantType) this.defaultValue;
6137    }
6138
6139    public boolean hasDefaultValueInstantType() { 
6140      return this != null && this.defaultValue instanceof InstantType;
6141    }
6142
6143    /**
6144     * @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').)
6145     */
6146    public IntegerType getDefaultValueIntegerType() throws FHIRException { 
6147      if (this.defaultValue == null)
6148        this.defaultValue = new IntegerType();
6149      if (!(this.defaultValue instanceof IntegerType))
6150        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6151      return (IntegerType) this.defaultValue;
6152    }
6153
6154    public boolean hasDefaultValueIntegerType() { 
6155      return this != null && this.defaultValue instanceof IntegerType;
6156    }
6157
6158    /**
6159     * @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').)
6160     */
6161    public Integer64Type getDefaultValueInteger64Type() throws FHIRException { 
6162      if (this.defaultValue == null)
6163        this.defaultValue = new Integer64Type();
6164      if (!(this.defaultValue instanceof Integer64Type))
6165        throw new FHIRException("Type mismatch: the type Integer64Type was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6166      return (Integer64Type) this.defaultValue;
6167    }
6168
6169    public boolean hasDefaultValueInteger64Type() { 
6170      return this != null && this.defaultValue instanceof Integer64Type;
6171    }
6172
6173    /**
6174     * @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').)
6175     */
6176    public MarkdownType getDefaultValueMarkdownType() throws FHIRException { 
6177      if (this.defaultValue == null)
6178        this.defaultValue = new MarkdownType();
6179      if (!(this.defaultValue instanceof MarkdownType))
6180        throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6181      return (MarkdownType) this.defaultValue;
6182    }
6183
6184    public boolean hasDefaultValueMarkdownType() { 
6185      return this != null && this.defaultValue instanceof MarkdownType;
6186    }
6187
6188    /**
6189     * @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').)
6190     */
6191    public OidType getDefaultValueOidType() throws FHIRException { 
6192      if (this.defaultValue == null)
6193        this.defaultValue = new OidType();
6194      if (!(this.defaultValue instanceof OidType))
6195        throw new FHIRException("Type mismatch: the type OidType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6196      return (OidType) this.defaultValue;
6197    }
6198
6199    public boolean hasDefaultValueOidType() { 
6200      return this != null && this.defaultValue instanceof OidType;
6201    }
6202
6203    /**
6204     * @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').)
6205     */
6206    public PositiveIntType getDefaultValuePositiveIntType() throws FHIRException { 
6207      if (this.defaultValue == null)
6208        this.defaultValue = new PositiveIntType();
6209      if (!(this.defaultValue instanceof PositiveIntType))
6210        throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6211      return (PositiveIntType) this.defaultValue;
6212    }
6213
6214    public boolean hasDefaultValuePositiveIntType() { 
6215      return this != null && this.defaultValue instanceof PositiveIntType;
6216    }
6217
6218    /**
6219     * @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').)
6220     */
6221    public StringType getDefaultValueStringType() throws FHIRException { 
6222      if (this.defaultValue == null)
6223        this.defaultValue = new StringType();
6224      if (!(this.defaultValue instanceof StringType))
6225        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6226      return (StringType) this.defaultValue;
6227    }
6228
6229    public boolean hasDefaultValueStringType() { 
6230      return this != null && this.defaultValue instanceof StringType;
6231    }
6232
6233    /**
6234     * @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').)
6235     */
6236    public TimeType getDefaultValueTimeType() throws FHIRException { 
6237      if (this.defaultValue == null)
6238        this.defaultValue = new TimeType();
6239      if (!(this.defaultValue instanceof TimeType))
6240        throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6241      return (TimeType) this.defaultValue;
6242    }
6243
6244    public boolean hasDefaultValueTimeType() { 
6245      return this != null && this.defaultValue instanceof TimeType;
6246    }
6247
6248    /**
6249     * @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').)
6250     */
6251    public UnsignedIntType getDefaultValueUnsignedIntType() throws FHIRException { 
6252      if (this.defaultValue == null)
6253        this.defaultValue = new UnsignedIntType();
6254      if (!(this.defaultValue instanceof UnsignedIntType))
6255        throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6256      return (UnsignedIntType) this.defaultValue;
6257    }
6258
6259    public boolean hasDefaultValueUnsignedIntType() { 
6260      return this != null && this.defaultValue instanceof UnsignedIntType;
6261    }
6262
6263    /**
6264     * @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').)
6265     */
6266    public UriType getDefaultValueUriType() throws FHIRException { 
6267      if (this.defaultValue == null)
6268        this.defaultValue = new UriType();
6269      if (!(this.defaultValue instanceof UriType))
6270        throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6271      return (UriType) this.defaultValue;
6272    }
6273
6274    public boolean hasDefaultValueUriType() { 
6275      return this != null && this.defaultValue instanceof UriType;
6276    }
6277
6278    /**
6279     * @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').)
6280     */
6281    public UrlType getDefaultValueUrlType() throws FHIRException { 
6282      if (this.defaultValue == null)
6283        this.defaultValue = new UrlType();
6284      if (!(this.defaultValue instanceof UrlType))
6285        throw new FHIRException("Type mismatch: the type UrlType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6286      return (UrlType) this.defaultValue;
6287    }
6288
6289    public boolean hasDefaultValueUrlType() { 
6290      return this != null && this.defaultValue instanceof UrlType;
6291    }
6292
6293    /**
6294     * @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').)
6295     */
6296    public UuidType getDefaultValueUuidType() throws FHIRException { 
6297      if (this.defaultValue == null)
6298        this.defaultValue = new UuidType();
6299      if (!(this.defaultValue instanceof UuidType))
6300        throw new FHIRException("Type mismatch: the type UuidType was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6301      return (UuidType) this.defaultValue;
6302    }
6303
6304    public boolean hasDefaultValueUuidType() { 
6305      return this != null && this.defaultValue instanceof UuidType;
6306    }
6307
6308    /**
6309     * @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').)
6310     */
6311    public Address getDefaultValueAddress() throws FHIRException { 
6312      if (this.defaultValue == null)
6313        this.defaultValue = new Address();
6314      if (!(this.defaultValue instanceof Address))
6315        throw new FHIRException("Type mismatch: the type Address was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6316      return (Address) this.defaultValue;
6317    }
6318
6319    public boolean hasDefaultValueAddress() { 
6320      return this != null && this.defaultValue instanceof Address;
6321    }
6322
6323    /**
6324     * @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').)
6325     */
6326    public Age getDefaultValueAge() throws FHIRException { 
6327      if (this.defaultValue == null)
6328        this.defaultValue = new Age();
6329      if (!(this.defaultValue instanceof Age))
6330        throw new FHIRException("Type mismatch: the type Age was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6331      return (Age) this.defaultValue;
6332    }
6333
6334    public boolean hasDefaultValueAge() { 
6335      return this != null && this.defaultValue instanceof Age;
6336    }
6337
6338    /**
6339     * @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').)
6340     */
6341    public Annotation getDefaultValueAnnotation() throws FHIRException { 
6342      if (this.defaultValue == null)
6343        this.defaultValue = new Annotation();
6344      if (!(this.defaultValue instanceof Annotation))
6345        throw new FHIRException("Type mismatch: the type Annotation was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6346      return (Annotation) this.defaultValue;
6347    }
6348
6349    public boolean hasDefaultValueAnnotation() { 
6350      return this != null && this.defaultValue instanceof Annotation;
6351    }
6352
6353    /**
6354     * @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').)
6355     */
6356    public Attachment getDefaultValueAttachment() throws FHIRException { 
6357      if (this.defaultValue == null)
6358        this.defaultValue = new Attachment();
6359      if (!(this.defaultValue instanceof Attachment))
6360        throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6361      return (Attachment) this.defaultValue;
6362    }
6363
6364    public boolean hasDefaultValueAttachment() { 
6365      return this != null && this.defaultValue instanceof Attachment;
6366    }
6367
6368    /**
6369     * @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').)
6370     */
6371    public CodeableConcept getDefaultValueCodeableConcept() throws FHIRException { 
6372      if (this.defaultValue == null)
6373        this.defaultValue = new CodeableConcept();
6374      if (!(this.defaultValue instanceof CodeableConcept))
6375        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6376      return (CodeableConcept) this.defaultValue;
6377    }
6378
6379    public boolean hasDefaultValueCodeableConcept() { 
6380      return this != null && this.defaultValue instanceof CodeableConcept;
6381    }
6382
6383    /**
6384     * @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').)
6385     */
6386    public Coding getDefaultValueCoding() throws FHIRException { 
6387      if (this.defaultValue == null)
6388        this.defaultValue = new Coding();
6389      if (!(this.defaultValue instanceof Coding))
6390        throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6391      return (Coding) this.defaultValue;
6392    }
6393
6394    public boolean hasDefaultValueCoding() { 
6395      return this != null && this.defaultValue instanceof Coding;
6396    }
6397
6398    /**
6399     * @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').)
6400     */
6401    public ContactPoint getDefaultValueContactPoint() throws FHIRException { 
6402      if (this.defaultValue == null)
6403        this.defaultValue = new ContactPoint();
6404      if (!(this.defaultValue instanceof ContactPoint))
6405        throw new FHIRException("Type mismatch: the type ContactPoint was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6406      return (ContactPoint) this.defaultValue;
6407    }
6408
6409    public boolean hasDefaultValueContactPoint() { 
6410      return this != null && this.defaultValue instanceof ContactPoint;
6411    }
6412
6413    /**
6414     * @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').)
6415     */
6416    public Count getDefaultValueCount() throws FHIRException { 
6417      if (this.defaultValue == null)
6418        this.defaultValue = new Count();
6419      if (!(this.defaultValue instanceof Count))
6420        throw new FHIRException("Type mismatch: the type Count was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6421      return (Count) this.defaultValue;
6422    }
6423
6424    public boolean hasDefaultValueCount() { 
6425      return this != null && this.defaultValue instanceof Count;
6426    }
6427
6428    /**
6429     * @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').)
6430     */
6431    public Distance getDefaultValueDistance() throws FHIRException { 
6432      if (this.defaultValue == null)
6433        this.defaultValue = new Distance();
6434      if (!(this.defaultValue instanceof Distance))
6435        throw new FHIRException("Type mismatch: the type Distance was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6436      return (Distance) this.defaultValue;
6437    }
6438
6439    public boolean hasDefaultValueDistance() { 
6440      return this != null && this.defaultValue instanceof Distance;
6441    }
6442
6443    /**
6444     * @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').)
6445     */
6446    public Duration getDefaultValueDuration() throws FHIRException { 
6447      if (this.defaultValue == null)
6448        this.defaultValue = new Duration();
6449      if (!(this.defaultValue instanceof Duration))
6450        throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6451      return (Duration) this.defaultValue;
6452    }
6453
6454    public boolean hasDefaultValueDuration() { 
6455      return this != null && this.defaultValue instanceof Duration;
6456    }
6457
6458    /**
6459     * @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').)
6460     */
6461    public HumanName getDefaultValueHumanName() throws FHIRException { 
6462      if (this.defaultValue == null)
6463        this.defaultValue = new HumanName();
6464      if (!(this.defaultValue instanceof HumanName))
6465        throw new FHIRException("Type mismatch: the type HumanName was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6466      return (HumanName) this.defaultValue;
6467    }
6468
6469    public boolean hasDefaultValueHumanName() { 
6470      return this != null && this.defaultValue instanceof HumanName;
6471    }
6472
6473    /**
6474     * @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').)
6475     */
6476    public Identifier getDefaultValueIdentifier() throws FHIRException { 
6477      if (this.defaultValue == null)
6478        this.defaultValue = new Identifier();
6479      if (!(this.defaultValue instanceof Identifier))
6480        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6481      return (Identifier) this.defaultValue;
6482    }
6483
6484    public boolean hasDefaultValueIdentifier() { 
6485      return this != null && this.defaultValue instanceof Identifier;
6486    }
6487
6488    /**
6489     * @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').)
6490     */
6491    public Money getDefaultValueMoney() throws FHIRException { 
6492      if (this.defaultValue == null)
6493        this.defaultValue = new Money();
6494      if (!(this.defaultValue instanceof Money))
6495        throw new FHIRException("Type mismatch: the type Money was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6496      return (Money) this.defaultValue;
6497    }
6498
6499    public boolean hasDefaultValueMoney() { 
6500      return this != null && this.defaultValue instanceof Money;
6501    }
6502
6503    /**
6504     * @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').)
6505     */
6506    public Period getDefaultValuePeriod() throws FHIRException { 
6507      if (this.defaultValue == null)
6508        this.defaultValue = new Period();
6509      if (!(this.defaultValue instanceof Period))
6510        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6511      return (Period) this.defaultValue;
6512    }
6513
6514    public boolean hasDefaultValuePeriod() { 
6515      return this != null && this.defaultValue instanceof Period;
6516    }
6517
6518    /**
6519     * @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').)
6520     */
6521    public Quantity getDefaultValueQuantity() throws FHIRException { 
6522      if (this.defaultValue == null)
6523        this.defaultValue = new Quantity();
6524      if (!(this.defaultValue instanceof Quantity))
6525        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6526      return (Quantity) this.defaultValue;
6527    }
6528
6529    public boolean hasDefaultValueQuantity() { 
6530      return this != null && this.defaultValue instanceof Quantity;
6531    }
6532
6533    /**
6534     * @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').)
6535     */
6536    public Range getDefaultValueRange() throws FHIRException { 
6537      if (this.defaultValue == null)
6538        this.defaultValue = new Range();
6539      if (!(this.defaultValue instanceof Range))
6540        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6541      return (Range) this.defaultValue;
6542    }
6543
6544    public boolean hasDefaultValueRange() { 
6545      return this != null && this.defaultValue instanceof Range;
6546    }
6547
6548    /**
6549     * @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').)
6550     */
6551    public Ratio getDefaultValueRatio() throws FHIRException { 
6552      if (this.defaultValue == null)
6553        this.defaultValue = new Ratio();
6554      if (!(this.defaultValue instanceof Ratio))
6555        throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6556      return (Ratio) this.defaultValue;
6557    }
6558
6559    public boolean hasDefaultValueRatio() { 
6560      return this != null && this.defaultValue instanceof Ratio;
6561    }
6562
6563    /**
6564     * @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').)
6565     */
6566    public Reference getDefaultValueReference() throws FHIRException { 
6567      if (this.defaultValue == null)
6568        this.defaultValue = new Reference();
6569      if (!(this.defaultValue instanceof Reference))
6570        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6571      return (Reference) this.defaultValue;
6572    }
6573
6574    public boolean hasDefaultValueReference() { 
6575      return this != null && this.defaultValue instanceof Reference;
6576    }
6577
6578    /**
6579     * @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').)
6580     */
6581    public SampledData getDefaultValueSampledData() throws FHIRException { 
6582      if (this.defaultValue == null)
6583        this.defaultValue = new SampledData();
6584      if (!(this.defaultValue instanceof SampledData))
6585        throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6586      return (SampledData) this.defaultValue;
6587    }
6588
6589    public boolean hasDefaultValueSampledData() { 
6590      return this != null && this.defaultValue instanceof SampledData;
6591    }
6592
6593    /**
6594     * @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').)
6595     */
6596    public Signature getDefaultValueSignature() throws FHIRException { 
6597      if (this.defaultValue == null)
6598        this.defaultValue = new Signature();
6599      if (!(this.defaultValue instanceof Signature))
6600        throw new FHIRException("Type mismatch: the type Signature was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6601      return (Signature) this.defaultValue;
6602    }
6603
6604    public boolean hasDefaultValueSignature() { 
6605      return this != null && this.defaultValue instanceof Signature;
6606    }
6607
6608    /**
6609     * @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').)
6610     */
6611    public Timing getDefaultValueTiming() throws FHIRException { 
6612      if (this.defaultValue == null)
6613        this.defaultValue = new Timing();
6614      if (!(this.defaultValue instanceof Timing))
6615        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6616      return (Timing) this.defaultValue;
6617    }
6618
6619    public boolean hasDefaultValueTiming() { 
6620      return this != null && this.defaultValue instanceof Timing;
6621    }
6622
6623    /**
6624     * @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').)
6625     */
6626    public ContactDetail getDefaultValueContactDetail() throws FHIRException { 
6627      if (this.defaultValue == null)
6628        this.defaultValue = new ContactDetail();
6629      if (!(this.defaultValue instanceof ContactDetail))
6630        throw new FHIRException("Type mismatch: the type ContactDetail was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6631      return (ContactDetail) this.defaultValue;
6632    }
6633
6634    public boolean hasDefaultValueContactDetail() { 
6635      return this != null && this.defaultValue instanceof ContactDetail;
6636    }
6637
6638    /**
6639     * @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').)
6640     */
6641    public Contributor getDefaultValueContributor() throws FHIRException { 
6642      if (this.defaultValue == null)
6643        this.defaultValue = new Contributor();
6644      if (!(this.defaultValue instanceof Contributor))
6645        throw new FHIRException("Type mismatch: the type Contributor was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6646      return (Contributor) this.defaultValue;
6647    }
6648
6649    public boolean hasDefaultValueContributor() { 
6650      return this != null && this.defaultValue instanceof Contributor;
6651    }
6652
6653    /**
6654     * @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').)
6655     */
6656    public DataRequirement getDefaultValueDataRequirement() throws FHIRException { 
6657      if (this.defaultValue == null)
6658        this.defaultValue = new DataRequirement();
6659      if (!(this.defaultValue instanceof DataRequirement))
6660        throw new FHIRException("Type mismatch: the type DataRequirement was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6661      return (DataRequirement) this.defaultValue;
6662    }
6663
6664    public boolean hasDefaultValueDataRequirement() { 
6665      return this != null && this.defaultValue instanceof DataRequirement;
6666    }
6667
6668    /**
6669     * @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').)
6670     */
6671    public Expression getDefaultValueExpression() throws FHIRException { 
6672      if (this.defaultValue == null)
6673        this.defaultValue = new Expression();
6674      if (!(this.defaultValue instanceof Expression))
6675        throw new FHIRException("Type mismatch: the type Expression was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6676      return (Expression) this.defaultValue;
6677    }
6678
6679    public boolean hasDefaultValueExpression() { 
6680      return this != null && this.defaultValue instanceof Expression;
6681    }
6682
6683    /**
6684     * @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').)
6685     */
6686    public ParameterDefinition getDefaultValueParameterDefinition() throws FHIRException { 
6687      if (this.defaultValue == null)
6688        this.defaultValue = new ParameterDefinition();
6689      if (!(this.defaultValue instanceof ParameterDefinition))
6690        throw new FHIRException("Type mismatch: the type ParameterDefinition was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6691      return (ParameterDefinition) this.defaultValue;
6692    }
6693
6694    public boolean hasDefaultValueParameterDefinition() { 
6695      return this != null && this.defaultValue instanceof ParameterDefinition;
6696    }
6697
6698    /**
6699     * @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').)
6700     */
6701    public RelatedArtifact getDefaultValueRelatedArtifact() throws FHIRException { 
6702      if (this.defaultValue == null)
6703        this.defaultValue = new RelatedArtifact();
6704      if (!(this.defaultValue instanceof RelatedArtifact))
6705        throw new FHIRException("Type mismatch: the type RelatedArtifact was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6706      return (RelatedArtifact) this.defaultValue;
6707    }
6708
6709    public boolean hasDefaultValueRelatedArtifact() { 
6710      return this != null && this.defaultValue instanceof RelatedArtifact;
6711    }
6712
6713    /**
6714     * @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').)
6715     */
6716    public TriggerDefinition getDefaultValueTriggerDefinition() throws FHIRException { 
6717      if (this.defaultValue == null)
6718        this.defaultValue = new TriggerDefinition();
6719      if (!(this.defaultValue instanceof TriggerDefinition))
6720        throw new FHIRException("Type mismatch: the type TriggerDefinition was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6721      return (TriggerDefinition) this.defaultValue;
6722    }
6723
6724    public boolean hasDefaultValueTriggerDefinition() { 
6725      return this != null && this.defaultValue instanceof TriggerDefinition;
6726    }
6727
6728    /**
6729     * @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').)
6730     */
6731    public UsageContext getDefaultValueUsageContext() throws FHIRException { 
6732      if (this.defaultValue == null)
6733        this.defaultValue = new UsageContext();
6734      if (!(this.defaultValue instanceof UsageContext))
6735        throw new FHIRException("Type mismatch: the type UsageContext was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6736      return (UsageContext) this.defaultValue;
6737    }
6738
6739    public boolean hasDefaultValueUsageContext() { 
6740      return this != null && this.defaultValue instanceof UsageContext;
6741    }
6742
6743    /**
6744     * @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').)
6745     */
6746    public Dosage getDefaultValueDosage() throws FHIRException { 
6747      if (this.defaultValue == null)
6748        this.defaultValue = new Dosage();
6749      if (!(this.defaultValue instanceof Dosage))
6750        throw new FHIRException("Type mismatch: the type Dosage was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6751      return (Dosage) this.defaultValue;
6752    }
6753
6754    public boolean hasDefaultValueDosage() { 
6755      return this != null && this.defaultValue instanceof Dosage;
6756    }
6757
6758    /**
6759     * @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').)
6760     */
6761    public Meta getDefaultValueMeta() throws FHIRException { 
6762      if (this.defaultValue == null)
6763        this.defaultValue = new Meta();
6764      if (!(this.defaultValue instanceof Meta))
6765        throw new FHIRException("Type mismatch: the type Meta was expected, but "+this.defaultValue.getClass().getName()+" was encountered");
6766      return (Meta) this.defaultValue;
6767    }
6768
6769    public boolean hasDefaultValueMeta() { 
6770      return this != null && this.defaultValue instanceof Meta;
6771    }
6772
6773    public boolean hasDefaultValue() { 
6774      return this.defaultValue != null && !this.defaultValue.isEmpty();
6775    }
6776
6777    /**
6778     * @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').)
6779     */
6780    public ElementDefinition setDefaultValue(DataType value) { 
6781      if (value != null && !(value instanceof Base64BinaryType || value instanceof BooleanType || value instanceof CanonicalType || value instanceof CodeType || value instanceof DateType || value instanceof DateTimeType || value instanceof DecimalType || value instanceof IdType || value instanceof InstantType || value instanceof IntegerType || value instanceof Integer64Type || value instanceof MarkdownType || value instanceof OidType || value instanceof PositiveIntType || value instanceof StringType || value instanceof TimeType || value instanceof UnsignedIntType || value instanceof UriType || value instanceof UrlType || value instanceof UuidType || value instanceof Address || value instanceof Age || value instanceof Annotation || value instanceof Attachment || value instanceof CodeableConcept || value instanceof Coding || value instanceof ContactPoint || value instanceof Count || value instanceof Distance || value instanceof Duration || value instanceof HumanName || value instanceof Identifier || value instanceof Money || value instanceof Period || value instanceof Quantity || value instanceof Range || value instanceof Ratio || value instanceof Reference || value instanceof SampledData || value instanceof Signature || value instanceof Timing || value instanceof ContactDetail || value instanceof Contributor || value instanceof DataRequirement || value instanceof Expression || value instanceof ParameterDefinition || value instanceof RelatedArtifact || value instanceof TriggerDefinition || value instanceof UsageContext || value instanceof Dosage || value instanceof Meta))
6782        throw new Error("Not the right type for ElementDefinition.defaultValue[x]: "+value.fhirType());
6783      this.defaultValue = value;
6784      return this;
6785    }
6786
6787    /**
6788     * @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
6789     */
6790    public MarkdownType getMeaningWhenMissingElement() { 
6791      if (this.meaningWhenMissing == null)
6792        if (Configuration.errorOnAutoCreate())
6793          throw new Error("Attempt to auto-create ElementDefinition.meaningWhenMissing");
6794        else if (Configuration.doAutoCreate())
6795          this.meaningWhenMissing = new MarkdownType(); // bb
6796      return this.meaningWhenMissing;
6797    }
6798
6799    public boolean hasMeaningWhenMissingElement() { 
6800      return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty();
6801    }
6802
6803    public boolean hasMeaningWhenMissing() { 
6804      return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty();
6805    }
6806
6807    /**
6808     * @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
6809     */
6810    public ElementDefinition setMeaningWhenMissingElement(MarkdownType value) { 
6811      this.meaningWhenMissing = value;
6812      return this;
6813    }
6814
6815    /**
6816     * @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').
6817     */
6818    public String getMeaningWhenMissing() { 
6819      return this.meaningWhenMissing == null ? null : this.meaningWhenMissing.getValue();
6820    }
6821
6822    /**
6823     * @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').
6824     */
6825    public ElementDefinition setMeaningWhenMissing(String value) { 
6826      if (value == null)
6827        this.meaningWhenMissing = null;
6828      else {
6829        if (this.meaningWhenMissing == null)
6830          this.meaningWhenMissing = new MarkdownType();
6831        this.meaningWhenMissing.setValue(value);
6832      }
6833      return this;
6834    }
6835
6836    /**
6837     * @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
6838     */
6839    public StringType getOrderMeaningElement() { 
6840      if (this.orderMeaning == null)
6841        if (Configuration.errorOnAutoCreate())
6842          throw new Error("Attempt to auto-create ElementDefinition.orderMeaning");
6843        else if (Configuration.doAutoCreate())
6844          this.orderMeaning = new StringType(); // bb
6845      return this.orderMeaning;
6846    }
6847
6848    public boolean hasOrderMeaningElement() { 
6849      return this.orderMeaning != null && !this.orderMeaning.isEmpty();
6850    }
6851
6852    public boolean hasOrderMeaning() { 
6853      return this.orderMeaning != null && !this.orderMeaning.isEmpty();
6854    }
6855
6856    /**
6857     * @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
6858     */
6859    public ElementDefinition setOrderMeaningElement(StringType value) { 
6860      this.orderMeaning = value;
6861      return this;
6862    }
6863
6864    /**
6865     * @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.
6866     */
6867    public String getOrderMeaning() { 
6868      return this.orderMeaning == null ? null : this.orderMeaning.getValue();
6869    }
6870
6871    /**
6872     * @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.
6873     */
6874    public ElementDefinition setOrderMeaning(String value) { 
6875      if (Utilities.noString(value))
6876        this.orderMeaning = null;
6877      else {
6878        if (this.orderMeaning == null)
6879          this.orderMeaning = new StringType();
6880        this.orderMeaning.setValue(value);
6881      }
6882      return this;
6883    }
6884
6885    /**
6886     * @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.)
6887     */
6888    public DataType getFixed() { 
6889      return this.fixed;
6890    }
6891
6892    /**
6893     * @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.)
6894     */
6895    public Base64BinaryType getFixedBase64BinaryType() throws FHIRException { 
6896      if (this.fixed == null)
6897        this.fixed = new Base64BinaryType();
6898      if (!(this.fixed instanceof Base64BinaryType))
6899        throw new FHIRException("Type mismatch: the type Base64BinaryType was expected, but "+this.fixed.getClass().getName()+" was encountered");
6900      return (Base64BinaryType) this.fixed;
6901    }
6902
6903    public boolean hasFixedBase64BinaryType() { 
6904      return this != null && this.fixed instanceof Base64BinaryType;
6905    }
6906
6907    /**
6908     * @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.)
6909     */
6910    public BooleanType getFixedBooleanType() throws FHIRException { 
6911      if (this.fixed == null)
6912        this.fixed = new BooleanType();
6913      if (!(this.fixed instanceof BooleanType))
6914        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.fixed.getClass().getName()+" was encountered");
6915      return (BooleanType) this.fixed;
6916    }
6917
6918    public boolean hasFixedBooleanType() { 
6919      return this != null && this.fixed instanceof BooleanType;
6920    }
6921
6922    /**
6923     * @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.)
6924     */
6925    public CanonicalType getFixedCanonicalType() throws FHIRException { 
6926      if (this.fixed == null)
6927        this.fixed = new CanonicalType();
6928      if (!(this.fixed instanceof CanonicalType))
6929        throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.fixed.getClass().getName()+" was encountered");
6930      return (CanonicalType) this.fixed;
6931    }
6932
6933    public boolean hasFixedCanonicalType() { 
6934      return this != null && this.fixed instanceof CanonicalType;
6935    }
6936
6937    /**
6938     * @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.)
6939     */
6940    public CodeType getFixedCodeType() throws FHIRException { 
6941      if (this.fixed == null)
6942        this.fixed = new CodeType();
6943      if (!(this.fixed instanceof CodeType))
6944        throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.fixed.getClass().getName()+" was encountered");
6945      return (CodeType) this.fixed;
6946    }
6947
6948    public boolean hasFixedCodeType() { 
6949      return this != null && this.fixed instanceof CodeType;
6950    }
6951
6952    /**
6953     * @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.)
6954     */
6955    public DateType getFixedDateType() throws FHIRException { 
6956      if (this.fixed == null)
6957        this.fixed = new DateType();
6958      if (!(this.fixed instanceof DateType))
6959        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.fixed.getClass().getName()+" was encountered");
6960      return (DateType) this.fixed;
6961    }
6962
6963    public boolean hasFixedDateType() { 
6964      return this != null && this.fixed instanceof DateType;
6965    }
6966
6967    /**
6968     * @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.)
6969     */
6970    public DateTimeType getFixedDateTimeType() throws FHIRException { 
6971      if (this.fixed == null)
6972        this.fixed = new DateTimeType();
6973      if (!(this.fixed instanceof DateTimeType))
6974        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.fixed.getClass().getName()+" was encountered");
6975      return (DateTimeType) this.fixed;
6976    }
6977
6978    public boolean hasFixedDateTimeType() { 
6979      return this != null && this.fixed instanceof DateTimeType;
6980    }
6981
6982    /**
6983     * @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.)
6984     */
6985    public DecimalType getFixedDecimalType() throws FHIRException { 
6986      if (this.fixed == null)
6987        this.fixed = new DecimalType();
6988      if (!(this.fixed instanceof DecimalType))
6989        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.fixed.getClass().getName()+" was encountered");
6990      return (DecimalType) this.fixed;
6991    }
6992
6993    public boolean hasFixedDecimalType() { 
6994      return this != null && this.fixed instanceof DecimalType;
6995    }
6996
6997    /**
6998     * @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.)
6999     */
7000    public IdType getFixedIdType() throws FHIRException { 
7001      if (this.fixed == null)
7002        this.fixed = new IdType();
7003      if (!(this.fixed instanceof IdType))
7004        throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7005      return (IdType) this.fixed;
7006    }
7007
7008    public boolean hasFixedIdType() { 
7009      return this != null && this.fixed instanceof IdType;
7010    }
7011
7012    /**
7013     * @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.)
7014     */
7015    public InstantType getFixedInstantType() throws FHIRException { 
7016      if (this.fixed == null)
7017        this.fixed = new InstantType();
7018      if (!(this.fixed instanceof InstantType))
7019        throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7020      return (InstantType) this.fixed;
7021    }
7022
7023    public boolean hasFixedInstantType() { 
7024      return this != null && this.fixed instanceof InstantType;
7025    }
7026
7027    /**
7028     * @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.)
7029     */
7030    public IntegerType getFixedIntegerType() throws FHIRException { 
7031      if (this.fixed == null)
7032        this.fixed = new IntegerType();
7033      if (!(this.fixed instanceof IntegerType))
7034        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7035      return (IntegerType) this.fixed;
7036    }
7037
7038    public boolean hasFixedIntegerType() { 
7039      return this != null && this.fixed instanceof IntegerType;
7040    }
7041
7042    /**
7043     * @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.)
7044     */
7045    public Integer64Type getFixedInteger64Type() throws FHIRException { 
7046      if (this.fixed == null)
7047        this.fixed = new Integer64Type();
7048      if (!(this.fixed instanceof Integer64Type))
7049        throw new FHIRException("Type mismatch: the type Integer64Type was expected, but "+this.fixed.getClass().getName()+" was encountered");
7050      return (Integer64Type) this.fixed;
7051    }
7052
7053    public boolean hasFixedInteger64Type() { 
7054      return this != null && this.fixed instanceof Integer64Type;
7055    }
7056
7057    /**
7058     * @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.)
7059     */
7060    public MarkdownType getFixedMarkdownType() throws FHIRException { 
7061      if (this.fixed == null)
7062        this.fixed = new MarkdownType();
7063      if (!(this.fixed instanceof MarkdownType))
7064        throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7065      return (MarkdownType) this.fixed;
7066    }
7067
7068    public boolean hasFixedMarkdownType() { 
7069      return this != null && this.fixed instanceof MarkdownType;
7070    }
7071
7072    /**
7073     * @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.)
7074     */
7075    public OidType getFixedOidType() throws FHIRException { 
7076      if (this.fixed == null)
7077        this.fixed = new OidType();
7078      if (!(this.fixed instanceof OidType))
7079        throw new FHIRException("Type mismatch: the type OidType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7080      return (OidType) this.fixed;
7081    }
7082
7083    public boolean hasFixedOidType() { 
7084      return this != null && this.fixed instanceof OidType;
7085    }
7086
7087    /**
7088     * @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.)
7089     */
7090    public PositiveIntType getFixedPositiveIntType() throws FHIRException { 
7091      if (this.fixed == null)
7092        this.fixed = new PositiveIntType();
7093      if (!(this.fixed instanceof PositiveIntType))
7094        throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7095      return (PositiveIntType) this.fixed;
7096    }
7097
7098    public boolean hasFixedPositiveIntType() { 
7099      return this != null && this.fixed instanceof PositiveIntType;
7100    }
7101
7102    /**
7103     * @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.)
7104     */
7105    public StringType getFixedStringType() throws FHIRException { 
7106      if (this.fixed == null)
7107        this.fixed = new StringType();
7108      if (!(this.fixed instanceof StringType))
7109        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7110      return (StringType) this.fixed;
7111    }
7112
7113    public boolean hasFixedStringType() { 
7114      return this != null && this.fixed instanceof StringType;
7115    }
7116
7117    /**
7118     * @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.)
7119     */
7120    public TimeType getFixedTimeType() throws FHIRException { 
7121      if (this.fixed == null)
7122        this.fixed = new TimeType();
7123      if (!(this.fixed instanceof TimeType))
7124        throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7125      return (TimeType) this.fixed;
7126    }
7127
7128    public boolean hasFixedTimeType() { 
7129      return this != null && this.fixed instanceof TimeType;
7130    }
7131
7132    /**
7133     * @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.)
7134     */
7135    public UnsignedIntType getFixedUnsignedIntType() throws FHIRException { 
7136      if (this.fixed == null)
7137        this.fixed = new UnsignedIntType();
7138      if (!(this.fixed instanceof UnsignedIntType))
7139        throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7140      return (UnsignedIntType) this.fixed;
7141    }
7142
7143    public boolean hasFixedUnsignedIntType() { 
7144      return this != null && this.fixed instanceof UnsignedIntType;
7145    }
7146
7147    /**
7148     * @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.)
7149     */
7150    public UriType getFixedUriType() throws FHIRException { 
7151      if (this.fixed == null)
7152        this.fixed = new UriType();
7153      if (!(this.fixed instanceof UriType))
7154        throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7155      return (UriType) this.fixed;
7156    }
7157
7158    public boolean hasFixedUriType() { 
7159      return this != null && this.fixed instanceof UriType;
7160    }
7161
7162    /**
7163     * @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.)
7164     */
7165    public UrlType getFixedUrlType() throws FHIRException { 
7166      if (this.fixed == null)
7167        this.fixed = new UrlType();
7168      if (!(this.fixed instanceof UrlType))
7169        throw new FHIRException("Type mismatch: the type UrlType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7170      return (UrlType) this.fixed;
7171    }
7172
7173    public boolean hasFixedUrlType() { 
7174      return this != null && this.fixed instanceof UrlType;
7175    }
7176
7177    /**
7178     * @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.)
7179     */
7180    public UuidType getFixedUuidType() throws FHIRException { 
7181      if (this.fixed == null)
7182        this.fixed = new UuidType();
7183      if (!(this.fixed instanceof UuidType))
7184        throw new FHIRException("Type mismatch: the type UuidType was expected, but "+this.fixed.getClass().getName()+" was encountered");
7185      return (UuidType) this.fixed;
7186    }
7187
7188    public boolean hasFixedUuidType() { 
7189      return this != null && this.fixed instanceof UuidType;
7190    }
7191
7192    /**
7193     * @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.)
7194     */
7195    public Address getFixedAddress() throws FHIRException { 
7196      if (this.fixed == null)
7197        this.fixed = new Address();
7198      if (!(this.fixed instanceof Address))
7199        throw new FHIRException("Type mismatch: the type Address was expected, but "+this.fixed.getClass().getName()+" was encountered");
7200      return (Address) this.fixed;
7201    }
7202
7203    public boolean hasFixedAddress() { 
7204      return this != null && this.fixed instanceof Address;
7205    }
7206
7207    /**
7208     * @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.)
7209     */
7210    public Age getFixedAge() throws FHIRException { 
7211      if (this.fixed == null)
7212        this.fixed = new Age();
7213      if (!(this.fixed instanceof Age))
7214        throw new FHIRException("Type mismatch: the type Age was expected, but "+this.fixed.getClass().getName()+" was encountered");
7215      return (Age) this.fixed;
7216    }
7217
7218    public boolean hasFixedAge() { 
7219      return this != null && this.fixed instanceof Age;
7220    }
7221
7222    /**
7223     * @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.)
7224     */
7225    public Annotation getFixedAnnotation() throws FHIRException { 
7226      if (this.fixed == null)
7227        this.fixed = new Annotation();
7228      if (!(this.fixed instanceof Annotation))
7229        throw new FHIRException("Type mismatch: the type Annotation was expected, but "+this.fixed.getClass().getName()+" was encountered");
7230      return (Annotation) this.fixed;
7231    }
7232
7233    public boolean hasFixedAnnotation() { 
7234      return this != null && this.fixed instanceof Annotation;
7235    }
7236
7237    /**
7238     * @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.)
7239     */
7240    public Attachment getFixedAttachment() throws FHIRException { 
7241      if (this.fixed == null)
7242        this.fixed = new Attachment();
7243      if (!(this.fixed instanceof Attachment))
7244        throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.fixed.getClass().getName()+" was encountered");
7245      return (Attachment) this.fixed;
7246    }
7247
7248    public boolean hasFixedAttachment() { 
7249      return this != null && this.fixed instanceof Attachment;
7250    }
7251
7252    /**
7253     * @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.)
7254     */
7255    public CodeableConcept getFixedCodeableConcept() throws FHIRException { 
7256      if (this.fixed == null)
7257        this.fixed = new CodeableConcept();
7258      if (!(this.fixed instanceof CodeableConcept))
7259        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.fixed.getClass().getName()+" was encountered");
7260      return (CodeableConcept) this.fixed;
7261    }
7262
7263    public boolean hasFixedCodeableConcept() { 
7264      return this != null && this.fixed instanceof CodeableConcept;
7265    }
7266
7267    /**
7268     * @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.)
7269     */
7270    public Coding getFixedCoding() throws FHIRException { 
7271      if (this.fixed == null)
7272        this.fixed = new Coding();
7273      if (!(this.fixed instanceof Coding))
7274        throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.fixed.getClass().getName()+" was encountered");
7275      return (Coding) this.fixed;
7276    }
7277
7278    public boolean hasFixedCoding() { 
7279      return this != null && this.fixed instanceof Coding;
7280    }
7281
7282    /**
7283     * @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.)
7284     */
7285    public ContactPoint getFixedContactPoint() throws FHIRException { 
7286      if (this.fixed == null)
7287        this.fixed = new ContactPoint();
7288      if (!(this.fixed instanceof ContactPoint))
7289        throw new FHIRException("Type mismatch: the type ContactPoint was expected, but "+this.fixed.getClass().getName()+" was encountered");
7290      return (ContactPoint) this.fixed;
7291    }
7292
7293    public boolean hasFixedContactPoint() { 
7294      return this != null && this.fixed instanceof ContactPoint;
7295    }
7296
7297    /**
7298     * @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.)
7299     */
7300    public Count getFixedCount() throws FHIRException { 
7301      if (this.fixed == null)
7302        this.fixed = new Count();
7303      if (!(this.fixed instanceof Count))
7304        throw new FHIRException("Type mismatch: the type Count was expected, but "+this.fixed.getClass().getName()+" was encountered");
7305      return (Count) this.fixed;
7306    }
7307
7308    public boolean hasFixedCount() { 
7309      return this != null && this.fixed instanceof Count;
7310    }
7311
7312    /**
7313     * @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.)
7314     */
7315    public Distance getFixedDistance() throws FHIRException { 
7316      if (this.fixed == null)
7317        this.fixed = new Distance();
7318      if (!(this.fixed instanceof Distance))
7319        throw new FHIRException("Type mismatch: the type Distance was expected, but "+this.fixed.getClass().getName()+" was encountered");
7320      return (Distance) this.fixed;
7321    }
7322
7323    public boolean hasFixedDistance() { 
7324      return this != null && this.fixed instanceof Distance;
7325    }
7326
7327    /**
7328     * @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.)
7329     */
7330    public Duration getFixedDuration() throws FHIRException { 
7331      if (this.fixed == null)
7332        this.fixed = new Duration();
7333      if (!(this.fixed instanceof Duration))
7334        throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.fixed.getClass().getName()+" was encountered");
7335      return (Duration) this.fixed;
7336    }
7337
7338    public boolean hasFixedDuration() { 
7339      return this != null && this.fixed instanceof Duration;
7340    }
7341
7342    /**
7343     * @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.)
7344     */
7345    public HumanName getFixedHumanName() throws FHIRException { 
7346      if (this.fixed == null)
7347        this.fixed = new HumanName();
7348      if (!(this.fixed instanceof HumanName))
7349        throw new FHIRException("Type mismatch: the type HumanName was expected, but "+this.fixed.getClass().getName()+" was encountered");
7350      return (HumanName) this.fixed;
7351    }
7352
7353    public boolean hasFixedHumanName() { 
7354      return this != null && this.fixed instanceof HumanName;
7355    }
7356
7357    /**
7358     * @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.)
7359     */
7360    public Identifier getFixedIdentifier() throws FHIRException { 
7361      if (this.fixed == null)
7362        this.fixed = new Identifier();
7363      if (!(this.fixed instanceof Identifier))
7364        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.fixed.getClass().getName()+" was encountered");
7365      return (Identifier) this.fixed;
7366    }
7367
7368    public boolean hasFixedIdentifier() { 
7369      return this != null && this.fixed instanceof Identifier;
7370    }
7371
7372    /**
7373     * @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.)
7374     */
7375    public Money getFixedMoney() throws FHIRException { 
7376      if (this.fixed == null)
7377        this.fixed = new Money();
7378      if (!(this.fixed instanceof Money))
7379        throw new FHIRException("Type mismatch: the type Money was expected, but "+this.fixed.getClass().getName()+" was encountered");
7380      return (Money) this.fixed;
7381    }
7382
7383    public boolean hasFixedMoney() { 
7384      return this != null && this.fixed instanceof Money;
7385    }
7386
7387    /**
7388     * @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.)
7389     */
7390    public Period getFixedPeriod() throws FHIRException { 
7391      if (this.fixed == null)
7392        this.fixed = new Period();
7393      if (!(this.fixed instanceof Period))
7394        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.fixed.getClass().getName()+" was encountered");
7395      return (Period) this.fixed;
7396    }
7397
7398    public boolean hasFixedPeriod() { 
7399      return this != null && this.fixed instanceof Period;
7400    }
7401
7402    /**
7403     * @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.)
7404     */
7405    public Quantity getFixedQuantity() throws FHIRException { 
7406      if (this.fixed == null)
7407        this.fixed = new Quantity();
7408      if (!(this.fixed instanceof Quantity))
7409        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.fixed.getClass().getName()+" was encountered");
7410      return (Quantity) this.fixed;
7411    }
7412
7413    public boolean hasFixedQuantity() { 
7414      return this != null && this.fixed instanceof Quantity;
7415    }
7416
7417    /**
7418     * @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.)
7419     */
7420    public Range getFixedRange() throws FHIRException { 
7421      if (this.fixed == null)
7422        this.fixed = new Range();
7423      if (!(this.fixed instanceof Range))
7424        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.fixed.getClass().getName()+" was encountered");
7425      return (Range) this.fixed;
7426    }
7427
7428    public boolean hasFixedRange() { 
7429      return this != null && this.fixed instanceof Range;
7430    }
7431
7432    /**
7433     * @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.)
7434     */
7435    public Ratio getFixedRatio() throws FHIRException { 
7436      if (this.fixed == null)
7437        this.fixed = new Ratio();
7438      if (!(this.fixed instanceof Ratio))
7439        throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.fixed.getClass().getName()+" was encountered");
7440      return (Ratio) this.fixed;
7441    }
7442
7443    public boolean hasFixedRatio() { 
7444      return this != null && this.fixed instanceof Ratio;
7445    }
7446
7447    /**
7448     * @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.)
7449     */
7450    public Reference getFixedReference() throws FHIRException { 
7451      if (this.fixed == null)
7452        this.fixed = new Reference();
7453      if (!(this.fixed instanceof Reference))
7454        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.fixed.getClass().getName()+" was encountered");
7455      return (Reference) this.fixed;
7456    }
7457
7458    public boolean hasFixedReference() { 
7459      return this != null && this.fixed instanceof Reference;
7460    }
7461
7462    /**
7463     * @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.)
7464     */
7465    public SampledData getFixedSampledData() throws FHIRException { 
7466      if (this.fixed == null)
7467        this.fixed = new SampledData();
7468      if (!(this.fixed instanceof SampledData))
7469        throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.fixed.getClass().getName()+" was encountered");
7470      return (SampledData) this.fixed;
7471    }
7472
7473    public boolean hasFixedSampledData() { 
7474      return this != null && this.fixed instanceof SampledData;
7475    }
7476
7477    /**
7478     * @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.)
7479     */
7480    public Signature getFixedSignature() throws FHIRException { 
7481      if (this.fixed == null)
7482        this.fixed = new Signature();
7483      if (!(this.fixed instanceof Signature))
7484        throw new FHIRException("Type mismatch: the type Signature was expected, but "+this.fixed.getClass().getName()+" was encountered");
7485      return (Signature) this.fixed;
7486    }
7487
7488    public boolean hasFixedSignature() { 
7489      return this != null && this.fixed instanceof Signature;
7490    }
7491
7492    /**
7493     * @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.)
7494     */
7495    public Timing getFixedTiming() throws FHIRException { 
7496      if (this.fixed == null)
7497        this.fixed = new Timing();
7498      if (!(this.fixed instanceof Timing))
7499        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.fixed.getClass().getName()+" was encountered");
7500      return (Timing) this.fixed;
7501    }
7502
7503    public boolean hasFixedTiming() { 
7504      return this != null && this.fixed instanceof Timing;
7505    }
7506
7507    /**
7508     * @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.)
7509     */
7510    public ContactDetail getFixedContactDetail() throws FHIRException { 
7511      if (this.fixed == null)
7512        this.fixed = new ContactDetail();
7513      if (!(this.fixed instanceof ContactDetail))
7514        throw new FHIRException("Type mismatch: the type ContactDetail was expected, but "+this.fixed.getClass().getName()+" was encountered");
7515      return (ContactDetail) this.fixed;
7516    }
7517
7518    public boolean hasFixedContactDetail() { 
7519      return this != null && this.fixed instanceof ContactDetail;
7520    }
7521
7522    /**
7523     * @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.)
7524     */
7525    public Contributor getFixedContributor() throws FHIRException { 
7526      if (this.fixed == null)
7527        this.fixed = new Contributor();
7528      if (!(this.fixed instanceof Contributor))
7529        throw new FHIRException("Type mismatch: the type Contributor was expected, but "+this.fixed.getClass().getName()+" was encountered");
7530      return (Contributor) this.fixed;
7531    }
7532
7533    public boolean hasFixedContributor() { 
7534      return this != null && this.fixed instanceof Contributor;
7535    }
7536
7537    /**
7538     * @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.)
7539     */
7540    public DataRequirement getFixedDataRequirement() throws FHIRException { 
7541      if (this.fixed == null)
7542        this.fixed = new DataRequirement();
7543      if (!(this.fixed instanceof DataRequirement))
7544        throw new FHIRException("Type mismatch: the type DataRequirement was expected, but "+this.fixed.getClass().getName()+" was encountered");
7545      return (DataRequirement) this.fixed;
7546    }
7547
7548    public boolean hasFixedDataRequirement() { 
7549      return this != null && this.fixed instanceof DataRequirement;
7550    }
7551
7552    /**
7553     * @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.)
7554     */
7555    public Expression getFixedExpression() throws FHIRException { 
7556      if (this.fixed == null)
7557        this.fixed = new Expression();
7558      if (!(this.fixed instanceof Expression))
7559        throw new FHIRException("Type mismatch: the type Expression was expected, but "+this.fixed.getClass().getName()+" was encountered");
7560      return (Expression) this.fixed;
7561    }
7562
7563    public boolean hasFixedExpression() { 
7564      return this != null && this.fixed instanceof Expression;
7565    }
7566
7567    /**
7568     * @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.)
7569     */
7570    public ParameterDefinition getFixedParameterDefinition() throws FHIRException { 
7571      if (this.fixed == null)
7572        this.fixed = new ParameterDefinition();
7573      if (!(this.fixed instanceof ParameterDefinition))
7574        throw new FHIRException("Type mismatch: the type ParameterDefinition was expected, but "+this.fixed.getClass().getName()+" was encountered");
7575      return (ParameterDefinition) this.fixed;
7576    }
7577
7578    public boolean hasFixedParameterDefinition() { 
7579      return this != null && this.fixed instanceof ParameterDefinition;
7580    }
7581
7582    /**
7583     * @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.)
7584     */
7585    public RelatedArtifact getFixedRelatedArtifact() throws FHIRException { 
7586      if (this.fixed == null)
7587        this.fixed = new RelatedArtifact();
7588      if (!(this.fixed instanceof RelatedArtifact))
7589        throw new FHIRException("Type mismatch: the type RelatedArtifact was expected, but "+this.fixed.getClass().getName()+" was encountered");
7590      return (RelatedArtifact) this.fixed;
7591    }
7592
7593    public boolean hasFixedRelatedArtifact() { 
7594      return this != null && this.fixed instanceof RelatedArtifact;
7595    }
7596
7597    /**
7598     * @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.)
7599     */
7600    public TriggerDefinition getFixedTriggerDefinition() throws FHIRException { 
7601      if (this.fixed == null)
7602        this.fixed = new TriggerDefinition();
7603      if (!(this.fixed instanceof TriggerDefinition))
7604        throw new FHIRException("Type mismatch: the type TriggerDefinition was expected, but "+this.fixed.getClass().getName()+" was encountered");
7605      return (TriggerDefinition) this.fixed;
7606    }
7607
7608    public boolean hasFixedTriggerDefinition() { 
7609      return this != null && this.fixed instanceof TriggerDefinition;
7610    }
7611
7612    /**
7613     * @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.)
7614     */
7615    public UsageContext getFixedUsageContext() throws FHIRException { 
7616      if (this.fixed == null)
7617        this.fixed = new UsageContext();
7618      if (!(this.fixed instanceof UsageContext))
7619        throw new FHIRException("Type mismatch: the type UsageContext was expected, but "+this.fixed.getClass().getName()+" was encountered");
7620      return (UsageContext) this.fixed;
7621    }
7622
7623    public boolean hasFixedUsageContext() { 
7624      return this != null && this.fixed instanceof UsageContext;
7625    }
7626
7627    /**
7628     * @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.)
7629     */
7630    public Dosage getFixedDosage() throws FHIRException { 
7631      if (this.fixed == null)
7632        this.fixed = new Dosage();
7633      if (!(this.fixed instanceof Dosage))
7634        throw new FHIRException("Type mismatch: the type Dosage was expected, but "+this.fixed.getClass().getName()+" was encountered");
7635      return (Dosage) this.fixed;
7636    }
7637
7638    public boolean hasFixedDosage() { 
7639      return this != null && this.fixed instanceof Dosage;
7640    }
7641
7642    /**
7643     * @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.)
7644     */
7645    public Meta getFixedMeta() throws FHIRException { 
7646      if (this.fixed == null)
7647        this.fixed = new Meta();
7648      if (!(this.fixed instanceof Meta))
7649        throw new FHIRException("Type mismatch: the type Meta was expected, but "+this.fixed.getClass().getName()+" was encountered");
7650      return (Meta) this.fixed;
7651    }
7652
7653    public boolean hasFixedMeta() { 
7654      return this != null && this.fixed instanceof Meta;
7655    }
7656
7657    public boolean hasFixed() { 
7658      return this.fixed != null && !this.fixed.isEmpty();
7659    }
7660
7661    /**
7662     * @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.)
7663     */
7664    public ElementDefinition setFixed(DataType value) { 
7665      if (value != null && !(value instanceof Base64BinaryType || value instanceof BooleanType || value instanceof CanonicalType || value instanceof CodeType || value instanceof DateType || value instanceof DateTimeType || value instanceof DecimalType || value instanceof IdType || value instanceof InstantType || value instanceof IntegerType || value instanceof Integer64Type || value instanceof MarkdownType || value instanceof OidType || value instanceof PositiveIntType || value instanceof StringType || value instanceof TimeType || value instanceof UnsignedIntType || value instanceof UriType || value instanceof UrlType || value instanceof UuidType || value instanceof Address || value instanceof Age || value instanceof Annotation || value instanceof Attachment || value instanceof CodeableConcept || value instanceof Coding || value instanceof ContactPoint || value instanceof Count || value instanceof Distance || value instanceof Duration || value instanceof HumanName || value instanceof Identifier || value instanceof Money || value instanceof Period || value instanceof Quantity || value instanceof Range || value instanceof Ratio || value instanceof Reference || value instanceof SampledData || value instanceof Signature || value instanceof Timing || value instanceof ContactDetail || value instanceof Contributor || value instanceof DataRequirement || value instanceof Expression || value instanceof ParameterDefinition || value instanceof RelatedArtifact || value instanceof TriggerDefinition || value instanceof UsageContext || value instanceof Dosage || value instanceof Meta))
7666        throw new Error("Not the right type for ElementDefinition.fixed[x]: "+value.fhirType());
7667      this.fixed = value;
7668      return this;
7669    }
7670
7671    /**
7672     * @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.  
7673
7674When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7675
7676When 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.
7677
7678When 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.,
7679
76801. If primitive: it must match exactly the pattern value
76812. If a complex object: it must match (recursively) the pattern value
76823. If an array: it must match (recursively) the pattern value.)
7683     */
7684    public DataType getPattern() { 
7685      return this.pattern;
7686    }
7687
7688    /**
7689     * @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.  
7690
7691When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7692
7693When 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.
7694
7695When 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.,
7696
76971. If primitive: it must match exactly the pattern value
76982. If a complex object: it must match (recursively) the pattern value
76993. If an array: it must match (recursively) the pattern value.)
7700     */
7701    public Base64BinaryType getPatternBase64BinaryType() throws FHIRException { 
7702      if (this.pattern == null)
7703        this.pattern = new Base64BinaryType();
7704      if (!(this.pattern instanceof Base64BinaryType))
7705        throw new FHIRException("Type mismatch: the type Base64BinaryType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7706      return (Base64BinaryType) this.pattern;
7707    }
7708
7709    public boolean hasPatternBase64BinaryType() { 
7710      return this != null && this.pattern instanceof Base64BinaryType;
7711    }
7712
7713    /**
7714     * @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.  
7715
7716When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7717
7718When 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.
7719
7720When 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.,
7721
77221. If primitive: it must match exactly the pattern value
77232. If a complex object: it must match (recursively) the pattern value
77243. If an array: it must match (recursively) the pattern value.)
7725     */
7726    public BooleanType getPatternBooleanType() throws FHIRException { 
7727      if (this.pattern == null)
7728        this.pattern = new BooleanType();
7729      if (!(this.pattern instanceof BooleanType))
7730        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7731      return (BooleanType) this.pattern;
7732    }
7733
7734    public boolean hasPatternBooleanType() { 
7735      return this != null && this.pattern instanceof BooleanType;
7736    }
7737
7738    /**
7739     * @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.  
7740
7741When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7742
7743When 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.
7744
7745When 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.,
7746
77471. If primitive: it must match exactly the pattern value
77482. If a complex object: it must match (recursively) the pattern value
77493. If an array: it must match (recursively) the pattern value.)
7750     */
7751    public CanonicalType getPatternCanonicalType() throws FHIRException { 
7752      if (this.pattern == null)
7753        this.pattern = new CanonicalType();
7754      if (!(this.pattern instanceof CanonicalType))
7755        throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7756      return (CanonicalType) this.pattern;
7757    }
7758
7759    public boolean hasPatternCanonicalType() { 
7760      return this != null && this.pattern instanceof CanonicalType;
7761    }
7762
7763    /**
7764     * @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.  
7765
7766When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7767
7768When 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.
7769
7770When 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.,
7771
77721. If primitive: it must match exactly the pattern value
77732. If a complex object: it must match (recursively) the pattern value
77743. If an array: it must match (recursively) the pattern value.)
7775     */
7776    public CodeType getPatternCodeType() throws FHIRException { 
7777      if (this.pattern == null)
7778        this.pattern = new CodeType();
7779      if (!(this.pattern instanceof CodeType))
7780        throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7781      return (CodeType) this.pattern;
7782    }
7783
7784    public boolean hasPatternCodeType() { 
7785      return this != null && this.pattern instanceof CodeType;
7786    }
7787
7788    /**
7789     * @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.  
7790
7791When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7792
7793When 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.
7794
7795When 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.,
7796
77971. If primitive: it must match exactly the pattern value
77982. If a complex object: it must match (recursively) the pattern value
77993. If an array: it must match (recursively) the pattern value.)
7800     */
7801    public DateType getPatternDateType() throws FHIRException { 
7802      if (this.pattern == null)
7803        this.pattern = new DateType();
7804      if (!(this.pattern instanceof DateType))
7805        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7806      return (DateType) this.pattern;
7807    }
7808
7809    public boolean hasPatternDateType() { 
7810      return this != null && this.pattern instanceof DateType;
7811    }
7812
7813    /**
7814     * @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.  
7815
7816When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7817
7818When 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.
7819
7820When 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.,
7821
78221. If primitive: it must match exactly the pattern value
78232. If a complex object: it must match (recursively) the pattern value
78243. If an array: it must match (recursively) the pattern value.)
7825     */
7826    public DateTimeType getPatternDateTimeType() throws FHIRException { 
7827      if (this.pattern == null)
7828        this.pattern = new DateTimeType();
7829      if (!(this.pattern instanceof DateTimeType))
7830        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7831      return (DateTimeType) this.pattern;
7832    }
7833
7834    public boolean hasPatternDateTimeType() { 
7835      return this != null && this.pattern instanceof DateTimeType;
7836    }
7837
7838    /**
7839     * @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.  
7840
7841When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7842
7843When 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.
7844
7845When 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.,
7846
78471. If primitive: it must match exactly the pattern value
78482. If a complex object: it must match (recursively) the pattern value
78493. If an array: it must match (recursively) the pattern value.)
7850     */
7851    public DecimalType getPatternDecimalType() throws FHIRException { 
7852      if (this.pattern == null)
7853        this.pattern = new DecimalType();
7854      if (!(this.pattern instanceof DecimalType))
7855        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7856      return (DecimalType) this.pattern;
7857    }
7858
7859    public boolean hasPatternDecimalType() { 
7860      return this != null && this.pattern instanceof DecimalType;
7861    }
7862
7863    /**
7864     * @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.  
7865
7866When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7867
7868When 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.
7869
7870When 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.,
7871
78721. If primitive: it must match exactly the pattern value
78732. If a complex object: it must match (recursively) the pattern value
78743. If an array: it must match (recursively) the pattern value.)
7875     */
7876    public IdType getPatternIdType() throws FHIRException { 
7877      if (this.pattern == null)
7878        this.pattern = new IdType();
7879      if (!(this.pattern instanceof IdType))
7880        throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7881      return (IdType) this.pattern;
7882    }
7883
7884    public boolean hasPatternIdType() { 
7885      return this != null && this.pattern instanceof IdType;
7886    }
7887
7888    /**
7889     * @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.  
7890
7891When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7892
7893When 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.
7894
7895When 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.,
7896
78971. If primitive: it must match exactly the pattern value
78982. If a complex object: it must match (recursively) the pattern value
78993. If an array: it must match (recursively) the pattern value.)
7900     */
7901    public InstantType getPatternInstantType() throws FHIRException { 
7902      if (this.pattern == null)
7903        this.pattern = new InstantType();
7904      if (!(this.pattern instanceof InstantType))
7905        throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7906      return (InstantType) this.pattern;
7907    }
7908
7909    public boolean hasPatternInstantType() { 
7910      return this != null && this.pattern instanceof InstantType;
7911    }
7912
7913    /**
7914     * @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.  
7915
7916When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7917
7918When 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.
7919
7920When 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.,
7921
79221. If primitive: it must match exactly the pattern value
79232. If a complex object: it must match (recursively) the pattern value
79243. If an array: it must match (recursively) the pattern value.)
7925     */
7926    public IntegerType getPatternIntegerType() throws FHIRException { 
7927      if (this.pattern == null)
7928        this.pattern = new IntegerType();
7929      if (!(this.pattern instanceof IntegerType))
7930        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7931      return (IntegerType) this.pattern;
7932    }
7933
7934    public boolean hasPatternIntegerType() { 
7935      return this != null && this.pattern instanceof IntegerType;
7936    }
7937
7938    /**
7939     * @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.  
7940
7941When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7942
7943When 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.
7944
7945When 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.,
7946
79471. If primitive: it must match exactly the pattern value
79482. If a complex object: it must match (recursively) the pattern value
79493. If an array: it must match (recursively) the pattern value.)
7950     */
7951    public Integer64Type getPatternInteger64Type() throws FHIRException { 
7952      if (this.pattern == null)
7953        this.pattern = new Integer64Type();
7954      if (!(this.pattern instanceof Integer64Type))
7955        throw new FHIRException("Type mismatch: the type Integer64Type was expected, but "+this.pattern.getClass().getName()+" was encountered");
7956      return (Integer64Type) this.pattern;
7957    }
7958
7959    public boolean hasPatternInteger64Type() { 
7960      return this != null && this.pattern instanceof Integer64Type;
7961    }
7962
7963    /**
7964     * @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.  
7965
7966When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7967
7968When 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.
7969
7970When 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.,
7971
79721. If primitive: it must match exactly the pattern value
79732. If a complex object: it must match (recursively) the pattern value
79743. If an array: it must match (recursively) the pattern value.)
7975     */
7976    public MarkdownType getPatternMarkdownType() throws FHIRException { 
7977      if (this.pattern == null)
7978        this.pattern = new MarkdownType();
7979      if (!(this.pattern instanceof MarkdownType))
7980        throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.pattern.getClass().getName()+" was encountered");
7981      return (MarkdownType) this.pattern;
7982    }
7983
7984    public boolean hasPatternMarkdownType() { 
7985      return this != null && this.pattern instanceof MarkdownType;
7986    }
7987
7988    /**
7989     * @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.  
7990
7991When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
7992
7993When 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.
7994
7995When 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.,
7996
79971. If primitive: it must match exactly the pattern value
79982. If a complex object: it must match (recursively) the pattern value
79993. If an array: it must match (recursively) the pattern value.)
8000     */
8001    public OidType getPatternOidType() throws FHIRException { 
8002      if (this.pattern == null)
8003        this.pattern = new OidType();
8004      if (!(this.pattern instanceof OidType))
8005        throw new FHIRException("Type mismatch: the type OidType was expected, but "+this.pattern.getClass().getName()+" was encountered");
8006      return (OidType) this.pattern;
8007    }
8008
8009    public boolean hasPatternOidType() { 
8010      return this != null && this.pattern instanceof OidType;
8011    }
8012
8013    /**
8014     * @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.  
8015
8016When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8017
8018When 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.
8019
8020When 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.,
8021
80221. If primitive: it must match exactly the pattern value
80232. If a complex object: it must match (recursively) the pattern value
80243. If an array: it must match (recursively) the pattern value.)
8025     */
8026    public PositiveIntType getPatternPositiveIntType() throws FHIRException { 
8027      if (this.pattern == null)
8028        this.pattern = new PositiveIntType();
8029      if (!(this.pattern instanceof PositiveIntType))
8030        throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.pattern.getClass().getName()+" was encountered");
8031      return (PositiveIntType) this.pattern;
8032    }
8033
8034    public boolean hasPatternPositiveIntType() { 
8035      return this != null && this.pattern instanceof PositiveIntType;
8036    }
8037
8038    /**
8039     * @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.  
8040
8041When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8042
8043When 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.
8044
8045When 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.,
8046
80471. If primitive: it must match exactly the pattern value
80482. If a complex object: it must match (recursively) the pattern value
80493. If an array: it must match (recursively) the pattern value.)
8050     */
8051    public StringType getPatternStringType() throws FHIRException { 
8052      if (this.pattern == null)
8053        this.pattern = new StringType();
8054      if (!(this.pattern instanceof StringType))
8055        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.pattern.getClass().getName()+" was encountered");
8056      return (StringType) this.pattern;
8057    }
8058
8059    public boolean hasPatternStringType() { 
8060      return this != null && this.pattern instanceof StringType;
8061    }
8062
8063    /**
8064     * @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.  
8065
8066When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8067
8068When 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.
8069
8070When 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.,
8071
80721. If primitive: it must match exactly the pattern value
80732. If a complex object: it must match (recursively) the pattern value
80743. If an array: it must match (recursively) the pattern value.)
8075     */
8076    public TimeType getPatternTimeType() throws FHIRException { 
8077      if (this.pattern == null)
8078        this.pattern = new TimeType();
8079      if (!(this.pattern instanceof TimeType))
8080        throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.pattern.getClass().getName()+" was encountered");
8081      return (TimeType) this.pattern;
8082    }
8083
8084    public boolean hasPatternTimeType() { 
8085      return this != null && this.pattern instanceof TimeType;
8086    }
8087
8088    /**
8089     * @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.  
8090
8091When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8092
8093When 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.
8094
8095When 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.,
8096
80971. If primitive: it must match exactly the pattern value
80982. If a complex object: it must match (recursively) the pattern value
80993. If an array: it must match (recursively) the pattern value.)
8100     */
8101    public UnsignedIntType getPatternUnsignedIntType() throws FHIRException { 
8102      if (this.pattern == null)
8103        this.pattern = new UnsignedIntType();
8104      if (!(this.pattern instanceof UnsignedIntType))
8105        throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.pattern.getClass().getName()+" was encountered");
8106      return (UnsignedIntType) this.pattern;
8107    }
8108
8109    public boolean hasPatternUnsignedIntType() { 
8110      return this != null && this.pattern instanceof UnsignedIntType;
8111    }
8112
8113    /**
8114     * @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.  
8115
8116When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8117
8118When 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.
8119
8120When 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.,
8121
81221. If primitive: it must match exactly the pattern value
81232. If a complex object: it must match (recursively) the pattern value
81243. If an array: it must match (recursively) the pattern value.)
8125     */
8126    public UriType getPatternUriType() throws FHIRException { 
8127      if (this.pattern == null)
8128        this.pattern = new UriType();
8129      if (!(this.pattern instanceof UriType))
8130        throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.pattern.getClass().getName()+" was encountered");
8131      return (UriType) this.pattern;
8132    }
8133
8134    public boolean hasPatternUriType() { 
8135      return this != null && this.pattern instanceof UriType;
8136    }
8137
8138    /**
8139     * @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.  
8140
8141When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8142
8143When 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.
8144
8145When 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.,
8146
81471. If primitive: it must match exactly the pattern value
81482. If a complex object: it must match (recursively) the pattern value
81493. If an array: it must match (recursively) the pattern value.)
8150     */
8151    public UrlType getPatternUrlType() throws FHIRException { 
8152      if (this.pattern == null)
8153        this.pattern = new UrlType();
8154      if (!(this.pattern instanceof UrlType))
8155        throw new FHIRException("Type mismatch: the type UrlType was expected, but "+this.pattern.getClass().getName()+" was encountered");
8156      return (UrlType) this.pattern;
8157    }
8158
8159    public boolean hasPatternUrlType() { 
8160      return this != null && this.pattern instanceof UrlType;
8161    }
8162
8163    /**
8164     * @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.  
8165
8166When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8167
8168When 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.
8169
8170When 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.,
8171
81721. If primitive: it must match exactly the pattern value
81732. If a complex object: it must match (recursively) the pattern value
81743. If an array: it must match (recursively) the pattern value.)
8175     */
8176    public UuidType getPatternUuidType() throws FHIRException { 
8177      if (this.pattern == null)
8178        this.pattern = new UuidType();
8179      if (!(this.pattern instanceof UuidType))
8180        throw new FHIRException("Type mismatch: the type UuidType was expected, but "+this.pattern.getClass().getName()+" was encountered");
8181      return (UuidType) this.pattern;
8182    }
8183
8184    public boolean hasPatternUuidType() { 
8185      return this != null && this.pattern instanceof UuidType;
8186    }
8187
8188    /**
8189     * @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.  
8190
8191When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8192
8193When 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.
8194
8195When 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.,
8196
81971. If primitive: it must match exactly the pattern value
81982. If a complex object: it must match (recursively) the pattern value
81993. If an array: it must match (recursively) the pattern value.)
8200     */
8201    public Address getPatternAddress() throws FHIRException { 
8202      if (this.pattern == null)
8203        this.pattern = new Address();
8204      if (!(this.pattern instanceof Address))
8205        throw new FHIRException("Type mismatch: the type Address was expected, but "+this.pattern.getClass().getName()+" was encountered");
8206      return (Address) this.pattern;
8207    }
8208
8209    public boolean hasPatternAddress() { 
8210      return this != null && this.pattern instanceof Address;
8211    }
8212
8213    /**
8214     * @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.  
8215
8216When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8217
8218When 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.
8219
8220When 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.,
8221
82221. If primitive: it must match exactly the pattern value
82232. If a complex object: it must match (recursively) the pattern value
82243. If an array: it must match (recursively) the pattern value.)
8225     */
8226    public Age getPatternAge() throws FHIRException { 
8227      if (this.pattern == null)
8228        this.pattern = new Age();
8229      if (!(this.pattern instanceof Age))
8230        throw new FHIRException("Type mismatch: the type Age was expected, but "+this.pattern.getClass().getName()+" was encountered");
8231      return (Age) this.pattern;
8232    }
8233
8234    public boolean hasPatternAge() { 
8235      return this != null && this.pattern instanceof Age;
8236    }
8237
8238    /**
8239     * @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.  
8240
8241When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8242
8243When 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.
8244
8245When 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.,
8246
82471. If primitive: it must match exactly the pattern value
82482. If a complex object: it must match (recursively) the pattern value
82493. If an array: it must match (recursively) the pattern value.)
8250     */
8251    public Annotation getPatternAnnotation() throws FHIRException { 
8252      if (this.pattern == null)
8253        this.pattern = new Annotation();
8254      if (!(this.pattern instanceof Annotation))
8255        throw new FHIRException("Type mismatch: the type Annotation was expected, but "+this.pattern.getClass().getName()+" was encountered");
8256      return (Annotation) this.pattern;
8257    }
8258
8259    public boolean hasPatternAnnotation() { 
8260      return this != null && this.pattern instanceof Annotation;
8261    }
8262
8263    /**
8264     * @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.  
8265
8266When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8267
8268When 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.
8269
8270When 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.,
8271
82721. If primitive: it must match exactly the pattern value
82732. If a complex object: it must match (recursively) the pattern value
82743. If an array: it must match (recursively) the pattern value.)
8275     */
8276    public Attachment getPatternAttachment() throws FHIRException { 
8277      if (this.pattern == null)
8278        this.pattern = new Attachment();
8279      if (!(this.pattern instanceof Attachment))
8280        throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.pattern.getClass().getName()+" was encountered");
8281      return (Attachment) this.pattern;
8282    }
8283
8284    public boolean hasPatternAttachment() { 
8285      return this != null && this.pattern instanceof Attachment;
8286    }
8287
8288    /**
8289     * @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.  
8290
8291When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8292
8293When 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.
8294
8295When 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.,
8296
82971. If primitive: it must match exactly the pattern value
82982. If a complex object: it must match (recursively) the pattern value
82993. If an array: it must match (recursively) the pattern value.)
8300     */
8301    public CodeableConcept getPatternCodeableConcept() throws FHIRException { 
8302      if (this.pattern == null)
8303        this.pattern = new CodeableConcept();
8304      if (!(this.pattern instanceof CodeableConcept))
8305        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.pattern.getClass().getName()+" was encountered");
8306      return (CodeableConcept) this.pattern;
8307    }
8308
8309    public boolean hasPatternCodeableConcept() { 
8310      return this != null && this.pattern instanceof CodeableConcept;
8311    }
8312
8313    /**
8314     * @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.  
8315
8316When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8317
8318When 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.
8319
8320When 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.,
8321
83221. If primitive: it must match exactly the pattern value
83232. If a complex object: it must match (recursively) the pattern value
83243. If an array: it must match (recursively) the pattern value.)
8325     */
8326    public Coding getPatternCoding() throws FHIRException { 
8327      if (this.pattern == null)
8328        this.pattern = new Coding();
8329      if (!(this.pattern instanceof Coding))
8330        throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.pattern.getClass().getName()+" was encountered");
8331      return (Coding) this.pattern;
8332    }
8333
8334    public boolean hasPatternCoding() { 
8335      return this != null && this.pattern instanceof Coding;
8336    }
8337
8338    /**
8339     * @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.  
8340
8341When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8342
8343When 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.
8344
8345When 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.,
8346
83471. If primitive: it must match exactly the pattern value
83482. If a complex object: it must match (recursively) the pattern value
83493. If an array: it must match (recursively) the pattern value.)
8350     */
8351    public ContactPoint getPatternContactPoint() throws FHIRException { 
8352      if (this.pattern == null)
8353        this.pattern = new ContactPoint();
8354      if (!(this.pattern instanceof ContactPoint))
8355        throw new FHIRException("Type mismatch: the type ContactPoint was expected, but "+this.pattern.getClass().getName()+" was encountered");
8356      return (ContactPoint) this.pattern;
8357    }
8358
8359    public boolean hasPatternContactPoint() { 
8360      return this != null && this.pattern instanceof ContactPoint;
8361    }
8362
8363    /**
8364     * @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.  
8365
8366When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8367
8368When 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.
8369
8370When 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.,
8371
83721. If primitive: it must match exactly the pattern value
83732. If a complex object: it must match (recursively) the pattern value
83743. If an array: it must match (recursively) the pattern value.)
8375     */
8376    public Count getPatternCount() throws FHIRException { 
8377      if (this.pattern == null)
8378        this.pattern = new Count();
8379      if (!(this.pattern instanceof Count))
8380        throw new FHIRException("Type mismatch: the type Count was expected, but "+this.pattern.getClass().getName()+" was encountered");
8381      return (Count) this.pattern;
8382    }
8383
8384    public boolean hasPatternCount() { 
8385      return this != null && this.pattern instanceof Count;
8386    }
8387
8388    /**
8389     * @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.  
8390
8391When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8392
8393When 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.
8394
8395When 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.,
8396
83971. If primitive: it must match exactly the pattern value
83982. If a complex object: it must match (recursively) the pattern value
83993. If an array: it must match (recursively) the pattern value.)
8400     */
8401    public Distance getPatternDistance() throws FHIRException { 
8402      if (this.pattern == null)
8403        this.pattern = new Distance();
8404      if (!(this.pattern instanceof Distance))
8405        throw new FHIRException("Type mismatch: the type Distance was expected, but "+this.pattern.getClass().getName()+" was encountered");
8406      return (Distance) this.pattern;
8407    }
8408
8409    public boolean hasPatternDistance() { 
8410      return this != null && this.pattern instanceof Distance;
8411    }
8412
8413    /**
8414     * @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.  
8415
8416When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8417
8418When 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.
8419
8420When 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.,
8421
84221. If primitive: it must match exactly the pattern value
84232. If a complex object: it must match (recursively) the pattern value
84243. If an array: it must match (recursively) the pattern value.)
8425     */
8426    public Duration getPatternDuration() throws FHIRException { 
8427      if (this.pattern == null)
8428        this.pattern = new Duration();
8429      if (!(this.pattern instanceof Duration))
8430        throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.pattern.getClass().getName()+" was encountered");
8431      return (Duration) this.pattern;
8432    }
8433
8434    public boolean hasPatternDuration() { 
8435      return this != null && this.pattern instanceof Duration;
8436    }
8437
8438    /**
8439     * @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.  
8440
8441When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8442
8443When 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.
8444
8445When 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.,
8446
84471. If primitive: it must match exactly the pattern value
84482. If a complex object: it must match (recursively) the pattern value
84493. If an array: it must match (recursively) the pattern value.)
8450     */
8451    public HumanName getPatternHumanName() throws FHIRException { 
8452      if (this.pattern == null)
8453        this.pattern = new HumanName();
8454      if (!(this.pattern instanceof HumanName))
8455        throw new FHIRException("Type mismatch: the type HumanName was expected, but "+this.pattern.getClass().getName()+" was encountered");
8456      return (HumanName) this.pattern;
8457    }
8458
8459    public boolean hasPatternHumanName() { 
8460      return this != null && this.pattern instanceof HumanName;
8461    }
8462
8463    /**
8464     * @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.  
8465
8466When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8467
8468When 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.
8469
8470When 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.,
8471
84721. If primitive: it must match exactly the pattern value
84732. If a complex object: it must match (recursively) the pattern value
84743. If an array: it must match (recursively) the pattern value.)
8475     */
8476    public Identifier getPatternIdentifier() throws FHIRException { 
8477      if (this.pattern == null)
8478        this.pattern = new Identifier();
8479      if (!(this.pattern instanceof Identifier))
8480        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.pattern.getClass().getName()+" was encountered");
8481      return (Identifier) this.pattern;
8482    }
8483
8484    public boolean hasPatternIdentifier() { 
8485      return this != null && this.pattern instanceof Identifier;
8486    }
8487
8488    /**
8489     * @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.  
8490
8491When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8492
8493When 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.
8494
8495When 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.,
8496
84971. If primitive: it must match exactly the pattern value
84982. If a complex object: it must match (recursively) the pattern value
84993. If an array: it must match (recursively) the pattern value.)
8500     */
8501    public Money getPatternMoney() throws FHIRException { 
8502      if (this.pattern == null)
8503        this.pattern = new Money();
8504      if (!(this.pattern instanceof Money))
8505        throw new FHIRException("Type mismatch: the type Money was expected, but "+this.pattern.getClass().getName()+" was encountered");
8506      return (Money) this.pattern;
8507    }
8508
8509    public boolean hasPatternMoney() { 
8510      return this != null && this.pattern instanceof Money;
8511    }
8512
8513    /**
8514     * @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.  
8515
8516When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8517
8518When 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.
8519
8520When 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.,
8521
85221. If primitive: it must match exactly the pattern value
85232. If a complex object: it must match (recursively) the pattern value
85243. If an array: it must match (recursively) the pattern value.)
8525     */
8526    public Period getPatternPeriod() throws FHIRException { 
8527      if (this.pattern == null)
8528        this.pattern = new Period();
8529      if (!(this.pattern instanceof Period))
8530        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.pattern.getClass().getName()+" was encountered");
8531      return (Period) this.pattern;
8532    }
8533
8534    public boolean hasPatternPeriod() { 
8535      return this != null && this.pattern instanceof Period;
8536    }
8537
8538    /**
8539     * @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.  
8540
8541When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8542
8543When 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.
8544
8545When 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.,
8546
85471. If primitive: it must match exactly the pattern value
85482. If a complex object: it must match (recursively) the pattern value
85493. If an array: it must match (recursively) the pattern value.)
8550     */
8551    public Quantity getPatternQuantity() throws FHIRException { 
8552      if (this.pattern == null)
8553        this.pattern = new Quantity();
8554      if (!(this.pattern instanceof Quantity))
8555        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.pattern.getClass().getName()+" was encountered");
8556      return (Quantity) this.pattern;
8557    }
8558
8559    public boolean hasPatternQuantity() { 
8560      return this != null && this.pattern instanceof Quantity;
8561    }
8562
8563    /**
8564     * @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.  
8565
8566When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8567
8568When 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.
8569
8570When 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.,
8571
85721. If primitive: it must match exactly the pattern value
85732. If a complex object: it must match (recursively) the pattern value
85743. If an array: it must match (recursively) the pattern value.)
8575     */
8576    public Range getPatternRange() throws FHIRException { 
8577      if (this.pattern == null)
8578        this.pattern = new Range();
8579      if (!(this.pattern instanceof Range))
8580        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.pattern.getClass().getName()+" was encountered");
8581      return (Range) this.pattern;
8582    }
8583
8584    public boolean hasPatternRange() { 
8585      return this != null && this.pattern instanceof Range;
8586    }
8587
8588    /**
8589     * @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.  
8590
8591When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8592
8593When 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.
8594
8595When 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.,
8596
85971. If primitive: it must match exactly the pattern value
85982. If a complex object: it must match (recursively) the pattern value
85993. If an array: it must match (recursively) the pattern value.)
8600     */
8601    public Ratio getPatternRatio() throws FHIRException { 
8602      if (this.pattern == null)
8603        this.pattern = new Ratio();
8604      if (!(this.pattern instanceof Ratio))
8605        throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.pattern.getClass().getName()+" was encountered");
8606      return (Ratio) this.pattern;
8607    }
8608
8609    public boolean hasPatternRatio() { 
8610      return this != null && this.pattern instanceof Ratio;
8611    }
8612
8613    /**
8614     * @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.  
8615
8616When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8617
8618When 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.
8619
8620When 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.,
8621
86221. If primitive: it must match exactly the pattern value
86232. If a complex object: it must match (recursively) the pattern value
86243. If an array: it must match (recursively) the pattern value.)
8625     */
8626    public Reference getPatternReference() throws FHIRException { 
8627      if (this.pattern == null)
8628        this.pattern = new Reference();
8629      if (!(this.pattern instanceof Reference))
8630        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.pattern.getClass().getName()+" was encountered");
8631      return (Reference) this.pattern;
8632    }
8633
8634    public boolean hasPatternReference() { 
8635      return this != null && this.pattern instanceof Reference;
8636    }
8637
8638    /**
8639     * @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.  
8640
8641When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8642
8643When 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.
8644
8645When 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.,
8646
86471. If primitive: it must match exactly the pattern value
86482. If a complex object: it must match (recursively) the pattern value
86493. If an array: it must match (recursively) the pattern value.)
8650     */
8651    public SampledData getPatternSampledData() throws FHIRException { 
8652      if (this.pattern == null)
8653        this.pattern = new SampledData();
8654      if (!(this.pattern instanceof SampledData))
8655        throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.pattern.getClass().getName()+" was encountered");
8656      return (SampledData) this.pattern;
8657    }
8658
8659    public boolean hasPatternSampledData() { 
8660      return this != null && this.pattern instanceof SampledData;
8661    }
8662
8663    /**
8664     * @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.  
8665
8666When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8667
8668When 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.
8669
8670When 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.,
8671
86721. If primitive: it must match exactly the pattern value
86732. If a complex object: it must match (recursively) the pattern value
86743. If an array: it must match (recursively) the pattern value.)
8675     */
8676    public Signature getPatternSignature() throws FHIRException { 
8677      if (this.pattern == null)
8678        this.pattern = new Signature();
8679      if (!(this.pattern instanceof Signature))
8680        throw new FHIRException("Type mismatch: the type Signature was expected, but "+this.pattern.getClass().getName()+" was encountered");
8681      return (Signature) this.pattern;
8682    }
8683
8684    public boolean hasPatternSignature() { 
8685      return this != null && this.pattern instanceof Signature;
8686    }
8687
8688    /**
8689     * @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.  
8690
8691When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8692
8693When 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.
8694
8695When 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.,
8696
86971. If primitive: it must match exactly the pattern value
86982. If a complex object: it must match (recursively) the pattern value
86993. If an array: it must match (recursively) the pattern value.)
8700     */
8701    public Timing getPatternTiming() throws FHIRException { 
8702      if (this.pattern == null)
8703        this.pattern = new Timing();
8704      if (!(this.pattern instanceof Timing))
8705        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.pattern.getClass().getName()+" was encountered");
8706      return (Timing) this.pattern;
8707    }
8708
8709    public boolean hasPatternTiming() { 
8710      return this != null && this.pattern instanceof Timing;
8711    }
8712
8713    /**
8714     * @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.  
8715
8716When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8717
8718When 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.
8719
8720When 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.,
8721
87221. If primitive: it must match exactly the pattern value
87232. If a complex object: it must match (recursively) the pattern value
87243. If an array: it must match (recursively) the pattern value.)
8725     */
8726    public ContactDetail getPatternContactDetail() throws FHIRException { 
8727      if (this.pattern == null)
8728        this.pattern = new ContactDetail();
8729      if (!(this.pattern instanceof ContactDetail))
8730        throw new FHIRException("Type mismatch: the type ContactDetail was expected, but "+this.pattern.getClass().getName()+" was encountered");
8731      return (ContactDetail) this.pattern;
8732    }
8733
8734    public boolean hasPatternContactDetail() { 
8735      return this != null && this.pattern instanceof ContactDetail;
8736    }
8737
8738    /**
8739     * @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.  
8740
8741When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8742
8743When 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.
8744
8745When 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.,
8746
87471. If primitive: it must match exactly the pattern value
87482. If a complex object: it must match (recursively) the pattern value
87493. If an array: it must match (recursively) the pattern value.)
8750     */
8751    public Contributor getPatternContributor() throws FHIRException { 
8752      if (this.pattern == null)
8753        this.pattern = new Contributor();
8754      if (!(this.pattern instanceof Contributor))
8755        throw new FHIRException("Type mismatch: the type Contributor was expected, but "+this.pattern.getClass().getName()+" was encountered");
8756      return (Contributor) this.pattern;
8757    }
8758
8759    public boolean hasPatternContributor() { 
8760      return this != null && this.pattern instanceof Contributor;
8761    }
8762
8763    /**
8764     * @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.  
8765
8766When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8767
8768When 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.
8769
8770When 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.,
8771
87721. If primitive: it must match exactly the pattern value
87732. If a complex object: it must match (recursively) the pattern value
87743. If an array: it must match (recursively) the pattern value.)
8775     */
8776    public DataRequirement getPatternDataRequirement() throws FHIRException { 
8777      if (this.pattern == null)
8778        this.pattern = new DataRequirement();
8779      if (!(this.pattern instanceof DataRequirement))
8780        throw new FHIRException("Type mismatch: the type DataRequirement was expected, but "+this.pattern.getClass().getName()+" was encountered");
8781      return (DataRequirement) this.pattern;
8782    }
8783
8784    public boolean hasPatternDataRequirement() { 
8785      return this != null && this.pattern instanceof DataRequirement;
8786    }
8787
8788    /**
8789     * @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.  
8790
8791When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8792
8793When 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.
8794
8795When 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.,
8796
87971. If primitive: it must match exactly the pattern value
87982. If a complex object: it must match (recursively) the pattern value
87993. If an array: it must match (recursively) the pattern value.)
8800     */
8801    public Expression getPatternExpression() throws FHIRException { 
8802      if (this.pattern == null)
8803        this.pattern = new Expression();
8804      if (!(this.pattern instanceof Expression))
8805        throw new FHIRException("Type mismatch: the type Expression was expected, but "+this.pattern.getClass().getName()+" was encountered");
8806      return (Expression) this.pattern;
8807    }
8808
8809    public boolean hasPatternExpression() { 
8810      return this != null && this.pattern instanceof Expression;
8811    }
8812
8813    /**
8814     * @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.  
8815
8816When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8817
8818When 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.
8819
8820When 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.,
8821
88221. If primitive: it must match exactly the pattern value
88232. If a complex object: it must match (recursively) the pattern value
88243. If an array: it must match (recursively) the pattern value.)
8825     */
8826    public ParameterDefinition getPatternParameterDefinition() throws FHIRException { 
8827      if (this.pattern == null)
8828        this.pattern = new ParameterDefinition();
8829      if (!(this.pattern instanceof ParameterDefinition))
8830        throw new FHIRException("Type mismatch: the type ParameterDefinition was expected, but "+this.pattern.getClass().getName()+" was encountered");
8831      return (ParameterDefinition) this.pattern;
8832    }
8833
8834    public boolean hasPatternParameterDefinition() { 
8835      return this != null && this.pattern instanceof ParameterDefinition;
8836    }
8837
8838    /**
8839     * @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.  
8840
8841When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8842
8843When 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.
8844
8845When 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.,
8846
88471. If primitive: it must match exactly the pattern value
88482. If a complex object: it must match (recursively) the pattern value
88493. If an array: it must match (recursively) the pattern value.)
8850     */
8851    public RelatedArtifact getPatternRelatedArtifact() throws FHIRException { 
8852      if (this.pattern == null)
8853        this.pattern = new RelatedArtifact();
8854      if (!(this.pattern instanceof RelatedArtifact))
8855        throw new FHIRException("Type mismatch: the type RelatedArtifact was expected, but "+this.pattern.getClass().getName()+" was encountered");
8856      return (RelatedArtifact) this.pattern;
8857    }
8858
8859    public boolean hasPatternRelatedArtifact() { 
8860      return this != null && this.pattern instanceof RelatedArtifact;
8861    }
8862
8863    /**
8864     * @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.  
8865
8866When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8867
8868When 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.
8869
8870When 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.,
8871
88721. If primitive: it must match exactly the pattern value
88732. If a complex object: it must match (recursively) the pattern value
88743. If an array: it must match (recursively) the pattern value.)
8875     */
8876    public TriggerDefinition getPatternTriggerDefinition() throws FHIRException { 
8877      if (this.pattern == null)
8878        this.pattern = new TriggerDefinition();
8879      if (!(this.pattern instanceof TriggerDefinition))
8880        throw new FHIRException("Type mismatch: the type TriggerDefinition was expected, but "+this.pattern.getClass().getName()+" was encountered");
8881      return (TriggerDefinition) this.pattern;
8882    }
8883
8884    public boolean hasPatternTriggerDefinition() { 
8885      return this != null && this.pattern instanceof TriggerDefinition;
8886    }
8887
8888    /**
8889     * @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.  
8890
8891When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8892
8893When 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.
8894
8895When 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.,
8896
88971. If primitive: it must match exactly the pattern value
88982. If a complex object: it must match (recursively) the pattern value
88993. If an array: it must match (recursively) the pattern value.)
8900     */
8901    public UsageContext getPatternUsageContext() throws FHIRException { 
8902      if (this.pattern == null)
8903        this.pattern = new UsageContext();
8904      if (!(this.pattern instanceof UsageContext))
8905        throw new FHIRException("Type mismatch: the type UsageContext was expected, but "+this.pattern.getClass().getName()+" was encountered");
8906      return (UsageContext) this.pattern;
8907    }
8908
8909    public boolean hasPatternUsageContext() { 
8910      return this != null && this.pattern instanceof UsageContext;
8911    }
8912
8913    /**
8914     * @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.  
8915
8916When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8917
8918When 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.
8919
8920When 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.,
8921
89221. If primitive: it must match exactly the pattern value
89232. If a complex object: it must match (recursively) the pattern value
89243. If an array: it must match (recursively) the pattern value.)
8925     */
8926    public Dosage getPatternDosage() throws FHIRException { 
8927      if (this.pattern == null)
8928        this.pattern = new Dosage();
8929      if (!(this.pattern instanceof Dosage))
8930        throw new FHIRException("Type mismatch: the type Dosage was expected, but "+this.pattern.getClass().getName()+" was encountered");
8931      return (Dosage) this.pattern;
8932    }
8933
8934    public boolean hasPatternDosage() { 
8935      return this != null && this.pattern instanceof Dosage;
8936    }
8937
8938    /**
8939     * @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.  
8940
8941When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8942
8943When 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.
8944
8945When 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.,
8946
89471. If primitive: it must match exactly the pattern value
89482. If a complex object: it must match (recursively) the pattern value
89493. If an array: it must match (recursively) the pattern value.)
8950     */
8951    public Meta getPatternMeta() throws FHIRException { 
8952      if (this.pattern == null)
8953        this.pattern = new Meta();
8954      if (!(this.pattern instanceof Meta))
8955        throw new FHIRException("Type mismatch: the type Meta was expected, but "+this.pattern.getClass().getName()+" was encountered");
8956      return (Meta) this.pattern;
8957    }
8958
8959    public boolean hasPatternMeta() { 
8960      return this != null && this.pattern instanceof Meta;
8961    }
8962
8963    public boolean hasPattern() { 
8964      return this.pattern != null && !this.pattern.isEmpty();
8965    }
8966
8967    /**
8968     * @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.  
8969
8970When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.
8971
8972When 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.
8973
8974When 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.,
8975
89761. If primitive: it must match exactly the pattern value
89772. If a complex object: it must match (recursively) the pattern value
89783. If an array: it must match (recursively) the pattern value.)
8979     */
8980    public ElementDefinition setPattern(DataType value) { 
8981      if (value != null && !(value instanceof Base64BinaryType || value instanceof BooleanType || value instanceof CanonicalType || value instanceof CodeType || value instanceof DateType || value instanceof DateTimeType || value instanceof DecimalType || value instanceof IdType || value instanceof InstantType || value instanceof IntegerType || value instanceof Integer64Type || value instanceof MarkdownType || value instanceof OidType || value instanceof PositiveIntType || value instanceof StringType || value instanceof TimeType || value instanceof UnsignedIntType || value instanceof UriType || value instanceof UrlType || value instanceof UuidType || value instanceof Address || value instanceof Age || value instanceof Annotation || value instanceof Attachment || value instanceof CodeableConcept || value instanceof Coding || value instanceof ContactPoint || value instanceof Count || value instanceof Distance || value instanceof Duration || value instanceof HumanName || value instanceof Identifier || value instanceof Money || value instanceof Period || value instanceof Quantity || value instanceof Range || value instanceof Ratio || value instanceof Reference || value instanceof SampledData || value instanceof Signature || value instanceof Timing || value instanceof ContactDetail || value instanceof Contributor || value instanceof DataRequirement || value instanceof Expression || value instanceof ParameterDefinition || value instanceof RelatedArtifact || value instanceof TriggerDefinition || value instanceof UsageContext || value instanceof Dosage || value instanceof Meta))
8982        throw new Error("Not the right type for ElementDefinition.pattern[x]: "+value.fhirType());
8983      this.pattern = value;
8984      return this;
8985    }
8986
8987    /**
8988     * @return {@link #example} (A sample value for this element demonstrating the type of information that would typically be found in the element.)
8989     */
8990    public List<ElementDefinitionExampleComponent> getExample() { 
8991      if (this.example == null)
8992        this.example = new ArrayList<ElementDefinitionExampleComponent>();
8993      return this.example;
8994    }
8995
8996    /**
8997     * @return Returns a reference to <code>this</code> for easy method chaining
8998     */
8999    public ElementDefinition setExample(List<ElementDefinitionExampleComponent> theExample) { 
9000      this.example = theExample;
9001      return this;
9002    }
9003
9004    public boolean hasExample() { 
9005      if (this.example == null)
9006        return false;
9007      for (ElementDefinitionExampleComponent item : this.example)
9008        if (!item.isEmpty())
9009          return true;
9010      return false;
9011    }
9012
9013    public ElementDefinitionExampleComponent addExample() { //3
9014      ElementDefinitionExampleComponent t = new ElementDefinitionExampleComponent();
9015      if (this.example == null)
9016        this.example = new ArrayList<ElementDefinitionExampleComponent>();
9017      this.example.add(t);
9018      return t;
9019    }
9020
9021    public ElementDefinition addExample(ElementDefinitionExampleComponent t) { //3
9022      if (t == null)
9023        return this;
9024      if (this.example == null)
9025        this.example = new ArrayList<ElementDefinitionExampleComponent>();
9026      this.example.add(t);
9027      return this;
9028    }
9029
9030    /**
9031     * @return The first repetition of repeating field {@link #example}, creating it if it does not already exist {3}
9032     */
9033    public ElementDefinitionExampleComponent getExampleFirstRep() { 
9034      if (getExample().isEmpty()) {
9035        addExample();
9036      }
9037      return getExample().get(0);
9038    }
9039
9040    /**
9041     * @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.)
9042     */
9043    public DataType getMinValue() { 
9044      return this.minValue;
9045    }
9046
9047    /**
9048     * @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.)
9049     */
9050    public DateType getMinValueDateType() throws FHIRException { 
9051      if (this.minValue == null)
9052        this.minValue = new DateType();
9053      if (!(this.minValue instanceof DateType))
9054        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.minValue.getClass().getName()+" was encountered");
9055      return (DateType) this.minValue;
9056    }
9057
9058    public boolean hasMinValueDateType() { 
9059      return this != null && this.minValue instanceof DateType;
9060    }
9061
9062    /**
9063     * @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.)
9064     */
9065    public DateTimeType getMinValueDateTimeType() throws FHIRException { 
9066      if (this.minValue == null)
9067        this.minValue = new DateTimeType();
9068      if (!(this.minValue instanceof DateTimeType))
9069        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.minValue.getClass().getName()+" was encountered");
9070      return (DateTimeType) this.minValue;
9071    }
9072
9073    public boolean hasMinValueDateTimeType() { 
9074      return this != null && this.minValue instanceof DateTimeType;
9075    }
9076
9077    /**
9078     * @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.)
9079     */
9080    public InstantType getMinValueInstantType() throws FHIRException { 
9081      if (this.minValue == null)
9082        this.minValue = new InstantType();
9083      if (!(this.minValue instanceof InstantType))
9084        throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.minValue.getClass().getName()+" was encountered");
9085      return (InstantType) this.minValue;
9086    }
9087
9088    public boolean hasMinValueInstantType() { 
9089      return this != null && this.minValue instanceof InstantType;
9090    }
9091
9092    /**
9093     * @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.)
9094     */
9095    public TimeType getMinValueTimeType() throws FHIRException { 
9096      if (this.minValue == null)
9097        this.minValue = new TimeType();
9098      if (!(this.minValue instanceof TimeType))
9099        throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.minValue.getClass().getName()+" was encountered");
9100      return (TimeType) this.minValue;
9101    }
9102
9103    public boolean hasMinValueTimeType() { 
9104      return this != null && this.minValue instanceof TimeType;
9105    }
9106
9107    /**
9108     * @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.)
9109     */
9110    public DecimalType getMinValueDecimalType() throws FHIRException { 
9111      if (this.minValue == null)
9112        this.minValue = new DecimalType();
9113      if (!(this.minValue instanceof DecimalType))
9114        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.minValue.getClass().getName()+" was encountered");
9115      return (DecimalType) this.minValue;
9116    }
9117
9118    public boolean hasMinValueDecimalType() { 
9119      return this != null && this.minValue instanceof DecimalType;
9120    }
9121
9122    /**
9123     * @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.)
9124     */
9125    public IntegerType getMinValueIntegerType() throws FHIRException { 
9126      if (this.minValue == null)
9127        this.minValue = new IntegerType();
9128      if (!(this.minValue instanceof IntegerType))
9129        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.minValue.getClass().getName()+" was encountered");
9130      return (IntegerType) this.minValue;
9131    }
9132
9133    public boolean hasMinValueIntegerType() { 
9134      return this != null && this.minValue instanceof IntegerType;
9135    }
9136
9137    /**
9138     * @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.)
9139     */
9140    public Integer64Type getMinValueInteger64Type() throws FHIRException { 
9141      if (this.minValue == null)
9142        this.minValue = new Integer64Type();
9143      if (!(this.minValue instanceof Integer64Type))
9144        throw new FHIRException("Type mismatch: the type Integer64Type was expected, but "+this.minValue.getClass().getName()+" was encountered");
9145      return (Integer64Type) this.minValue;
9146    }
9147
9148    public boolean hasMinValueInteger64Type() { 
9149      return this != null && this.minValue instanceof Integer64Type;
9150    }
9151
9152    /**
9153     * @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.)
9154     */
9155    public PositiveIntType getMinValuePositiveIntType() throws FHIRException { 
9156      if (this.minValue == null)
9157        this.minValue = new PositiveIntType();
9158      if (!(this.minValue instanceof PositiveIntType))
9159        throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.minValue.getClass().getName()+" was encountered");
9160      return (PositiveIntType) this.minValue;
9161    }
9162
9163    public boolean hasMinValuePositiveIntType() { 
9164      return this != null && this.minValue instanceof PositiveIntType;
9165    }
9166
9167    /**
9168     * @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.)
9169     */
9170    public UnsignedIntType getMinValueUnsignedIntType() throws FHIRException { 
9171      if (this.minValue == null)
9172        this.minValue = new UnsignedIntType();
9173      if (!(this.minValue instanceof UnsignedIntType))
9174        throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.minValue.getClass().getName()+" was encountered");
9175      return (UnsignedIntType) this.minValue;
9176    }
9177
9178    public boolean hasMinValueUnsignedIntType() { 
9179      return this != null && this.minValue instanceof UnsignedIntType;
9180    }
9181
9182    /**
9183     * @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.)
9184     */
9185    public Quantity getMinValueQuantity() throws FHIRException { 
9186      if (this.minValue == null)
9187        this.minValue = new Quantity();
9188      if (!(this.minValue instanceof Quantity))
9189        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.minValue.getClass().getName()+" was encountered");
9190      return (Quantity) this.minValue;
9191    }
9192
9193    public boolean hasMinValueQuantity() { 
9194      return this != null && this.minValue instanceof Quantity;
9195    }
9196
9197    public boolean hasMinValue() { 
9198      return this.minValue != null && !this.minValue.isEmpty();
9199    }
9200
9201    /**
9202     * @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.)
9203     */
9204    public ElementDefinition setMinValue(DataType value) { 
9205      if (value != null && !(value instanceof DateType || value instanceof DateTimeType || value instanceof InstantType || value instanceof TimeType || value instanceof DecimalType || value instanceof IntegerType || value instanceof Integer64Type || value instanceof PositiveIntType || value instanceof UnsignedIntType || value instanceof Quantity))
9206        throw new Error("Not the right type for ElementDefinition.minValue[x]: "+value.fhirType());
9207      this.minValue = value;
9208      return this;
9209    }
9210
9211    /**
9212     * @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.)
9213     */
9214    public DataType getMaxValue() { 
9215      return this.maxValue;
9216    }
9217
9218    /**
9219     * @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.)
9220     */
9221    public DateType getMaxValueDateType() throws FHIRException { 
9222      if (this.maxValue == null)
9223        this.maxValue = new DateType();
9224      if (!(this.maxValue instanceof DateType))
9225        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
9226      return (DateType) this.maxValue;
9227    }
9228
9229    public boolean hasMaxValueDateType() { 
9230      return this != null && this.maxValue instanceof DateType;
9231    }
9232
9233    /**
9234     * @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.)
9235     */
9236    public DateTimeType getMaxValueDateTimeType() throws FHIRException { 
9237      if (this.maxValue == null)
9238        this.maxValue = new DateTimeType();
9239      if (!(this.maxValue instanceof DateTimeType))
9240        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
9241      return (DateTimeType) this.maxValue;
9242    }
9243
9244    public boolean hasMaxValueDateTimeType() { 
9245      return this != null && this.maxValue instanceof DateTimeType;
9246    }
9247
9248    /**
9249     * @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.)
9250     */
9251    public InstantType getMaxValueInstantType() throws FHIRException { 
9252      if (this.maxValue == null)
9253        this.maxValue = new InstantType();
9254      if (!(this.maxValue instanceof InstantType))
9255        throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
9256      return (InstantType) this.maxValue;
9257    }
9258
9259    public boolean hasMaxValueInstantType() { 
9260      return this != null && this.maxValue instanceof InstantType;
9261    }
9262
9263    /**
9264     * @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.)
9265     */
9266    public TimeType getMaxValueTimeType() throws FHIRException { 
9267      if (this.maxValue == null)
9268        this.maxValue = new TimeType();
9269      if (!(this.maxValue instanceof TimeType))
9270        throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
9271      return (TimeType) this.maxValue;
9272    }
9273
9274    public boolean hasMaxValueTimeType() { 
9275      return this != null && this.maxValue instanceof TimeType;
9276    }
9277
9278    /**
9279     * @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.)
9280     */
9281    public DecimalType getMaxValueDecimalType() throws FHIRException { 
9282      if (this.maxValue == null)
9283        this.maxValue = new DecimalType();
9284      if (!(this.maxValue instanceof DecimalType))
9285        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
9286      return (DecimalType) this.maxValue;
9287    }
9288
9289    public boolean hasMaxValueDecimalType() { 
9290      return this != null && this.maxValue instanceof DecimalType;
9291    }
9292
9293    /**
9294     * @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.)
9295     */
9296    public IntegerType getMaxValueIntegerType() throws FHIRException { 
9297      if (this.maxValue == null)
9298        this.maxValue = new IntegerType();
9299      if (!(this.maxValue instanceof IntegerType))
9300        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
9301      return (IntegerType) this.maxValue;
9302    }
9303
9304    public boolean hasMaxValueIntegerType() { 
9305      return this != null && this.maxValue instanceof IntegerType;
9306    }
9307
9308    /**
9309     * @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.)
9310     */
9311    public Integer64Type getMaxValueInteger64Type() throws FHIRException { 
9312      if (this.maxValue == null)
9313        this.maxValue = new Integer64Type();
9314      if (!(this.maxValue instanceof Integer64Type))
9315        throw new FHIRException("Type mismatch: the type Integer64Type was expected, but "+this.maxValue.getClass().getName()+" was encountered");
9316      return (Integer64Type) this.maxValue;
9317    }
9318
9319    public boolean hasMaxValueInteger64Type() { 
9320      return this != null && this.maxValue instanceof Integer64Type;
9321    }
9322
9323    /**
9324     * @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.)
9325     */
9326    public PositiveIntType getMaxValuePositiveIntType() throws FHIRException { 
9327      if (this.maxValue == null)
9328        this.maxValue = new PositiveIntType();
9329      if (!(this.maxValue instanceof PositiveIntType))
9330        throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
9331      return (PositiveIntType) this.maxValue;
9332    }
9333
9334    public boolean hasMaxValuePositiveIntType() { 
9335      return this != null && this.maxValue instanceof PositiveIntType;
9336    }
9337
9338    /**
9339     * @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.)
9340     */
9341    public UnsignedIntType getMaxValueUnsignedIntType() throws FHIRException { 
9342      if (this.maxValue == null)
9343        this.maxValue = new UnsignedIntType();
9344      if (!(this.maxValue instanceof UnsignedIntType))
9345        throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.maxValue.getClass().getName()+" was encountered");
9346      return (UnsignedIntType) this.maxValue;
9347    }
9348
9349    public boolean hasMaxValueUnsignedIntType() { 
9350      return this != null && this.maxValue instanceof UnsignedIntType;
9351    }
9352
9353    /**
9354     * @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.)
9355     */
9356    public Quantity getMaxValueQuantity() throws FHIRException { 
9357      if (this.maxValue == null)
9358        this.maxValue = new Quantity();
9359      if (!(this.maxValue instanceof Quantity))
9360        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.maxValue.getClass().getName()+" was encountered");
9361      return (Quantity) this.maxValue;
9362    }
9363
9364    public boolean hasMaxValueQuantity() { 
9365      return this != null && this.maxValue instanceof Quantity;
9366    }
9367
9368    public boolean hasMaxValue() { 
9369      return this.maxValue != null && !this.maxValue.isEmpty();
9370    }
9371
9372    /**
9373     * @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.)
9374     */
9375    public ElementDefinition setMaxValue(DataType value) { 
9376      if (value != null && !(value instanceof DateType || value instanceof DateTimeType || value instanceof InstantType || value instanceof TimeType || value instanceof DecimalType || value instanceof IntegerType || value instanceof Integer64Type || value instanceof PositiveIntType || value instanceof UnsignedIntType || value instanceof Quantity))
9377        throw new Error("Not the right type for ElementDefinition.maxValue[x]: "+value.fhirType());
9378      this.maxValue = value;
9379      return this;
9380    }
9381
9382    /**
9383     * @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
9384     */
9385    public IntegerType getMaxLengthElement() { 
9386      if (this.maxLength == null)
9387        if (Configuration.errorOnAutoCreate())
9388          throw new Error("Attempt to auto-create ElementDefinition.maxLength");
9389        else if (Configuration.doAutoCreate())
9390          this.maxLength = new IntegerType(); // bb
9391      return this.maxLength;
9392    }
9393
9394    public boolean hasMaxLengthElement() { 
9395      return this.maxLength != null && !this.maxLength.isEmpty();
9396    }
9397
9398    public boolean hasMaxLength() { 
9399      return this.maxLength != null && !this.maxLength.isEmpty();
9400    }
9401
9402    /**
9403     * @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
9404     */
9405    public ElementDefinition setMaxLengthElement(IntegerType value) { 
9406      this.maxLength = value;
9407      return this;
9408    }
9409
9410    /**
9411     * @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.
9412     */
9413    public int getMaxLength() { 
9414      return this.maxLength == null || this.maxLength.isEmpty() ? 0 : this.maxLength.getValue();
9415    }
9416
9417    /**
9418     * @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.
9419     */
9420    public ElementDefinition setMaxLength(int value) { 
9421        if (this.maxLength == null)
9422          this.maxLength = new IntegerType();
9423        this.maxLength.setValue(value);
9424      return this;
9425    }
9426
9427    /**
9428     * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
9429     */
9430    public List<IdType> getCondition() { 
9431      if (this.condition == null)
9432        this.condition = new ArrayList<IdType>();
9433      return this.condition;
9434    }
9435
9436    /**
9437     * @return Returns a reference to <code>this</code> for easy method chaining
9438     */
9439    public ElementDefinition setCondition(List<IdType> theCondition) { 
9440      this.condition = theCondition;
9441      return this;
9442    }
9443
9444    public boolean hasCondition() { 
9445      if (this.condition == null)
9446        return false;
9447      for (IdType item : this.condition)
9448        if (!item.isEmpty())
9449          return true;
9450      return false;
9451    }
9452
9453    /**
9454     * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
9455     */
9456    public IdType addConditionElement() {//2 
9457      IdType t = new IdType();
9458      if (this.condition == null)
9459        this.condition = new ArrayList<IdType>();
9460      this.condition.add(t);
9461      return t;
9462    }
9463
9464    /**
9465     * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
9466     */
9467    public ElementDefinition addCondition(String value) { //1
9468      IdType t = new IdType();
9469      t.setValue(value);
9470      if (this.condition == null)
9471        this.condition = new ArrayList<IdType>();
9472      this.condition.add(t);
9473      return this;
9474    }
9475
9476    /**
9477     * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.)
9478     */
9479    public boolean hasCondition(String value) { 
9480      if (this.condition == null)
9481        return false;
9482      for (IdType v : this.condition)
9483        if (v.getValue().equals(value)) // id
9484          return true;
9485      return false;
9486    }
9487
9488    /**
9489     * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.)
9490     */
9491    public List<ElementDefinitionConstraintComponent> getConstraint() { 
9492      if (this.constraint == null)
9493        this.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
9494      return this.constraint;
9495    }
9496
9497    /**
9498     * @return Returns a reference to <code>this</code> for easy method chaining
9499     */
9500    public ElementDefinition setConstraint(List<ElementDefinitionConstraintComponent> theConstraint) { 
9501      this.constraint = theConstraint;
9502      return this;
9503    }
9504
9505    public boolean hasConstraint() { 
9506      if (this.constraint == null)
9507        return false;
9508      for (ElementDefinitionConstraintComponent item : this.constraint)
9509        if (!item.isEmpty())
9510          return true;
9511      return false;
9512    }
9513
9514    public ElementDefinitionConstraintComponent addConstraint() { //3
9515      ElementDefinitionConstraintComponent t = new ElementDefinitionConstraintComponent();
9516      if (this.constraint == null)
9517        this.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
9518      this.constraint.add(t);
9519      return t;
9520    }
9521
9522    public ElementDefinition addConstraint(ElementDefinitionConstraintComponent t) { //3
9523      if (t == null)
9524        return this;
9525      if (this.constraint == null)
9526        this.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
9527      this.constraint.add(t);
9528      return this;
9529    }
9530
9531    /**
9532     * @return The first repetition of repeating field {@link #constraint}, creating it if it does not already exist {3}
9533     */
9534    public ElementDefinitionConstraintComponent getConstraintFirstRep() { 
9535      if (getConstraint().isEmpty()) {
9536        addConstraint();
9537      }
9538      return getConstraint().get(0);
9539    }
9540
9541    /**
9542     * @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
9543     */
9544    public BooleanType getMustSupportElement() { 
9545      if (this.mustSupport == null)
9546        if (Configuration.errorOnAutoCreate())
9547          throw new Error("Attempt to auto-create ElementDefinition.mustSupport");
9548        else if (Configuration.doAutoCreate())
9549          this.mustSupport = new BooleanType(); // bb
9550      return this.mustSupport;
9551    }
9552
9553    public boolean hasMustSupportElement() { 
9554      return this.mustSupport != null && !this.mustSupport.isEmpty();
9555    }
9556
9557    public boolean hasMustSupport() { 
9558      return this.mustSupport != null && !this.mustSupport.isEmpty();
9559    }
9560
9561    /**
9562     * @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
9563     */
9564    public ElementDefinition setMustSupportElement(BooleanType value) { 
9565      this.mustSupport = value;
9566      return this;
9567    }
9568
9569    /**
9570     * @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.
9571     */
9572    public boolean getMustSupport() { 
9573      return this.mustSupport == null || this.mustSupport.isEmpty() ? false : this.mustSupport.getValue();
9574    }
9575
9576    /**
9577     * @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.
9578     */
9579    public ElementDefinition setMustSupport(boolean value) { 
9580        if (this.mustSupport == null)
9581          this.mustSupport = new BooleanType();
9582        this.mustSupport.setValue(value);
9583      return this;
9584    }
9585
9586    /**
9587     * @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
9588     */
9589    public BooleanType getIsModifierElement() { 
9590      if (this.isModifier == null)
9591        if (Configuration.errorOnAutoCreate())
9592          throw new Error("Attempt to auto-create ElementDefinition.isModifier");
9593        else if (Configuration.doAutoCreate())
9594          this.isModifier = new BooleanType(); // bb
9595      return this.isModifier;
9596    }
9597
9598    public boolean hasIsModifierElement() { 
9599      return this.isModifier != null && !this.isModifier.isEmpty();
9600    }
9601
9602    public boolean hasIsModifier() { 
9603      return this.isModifier != null && !this.isModifier.isEmpty();
9604    }
9605
9606    /**
9607     * @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
9608     */
9609    public ElementDefinition setIsModifierElement(BooleanType value) { 
9610      this.isModifier = value;
9611      return this;
9612    }
9613
9614    /**
9615     * @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.
9616     */
9617    public boolean getIsModifier() { 
9618      return this.isModifier == null || this.isModifier.isEmpty() ? false : this.isModifier.getValue();
9619    }
9620
9621    /**
9622     * @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.
9623     */
9624    public ElementDefinition setIsModifier(boolean value) { 
9625        if (this.isModifier == null)
9626          this.isModifier = new BooleanType();
9627        this.isModifier.setValue(value);
9628      return this;
9629    }
9630
9631    /**
9632     * @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
9633     */
9634    public StringType getIsModifierReasonElement() { 
9635      if (this.isModifierReason == null)
9636        if (Configuration.errorOnAutoCreate())
9637          throw new Error("Attempt to auto-create ElementDefinition.isModifierReason");
9638        else if (Configuration.doAutoCreate())
9639          this.isModifierReason = new StringType(); // bb
9640      return this.isModifierReason;
9641    }
9642
9643    public boolean hasIsModifierReasonElement() { 
9644      return this.isModifierReason != null && !this.isModifierReason.isEmpty();
9645    }
9646
9647    public boolean hasIsModifierReason() { 
9648      return this.isModifierReason != null && !this.isModifierReason.isEmpty();
9649    }
9650
9651    /**
9652     * @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
9653     */
9654    public ElementDefinition setIsModifierReasonElement(StringType value) { 
9655      this.isModifierReason = value;
9656      return this;
9657    }
9658
9659    /**
9660     * @return Explains how that element affects the interpretation of the resource or element that contains it.
9661     */
9662    public String getIsModifierReason() { 
9663      return this.isModifierReason == null ? null : this.isModifierReason.getValue();
9664    }
9665
9666    /**
9667     * @param value Explains how that element affects the interpretation of the resource or element that contains it.
9668     */
9669    public ElementDefinition setIsModifierReason(String value) { 
9670      if (Utilities.noString(value))
9671        this.isModifierReason = null;
9672      else {
9673        if (this.isModifierReason == null)
9674          this.isModifierReason = new StringType();
9675        this.isModifierReason.setValue(value);
9676      }
9677      return this;
9678    }
9679
9680    /**
9681     * @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
9682     */
9683    public BooleanType getIsSummaryElement() { 
9684      if (this.isSummary == null)
9685        if (Configuration.errorOnAutoCreate())
9686          throw new Error("Attempt to auto-create ElementDefinition.isSummary");
9687        else if (Configuration.doAutoCreate())
9688          this.isSummary = new BooleanType(); // bb
9689      return this.isSummary;
9690    }
9691
9692    public boolean hasIsSummaryElement() { 
9693      return this.isSummary != null && !this.isSummary.isEmpty();
9694    }
9695
9696    public boolean hasIsSummary() { 
9697      return this.isSummary != null && !this.isSummary.isEmpty();
9698    }
9699
9700    /**
9701     * @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
9702     */
9703    public ElementDefinition setIsSummaryElement(BooleanType value) { 
9704      this.isSummary = value;
9705      return this;
9706    }
9707
9708    /**
9709     * @return Whether the element should be included if a client requests a search with the parameter _summary=true.
9710     */
9711    public boolean getIsSummary() { 
9712      return this.isSummary == null || this.isSummary.isEmpty() ? false : this.isSummary.getValue();
9713    }
9714
9715    /**
9716     * @param value Whether the element should be included if a client requests a search with the parameter _summary=true.
9717     */
9718    public ElementDefinition setIsSummary(boolean value) { 
9719        if (this.isSummary == null)
9720          this.isSummary = new BooleanType();
9721        this.isSummary.setValue(value);
9722      return this;
9723    }
9724
9725    /**
9726     * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).)
9727     */
9728    public ElementDefinitionBindingComponent getBinding() { 
9729      if (this.binding == null)
9730        if (Configuration.errorOnAutoCreate())
9731          throw new Error("Attempt to auto-create ElementDefinition.binding");
9732        else if (Configuration.doAutoCreate())
9733          this.binding = new ElementDefinitionBindingComponent(); // cc
9734      return this.binding;
9735    }
9736
9737    public boolean hasBinding() { 
9738      return this.binding != null && !this.binding.isEmpty();
9739    }
9740
9741    /**
9742     * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).)
9743     */
9744    public ElementDefinition setBinding(ElementDefinitionBindingComponent value) { 
9745      this.binding = value;
9746      return this;
9747    }
9748
9749    /**
9750     * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.)
9751     */
9752    public List<ElementDefinitionMappingComponent> getMapping() { 
9753      if (this.mapping == null)
9754        this.mapping = new ArrayList<ElementDefinitionMappingComponent>();
9755      return this.mapping;
9756    }
9757
9758    /**
9759     * @return Returns a reference to <code>this</code> for easy method chaining
9760     */
9761    public ElementDefinition setMapping(List<ElementDefinitionMappingComponent> theMapping) { 
9762      this.mapping = theMapping;
9763      return this;
9764    }
9765
9766    public boolean hasMapping() { 
9767      if (this.mapping == null)
9768        return false;
9769      for (ElementDefinitionMappingComponent item : this.mapping)
9770        if (!item.isEmpty())
9771          return true;
9772      return false;
9773    }
9774
9775    public ElementDefinitionMappingComponent addMapping() { //3
9776      ElementDefinitionMappingComponent t = new ElementDefinitionMappingComponent();
9777      if (this.mapping == null)
9778        this.mapping = new ArrayList<ElementDefinitionMappingComponent>();
9779      this.mapping.add(t);
9780      return t;
9781    }
9782
9783    public ElementDefinition addMapping(ElementDefinitionMappingComponent t) { //3
9784      if (t == null)
9785        return this;
9786      if (this.mapping == null)
9787        this.mapping = new ArrayList<ElementDefinitionMappingComponent>();
9788      this.mapping.add(t);
9789      return this;
9790    }
9791
9792    /**
9793     * @return The first repetition of repeating field {@link #mapping}, creating it if it does not already exist {3}
9794     */
9795    public ElementDefinitionMappingComponent getMappingFirstRep() { 
9796      if (getMapping().isEmpty()) {
9797        addMapping();
9798      }
9799      return getMapping().get(0);
9800    }
9801
9802      protected void listChildren(List<Property> children) {
9803        super.listChildren(children);
9804        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));
9805        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));
9806        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));
9807        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));
9808        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));
9809        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));
9810        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));
9811        children.add(new Property("short", "string", "A concise description of what this element means (e.g. for use in autogenerated summaries).", 0, 1, short_));
9812        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));
9813        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));
9814        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));
9815        children.add(new Property("alias", "string", "Identifies additional names by which this element might also be known.", 0, java.lang.Integer.MAX_VALUE, alias));
9816        children.add(new Property("min", "unsignedInt", "The minimum number of times this element SHALL appear in the instance.", 0, 1, min));
9817        children.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the instance.", 0, 1, max));
9818        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));
9819        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));
9820        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));
9821        children.add(new Property("defaultValue[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "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));
9822        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));
9823        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));
9824        children.add(new Property("fixed[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "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));
9825        children.add(new Property("pattern[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "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));
9826        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));
9827        children.add(new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|integer64|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));
9828        children.add(new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|integer64|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));
9829        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));
9830        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));
9831        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));
9832        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));
9833        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));
9834        children.add(new Property("isModifierReason", "string", "Explains how that element affects the interpretation of the resource or element that contains it.", 0, 1, isModifierReason));
9835        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));
9836        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));
9837        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));
9838      }
9839
9840      @Override
9841      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9842        switch (_hash) {
9843        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);
9844        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);
9845        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);
9846        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);
9847        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);
9848        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);
9849        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);
9850        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_);
9851        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);
9852        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);
9853        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);
9854        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);
9855        case 108114: /*min*/  return new Property("min", "unsignedInt", "The minimum number of times this element SHALL appear in the instance.", 0, 1, min);
9856        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);
9857        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);
9858        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);
9859        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);
9860        case 587922128: /*defaultValue[x]*/  return new Property("defaultValue[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "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);
9861        case -659125328: /*defaultValue*/  return new Property("defaultValue[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "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);
9862        case 1470297600: /*defaultValueBase64Binary*/  return new Property("defaultValue[x]", "base64Binary", "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);
9863        case 600437336: /*defaultValueBoolean*/  return new Property("defaultValue[x]", "boolean", "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);
9864        case 264593188: /*defaultValueCanonical*/  return new Property("defaultValue[x]", "canonical", "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);
9865        case 1044993469: /*defaultValueCode*/  return new Property("defaultValue[x]", "code", "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);
9866        case 1045010302: /*defaultValueDate*/  return new Property("defaultValue[x]", "date", "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);
9867        case 1220374379: /*defaultValueDateTime*/  return new Property("defaultValue[x]", "dateTime", "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);
9868        case 2077989249: /*defaultValueDecimal*/  return new Property("defaultValue[x]", "decimal", "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);
9869        case -2059245333: /*defaultValueId*/  return new Property("defaultValue[x]", "id", "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);
9870        case -1801671663: /*defaultValueInstant*/  return new Property("defaultValue[x]", "instant", "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);
9871        case -1801189522: /*defaultValueInteger*/  return new Property("defaultValue[x]", "integer", "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);
9872        case -71308628: /*defaultValueInteger64*/  return new Property("defaultValue[x]", "integer64", "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);
9873        case -325436225: /*defaultValueMarkdown*/  return new Property("defaultValue[x]", "markdown", "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);
9874        case 587910138: /*defaultValueOid*/  return new Property("defaultValue[x]", "oid", "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);
9875        case -737344154: /*defaultValuePositiveInt*/  return new Property("defaultValue[x]", "positiveInt", "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);
9876        case -320515103: /*defaultValueString*/  return new Property("defaultValue[x]", "string", "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);
9877        case 1045494429: /*defaultValueTime*/  return new Property("defaultValue[x]", "time", "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);
9878        case 539117290: /*defaultValueUnsignedInt*/  return new Property("defaultValue[x]", "unsignedInt", "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);
9879        case 587916188: /*defaultValueUri*/  return new Property("defaultValue[x]", "uri", "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);
9880        case 587916191: /*defaultValueUrl*/  return new Property("defaultValue[x]", "url", "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);
9881        case 1045535627: /*defaultValueUuid*/  return new Property("defaultValue[x]", "uuid", "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);
9882        case -611966428: /*defaultValueAddress*/  return new Property("defaultValue[x]", "Address", "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);
9883        case 587896623: /*defaultValueAge*/  return new Property("defaultValue[x]", "Age", "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);
9884        case -1851689217: /*defaultValueAnnotation*/  return new Property("defaultValue[x]", "Annotation", "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);
9885        case 2034820339: /*defaultValueAttachment*/  return new Property("defaultValue[x]", "Attachment", "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);
9886        case -410434095: /*defaultValueCodeableConcept*/  return new Property("defaultValue[x]", "CodeableConcept", "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);
9887        case -783616198: /*defaultValueCoding*/  return new Property("defaultValue[x]", "Coding", "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);
9888        case -344740576: /*defaultValueContactPoint*/  return new Property("defaultValue[x]", "ContactPoint", "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);
9889        case -1964924097: /*defaultValueCount*/  return new Property("defaultValue[x]", "Count", "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);
9890        case -283915323: /*defaultValueDistance*/  return new Property("defaultValue[x]", "Distance", "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);
9891        case 1730579812: /*defaultValueDuration*/  return new Property("defaultValue[x]", "Duration", "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);
9892        case -975393912: /*defaultValueHumanName*/  return new Property("defaultValue[x]", "HumanName", "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);
9893        case -1915078535: /*defaultValueIdentifier*/  return new Property("defaultValue[x]", "Identifier", "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);
9894        case -1955695888: /*defaultValueMoney*/  return new Property("defaultValue[x]", "Money", "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);
9895        case -420255343: /*defaultValuePeriod*/  return new Property("defaultValue[x]", "Period", "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);
9896        case -1857379237: /*defaultValueQuantity*/  return new Property("defaultValue[x]", "Quantity", "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);
9897        case -1951495315: /*defaultValueRange*/  return new Property("defaultValue[x]", "Range", "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);
9898        case -1951489477: /*defaultValueRatio*/  return new Property("defaultValue[x]", "Ratio", "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);
9899        case -1488914053: /*defaultValueReference*/  return new Property("defaultValue[x]", "Reference", "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);
9900        case -449641228: /*defaultValueSampledData*/  return new Property("defaultValue[x]", "SampledData", "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);
9901        case 509825768: /*defaultValueSignature*/  return new Property("defaultValue[x]", "Signature", "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);
9902        case -302193638: /*defaultValueTiming*/  return new Property("defaultValue[x]", "Timing", "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);
9903        case 1845473985: /*defaultValueContactDetail*/  return new Property("defaultValue[x]", "ContactDetail", "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);
9904        case 1793609483: /*defaultValueContributor*/  return new Property("defaultValue[x]", "Contributor", "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);
9905        case 375217257: /*defaultValueDataRequirement*/  return new Property("defaultValue[x]", "DataRequirement", "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);
9906        case -2092097944: /*defaultValueExpression*/  return new Property("defaultValue[x]", "Expression", "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);
9907        case -701053940: /*defaultValueParameterDefinition*/  return new Property("defaultValue[x]", "ParameterDefinition", "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);
9908        case 412877133: /*defaultValueRelatedArtifact*/  return new Property("defaultValue[x]", "RelatedArtifact", "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);
9909        case 1913203547: /*defaultValueTriggerDefinition*/  return new Property("defaultValue[x]", "TriggerDefinition", "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);
9910        case -701644642: /*defaultValueUsageContext*/  return new Property("defaultValue[x]", "UsageContext", "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);
9911        case -754548089: /*defaultValueDosage*/  return new Property("defaultValue[x]", "Dosage", "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);
9912        case 1045282261: /*defaultValueMeta*/  return new Property("defaultValue[x]", "Meta", "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);
9913        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);
9914        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);
9915        case -391522164: /*fixed[x]*/  return new Property("fixed[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "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);
9916        case 97445748: /*fixed*/  return new Property("fixed[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "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);
9917        case -799290428: /*fixedBase64Binary*/  return new Property("fixed[x]", "base64Binary", "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);
9918        case 520851988: /*fixedBoolean*/  return new Property("fixed[x]", "boolean", "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);
9919        case 1092485088: /*fixedCanonical*/  return new Property("fixed[x]", "canonical", "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);
9920        case 746991489: /*fixedCode*/  return new Property("fixed[x]", "code", "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);
9921        case 747008322: /*fixedDate*/  return new Property("fixed[x]", "date", "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);
9922        case -1246771409: /*fixedDateTime*/  return new Property("fixed[x]", "dateTime", "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);
9923        case 1998403901: /*fixedDecimal*/  return new Property("fixed[x]", "decimal", "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);
9924        case -843914321: /*fixedId*/  return new Property("fixed[x]", "id", "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);
9925        case -1881257011: /*fixedInstant*/  return new Property("fixed[x]", "instant", "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);
9926        case -1880774870: /*fixedInteger*/  return new Property("fixed[x]", "integer", "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);
9927        case 756583272: /*fixedInteger64*/  return new Property("fixed[x]", "integer64", "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);
9928        case 1502385283: /*fixedMarkdown*/  return new Property("fixed[x]", "markdown", "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);
9929        case -391534154: /*fixedOid*/  return new Property("fixed[x]", "oid", "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);
9930        case 297821986: /*fixedPositiveInt*/  return new Property("fixed[x]", "positiveInt", "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);
9931        case 1062390949: /*fixedString*/  return new Property("fixed[x]", "string", "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);
9932        case 747492449: /*fixedTime*/  return new Property("fixed[x]", "time", "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);
9933        case 1574283430: /*fixedUnsignedInt*/  return new Property("fixed[x]", "unsignedInt", "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);
9934        case -391528104: /*fixedUri*/  return new Property("fixed[x]", "uri", "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);
9935        case -391528101: /*fixedUrl*/  return new Property("fixed[x]", "url", "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);
9936        case 747533647: /*fixedUuid*/  return new Property("fixed[x]", "uuid", "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);
9937        case -691551776: /*fixedAddress*/  return new Property("fixed[x]", "Address", "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);
9938        case -391547669: /*fixedAge*/  return new Property("fixed[x]", "Age", "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);
9939        case -1956844093: /*fixedAnnotation*/  return new Property("fixed[x]", "Annotation", "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);
9940        case 1929665463: /*fixedAttachment*/  return new Property("fixed[x]", "Attachment", "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);
9941        case 1962764685: /*fixedCodeableConcept*/  return new Property("fixed[x]", "CodeableConcept", "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);
9942        case 599289854: /*fixedCoding*/  return new Property("fixed[x]", "Coding", "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);
9943        case 1680638692: /*fixedContactPoint*/  return new Property("fixed[x]", "ContactPoint", "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);
9944        case 1681916411: /*fixedCount*/  return new Property("fixed[x]", "Count", "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);
9945        case 1543906185: /*fixedDistance*/  return new Property("fixed[x]", "Distance", "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);
9946        case -736565976: /*fixedDuration*/  return new Property("fixed[x]", "Duration", "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);
9947        case -147502012: /*fixedHumanName*/  return new Property("fixed[x]", "HumanName", "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);
9948        case -2020233411: /*fixedIdentifier*/  return new Property("fixed[x]", "Identifier", "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);
9949        case 1691144620: /*fixedMoney*/  return new Property("fixed[x]", "Money", "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);
9950        case 962650709: /*fixedPeriod*/  return new Property("fixed[x]", "Period", "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);
9951        case -29557729: /*fixedQuantity*/  return new Property("fixed[x]", "Quantity", "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);
9952        case 1695345193: /*fixedRange*/  return new Property("fixed[x]", "Range", "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);
9953        case 1695351031: /*fixedRatio*/  return new Property("fixed[x]", "Ratio", "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);
9954        case -661022153: /*fixedReference*/  return new Property("fixed[x]", "Reference", "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);
9955        case 585524912: /*fixedSampledData*/  return new Property("fixed[x]", "SampledData", "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);
9956        case 1337717668: /*fixedSignature*/  return new Property("fixed[x]", "Signature", "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);
9957        case 1080712414: /*fixedTiming*/  return new Property("fixed[x]", "Timing", "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);
9958        case 207721853: /*fixedContactDetail*/  return new Property("fixed[x]", "ContactDetail", "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);
9959        case -1466191673: /*fixedContributor*/  return new Property("fixed[x]", "Contributor", "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);
9960        case -1546551259: /*fixedDataRequirement*/  return new Property("fixed[x]", "DataRequirement", "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);
9961        case 2097714476: /*fixedExpression*/  return new Property("fixed[x]", "Expression", "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);
9962        case -2126861880: /*fixedParameterDefinition*/  return new Property("fixed[x]", "ParameterDefinition", "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);
9963        case -1508891383: /*fixedRelatedArtifact*/  return new Property("fixed[x]", "RelatedArtifact", "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);
9964        case 1929596951: /*fixedTriggerDefinition*/  return new Property("fixed[x]", "TriggerDefinition", "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);
9965        case 1323734626: /*fixedUsageContext*/  return new Property("fixed[x]", "UsageContext", "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);
9966        case 628357963: /*fixedDosage*/  return new Property("fixed[x]", "Dosage", "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);
9967        case 747280281: /*fixedMeta*/  return new Property("fixed[x]", "Meta", "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);
9968        case -885125392: /*pattern[x]*/  return new Property("pattern[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "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);
9969        case -791090288: /*pattern*/  return new Property("pattern[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "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);
9970        case 2127857120: /*patternBase64Binary*/  return new Property("pattern[x]", "base64Binary", "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);
9971        case -1776945544: /*patternBoolean*/  return new Property("pattern[x]", "boolean", "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);
9972        case 522246980: /*patternCanonical*/  return new Property("pattern[x]", "canonical", "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);
9973        case -1669806691: /*patternCode*/  return new Property("pattern[x]", "code", "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);
9974        case -1669789858: /*patternDate*/  return new Property("pattern[x]", "date", "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);
9975        case 535949131: /*patternDateTime*/  return new Property("pattern[x]", "dateTime", "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);
9976        case -299393631: /*patternDecimal*/  return new Property("pattern[x]", "decimal", "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);
9977        case -28553013: /*patternId*/  return new Property("pattern[x]", "id", "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);
9978        case 115912753: /*patternInstant*/  return new Property("pattern[x]", "instant", "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);
9979        case 116394894: /*patternInteger*/  return new Property("pattern[x]", "integer", "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);
9980        case 186345164: /*patternInteger64*/  return new Property("pattern[x]", "integer64", "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);
9981        case -1009861473: /*patternMarkdown*/  return new Property("pattern[x]", "markdown", "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);
9982        case -885137382: /*patternOid*/  return new Property("pattern[x]", "oid", "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);
9983        case 2054814086: /*patternPositiveInt*/  return new Property("pattern[x]", "positiveInt", "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);
9984        case 2096647105: /*patternString*/  return new Property("pattern[x]", "string", "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);
9985        case -1669305731: /*patternTime*/  return new Property("pattern[x]", "time", "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);
9986        case -963691766: /*patternUnsignedInt*/  return new Property("pattern[x]", "unsignedInt", "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);
9987        case -885131332: /*patternUri*/  return new Property("pattern[x]", "uri", "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);
9988        case -885131329: /*patternUrl*/  return new Property("pattern[x]", "url", "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);
9989        case -1669264533: /*patternUuid*/  return new Property("pattern[x]", "uuid", "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);
9990        case 1305617988: /*patternAddress*/  return new Property("pattern[x]", "Address", "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);
9991        case -885150897: /*patternAge*/  return new Property("pattern[x]", "Age", "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);
9992        case 1840611039: /*patternAnnotation*/  return new Property("pattern[x]", "Annotation", "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);
9993        case 1432153299: /*patternAttachment*/  return new Property("pattern[x]", "Attachment", "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);
9994        case -400610831: /*patternCodeableConcept*/  return new Property("pattern[x]", "CodeableConcept", "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);
9995        case 1633546010: /*patternCoding*/  return new Property("pattern[x]", "Coding", "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);
9996        case 312818944: /*patternContactPoint*/  return new Property("pattern[x]", "ContactPoint", "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);
9997        case -224383137: /*patternCount*/  return new Property("pattern[x]", "Count", "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);
9998        case -968340571: /*patternDistance*/  return new Property("pattern[x]", "Distance", "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);
9999        case 1046154564: /*patternDuration*/  return new Property("pattern[x]", "Duration", "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);
10000        case -717740120: /*patternHumanName*/  return new Property("pattern[x]", "HumanName", "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);
10001        case 1777221721: /*patternIdentifier*/  return new Property("pattern[x]", "Identifier", "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);
10002        case -215154928: /*patternMoney*/  return new Property("pattern[x]", "Money", "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);
10003        case 1996906865: /*patternPeriod*/  return new Property("pattern[x]", "Period", "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);
10004        case 1753162811: /*patternQuantity*/  return new Property("pattern[x]", "Quantity", "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);
10005        case -210954355: /*patternRange*/  return new Property("pattern[x]", "Range", "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);
10006        case -210948517: /*patternRatio*/  return new Property("pattern[x]", "Ratio", "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);
10007        case -1231260261: /*patternReference*/  return new Property("pattern[x]", "Reference", "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);
10008        case -1952450284: /*patternSampledData*/  return new Property("pattern[x]", "SampledData", "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);
10009        case 767479560: /*patternSignature*/  return new Property("pattern[x]", "Signature", "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);
10010        case 2114968570: /*patternTiming*/  return new Property("pattern[x]", "Timing", "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);
10011        case 754982625: /*patternContactDetail*/  return new Property("pattern[x]", "ContactDetail", "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);
10012        case 290800427: /*patternContributor*/  return new Property("pattern[x]", "Contributor", "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);
10013        case 385040521: /*patternDataRequirement*/  return new Property("pattern[x]", "DataRequirement", "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);
10014        case 1600202312: /*patternExpression*/  return new Property("pattern[x]", "Expression", "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);
10015        case 318609452: /*patternParameterDefinition*/  return new Property("pattern[x]", "ParameterDefinition", "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);
10016        case 422700397: /*patternRelatedArtifact*/  return new Property("pattern[x]", "RelatedArtifact", "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);
10017        case -1531541637: /*patternTriggerDefinition*/  return new Property("pattern[x]", "TriggerDefinition", "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);
10018        case -44085122: /*patternUsageContext*/  return new Property("pattern[x]", "UsageContext", "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);
10019        case 1662614119: /*patternDosage*/  return new Property("pattern[x]", "Dosage", "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);
10020        case -1669517899: /*patternMeta*/  return new Property("pattern[x]", "Meta", "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);
10021        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);
10022        case -55301663: /*minValue[x]*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|integer64|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);
10023        case -1376969153: /*minValue*/  return new Property("minValue[x]", "date|dateTime|instant|time|decimal|integer|integer64|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);
10024        case -1715058035: /*minValueDate*/  return new Property("minValue[x]", "date", "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);
10025        case 1635517178: /*minValueDateTime*/  return new Property("minValue[x]", "dateTime", "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);
10026        case 151382690: /*minValueInstant*/  return new Property("minValue[x]", "instant", "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);
10027        case -1714573908: /*minValueTime*/  return new Property("minValue[x]", "time", "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);
10028        case -263923694: /*minValueDecimal*/  return new Property("minValue[x]", "decimal", "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);
10029        case 151864831: /*minValueInteger*/  return new Property("minValue[x]", "integer", "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);
10030        case -86783747: /*minValueInteger64*/  return new Property("minValue[x]", "integer64", "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);
10031        case 1570935671: /*minValuePositiveInt*/  return new Property("minValue[x]", "positiveInt", "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);
10032        case -1447570181: /*minValueUnsignedInt*/  return new Property("minValue[x]", "unsignedInt", "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);
10033        case -1442236438: /*minValueQuantity*/  return new Property("minValue[x]", "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);
10034        case 622130931: /*maxValue[x]*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|integer64|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);
10035        case 399227501: /*maxValue*/  return new Property("maxValue[x]", "date|dateTime|instant|time|decimal|integer|integer64|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);
10036        case 2105483195: /*maxValueDate*/  return new Property("maxValue[x]", "date", "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);
10037        case 1699385640: /*maxValueDateTime*/  return new Property("maxValue[x]", "dateTime", "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);
10038        case 1261821620: /*maxValueInstant*/  return new Property("maxValue[x]", "instant", "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);
10039        case 2105967322: /*maxValueTime*/  return new Property("maxValue[x]", "time", "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);
10040        case 846515236: /*maxValueDecimal*/  return new Property("maxValue[x]", "decimal", "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);
10041        case 1262303761: /*maxValueInteger*/  return new Property("maxValue[x]", "integer", "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);
10042        case 1893138575: /*maxValueInteger64*/  return new Property("maxValue[x]", "integer64", "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);
10043        case 1605774985: /*maxValuePositiveInt*/  return new Property("maxValue[x]", "positiveInt", "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);
10044        case -1412730867: /*maxValueUnsignedInt*/  return new Property("maxValue[x]", "unsignedInt", "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);
10045        case -1378367976: /*maxValueQuantity*/  return new Property("maxValue[x]", "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);
10046        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);
10047        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);
10048        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);
10049        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);
10050        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);
10051        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);
10052        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);
10053        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);
10054        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);
10055        default: return super.getNamedProperty(_hash, _name, _checkValid);
10056        }
10057
10058      }
10059
10060      @Override
10061      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
10062        switch (hash) {
10063        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
10064        case -671065907: /*representation*/ return this.representation == null ? new Base[0] : this.representation.toArray(new Base[this.representation.size()]); // Enumeration<PropertyRepresentation>
10065        case -825289923: /*sliceName*/ return this.sliceName == null ? new Base[0] : new Base[] {this.sliceName}; // StringType
10066        case 333040519: /*sliceIsConstraining*/ return this.sliceIsConstraining == null ? new Base[0] : new Base[] {this.sliceIsConstraining}; // BooleanType
10067        case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType
10068        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // Coding
10069        case -2119287345: /*slicing*/ return this.slicing == null ? new Base[0] : new Base[] {this.slicing}; // ElementDefinitionSlicingComponent
10070        case 109413500: /*short*/ return this.short_ == null ? new Base[0] : new Base[] {this.short_}; // StringType
10071        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // MarkdownType
10072        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // MarkdownType
10073        case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // MarkdownType
10074        case 92902992: /*alias*/ return this.alias == null ? new Base[0] : this.alias.toArray(new Base[this.alias.size()]); // StringType
10075        case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // UnsignedIntType
10076        case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType
10077        case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // ElementDefinitionBaseComponent
10078        case 1193747154: /*contentReference*/ return this.contentReference == null ? new Base[0] : new Base[] {this.contentReference}; // UriType
10079        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // TypeRefComponent
10080        case -659125328: /*defaultValue*/ return this.defaultValue == null ? new Base[0] : new Base[] {this.defaultValue}; // DataType
10081        case 1857257103: /*meaningWhenMissing*/ return this.meaningWhenMissing == null ? new Base[0] : new Base[] {this.meaningWhenMissing}; // MarkdownType
10082        case 1828196047: /*orderMeaning*/ return this.orderMeaning == null ? new Base[0] : new Base[] {this.orderMeaning}; // StringType
10083        case 97445748: /*fixed*/ return this.fixed == null ? new Base[0] : new Base[] {this.fixed}; // DataType
10084        case -791090288: /*pattern*/ return this.pattern == null ? new Base[0] : new Base[] {this.pattern}; // DataType
10085        case -1322970774: /*example*/ return this.example == null ? new Base[0] : this.example.toArray(new Base[this.example.size()]); // ElementDefinitionExampleComponent
10086        case -1376969153: /*minValue*/ return this.minValue == null ? new Base[0] : new Base[] {this.minValue}; // DataType
10087        case 399227501: /*maxValue*/ return this.maxValue == null ? new Base[0] : new Base[] {this.maxValue}; // DataType
10088        case -791400086: /*maxLength*/ return this.maxLength == null ? new Base[0] : new Base[] {this.maxLength}; // IntegerType
10089        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // IdType
10090        case -190376483: /*constraint*/ return this.constraint == null ? new Base[0] : this.constraint.toArray(new Base[this.constraint.size()]); // ElementDefinitionConstraintComponent
10091        case -1402857082: /*mustSupport*/ return this.mustSupport == null ? new Base[0] : new Base[] {this.mustSupport}; // BooleanType
10092        case -1408783839: /*isModifier*/ return this.isModifier == null ? new Base[0] : new Base[] {this.isModifier}; // BooleanType
10093        case -1854387259: /*isModifierReason*/ return this.isModifierReason == null ? new Base[0] : new Base[] {this.isModifierReason}; // StringType
10094        case 1857548060: /*isSummary*/ return this.isSummary == null ? new Base[0] : new Base[] {this.isSummary}; // BooleanType
10095        case -108220795: /*binding*/ return this.binding == null ? new Base[0] : new Base[] {this.binding}; // ElementDefinitionBindingComponent
10096        case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // ElementDefinitionMappingComponent
10097        default: return super.getProperty(hash, name, checkValid);
10098        }
10099
10100      }
10101
10102      @Override
10103      public Base setProperty(int hash, String name, Base value) throws FHIRException {
10104        switch (hash) {
10105        case 3433509: // path
10106          this.path = TypeConvertor.castToString(value); // StringType
10107          return value;
10108        case -671065907: // representation
10109          value = new PropertyRepresentationEnumFactory().fromType(TypeConvertor.castToCode(value));
10110          this.getRepresentation().add((Enumeration) value); // Enumeration<PropertyRepresentation>
10111          return value;
10112        case -825289923: // sliceName
10113          this.sliceName = TypeConvertor.castToString(value); // StringType
10114          return value;
10115        case 333040519: // sliceIsConstraining
10116          this.sliceIsConstraining = TypeConvertor.castToBoolean(value); // BooleanType
10117          return value;
10118        case 102727412: // label
10119          this.label = TypeConvertor.castToString(value); // StringType
10120          return value;
10121        case 3059181: // code
10122          this.getCode().add(TypeConvertor.castToCoding(value)); // Coding
10123          return value;
10124        case -2119287345: // slicing
10125          this.slicing = (ElementDefinitionSlicingComponent) value; // ElementDefinitionSlicingComponent
10126          return value;
10127        case 109413500: // short
10128          this.short_ = TypeConvertor.castToString(value); // StringType
10129          return value;
10130        case -1014418093: // definition
10131          this.definition = TypeConvertor.castToMarkdown(value); // MarkdownType
10132          return value;
10133        case 950398559: // comment
10134          this.comment = TypeConvertor.castToMarkdown(value); // MarkdownType
10135          return value;
10136        case -1619874672: // requirements
10137          this.requirements = TypeConvertor.castToMarkdown(value); // MarkdownType
10138          return value;
10139        case 92902992: // alias
10140          this.getAlias().add(TypeConvertor.castToString(value)); // StringType
10141          return value;
10142        case 108114: // min
10143          this.min = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
10144          return value;
10145        case 107876: // max
10146          this.max = TypeConvertor.castToString(value); // StringType
10147          return value;
10148        case 3016401: // base
10149          this.base = (ElementDefinitionBaseComponent) value; // ElementDefinitionBaseComponent
10150          return value;
10151        case 1193747154: // contentReference
10152          this.contentReference = TypeConvertor.castToUri(value); // UriType
10153          return value;
10154        case 3575610: // type
10155          this.getType().add((TypeRefComponent) value); // TypeRefComponent
10156          return value;
10157        case -659125328: // defaultValue
10158          this.defaultValue = TypeConvertor.castToType(value); // DataType
10159          return value;
10160        case 1857257103: // meaningWhenMissing
10161          this.meaningWhenMissing = TypeConvertor.castToMarkdown(value); // MarkdownType
10162          return value;
10163        case 1828196047: // orderMeaning
10164          this.orderMeaning = TypeConvertor.castToString(value); // StringType
10165          return value;
10166        case 97445748: // fixed
10167          this.fixed = TypeConvertor.castToType(value); // DataType
10168          return value;
10169        case -791090288: // pattern
10170          this.pattern = TypeConvertor.castToType(value); // DataType
10171          return value;
10172        case -1322970774: // example
10173          this.getExample().add((ElementDefinitionExampleComponent) value); // ElementDefinitionExampleComponent
10174          return value;
10175        case -1376969153: // minValue
10176          this.minValue = TypeConvertor.castToType(value); // DataType
10177          return value;
10178        case 399227501: // maxValue
10179          this.maxValue = TypeConvertor.castToType(value); // DataType
10180          return value;
10181        case -791400086: // maxLength
10182          this.maxLength = TypeConvertor.castToInteger(value); // IntegerType
10183          return value;
10184        case -861311717: // condition
10185          this.getCondition().add(TypeConvertor.castToId(value)); // IdType
10186          return value;
10187        case -190376483: // constraint
10188          this.getConstraint().add((ElementDefinitionConstraintComponent) value); // ElementDefinitionConstraintComponent
10189          return value;
10190        case -1402857082: // mustSupport
10191          this.mustSupport = TypeConvertor.castToBoolean(value); // BooleanType
10192          return value;
10193        case -1408783839: // isModifier
10194          this.isModifier = TypeConvertor.castToBoolean(value); // BooleanType
10195          return value;
10196        case -1854387259: // isModifierReason
10197          this.isModifierReason = TypeConvertor.castToString(value); // StringType
10198          return value;
10199        case 1857548060: // isSummary
10200          this.isSummary = TypeConvertor.castToBoolean(value); // BooleanType
10201          return value;
10202        case -108220795: // binding
10203          this.binding = (ElementDefinitionBindingComponent) value; // ElementDefinitionBindingComponent
10204          return value;
10205        case 837556430: // mapping
10206          this.getMapping().add((ElementDefinitionMappingComponent) value); // ElementDefinitionMappingComponent
10207          return value;
10208        default: return super.setProperty(hash, name, value);
10209        }
10210
10211      }
10212
10213      @Override
10214      public Base setProperty(String name, Base value) throws FHIRException {
10215        if (name.equals("path")) {
10216          this.path = TypeConvertor.castToString(value); // StringType
10217        } else if (name.equals("representation")) {
10218          value = new PropertyRepresentationEnumFactory().fromType(TypeConvertor.castToCode(value));
10219          this.getRepresentation().add((Enumeration) value);
10220        } else if (name.equals("sliceName")) {
10221          this.sliceName = TypeConvertor.castToString(value); // StringType
10222        } else if (name.equals("sliceIsConstraining")) {
10223          this.sliceIsConstraining = TypeConvertor.castToBoolean(value); // BooleanType
10224        } else if (name.equals("label")) {
10225          this.label = TypeConvertor.castToString(value); // StringType
10226        } else if (name.equals("code")) {
10227          this.getCode().add(TypeConvertor.castToCoding(value));
10228        } else if (name.equals("slicing")) {
10229          this.slicing = (ElementDefinitionSlicingComponent) value; // ElementDefinitionSlicingComponent
10230        } else if (name.equals("short")) {
10231          this.short_ = TypeConvertor.castToString(value); // StringType
10232        } else if (name.equals("definition")) {
10233          this.definition = TypeConvertor.castToMarkdown(value); // MarkdownType
10234        } else if (name.equals("comment")) {
10235          this.comment = TypeConvertor.castToMarkdown(value); // MarkdownType
10236        } else if (name.equals("requirements")) {
10237          this.requirements = TypeConvertor.castToMarkdown(value); // MarkdownType
10238        } else if (name.equals("alias")) {
10239          this.getAlias().add(TypeConvertor.castToString(value));
10240        } else if (name.equals("min")) {
10241          this.min = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
10242        } else if (name.equals("max")) {
10243          this.max = TypeConvertor.castToString(value); // StringType
10244        } else if (name.equals("base")) {
10245          this.base = (ElementDefinitionBaseComponent) value; // ElementDefinitionBaseComponent
10246        } else if (name.equals("contentReference")) {
10247          this.contentReference = TypeConvertor.castToUri(value); // UriType
10248        } else if (name.equals("type")) {
10249          this.getType().add((TypeRefComponent) value);
10250        } else if (name.equals("defaultValue[x]")) {
10251          this.defaultValue = TypeConvertor.castToType(value); // DataType
10252        } else if (name.equals("meaningWhenMissing")) {
10253          this.meaningWhenMissing = TypeConvertor.castToMarkdown(value); // MarkdownType
10254        } else if (name.equals("orderMeaning")) {
10255          this.orderMeaning = TypeConvertor.castToString(value); // StringType
10256        } else if (name.equals("fixed[x]")) {
10257          this.fixed = TypeConvertor.castToType(value); // DataType
10258        } else if (name.equals("pattern[x]")) {
10259          this.pattern = TypeConvertor.castToType(value); // DataType
10260        } else if (name.equals("example")) {
10261          this.getExample().add((ElementDefinitionExampleComponent) value);
10262        } else if (name.equals("minValue[x]")) {
10263          this.minValue = TypeConvertor.castToType(value); // DataType
10264        } else if (name.equals("maxValue[x]")) {
10265          this.maxValue = TypeConvertor.castToType(value); // DataType
10266        } else if (name.equals("maxLength")) {
10267          this.maxLength = TypeConvertor.castToInteger(value); // IntegerType
10268        } else if (name.equals("condition")) {
10269          this.getCondition().add(TypeConvertor.castToId(value));
10270        } else if (name.equals("constraint")) {
10271          this.getConstraint().add((ElementDefinitionConstraintComponent) value);
10272        } else if (name.equals("mustSupport")) {
10273          this.mustSupport = TypeConvertor.castToBoolean(value); // BooleanType
10274        } else if (name.equals("isModifier")) {
10275          this.isModifier = TypeConvertor.castToBoolean(value); // BooleanType
10276        } else if (name.equals("isModifierReason")) {
10277          this.isModifierReason = TypeConvertor.castToString(value); // StringType
10278        } else if (name.equals("isSummary")) {
10279          this.isSummary = TypeConvertor.castToBoolean(value); // BooleanType
10280        } else if (name.equals("binding")) {
10281          this.binding = (ElementDefinitionBindingComponent) value; // ElementDefinitionBindingComponent
10282        } else if (name.equals("mapping")) {
10283          this.getMapping().add((ElementDefinitionMappingComponent) value);
10284        } else
10285          return super.setProperty(name, value);
10286        return value;
10287      }
10288
10289      @Override
10290      public Base makeProperty(int hash, String name) throws FHIRException {
10291        switch (hash) {
10292        case 3433509:  return getPathElement();
10293        case -671065907:  return addRepresentationElement();
10294        case -825289923:  return getSliceNameElement();
10295        case 333040519:  return getSliceIsConstrainingElement();
10296        case 102727412:  return getLabelElement();
10297        case 3059181:  return addCode(); 
10298        case -2119287345:  return getSlicing();
10299        case 109413500:  return getShortElement();
10300        case -1014418093:  return getDefinitionElement();
10301        case 950398559:  return getCommentElement();
10302        case -1619874672:  return getRequirementsElement();
10303        case 92902992:  return addAliasElement();
10304        case 108114:  return getMinElement();
10305        case 107876:  return getMaxElement();
10306        case 3016401:  return getBase();
10307        case 1193747154:  return getContentReferenceElement();
10308        case 3575610:  return addType(); 
10309        case 587922128:  return getDefaultValue();
10310        case -659125328:  return getDefaultValue();
10311        case 1857257103:  return getMeaningWhenMissingElement();
10312        case 1828196047:  return getOrderMeaningElement();
10313        case -391522164:  return getFixed();
10314        case 97445748:  return getFixed();
10315        case -885125392:  return getPattern();
10316        case -791090288:  return getPattern();
10317        case -1322970774:  return addExample(); 
10318        case -55301663:  return getMinValue();
10319        case -1376969153:  return getMinValue();
10320        case 622130931:  return getMaxValue();
10321        case 399227501:  return getMaxValue();
10322        case -791400086:  return getMaxLengthElement();
10323        case -861311717:  return addConditionElement();
10324        case -190376483:  return addConstraint(); 
10325        case -1402857082:  return getMustSupportElement();
10326        case -1408783839:  return getIsModifierElement();
10327        case -1854387259:  return getIsModifierReasonElement();
10328        case 1857548060:  return getIsSummaryElement();
10329        case -108220795:  return getBinding();
10330        case 837556430:  return addMapping(); 
10331        default: return super.makeProperty(hash, name);
10332        }
10333
10334      }
10335
10336      @Override
10337      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
10338        switch (hash) {
10339        case 3433509: /*path*/ return new String[] {"string"};
10340        case -671065907: /*representation*/ return new String[] {"code"};
10341        case -825289923: /*sliceName*/ return new String[] {"string"};
10342        case 333040519: /*sliceIsConstraining*/ return new String[] {"boolean"};
10343        case 102727412: /*label*/ return new String[] {"string"};
10344        case 3059181: /*code*/ return new String[] {"Coding"};
10345        case -2119287345: /*slicing*/ return new String[] {};
10346        case 109413500: /*short*/ return new String[] {"string"};
10347        case -1014418093: /*definition*/ return new String[] {"markdown"};
10348        case 950398559: /*comment*/ return new String[] {"markdown"};
10349        case -1619874672: /*requirements*/ return new String[] {"markdown"};
10350        case 92902992: /*alias*/ return new String[] {"string"};
10351        case 108114: /*min*/ return new String[] {"unsignedInt"};
10352        case 107876: /*max*/ return new String[] {"string"};
10353        case 3016401: /*base*/ return new String[] {};
10354        case 1193747154: /*contentReference*/ return new String[] {"uri"};
10355        case 3575610: /*type*/ return new String[] {};
10356        case -659125328: /*defaultValue*/ return new String[] {"base64Binary", "boolean", "canonical", "code", "date", "dateTime", "decimal", "id", "instant", "integer", "integer64", "markdown", "oid", "positiveInt", "string", "time", "unsignedInt", "uri", "url", "uuid", "Address", "Age", "Annotation", "Attachment", "CodeableConcept", "Coding", "ContactPoint", "Count", "Distance", "Duration", "HumanName", "Identifier", "Money", "Period", "Quantity", "Range", "Ratio", "Reference", "SampledData", "Signature", "Timing", "ContactDetail", "Contributor", "DataRequirement", "Expression", "ParameterDefinition", "RelatedArtifact", "TriggerDefinition", "UsageContext", "Dosage", "Meta"};
10357        case 1857257103: /*meaningWhenMissing*/ return new String[] {"markdown"};
10358        case 1828196047: /*orderMeaning*/ return new String[] {"string"};
10359        case 97445748: /*fixed*/ return new String[] {"base64Binary", "boolean", "canonical", "code", "date", "dateTime", "decimal", "id", "instant", "integer", "integer64", "markdown", "oid", "positiveInt", "string", "time", "unsignedInt", "uri", "url", "uuid", "Address", "Age", "Annotation", "Attachment", "CodeableConcept", "Coding", "ContactPoint", "Count", "Distance", "Duration", "HumanName", "Identifier", "Money", "Period", "Quantity", "Range", "Ratio", "Reference", "SampledData", "Signature", "Timing", "ContactDetail", "Contributor", "DataRequirement", "Expression", "ParameterDefinition", "RelatedArtifact", "TriggerDefinition", "UsageContext", "Dosage", "Meta"};
10360        case -791090288: /*pattern*/ return new String[] {"base64Binary", "boolean", "canonical", "code", "date", "dateTime", "decimal", "id", "instant", "integer", "integer64", "markdown", "oid", "positiveInt", "string", "time", "unsignedInt", "uri", "url", "uuid", "Address", "Age", "Annotation", "Attachment", "CodeableConcept", "Coding", "ContactPoint", "Count", "Distance", "Duration", "HumanName", "Identifier", "Money", "Period", "Quantity", "Range", "Ratio", "Reference", "SampledData", "Signature", "Timing", "ContactDetail", "Contributor", "DataRequirement", "Expression", "ParameterDefinition", "RelatedArtifact", "TriggerDefinition", "UsageContext", "Dosage", "Meta"};
10361        case -1322970774: /*example*/ return new String[] {};
10362        case -1376969153: /*minValue*/ return new String[] {"date", "dateTime", "instant", "time", "decimal", "integer", "integer64", "positiveInt", "unsignedInt", "Quantity"};
10363        case 399227501: /*maxValue*/ return new String[] {"date", "dateTime", "instant", "time", "decimal", "integer", "integer64", "positiveInt", "unsignedInt", "Quantity"};
10364        case -791400086: /*maxLength*/ return new String[] {"integer"};
10365        case -861311717: /*condition*/ return new String[] {"id"};
10366        case -190376483: /*constraint*/ return new String[] {};
10367        case -1402857082: /*mustSupport*/ return new String[] {"boolean"};
10368        case -1408783839: /*isModifier*/ return new String[] {"boolean"};
10369        case -1854387259: /*isModifierReason*/ return new String[] {"string"};
10370        case 1857548060: /*isSummary*/ return new String[] {"boolean"};
10371        case -108220795: /*binding*/ return new String[] {};
10372        case 837556430: /*mapping*/ return new String[] {};
10373        default: return super.getTypesForProperty(hash, name);
10374        }
10375
10376      }
10377
10378      @Override
10379      public Base addChild(String name) throws FHIRException {
10380        if (name.equals("path")) {
10381          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.path");
10382        }
10383        else if (name.equals("representation")) {
10384          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.representation");
10385        }
10386        else if (name.equals("sliceName")) {
10387          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.sliceName");
10388        }
10389        else if (name.equals("sliceIsConstraining")) {
10390          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.sliceIsConstraining");
10391        }
10392        else if (name.equals("label")) {
10393          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.label");
10394        }
10395        else if (name.equals("code")) {
10396          return addCode();
10397        }
10398        else if (name.equals("slicing")) {
10399          this.slicing = new ElementDefinitionSlicingComponent();
10400          return this.slicing;
10401        }
10402        else if (name.equals("short")) {
10403          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.short");
10404        }
10405        else if (name.equals("definition")) {
10406          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.definition");
10407        }
10408        else if (name.equals("comment")) {
10409          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.comment");
10410        }
10411        else if (name.equals("requirements")) {
10412          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.requirements");
10413        }
10414        else if (name.equals("alias")) {
10415          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.alias");
10416        }
10417        else if (name.equals("min")) {
10418          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.min");
10419        }
10420        else if (name.equals("max")) {
10421          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.max");
10422        }
10423        else if (name.equals("base")) {
10424          this.base = new ElementDefinitionBaseComponent();
10425          return this.base;
10426        }
10427        else if (name.equals("contentReference")) {
10428          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.contentReference");
10429        }
10430        else if (name.equals("type")) {
10431          return addType();
10432        }
10433        else if (name.equals("defaultValueBase64Binary")) {
10434          this.defaultValue = new Base64BinaryType();
10435          return this.defaultValue;
10436        }
10437        else if (name.equals("defaultValueBoolean")) {
10438          this.defaultValue = new BooleanType();
10439          return this.defaultValue;
10440        }
10441        else if (name.equals("defaultValueCanonical")) {
10442          this.defaultValue = new CanonicalType();
10443          return this.defaultValue;
10444        }
10445        else if (name.equals("defaultValueCode")) {
10446          this.defaultValue = new CodeType();
10447          return this.defaultValue;
10448        }
10449        else if (name.equals("defaultValueDate")) {
10450          this.defaultValue = new DateType();
10451          return this.defaultValue;
10452        }
10453        else if (name.equals("defaultValueDateTime")) {
10454          this.defaultValue = new DateTimeType();
10455          return this.defaultValue;
10456        }
10457        else if (name.equals("defaultValueDecimal")) {
10458          this.defaultValue = new DecimalType();
10459          return this.defaultValue;
10460        }
10461        else if (name.equals("defaultValueId")) {
10462          this.defaultValue = new IdType();
10463          return this.defaultValue;
10464        }
10465        else if (name.equals("defaultValueInstant")) {
10466          this.defaultValue = new InstantType();
10467          return this.defaultValue;
10468        }
10469        else if (name.equals("defaultValueInteger")) {
10470          this.defaultValue = new IntegerType();
10471          return this.defaultValue;
10472        }
10473        else if (name.equals("defaultValueInteger64")) {
10474          this.defaultValue = new Integer64Type();
10475          return this.defaultValue;
10476        }
10477        else if (name.equals("defaultValueMarkdown")) {
10478          this.defaultValue = new MarkdownType();
10479          return this.defaultValue;
10480        }
10481        else if (name.equals("defaultValueOid")) {
10482          this.defaultValue = new OidType();
10483          return this.defaultValue;
10484        }
10485        else if (name.equals("defaultValuePositiveInt")) {
10486          this.defaultValue = new PositiveIntType();
10487          return this.defaultValue;
10488        }
10489        else if (name.equals("defaultValueString")) {
10490          this.defaultValue = new StringType();
10491          return this.defaultValue;
10492        }
10493        else if (name.equals("defaultValueTime")) {
10494          this.defaultValue = new TimeType();
10495          return this.defaultValue;
10496        }
10497        else if (name.equals("defaultValueUnsignedInt")) {
10498          this.defaultValue = new UnsignedIntType();
10499          return this.defaultValue;
10500        }
10501        else if (name.equals("defaultValueUri")) {
10502          this.defaultValue = new UriType();
10503          return this.defaultValue;
10504        }
10505        else if (name.equals("defaultValueUrl")) {
10506          this.defaultValue = new UrlType();
10507          return this.defaultValue;
10508        }
10509        else if (name.equals("defaultValueUuid")) {
10510          this.defaultValue = new UuidType();
10511          return this.defaultValue;
10512        }
10513        else if (name.equals("defaultValueAddress")) {
10514          this.defaultValue = new Address();
10515          return this.defaultValue;
10516        }
10517        else if (name.equals("defaultValueAge")) {
10518          this.defaultValue = new Age();
10519          return this.defaultValue;
10520        }
10521        else if (name.equals("defaultValueAnnotation")) {
10522          this.defaultValue = new Annotation();
10523          return this.defaultValue;
10524        }
10525        else if (name.equals("defaultValueAttachment")) {
10526          this.defaultValue = new Attachment();
10527          return this.defaultValue;
10528        }
10529        else if (name.equals("defaultValueCodeableConcept")) {
10530          this.defaultValue = new CodeableConcept();
10531          return this.defaultValue;
10532        }
10533        else if (name.equals("defaultValueCoding")) {
10534          this.defaultValue = new Coding();
10535          return this.defaultValue;
10536        }
10537        else if (name.equals("defaultValueContactPoint")) {
10538          this.defaultValue = new ContactPoint();
10539          return this.defaultValue;
10540        }
10541        else if (name.equals("defaultValueCount")) {
10542          this.defaultValue = new Count();
10543          return this.defaultValue;
10544        }
10545        else if (name.equals("defaultValueDistance")) {
10546          this.defaultValue = new Distance();
10547          return this.defaultValue;
10548        }
10549        else if (name.equals("defaultValueDuration")) {
10550          this.defaultValue = new Duration();
10551          return this.defaultValue;
10552        }
10553        else if (name.equals("defaultValueHumanName")) {
10554          this.defaultValue = new HumanName();
10555          return this.defaultValue;
10556        }
10557        else if (name.equals("defaultValueIdentifier")) {
10558          this.defaultValue = new Identifier();
10559          return this.defaultValue;
10560        }
10561        else if (name.equals("defaultValueMoney")) {
10562          this.defaultValue = new Money();
10563          return this.defaultValue;
10564        }
10565        else if (name.equals("defaultValuePeriod")) {
10566          this.defaultValue = new Period();
10567          return this.defaultValue;
10568        }
10569        else if (name.equals("defaultValueQuantity")) {
10570          this.defaultValue = new Quantity();
10571          return this.defaultValue;
10572        }
10573        else if (name.equals("defaultValueRange")) {
10574          this.defaultValue = new Range();
10575          return this.defaultValue;
10576        }
10577        else if (name.equals("defaultValueRatio")) {
10578          this.defaultValue = new Ratio();
10579          return this.defaultValue;
10580        }
10581        else if (name.equals("defaultValueReference")) {
10582          this.defaultValue = new Reference();
10583          return this.defaultValue;
10584        }
10585        else if (name.equals("defaultValueSampledData")) {
10586          this.defaultValue = new SampledData();
10587          return this.defaultValue;
10588        }
10589        else if (name.equals("defaultValueSignature")) {
10590          this.defaultValue = new Signature();
10591          return this.defaultValue;
10592        }
10593        else if (name.equals("defaultValueTiming")) {
10594          this.defaultValue = new Timing();
10595          return this.defaultValue;
10596        }
10597        else if (name.equals("defaultValueContactDetail")) {
10598          this.defaultValue = new ContactDetail();
10599          return this.defaultValue;
10600        }
10601        else if (name.equals("defaultValueContributor")) {
10602          this.defaultValue = new Contributor();
10603          return this.defaultValue;
10604        }
10605        else if (name.equals("defaultValueDataRequirement")) {
10606          this.defaultValue = new DataRequirement();
10607          return this.defaultValue;
10608        }
10609        else if (name.equals("defaultValueExpression")) {
10610          this.defaultValue = new Expression();
10611          return this.defaultValue;
10612        }
10613        else if (name.equals("defaultValueParameterDefinition")) {
10614          this.defaultValue = new ParameterDefinition();
10615          return this.defaultValue;
10616        }
10617        else if (name.equals("defaultValueRelatedArtifact")) {
10618          this.defaultValue = new RelatedArtifact();
10619          return this.defaultValue;
10620        }
10621        else if (name.equals("defaultValueTriggerDefinition")) {
10622          this.defaultValue = new TriggerDefinition();
10623          return this.defaultValue;
10624        }
10625        else if (name.equals("defaultValueUsageContext")) {
10626          this.defaultValue = new UsageContext();
10627          return this.defaultValue;
10628        }
10629        else if (name.equals("defaultValueDosage")) {
10630          this.defaultValue = new Dosage();
10631          return this.defaultValue;
10632        }
10633        else if (name.equals("defaultValueMeta")) {
10634          this.defaultValue = new Meta();
10635          return this.defaultValue;
10636        }
10637        else if (name.equals("meaningWhenMissing")) {
10638          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.meaningWhenMissing");
10639        }
10640        else if (name.equals("orderMeaning")) {
10641          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.orderMeaning");
10642        }
10643        else if (name.equals("fixedBase64Binary")) {
10644          this.fixed = new Base64BinaryType();
10645          return this.fixed;
10646        }
10647        else if (name.equals("fixedBoolean")) {
10648          this.fixed = new BooleanType();
10649          return this.fixed;
10650        }
10651        else if (name.equals("fixedCanonical")) {
10652          this.fixed = new CanonicalType();
10653          return this.fixed;
10654        }
10655        else if (name.equals("fixedCode")) {
10656          this.fixed = new CodeType();
10657          return this.fixed;
10658        }
10659        else if (name.equals("fixedDate")) {
10660          this.fixed = new DateType();
10661          return this.fixed;
10662        }
10663        else if (name.equals("fixedDateTime")) {
10664          this.fixed = new DateTimeType();
10665          return this.fixed;
10666        }
10667        else if (name.equals("fixedDecimal")) {
10668          this.fixed = new DecimalType();
10669          return this.fixed;
10670        }
10671        else if (name.equals("fixedId")) {
10672          this.fixed = new IdType();
10673          return this.fixed;
10674        }
10675        else if (name.equals("fixedInstant")) {
10676          this.fixed = new InstantType();
10677          return this.fixed;
10678        }
10679        else if (name.equals("fixedInteger")) {
10680          this.fixed = new IntegerType();
10681          return this.fixed;
10682        }
10683        else if (name.equals("fixedInteger64")) {
10684          this.fixed = new Integer64Type();
10685          return this.fixed;
10686        }
10687        else if (name.equals("fixedMarkdown")) {
10688          this.fixed = new MarkdownType();
10689          return this.fixed;
10690        }
10691        else if (name.equals("fixedOid")) {
10692          this.fixed = new OidType();
10693          return this.fixed;
10694        }
10695        else if (name.equals("fixedPositiveInt")) {
10696          this.fixed = new PositiveIntType();
10697          return this.fixed;
10698        }
10699        else if (name.equals("fixedString")) {
10700          this.fixed = new StringType();
10701          return this.fixed;
10702        }
10703        else if (name.equals("fixedTime")) {
10704          this.fixed = new TimeType();
10705          return this.fixed;
10706        }
10707        else if (name.equals("fixedUnsignedInt")) {
10708          this.fixed = new UnsignedIntType();
10709          return this.fixed;
10710        }
10711        else if (name.equals("fixedUri")) {
10712          this.fixed = new UriType();
10713          return this.fixed;
10714        }
10715        else if (name.equals("fixedUrl")) {
10716          this.fixed = new UrlType();
10717          return this.fixed;
10718        }
10719        else if (name.equals("fixedUuid")) {
10720          this.fixed = new UuidType();
10721          return this.fixed;
10722        }
10723        else if (name.equals("fixedAddress")) {
10724          this.fixed = new Address();
10725          return this.fixed;
10726        }
10727        else if (name.equals("fixedAge")) {
10728          this.fixed = new Age();
10729          return this.fixed;
10730        }
10731        else if (name.equals("fixedAnnotation")) {
10732          this.fixed = new Annotation();
10733          return this.fixed;
10734        }
10735        else if (name.equals("fixedAttachment")) {
10736          this.fixed = new Attachment();
10737          return this.fixed;
10738        }
10739        else if (name.equals("fixedCodeableConcept")) {
10740          this.fixed = new CodeableConcept();
10741          return this.fixed;
10742        }
10743        else if (name.equals("fixedCoding")) {
10744          this.fixed = new Coding();
10745          return this.fixed;
10746        }
10747        else if (name.equals("fixedContactPoint")) {
10748          this.fixed = new ContactPoint();
10749          return this.fixed;
10750        }
10751        else if (name.equals("fixedCount")) {
10752          this.fixed = new Count();
10753          return this.fixed;
10754        }
10755        else if (name.equals("fixedDistance")) {
10756          this.fixed = new Distance();
10757          return this.fixed;
10758        }
10759        else if (name.equals("fixedDuration")) {
10760          this.fixed = new Duration();
10761          return this.fixed;
10762        }
10763        else if (name.equals("fixedHumanName")) {
10764          this.fixed = new HumanName();
10765          return this.fixed;
10766        }
10767        else if (name.equals("fixedIdentifier")) {
10768          this.fixed = new Identifier();
10769          return this.fixed;
10770        }
10771        else if (name.equals("fixedMoney")) {
10772          this.fixed = new Money();
10773          return this.fixed;
10774        }
10775        else if (name.equals("fixedPeriod")) {
10776          this.fixed = new Period();
10777          return this.fixed;
10778        }
10779        else if (name.equals("fixedQuantity")) {
10780          this.fixed = new Quantity();
10781          return this.fixed;
10782        }
10783        else if (name.equals("fixedRange")) {
10784          this.fixed = new Range();
10785          return this.fixed;
10786        }
10787        else if (name.equals("fixedRatio")) {
10788          this.fixed = new Ratio();
10789          return this.fixed;
10790        }
10791        else if (name.equals("fixedReference")) {
10792          this.fixed = new Reference();
10793          return this.fixed;
10794        }
10795        else if (name.equals("fixedSampledData")) {
10796          this.fixed = new SampledData();
10797          return this.fixed;
10798        }
10799        else if (name.equals("fixedSignature")) {
10800          this.fixed = new Signature();
10801          return this.fixed;
10802        }
10803        else if (name.equals("fixedTiming")) {
10804          this.fixed = new Timing();
10805          return this.fixed;
10806        }
10807        else if (name.equals("fixedContactDetail")) {
10808          this.fixed = new ContactDetail();
10809          return this.fixed;
10810        }
10811        else if (name.equals("fixedContributor")) {
10812          this.fixed = new Contributor();
10813          return this.fixed;
10814        }
10815        else if (name.equals("fixedDataRequirement")) {
10816          this.fixed = new DataRequirement();
10817          return this.fixed;
10818        }
10819        else if (name.equals("fixedExpression")) {
10820          this.fixed = new Expression();
10821          return this.fixed;
10822        }
10823        else if (name.equals("fixedParameterDefinition")) {
10824          this.fixed = new ParameterDefinition();
10825          return this.fixed;
10826        }
10827        else if (name.equals("fixedRelatedArtifact")) {
10828          this.fixed = new RelatedArtifact();
10829          return this.fixed;
10830        }
10831        else if (name.equals("fixedTriggerDefinition")) {
10832          this.fixed = new TriggerDefinition();
10833          return this.fixed;
10834        }
10835        else if (name.equals("fixedUsageContext")) {
10836          this.fixed = new UsageContext();
10837          return this.fixed;
10838        }
10839        else if (name.equals("fixedDosage")) {
10840          this.fixed = new Dosage();
10841          return this.fixed;
10842        }
10843        else if (name.equals("fixedMeta")) {
10844          this.fixed = new Meta();
10845          return this.fixed;
10846        }
10847        else if (name.equals("patternBase64Binary")) {
10848          this.pattern = new Base64BinaryType();
10849          return this.pattern;
10850        }
10851        else if (name.equals("patternBoolean")) {
10852          this.pattern = new BooleanType();
10853          return this.pattern;
10854        }
10855        else if (name.equals("patternCanonical")) {
10856          this.pattern = new CanonicalType();
10857          return this.pattern;
10858        }
10859        else if (name.equals("patternCode")) {
10860          this.pattern = new CodeType();
10861          return this.pattern;
10862        }
10863        else if (name.equals("patternDate")) {
10864          this.pattern = new DateType();
10865          return this.pattern;
10866        }
10867        else if (name.equals("patternDateTime")) {
10868          this.pattern = new DateTimeType();
10869          return this.pattern;
10870        }
10871        else if (name.equals("patternDecimal")) {
10872          this.pattern = new DecimalType();
10873          return this.pattern;
10874        }
10875        else if (name.equals("patternId")) {
10876          this.pattern = new IdType();
10877          return this.pattern;
10878        }
10879        else if (name.equals("patternInstant")) {
10880          this.pattern = new InstantType();
10881          return this.pattern;
10882        }
10883        else if (name.equals("patternInteger")) {
10884          this.pattern = new IntegerType();
10885          return this.pattern;
10886        }
10887        else if (name.equals("patternInteger64")) {
10888          this.pattern = new Integer64Type();
10889          return this.pattern;
10890        }
10891        else if (name.equals("patternMarkdown")) {
10892          this.pattern = new MarkdownType();
10893          return this.pattern;
10894        }
10895        else if (name.equals("patternOid")) {
10896          this.pattern = new OidType();
10897          return this.pattern;
10898        }
10899        else if (name.equals("patternPositiveInt")) {
10900          this.pattern = new PositiveIntType();
10901          return this.pattern;
10902        }
10903        else if (name.equals("patternString")) {
10904          this.pattern = new StringType();
10905          return this.pattern;
10906        }
10907        else if (name.equals("patternTime")) {
10908          this.pattern = new TimeType();
10909          return this.pattern;
10910        }
10911        else if (name.equals("patternUnsignedInt")) {
10912          this.pattern = new UnsignedIntType();
10913          return this.pattern;
10914        }
10915        else if (name.equals("patternUri")) {
10916          this.pattern = new UriType();
10917          return this.pattern;
10918        }
10919        else if (name.equals("patternUrl")) {
10920          this.pattern = new UrlType();
10921          return this.pattern;
10922        }
10923        else if (name.equals("patternUuid")) {
10924          this.pattern = new UuidType();
10925          return this.pattern;
10926        }
10927        else if (name.equals("patternAddress")) {
10928          this.pattern = new Address();
10929          return this.pattern;
10930        }
10931        else if (name.equals("patternAge")) {
10932          this.pattern = new Age();
10933          return this.pattern;
10934        }
10935        else if (name.equals("patternAnnotation")) {
10936          this.pattern = new Annotation();
10937          return this.pattern;
10938        }
10939        else if (name.equals("patternAttachment")) {
10940          this.pattern = new Attachment();
10941          return this.pattern;
10942        }
10943        else if (name.equals("patternCodeableConcept")) {
10944          this.pattern = new CodeableConcept();
10945          return this.pattern;
10946        }
10947        else if (name.equals("patternCoding")) {
10948          this.pattern = new Coding();
10949          return this.pattern;
10950        }
10951        else if (name.equals("patternContactPoint")) {
10952          this.pattern = new ContactPoint();
10953          return this.pattern;
10954        }
10955        else if (name.equals("patternCount")) {
10956          this.pattern = new Count();
10957          return this.pattern;
10958        }
10959        else if (name.equals("patternDistance")) {
10960          this.pattern = new Distance();
10961          return this.pattern;
10962        }
10963        else if (name.equals("patternDuration")) {
10964          this.pattern = new Duration();
10965          return this.pattern;
10966        }
10967        else if (name.equals("patternHumanName")) {
10968          this.pattern = new HumanName();
10969          return this.pattern;
10970        }
10971        else if (name.equals("patternIdentifier")) {
10972          this.pattern = new Identifier();
10973          return this.pattern;
10974        }
10975        else if (name.equals("patternMoney")) {
10976          this.pattern = new Money();
10977          return this.pattern;
10978        }
10979        else if (name.equals("patternPeriod")) {
10980          this.pattern = new Period();
10981          return this.pattern;
10982        }
10983        else if (name.equals("patternQuantity")) {
10984          this.pattern = new Quantity();
10985          return this.pattern;
10986        }
10987        else if (name.equals("patternRange")) {
10988          this.pattern = new Range();
10989          return this.pattern;
10990        }
10991        else if (name.equals("patternRatio")) {
10992          this.pattern = new Ratio();
10993          return this.pattern;
10994        }
10995        else if (name.equals("patternReference")) {
10996          this.pattern = new Reference();
10997          return this.pattern;
10998        }
10999        else if (name.equals("patternSampledData")) {
11000          this.pattern = new SampledData();
11001          return this.pattern;
11002        }
11003        else if (name.equals("patternSignature")) {
11004          this.pattern = new Signature();
11005          return this.pattern;
11006        }
11007        else if (name.equals("patternTiming")) {
11008          this.pattern = new Timing();
11009          return this.pattern;
11010        }
11011        else if (name.equals("patternContactDetail")) {
11012          this.pattern = new ContactDetail();
11013          return this.pattern;
11014        }
11015        else if (name.equals("patternContributor")) {
11016          this.pattern = new Contributor();
11017          return this.pattern;
11018        }
11019        else if (name.equals("patternDataRequirement")) {
11020          this.pattern = new DataRequirement();
11021          return this.pattern;
11022        }
11023        else if (name.equals("patternExpression")) {
11024          this.pattern = new Expression();
11025          return this.pattern;
11026        }
11027        else if (name.equals("patternParameterDefinition")) {
11028          this.pattern = new ParameterDefinition();
11029          return this.pattern;
11030        }
11031        else if (name.equals("patternRelatedArtifact")) {
11032          this.pattern = new RelatedArtifact();
11033          return this.pattern;
11034        }
11035        else if (name.equals("patternTriggerDefinition")) {
11036          this.pattern = new TriggerDefinition();
11037          return this.pattern;
11038        }
11039        else if (name.equals("patternUsageContext")) {
11040          this.pattern = new UsageContext();
11041          return this.pattern;
11042        }
11043        else if (name.equals("patternDosage")) {
11044          this.pattern = new Dosage();
11045          return this.pattern;
11046        }
11047        else if (name.equals("patternMeta")) {
11048          this.pattern = new Meta();
11049          return this.pattern;
11050        }
11051        else if (name.equals("example")) {
11052          return addExample();
11053        }
11054        else if (name.equals("minValueDate")) {
11055          this.minValue = new DateType();
11056          return this.minValue;
11057        }
11058        else if (name.equals("minValueDateTime")) {
11059          this.minValue = new DateTimeType();
11060          return this.minValue;
11061        }
11062        else if (name.equals("minValueInstant")) {
11063          this.minValue = new InstantType();
11064          return this.minValue;
11065        }
11066        else if (name.equals("minValueTime")) {
11067          this.minValue = new TimeType();
11068          return this.minValue;
11069        }
11070        else if (name.equals("minValueDecimal")) {
11071          this.minValue = new DecimalType();
11072          return this.minValue;
11073        }
11074        else if (name.equals("minValueInteger")) {
11075          this.minValue = new IntegerType();
11076          return this.minValue;
11077        }
11078        else if (name.equals("minValueInteger64")) {
11079          this.minValue = new Integer64Type();
11080          return this.minValue;
11081        }
11082        else if (name.equals("minValuePositiveInt")) {
11083          this.minValue = new PositiveIntType();
11084          return this.minValue;
11085        }
11086        else if (name.equals("minValueUnsignedInt")) {
11087          this.minValue = new UnsignedIntType();
11088          return this.minValue;
11089        }
11090        else if (name.equals("minValueQuantity")) {
11091          this.minValue = new Quantity();
11092          return this.minValue;
11093        }
11094        else if (name.equals("maxValueDate")) {
11095          this.maxValue = new DateType();
11096          return this.maxValue;
11097        }
11098        else if (name.equals("maxValueDateTime")) {
11099          this.maxValue = new DateTimeType();
11100          return this.maxValue;
11101        }
11102        else if (name.equals("maxValueInstant")) {
11103          this.maxValue = new InstantType();
11104          return this.maxValue;
11105        }
11106        else if (name.equals("maxValueTime")) {
11107          this.maxValue = new TimeType();
11108          return this.maxValue;
11109        }
11110        else if (name.equals("maxValueDecimal")) {
11111          this.maxValue = new DecimalType();
11112          return this.maxValue;
11113        }
11114        else if (name.equals("maxValueInteger")) {
11115          this.maxValue = new IntegerType();
11116          return this.maxValue;
11117        }
11118        else if (name.equals("maxValueInteger64")) {
11119          this.maxValue = new Integer64Type();
11120          return this.maxValue;
11121        }
11122        else if (name.equals("maxValuePositiveInt")) {
11123          this.maxValue = new PositiveIntType();
11124          return this.maxValue;
11125        }
11126        else if (name.equals("maxValueUnsignedInt")) {
11127          this.maxValue = new UnsignedIntType();
11128          return this.maxValue;
11129        }
11130        else if (name.equals("maxValueQuantity")) {
11131          this.maxValue = new Quantity();
11132          return this.maxValue;
11133        }
11134        else if (name.equals("maxLength")) {
11135          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.maxLength");
11136        }
11137        else if (name.equals("condition")) {
11138          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.condition");
11139        }
11140        else if (name.equals("constraint")) {
11141          return addConstraint();
11142        }
11143        else if (name.equals("mustSupport")) {
11144          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.mustSupport");
11145        }
11146        else if (name.equals("isModifier")) {
11147          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isModifier");
11148        }
11149        else if (name.equals("isModifierReason")) {
11150          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isModifierReason");
11151        }
11152        else if (name.equals("isSummary")) {
11153          throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isSummary");
11154        }
11155        else if (name.equals("binding")) {
11156          this.binding = new ElementDefinitionBindingComponent();
11157          return this.binding;
11158        }
11159        else if (name.equals("mapping")) {
11160          return addMapping();
11161        }
11162        else
11163          return super.addChild(name);
11164      }
11165
11166  public String fhirType() {
11167    return "ElementDefinition";
11168
11169  }
11170
11171      public ElementDefinition copy() {
11172        ElementDefinition dst = new ElementDefinition();
11173        copyValues(dst);
11174        return dst;
11175      }
11176
11177      public void copyValues(ElementDefinition dst) {
11178        super.copyValues(dst);
11179        dst.path = path == null ? null : path.copy();
11180        if (representation != null) {
11181          dst.representation = new ArrayList<Enumeration<PropertyRepresentation>>();
11182          for (Enumeration<PropertyRepresentation> i : representation)
11183            dst.representation.add(i.copy());
11184        };
11185        dst.sliceName = sliceName == null ? null : sliceName.copy();
11186        dst.sliceIsConstraining = sliceIsConstraining == null ? null : sliceIsConstraining.copy();
11187        dst.label = label == null ? null : label.copy();
11188        if (code != null) {
11189          dst.code = new ArrayList<Coding>();
11190          for (Coding i : code)
11191            dst.code.add(i.copy());
11192        };
11193        dst.slicing = slicing == null ? null : slicing.copy();
11194        dst.short_ = short_ == null ? null : short_.copy();
11195        dst.definition = definition == null ? null : definition.copy();
11196        dst.comment = comment == null ? null : comment.copy();
11197        dst.requirements = requirements == null ? null : requirements.copy();
11198        if (alias != null) {
11199          dst.alias = new ArrayList<StringType>();
11200          for (StringType i : alias)
11201            dst.alias.add(i.copy());
11202        };
11203        dst.min = min == null ? null : min.copy();
11204        dst.max = max == null ? null : max.copy();
11205        dst.base = base == null ? null : base.copy();
11206        dst.contentReference = contentReference == null ? null : contentReference.copy();
11207        if (type != null) {
11208          dst.type = new ArrayList<TypeRefComponent>();
11209          for (TypeRefComponent i : type)
11210            dst.type.add(i.copy());
11211        };
11212        dst.defaultValue = defaultValue == null ? null : defaultValue.copy();
11213        dst.meaningWhenMissing = meaningWhenMissing == null ? null : meaningWhenMissing.copy();
11214        dst.orderMeaning = orderMeaning == null ? null : orderMeaning.copy();
11215        dst.fixed = fixed == null ? null : fixed.copy();
11216        dst.pattern = pattern == null ? null : pattern.copy();
11217        if (example != null) {
11218          dst.example = new ArrayList<ElementDefinitionExampleComponent>();
11219          for (ElementDefinitionExampleComponent i : example)
11220            dst.example.add(i.copy());
11221        };
11222        dst.minValue = minValue == null ? null : minValue.copy();
11223        dst.maxValue = maxValue == null ? null : maxValue.copy();
11224        dst.maxLength = maxLength == null ? null : maxLength.copy();
11225        if (condition != null) {
11226          dst.condition = new ArrayList<IdType>();
11227          for (IdType i : condition)
11228            dst.condition.add(i.copy());
11229        };
11230        if (constraint != null) {
11231          dst.constraint = new ArrayList<ElementDefinitionConstraintComponent>();
11232          for (ElementDefinitionConstraintComponent i : constraint)
11233            dst.constraint.add(i.copy());
11234        };
11235        dst.mustSupport = mustSupport == null ? null : mustSupport.copy();
11236        dst.isModifier = isModifier == null ? null : isModifier.copy();
11237        dst.isModifierReason = isModifierReason == null ? null : isModifierReason.copy();
11238        dst.isSummary = isSummary == null ? null : isSummary.copy();
11239        dst.binding = binding == null ? null : binding.copy();
11240        if (mapping != null) {
11241          dst.mapping = new ArrayList<ElementDefinitionMappingComponent>();
11242          for (ElementDefinitionMappingComponent i : mapping)
11243            dst.mapping.add(i.copy());
11244        };
11245      }
11246
11247      protected ElementDefinition typedCopy() {
11248        return copy();
11249      }
11250
11251      @Override
11252      public boolean equalsDeep(Base other_) {
11253        if (!super.equalsDeep(other_))
11254          return false;
11255        if (!(other_ instanceof ElementDefinition))
11256          return false;
11257        ElementDefinition o = (ElementDefinition) other_;
11258        return compareDeep(path, o.path, true) && compareDeep(representation, o.representation, true) && compareDeep(sliceName, o.sliceName, true)
11259           && compareDeep(sliceIsConstraining, o.sliceIsConstraining, true) && compareDeep(label, o.label, true)
11260           && compareDeep(code, o.code, true) && compareDeep(slicing, o.slicing, true) && compareDeep(short_, o.short_, true)
11261           && compareDeep(definition, o.definition, true) && compareDeep(comment, o.comment, true) && compareDeep(requirements, o.requirements, true)
11262           && compareDeep(alias, o.alias, true) && compareDeep(min, o.min, true) && compareDeep(max, o.max, true)
11263           && compareDeep(base, o.base, true) && compareDeep(contentReference, o.contentReference, true) && compareDeep(type, o.type, true)
11264           && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(meaningWhenMissing, o.meaningWhenMissing, true)
11265           && compareDeep(orderMeaning, o.orderMeaning, true) && compareDeep(fixed, o.fixed, true) && compareDeep(pattern, o.pattern, true)
11266           && compareDeep(example, o.example, true) && compareDeep(minValue, o.minValue, true) && compareDeep(maxValue, o.maxValue, true)
11267           && compareDeep(maxLength, o.maxLength, true) && compareDeep(condition, o.condition, true) && compareDeep(constraint, o.constraint, true)
11268           && compareDeep(mustSupport, o.mustSupport, true) && compareDeep(isModifier, o.isModifier, true)
11269           && compareDeep(isModifierReason, o.isModifierReason, true) && compareDeep(isSummary, o.isSummary, true)
11270           && compareDeep(binding, o.binding, true) && compareDeep(mapping, o.mapping, true);
11271      }
11272
11273      @Override
11274      public boolean equalsShallow(Base other_) {
11275        if (!super.equalsShallow(other_))
11276          return false;
11277        if (!(other_ instanceof ElementDefinition))
11278          return false;
11279        ElementDefinition o = (ElementDefinition) other_;
11280        return compareValues(path, o.path, true) && compareValues(representation, o.representation, true) && compareValues(sliceName, o.sliceName, true)
11281           && compareValues(sliceIsConstraining, o.sliceIsConstraining, true) && compareValues(label, o.label, true)
11282           && compareValues(short_, o.short_, true) && compareValues(definition, o.definition, true) && compareValues(comment, o.comment, true)
11283           && compareValues(requirements, o.requirements, true) && compareValues(alias, o.alias, true) && compareValues(min, o.min, true)
11284           && compareValues(max, o.max, true) && compareValues(contentReference, o.contentReference, true) && compareValues(meaningWhenMissing, o.meaningWhenMissing, true)
11285           && compareValues(orderMeaning, o.orderMeaning, true) && compareValues(maxLength, o.maxLength, true)
11286           && compareValues(condition, o.condition, true) && compareValues(mustSupport, o.mustSupport, true) && compareValues(isModifier, o.isModifier, true)
11287           && compareValues(isModifierReason, o.isModifierReason, true) && compareValues(isSummary, o.isSummary, true)
11288          ;
11289      }
11290
11291      public boolean isEmpty() {
11292        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(path, representation, sliceName
11293          , sliceIsConstraining, label, code, slicing, short_, definition, comment, requirements
11294          , alias, min, max, base, contentReference, type, defaultValue, meaningWhenMissing
11295          , orderMeaning, fixed, pattern, example, minValue, maxValue, maxLength, condition
11296          , constraint, mustSupport, isModifier, isModifierReason, isSummary, binding, mapping
11297          );
11298      }
11299
11300// Manual code (from Configuration.txt)t:
11301  
11302  public String toString() {
11303    if (hasId())
11304      return getId();
11305    if (hasSliceName())
11306      return getPath()+":"+getSliceName();
11307    else
11308      return getPath();
11309  }
11310    
11311  public void makeBase(String path, int min, String max) {
11312    ElementDefinitionBaseComponent self = getBase();
11313    self.setPath(path);
11314    self.setMin(min);
11315    self.setMax(max);
11316  }
11317  
11318  public void makeBase() {
11319    ElementDefinitionBaseComponent self = getBase();
11320    self.setPath(getPath());
11321    self.setMin(getMin());
11322    self.setMax(getMax());
11323  }
11324 
11325  
11326  public String typeSummary() {
11327    CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
11328    for (TypeRefComponent tr : getType()) {
11329      if (tr.hasCode())
11330        b.append(tr.getWorkingCode());
11331    }
11332    return b.toString();
11333  }
11334  
11335  public String typeSummaryVB() {
11336    CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder("|");
11337    for (TypeRefComponent tr : getType()) {
11338      if (tr.hasCode())
11339        b.append(tr.getWorkingCode());
11340    }
11341    return b.toString().replace(" ", "");
11342  }
11343  
11344
11345  public TypeRefComponent getType(String code) {
11346    for (TypeRefComponent tr : getType()) 
11347      if (tr.getCode().equals(code))
11348        return tr;
11349    TypeRefComponent tr = new TypeRefComponent();
11350    tr.setCode(code);
11351    type.add(tr);
11352    return tr;
11353  }
11354
11355  public static final boolean NOT_MODIFIER = false;
11356  public static final boolean NOT_IN_SUMMARY = false;
11357  public static final boolean IS_MODIFIER = true;
11358  public static final boolean IS_IN_SUMMARY = true;
11359  public ElementDefinition(boolean defaults, boolean modifier, boolean inSummary) {
11360    super();
11361    if (defaults) {
11362      setIsModifier(modifier);
11363      setIsSummary(inSummary);
11364    }
11365  }  
11366
11367 public String present() {
11368    return hasId() ? getId() : getPath();
11369  }
11370
11371  public boolean hasCondition(IdType id) {
11372    for (IdType c : getCondition()) {
11373      if (c.primitiveValue().equals(id.primitiveValue()))
11374        return true;
11375    }
11376    return false;
11377  }
11378
11379  public boolean hasConstraint(String key) {
11380    for (ElementDefinitionConstraintComponent c : getConstraint()) {
11381      if (c.getKey().equals(key))
11382        return true;
11383    }
11384    return false;
11385  }
11386
11387  public boolean hasCode(Coding c) {
11388    for (Coding t : getCode()) {
11389      if (t.getSystem().equals(c.getSystem()) && t.getCode().equals(c.getCode()))
11390        return true;
11391    }
11392    return false;
11393  }  
11394
11395  public boolean isChoice() {
11396    return getPath().endsWith("[x]");
11397  }  
11398
11399  public String getName() {
11400    return hasPath() ? getPath().contains(".") ? getPath().substring(getPath().lastIndexOf(".")+1) : getPath() : null;
11401  }
11402
11403  public boolean unbounded() {
11404    return getMax().equals("*") || Integer.parseInt(getMax()) > 1;
11405  }
11406
11407  public boolean isMandatory() {
11408    return getMin() > 0;
11409  }
11410
11411  public boolean isInlineType() {
11412    return getType().size() == 1 && Utilities.existsInList(getType().get(0).getCode(), "Element", "BackboneElement");
11413  }  
11414
11415
11416
11417
11418// end addition
11419
11420}
11421