001package org.hl7.fhir.dstu3.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.1
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.dstu3.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046import org.hl7.fhir.exceptions.FHIRFormatError;
047/**
048 * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.
049 */
050@ResourceDef(name="StructureDefinition", profile="http://hl7.org/fhir/StructureDefinition/StructureDefinition")
051@ChildOrder(names={"url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "keyword", "fhirVersion", "mapping", "kind", "abstract", "contextType", "context", "contextInvariant", "type", "baseDefinition", "derivation", "snapshot", "differential"})
052public class StructureDefinition extends MetadataResource {
053
054    public enum StructureDefinitionKind {
055        /**
056         * A primitive type that has a value and an extension. These can be used throughout Resource and extension definitions. Only the base specification can define primitive types.
057         */
058        PRIMITIVETYPE, 
059        /**
060         * A  complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions, and in logical models.
061         */
062        COMPLEXTYPE, 
063        /**
064         * A resource defined by the FHIR specification.
065         */
066        RESOURCE, 
067        /**
068         * A conceptual package of data that will be mapped to resources for implementation.
069         */
070        LOGICAL, 
071        /**
072         * added to help the parsers with the generic types
073         */
074        NULL;
075        public static StructureDefinitionKind fromCode(String codeString) throws FHIRException {
076            if (codeString == null || "".equals(codeString))
077                return null;
078        if ("primitive-type".equals(codeString))
079          return PRIMITIVETYPE;
080        if ("complex-type".equals(codeString))
081          return COMPLEXTYPE;
082        if ("resource".equals(codeString))
083          return RESOURCE;
084        if ("logical".equals(codeString))
085          return LOGICAL;
086        if (Configuration.isAcceptInvalidEnums())
087          return null;
088        else
089          throw new FHIRException("Unknown StructureDefinitionKind code '"+codeString+"'");
090        }
091        public String toCode() {
092          switch (this) {
093            case PRIMITIVETYPE: return "primitive-type";
094            case COMPLEXTYPE: return "complex-type";
095            case RESOURCE: return "resource";
096            case LOGICAL: return "logical";
097            default: return "?";
098          }
099        }
100        public String getSystem() {
101          switch (this) {
102            case PRIMITIVETYPE: return "http://hl7.org/fhir/structure-definition-kind";
103            case COMPLEXTYPE: return "http://hl7.org/fhir/structure-definition-kind";
104            case RESOURCE: return "http://hl7.org/fhir/structure-definition-kind";
105            case LOGICAL: return "http://hl7.org/fhir/structure-definition-kind";
106            default: return "?";
107          }
108        }
109        public String getDefinition() {
110          switch (this) {
111            case PRIMITIVETYPE: return "A primitive type that has a value and an extension. These can be used throughout Resource and extension definitions. Only the base specification can define primitive types.";
112            case COMPLEXTYPE: return "A  complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions, and in logical models.";
113            case RESOURCE: return "A resource defined by the FHIR specification.";
114            case LOGICAL: return "A conceptual package of data that will be mapped to resources for implementation.";
115            default: return "?";
116          }
117        }
118        public String getDisplay() {
119          switch (this) {
120            case PRIMITIVETYPE: return "Primitive Data Type";
121            case COMPLEXTYPE: return "Complex Data Type";
122            case RESOURCE: return "Resource";
123            case LOGICAL: return "Logical Model";
124            default: return "?";
125          }
126        }
127    }
128
129  public static class StructureDefinitionKindEnumFactory implements EnumFactory<StructureDefinitionKind> {
130    public StructureDefinitionKind fromCode(String codeString) throws IllegalArgumentException {
131      if (codeString == null || "".equals(codeString))
132            if (codeString == null || "".equals(codeString))
133                return null;
134        if ("primitive-type".equals(codeString))
135          return StructureDefinitionKind.PRIMITIVETYPE;
136        if ("complex-type".equals(codeString))
137          return StructureDefinitionKind.COMPLEXTYPE;
138        if ("resource".equals(codeString))
139          return StructureDefinitionKind.RESOURCE;
140        if ("logical".equals(codeString))
141          return StructureDefinitionKind.LOGICAL;
142        throw new IllegalArgumentException("Unknown StructureDefinitionKind code '"+codeString+"'");
143        }
144        public Enumeration<StructureDefinitionKind> fromType(Base code) throws FHIRException {
145          if (code == null)
146            return null;
147          if (code.isEmpty())
148            return new Enumeration<StructureDefinitionKind>(this);
149          String codeString = ((PrimitiveType) code).asStringValue();
150          if (codeString == null || "".equals(codeString))
151            return null;
152        if ("primitive-type".equals(codeString))
153          return new Enumeration<StructureDefinitionKind>(this, StructureDefinitionKind.PRIMITIVETYPE);
154        if ("complex-type".equals(codeString))
155          return new Enumeration<StructureDefinitionKind>(this, StructureDefinitionKind.COMPLEXTYPE);
156        if ("resource".equals(codeString))
157          return new Enumeration<StructureDefinitionKind>(this, StructureDefinitionKind.RESOURCE);
158        if ("logical".equals(codeString))
159          return new Enumeration<StructureDefinitionKind>(this, StructureDefinitionKind.LOGICAL);
160        throw new FHIRException("Unknown StructureDefinitionKind code '"+codeString+"'");
161        }
162    public String toCode(StructureDefinitionKind code) {
163      if (code == StructureDefinitionKind.PRIMITIVETYPE)
164        return "primitive-type";
165      if (code == StructureDefinitionKind.COMPLEXTYPE)
166        return "complex-type";
167      if (code == StructureDefinitionKind.RESOURCE)
168        return "resource";
169      if (code == StructureDefinitionKind.LOGICAL)
170        return "logical";
171      return "?";
172      }
173    public String toSystem(StructureDefinitionKind code) {
174      return code.getSystem();
175      }
176    }
177
178    public enum ExtensionContext {
179        /**
180         * The context is all elements matching a particular resource element path.
181         */
182        RESOURCE, 
183        /**
184         * The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name).
185         */
186        DATATYPE, 
187        /**
188         * The context is a particular extension from a particular profile, a uri that identifies the extension definition.
189         */
190        EXTENSION, 
191        /**
192         * added to help the parsers with the generic types
193         */
194        NULL;
195        public static ExtensionContext fromCode(String codeString) throws FHIRException {
196            if (codeString == null || "".equals(codeString))
197                return null;
198        if ("resource".equals(codeString))
199          return RESOURCE;
200        if ("datatype".equals(codeString))
201          return DATATYPE;
202        if ("extension".equals(codeString))
203          return EXTENSION;
204        if (Configuration.isAcceptInvalidEnums())
205          return null;
206        else
207          throw new FHIRException("Unknown ExtensionContext code '"+codeString+"'");
208        }
209        public String toCode() {
210          switch (this) {
211            case RESOURCE: return "resource";
212            case DATATYPE: return "datatype";
213            case EXTENSION: return "extension";
214            default: return "?";
215          }
216        }
217        public String getSystem() {
218          switch (this) {
219            case RESOURCE: return "http://hl7.org/fhir/extension-context";
220            case DATATYPE: return "http://hl7.org/fhir/extension-context";
221            case EXTENSION: return "http://hl7.org/fhir/extension-context";
222            default: return "?";
223          }
224        }
225        public String getDefinition() {
226          switch (this) {
227            case RESOURCE: return "The context is all elements matching a particular resource element path.";
228            case DATATYPE: return "The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name).";
229            case EXTENSION: return "The context is a particular extension from a particular profile, a uri that identifies the extension definition.";
230            default: return "?";
231          }
232        }
233        public String getDisplay() {
234          switch (this) {
235            case RESOURCE: return "Resource";
236            case DATATYPE: return "Datatype";
237            case EXTENSION: return "Extension";
238            default: return "?";
239          }
240        }
241    }
242
243  public static class ExtensionContextEnumFactory implements EnumFactory<ExtensionContext> {
244    public ExtensionContext fromCode(String codeString) throws IllegalArgumentException {
245      if (codeString == null || "".equals(codeString))
246            if (codeString == null || "".equals(codeString))
247                return null;
248        if ("resource".equals(codeString))
249          return ExtensionContext.RESOURCE;
250        if ("datatype".equals(codeString))
251          return ExtensionContext.DATATYPE;
252        if ("extension".equals(codeString))
253          return ExtensionContext.EXTENSION;
254        throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'");
255        }
256        public Enumeration<ExtensionContext> fromType(Base code) throws FHIRException {
257          if (code == null)
258            return null;
259          if (code.isEmpty())
260            return new Enumeration<ExtensionContext>(this);
261          String codeString = ((PrimitiveType) code).asStringValue();
262          if (codeString == null || "".equals(codeString))
263            return null;
264        if ("resource".equals(codeString))
265          return new Enumeration<ExtensionContext>(this, ExtensionContext.RESOURCE);
266        if ("datatype".equals(codeString))
267          return new Enumeration<ExtensionContext>(this, ExtensionContext.DATATYPE);
268        if ("extension".equals(codeString))
269          return new Enumeration<ExtensionContext>(this, ExtensionContext.EXTENSION);
270        throw new FHIRException("Unknown ExtensionContext code '"+codeString+"'");
271        }
272    public String toCode(ExtensionContext code) {
273      if (code == ExtensionContext.RESOURCE)
274        return "resource";
275      if (code == ExtensionContext.DATATYPE)
276        return "datatype";
277      if (code == ExtensionContext.EXTENSION)
278        return "extension";
279      return "?";
280      }
281    public String toSystem(ExtensionContext code) {
282      return code.getSystem();
283      }
284    }
285
286    public enum TypeDerivationRule {
287        /**
288         * This definition defines a new type that adds additional elements to the base type
289         */
290        SPECIALIZATION, 
291        /**
292         * This definition adds additional rules to an existing concrete type
293         */
294        CONSTRAINT, 
295        /**
296         * added to help the parsers with the generic types
297         */
298        NULL;
299        public static TypeDerivationRule fromCode(String codeString) throws FHIRException {
300            if (codeString == null || "".equals(codeString))
301                return null;
302        if ("specialization".equals(codeString))
303          return SPECIALIZATION;
304        if ("constraint".equals(codeString))
305          return CONSTRAINT;
306        if (Configuration.isAcceptInvalidEnums())
307          return null;
308        else
309          throw new FHIRException("Unknown TypeDerivationRule code '"+codeString+"'");
310        }
311        public String toCode() {
312          switch (this) {
313            case SPECIALIZATION: return "specialization";
314            case CONSTRAINT: return "constraint";
315            default: return "?";
316          }
317        }
318        public String getSystem() {
319          switch (this) {
320            case SPECIALIZATION: return "http://hl7.org/fhir/type-derivation-rule";
321            case CONSTRAINT: return "http://hl7.org/fhir/type-derivation-rule";
322            default: return "?";
323          }
324        }
325        public String getDefinition() {
326          switch (this) {
327            case SPECIALIZATION: return "This definition defines a new type that adds additional elements to the base type";
328            case CONSTRAINT: return "This definition adds additional rules to an existing concrete type";
329            default: return "?";
330          }
331        }
332        public String getDisplay() {
333          switch (this) {
334            case SPECIALIZATION: return "Specialization";
335            case CONSTRAINT: return "Constraint";
336            default: return "?";
337          }
338        }
339    }
340
341  public static class TypeDerivationRuleEnumFactory implements EnumFactory<TypeDerivationRule> {
342    public TypeDerivationRule fromCode(String codeString) throws IllegalArgumentException {
343      if (codeString == null || "".equals(codeString))
344            if (codeString == null || "".equals(codeString))
345                return null;
346        if ("specialization".equals(codeString))
347          return TypeDerivationRule.SPECIALIZATION;
348        if ("constraint".equals(codeString))
349          return TypeDerivationRule.CONSTRAINT;
350        throw new IllegalArgumentException("Unknown TypeDerivationRule code '"+codeString+"'");
351        }
352        public Enumeration<TypeDerivationRule> fromType(Base code) throws FHIRException {
353          if (code == null)
354            return null;
355          if (code.isEmpty())
356            return new Enumeration<TypeDerivationRule>(this);
357          String codeString = ((PrimitiveType) code).asStringValue();
358          if (codeString == null || "".equals(codeString))
359            return null;
360        if ("specialization".equals(codeString))
361          return new Enumeration<TypeDerivationRule>(this, TypeDerivationRule.SPECIALIZATION);
362        if ("constraint".equals(codeString))
363          return new Enumeration<TypeDerivationRule>(this, TypeDerivationRule.CONSTRAINT);
364        throw new FHIRException("Unknown TypeDerivationRule code '"+codeString+"'");
365        }
366    public String toCode(TypeDerivationRule code) {
367      if (code == TypeDerivationRule.SPECIALIZATION)
368        return "specialization";
369      if (code == TypeDerivationRule.CONSTRAINT)
370        return "constraint";
371      return "?";
372      }
373    public String toSystem(TypeDerivationRule code) {
374      return code.getSystem();
375      }
376    }
377
378    @Block()
379    public static class StructureDefinitionMappingComponent extends BackboneElement implements IBaseBackboneElement {
380        /**
381         * An Internal id that is used to identify this mapping set when specific mappings are made.
382         */
383        @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
384        @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made." )
385        protected IdType identity;
386
387        /**
388         * An absolute URI that identifies the specification that this mapping is expressed to.
389         */
390        @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
391        @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to." )
392        protected UriType uri;
393
394        /**
395         * A name for the specification that is being mapped to.
396         */
397        @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
398        @Description(shortDefinition="Names what this mapping refers to", formalDefinition="A name for the specification that is being mapped to." )
399        protected StringType name;
400
401        /**
402         * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.
403         */
404        @Child(name = "comment", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
405        @Description(shortDefinition="Versions, Issues, Scope limitations etc.", formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage." )
406        protected StringType comment;
407
408        private static final long serialVersionUID = 9610265L;
409
410    /**
411     * Constructor
412     */
413      public StructureDefinitionMappingComponent() {
414        super();
415      }
416
417    /**
418     * Constructor
419     */
420      public StructureDefinitionMappingComponent(IdType identity) {
421        super();
422        this.identity = identity;
423      }
424
425        /**
426         * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value
427         */
428        public IdType getIdentityElement() { 
429          if (this.identity == null)
430            if (Configuration.errorOnAutoCreate())
431              throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.identity");
432            else if (Configuration.doAutoCreate())
433              this.identity = new IdType(); // bb
434          return this.identity;
435        }
436
437        public boolean hasIdentityElement() { 
438          return this.identity != null && !this.identity.isEmpty();
439        }
440
441        public boolean hasIdentity() { 
442          return this.identity != null && !this.identity.isEmpty();
443        }
444
445        /**
446         * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value
447         */
448        public StructureDefinitionMappingComponent setIdentityElement(IdType value) { 
449          this.identity = value;
450          return this;
451        }
452
453        /**
454         * @return An Internal id that is used to identify this mapping set when specific mappings are made.
455         */
456        public String getIdentity() { 
457          return this.identity == null ? null : this.identity.getValue();
458        }
459
460        /**
461         * @param value An Internal id that is used to identify this mapping set when specific mappings are made.
462         */
463        public StructureDefinitionMappingComponent setIdentity(String value) { 
464            if (this.identity == null)
465              this.identity = new IdType();
466            this.identity.setValue(value);
467          return this;
468        }
469
470        /**
471         * @return {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
472         */
473        public UriType getUriElement() { 
474          if (this.uri == null)
475            if (Configuration.errorOnAutoCreate())
476              throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.uri");
477            else if (Configuration.doAutoCreate())
478              this.uri = new UriType(); // bb
479          return this.uri;
480        }
481
482        public boolean hasUriElement() { 
483          return this.uri != null && !this.uri.isEmpty();
484        }
485
486        public boolean hasUri() { 
487          return this.uri != null && !this.uri.isEmpty();
488        }
489
490        /**
491         * @param value {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
492         */
493        public StructureDefinitionMappingComponent setUriElement(UriType value) { 
494          this.uri = value;
495          return this;
496        }
497
498        /**
499         * @return An absolute URI that identifies the specification that this mapping is expressed to.
500         */
501        public String getUri() { 
502          return this.uri == null ? null : this.uri.getValue();
503        }
504
505        /**
506         * @param value An absolute URI that identifies the specification that this mapping is expressed to.
507         */
508        public StructureDefinitionMappingComponent setUri(String value) { 
509          if (Utilities.noString(value))
510            this.uri = null;
511          else {
512            if (this.uri == null)
513              this.uri = new UriType();
514            this.uri.setValue(value);
515          }
516          return this;
517        }
518
519        /**
520         * @return {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
521         */
522        public StringType getNameElement() { 
523          if (this.name == null)
524            if (Configuration.errorOnAutoCreate())
525              throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.name");
526            else if (Configuration.doAutoCreate())
527              this.name = new StringType(); // bb
528          return this.name;
529        }
530
531        public boolean hasNameElement() { 
532          return this.name != null && !this.name.isEmpty();
533        }
534
535        public boolean hasName() { 
536          return this.name != null && !this.name.isEmpty();
537        }
538
539        /**
540         * @param value {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
541         */
542        public StructureDefinitionMappingComponent setNameElement(StringType value) { 
543          this.name = value;
544          return this;
545        }
546
547        /**
548         * @return A name for the specification that is being mapped to.
549         */
550        public String getName() { 
551          return this.name == null ? null : this.name.getValue();
552        }
553
554        /**
555         * @param value A name for the specification that is being mapped to.
556         */
557        public StructureDefinitionMappingComponent setName(String value) { 
558          if (Utilities.noString(value))
559            this.name = null;
560          else {
561            if (this.name == null)
562              this.name = new StringType();
563            this.name.setValue(value);
564          }
565          return this;
566        }
567
568        /**
569         * @return {@link #comment} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
570         */
571        public StringType getCommentElement() { 
572          if (this.comment == null)
573            if (Configuration.errorOnAutoCreate())
574              throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.comment");
575            else if (Configuration.doAutoCreate())
576              this.comment = new StringType(); // bb
577          return this.comment;
578        }
579
580        public boolean hasCommentElement() { 
581          return this.comment != null && !this.comment.isEmpty();
582        }
583
584        public boolean hasComment() { 
585          return this.comment != null && !this.comment.isEmpty();
586        }
587
588        /**
589         * @param value {@link #comment} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
590         */
591        public StructureDefinitionMappingComponent setCommentElement(StringType value) { 
592          this.comment = value;
593          return this;
594        }
595
596        /**
597         * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.
598         */
599        public String getComment() { 
600          return this.comment == null ? null : this.comment.getValue();
601        }
602
603        /**
604         * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.
605         */
606        public StructureDefinitionMappingComponent setComment(String value) { 
607          if (Utilities.noString(value))
608            this.comment = null;
609          else {
610            if (this.comment == null)
611              this.comment = new StringType();
612            this.comment.setValue(value);
613          }
614          return this;
615        }
616
617        protected void listChildren(List<Property> children) {
618          super.listChildren(children);
619          children.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made.", 0, 1, identity));
620          children.add(new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, 1, uri));
621          children.add(new Property("name", "string", "A name for the specification that is being mapped to.", 0, 1, name));
622          children.add(new Property("comment", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, 1, comment));
623        }
624
625        @Override
626        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
627          switch (_hash) {
628          case -135761730: /*identity*/  return new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made.", 0, 1, identity);
629          case 116076: /*uri*/  return new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, 1, uri);
630          case 3373707: /*name*/  return new Property("name", "string", "A name for the specification that is being mapped to.", 0, 1, name);
631          case 950398559: /*comment*/  return new Property("comment", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, 1, comment);
632          default: return super.getNamedProperty(_hash, _name, _checkValid);
633          }
634
635        }
636
637      @Override
638      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
639        switch (hash) {
640        case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType
641        case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType
642        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
643        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
644        default: return super.getProperty(hash, name, checkValid);
645        }
646
647      }
648
649      @Override
650      public Base setProperty(int hash, String name, Base value) throws FHIRException {
651        switch (hash) {
652        case -135761730: // identity
653          this.identity = castToId(value); // IdType
654          return value;
655        case 116076: // uri
656          this.uri = castToUri(value); // UriType
657          return value;
658        case 3373707: // name
659          this.name = castToString(value); // StringType
660          return value;
661        case 950398559: // comment
662          this.comment = castToString(value); // StringType
663          return value;
664        default: return super.setProperty(hash, name, value);
665        }
666
667      }
668
669      @Override
670      public Base setProperty(String name, Base value) throws FHIRException {
671        if (name.equals("identity")) {
672          this.identity = castToId(value); // IdType
673        } else if (name.equals("uri")) {
674          this.uri = castToUri(value); // UriType
675        } else if (name.equals("name")) {
676          this.name = castToString(value); // StringType
677        } else if (name.equals("comment")) {
678          this.comment = castToString(value); // StringType
679        } else
680          return super.setProperty(name, value);
681        return value;
682      }
683
684      @Override
685      public Base makeProperty(int hash, String name) throws FHIRException {
686        switch (hash) {
687        case -135761730:  return getIdentityElement();
688        case 116076:  return getUriElement();
689        case 3373707:  return getNameElement();
690        case 950398559:  return getCommentElement();
691        default: return super.makeProperty(hash, name);
692        }
693
694      }
695
696      @Override
697      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
698        switch (hash) {
699        case -135761730: /*identity*/ return new String[] {"id"};
700        case 116076: /*uri*/ return new String[] {"uri"};
701        case 3373707: /*name*/ return new String[] {"string"};
702        case 950398559: /*comment*/ return new String[] {"string"};
703        default: return super.getTypesForProperty(hash, name);
704        }
705
706      }
707
708      @Override
709      public Base addChild(String name) throws FHIRException {
710        if (name.equals("identity")) {
711          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.identity");
712        }
713        else if (name.equals("uri")) {
714          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.uri");
715        }
716        else if (name.equals("name")) {
717          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.name");
718        }
719        else if (name.equals("comment")) {
720          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.comment");
721        }
722        else
723          return super.addChild(name);
724      }
725
726      public StructureDefinitionMappingComponent copy() {
727        StructureDefinitionMappingComponent dst = new StructureDefinitionMappingComponent();
728        copyValues(dst);
729        dst.identity = identity == null ? null : identity.copy();
730        dst.uri = uri == null ? null : uri.copy();
731        dst.name = name == null ? null : name.copy();
732        dst.comment = comment == null ? null : comment.copy();
733        return dst;
734      }
735
736      @Override
737      public boolean equalsDeep(Base other_) {
738        if (!super.equalsDeep(other_))
739          return false;
740        if (!(other_ instanceof StructureDefinitionMappingComponent))
741          return false;
742        StructureDefinitionMappingComponent o = (StructureDefinitionMappingComponent) other_;
743        return compareDeep(identity, o.identity, true) && compareDeep(uri, o.uri, true) && compareDeep(name, o.name, true)
744           && compareDeep(comment, o.comment, true);
745      }
746
747      @Override
748      public boolean equalsShallow(Base other_) {
749        if (!super.equalsShallow(other_))
750          return false;
751        if (!(other_ instanceof StructureDefinitionMappingComponent))
752          return false;
753        StructureDefinitionMappingComponent o = (StructureDefinitionMappingComponent) other_;
754        return compareValues(identity, o.identity, true) && compareValues(uri, o.uri, true) && compareValues(name, o.name, true)
755           && compareValues(comment, o.comment, true);
756      }
757
758      public boolean isEmpty() {
759        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identity, uri, name, comment
760          );
761      }
762
763  public String fhirType() {
764    return "StructureDefinition.mapping";
765
766  }
767
768  }
769
770    @Block()
771    public static class StructureDefinitionSnapshotComponent extends BackboneElement implements IBaseBackboneElement {
772        /**
773         * Captures constraints on each element within the resource.
774         */
775        @Child(name = "element", type = {ElementDefinition.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
776        @Description(shortDefinition="Definition of elements in the resource (if no StructureDefinition)", formalDefinition="Captures constraints on each element within the resource." )
777        protected List<ElementDefinition> element;
778
779        private static final long serialVersionUID = 53896641L;
780
781    /**
782     * Constructor
783     */
784      public StructureDefinitionSnapshotComponent() {
785        super();
786      }
787
788        /**
789         * @return {@link #element} (Captures constraints on each element within the resource.)
790         */
791        public List<ElementDefinition> getElement() { 
792          if (this.element == null)
793            this.element = new ArrayList<ElementDefinition>();
794          return this.element;
795        }
796
797        /**
798         * @return Returns a reference to <code>this</code> for easy method chaining
799         */
800        public StructureDefinitionSnapshotComponent setElement(List<ElementDefinition> theElement) { 
801          this.element = theElement;
802          return this;
803        }
804
805        public boolean hasElement() { 
806          if (this.element == null)
807            return false;
808          for (ElementDefinition item : this.element)
809            if (!item.isEmpty())
810              return true;
811          return false;
812        }
813
814        public ElementDefinition addElement() { //3
815          ElementDefinition t = new ElementDefinition();
816          if (this.element == null)
817            this.element = new ArrayList<ElementDefinition>();
818          this.element.add(t);
819          return t;
820        }
821
822        public StructureDefinitionSnapshotComponent addElement(ElementDefinition t) { //3
823          if (t == null)
824            return this;
825          if (this.element == null)
826            this.element = new ArrayList<ElementDefinition>();
827          this.element.add(t);
828          return this;
829        }
830
831        /**
832         * @return The first repetition of repeating field {@link #element}, creating it if it does not already exist
833         */
834        public ElementDefinition getElementFirstRep() { 
835          if (getElement().isEmpty()) {
836            addElement();
837          }
838          return getElement().get(0);
839        }
840
841        protected void listChildren(List<Property> children) {
842          super.listChildren(children);
843          children.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element));
844        }
845
846        @Override
847        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
848          switch (_hash) {
849          case -1662836996: /*element*/  return new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element);
850          default: return super.getNamedProperty(_hash, _name, _checkValid);
851          }
852
853        }
854
855      @Override
856      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
857        switch (hash) {
858        case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // ElementDefinition
859        default: return super.getProperty(hash, name, checkValid);
860        }
861
862      }
863
864      @Override
865      public Base setProperty(int hash, String name, Base value) throws FHIRException {
866        switch (hash) {
867        case -1662836996: // element
868          this.getElement().add(castToElementDefinition(value)); // ElementDefinition
869          return value;
870        default: return super.setProperty(hash, name, value);
871        }
872
873      }
874
875      @Override
876      public Base setProperty(String name, Base value) throws FHIRException {
877        if (name.equals("element")) {
878          this.getElement().add(castToElementDefinition(value));
879        } else
880          return super.setProperty(name, value);
881        return value;
882      }
883
884      @Override
885      public Base makeProperty(int hash, String name) throws FHIRException {
886        switch (hash) {
887        case -1662836996:  return addElement(); 
888        default: return super.makeProperty(hash, name);
889        }
890
891      }
892
893      @Override
894      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
895        switch (hash) {
896        case -1662836996: /*element*/ return new String[] {"ElementDefinition"};
897        default: return super.getTypesForProperty(hash, name);
898        }
899
900      }
901
902      @Override
903      public Base addChild(String name) throws FHIRException {
904        if (name.equals("element")) {
905          return addElement();
906        }
907        else
908          return super.addChild(name);
909      }
910
911      public StructureDefinitionSnapshotComponent copy() {
912        StructureDefinitionSnapshotComponent dst = new StructureDefinitionSnapshotComponent();
913        copyValues(dst);
914        if (element != null) {
915          dst.element = new ArrayList<ElementDefinition>();
916          for (ElementDefinition i : element)
917            dst.element.add(i.copy());
918        };
919        return dst;
920      }
921
922      @Override
923      public boolean equalsDeep(Base other_) {
924        if (!super.equalsDeep(other_))
925          return false;
926        if (!(other_ instanceof StructureDefinitionSnapshotComponent))
927          return false;
928        StructureDefinitionSnapshotComponent o = (StructureDefinitionSnapshotComponent) other_;
929        return compareDeep(element, o.element, true);
930      }
931
932      @Override
933      public boolean equalsShallow(Base other_) {
934        if (!super.equalsShallow(other_))
935          return false;
936        if (!(other_ instanceof StructureDefinitionSnapshotComponent))
937          return false;
938        StructureDefinitionSnapshotComponent o = (StructureDefinitionSnapshotComponent) other_;
939        return true;
940      }
941
942      public boolean isEmpty() {
943        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(element);
944      }
945
946  public String fhirType() {
947    return "StructureDefinition.snapshot";
948
949  }
950
951  }
952
953    @Block()
954    public static class StructureDefinitionDifferentialComponent extends BackboneElement implements IBaseBackboneElement {
955        /**
956         * Captures constraints on each element within the resource.
957         */
958        @Child(name = "element", type = {ElementDefinition.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
959        @Description(shortDefinition="Definition of elements in the resource (if no StructureDefinition)", formalDefinition="Captures constraints on each element within the resource." )
960        protected List<ElementDefinition> element;
961
962        private static final long serialVersionUID = 53896641L;
963
964    /**
965     * Constructor
966     */
967      public StructureDefinitionDifferentialComponent() {
968        super();
969      }
970
971        /**
972         * @return {@link #element} (Captures constraints on each element within the resource.)
973         */
974        public List<ElementDefinition> getElement() { 
975          if (this.element == null)
976            this.element = new ArrayList<ElementDefinition>();
977          return this.element;
978        }
979
980        /**
981         * @return Returns a reference to <code>this</code> for easy method chaining
982         */
983        public StructureDefinitionDifferentialComponent setElement(List<ElementDefinition> theElement) { 
984          this.element = theElement;
985          return this;
986        }
987
988        public boolean hasElement() { 
989          if (this.element == null)
990            return false;
991          for (ElementDefinition item : this.element)
992            if (!item.isEmpty())
993              return true;
994          return false;
995        }
996
997        public ElementDefinition addElement() { //3
998          ElementDefinition t = new ElementDefinition();
999          if (this.element == null)
1000            this.element = new ArrayList<ElementDefinition>();
1001          this.element.add(t);
1002          return t;
1003        }
1004
1005        public StructureDefinitionDifferentialComponent addElement(ElementDefinition t) { //3
1006          if (t == null)
1007            return this;
1008          if (this.element == null)
1009            this.element = new ArrayList<ElementDefinition>();
1010          this.element.add(t);
1011          return this;
1012        }
1013
1014        /**
1015         * @return The first repetition of repeating field {@link #element}, creating it if it does not already exist
1016         */
1017        public ElementDefinition getElementFirstRep() { 
1018          if (getElement().isEmpty()) {
1019            addElement();
1020          }
1021          return getElement().get(0);
1022        }
1023
1024        protected void listChildren(List<Property> children) {
1025          super.listChildren(children);
1026          children.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element));
1027        }
1028
1029        @Override
1030        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1031          switch (_hash) {
1032          case -1662836996: /*element*/  return new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element);
1033          default: return super.getNamedProperty(_hash, _name, _checkValid);
1034          }
1035
1036        }
1037
1038      @Override
1039      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1040        switch (hash) {
1041        case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // ElementDefinition
1042        default: return super.getProperty(hash, name, checkValid);
1043        }
1044
1045      }
1046
1047      @Override
1048      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1049        switch (hash) {
1050        case -1662836996: // element
1051          this.getElement().add(castToElementDefinition(value)); // ElementDefinition
1052          return value;
1053        default: return super.setProperty(hash, name, value);
1054        }
1055
1056      }
1057
1058      @Override
1059      public Base setProperty(String name, Base value) throws FHIRException {
1060        if (name.equals("element")) {
1061          this.getElement().add(castToElementDefinition(value));
1062        } else
1063          return super.setProperty(name, value);
1064        return value;
1065      }
1066
1067      @Override
1068      public Base makeProperty(int hash, String name) throws FHIRException {
1069        switch (hash) {
1070        case -1662836996:  return addElement(); 
1071        default: return super.makeProperty(hash, name);
1072        }
1073
1074      }
1075
1076      @Override
1077      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1078        switch (hash) {
1079        case -1662836996: /*element*/ return new String[] {"ElementDefinition"};
1080        default: return super.getTypesForProperty(hash, name);
1081        }
1082
1083      }
1084
1085      @Override
1086      public Base addChild(String name) throws FHIRException {
1087        if (name.equals("element")) {
1088          return addElement();
1089        }
1090        else
1091          return super.addChild(name);
1092      }
1093
1094      public StructureDefinitionDifferentialComponent copy() {
1095        StructureDefinitionDifferentialComponent dst = new StructureDefinitionDifferentialComponent();
1096        copyValues(dst);
1097        if (element != null) {
1098          dst.element = new ArrayList<ElementDefinition>();
1099          for (ElementDefinition i : element)
1100            dst.element.add(i.copy());
1101        };
1102        return dst;
1103      }
1104
1105      @Override
1106      public boolean equalsDeep(Base other_) {
1107        if (!super.equalsDeep(other_))
1108          return false;
1109        if (!(other_ instanceof StructureDefinitionDifferentialComponent))
1110          return false;
1111        StructureDefinitionDifferentialComponent o = (StructureDefinitionDifferentialComponent) other_;
1112        return compareDeep(element, o.element, true);
1113      }
1114
1115      @Override
1116      public boolean equalsShallow(Base other_) {
1117        if (!super.equalsShallow(other_))
1118          return false;
1119        if (!(other_ instanceof StructureDefinitionDifferentialComponent))
1120          return false;
1121        StructureDefinitionDifferentialComponent o = (StructureDefinitionDifferentialComponent) other_;
1122        return true;
1123      }
1124
1125      public boolean isEmpty() {
1126        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(element);
1127      }
1128
1129  public String fhirType() {
1130    return "StructureDefinition.differential";
1131
1132  }
1133
1134  }
1135
1136    /**
1137     * A formal identifier that is used to identify this structure definition when it is represented in other formats, or referenced in a specification, model, design or an instance.
1138     */
1139    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1140    @Description(shortDefinition="Additional identifier for the structure definition", formalDefinition="A formal identifier that is used to identify this structure definition when it is represented in other formats, or referenced in a specification, model, design or an instance." )
1141    protected List<Identifier> identifier;
1142
1143    /**
1144     * Explaination of why this structure definition is needed and why it has been designed as it has.
1145     */
1146    @Child(name = "purpose", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1147    @Description(shortDefinition="Why this structure definition is defined", formalDefinition="Explaination of why this structure definition is needed and why it has been designed as it has." )
1148    protected MarkdownType purpose;
1149
1150    /**
1151     * A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.
1152     */
1153    @Child(name = "copyright", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1154    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition." )
1155    protected MarkdownType copyright;
1156
1157    /**
1158     * A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates.
1159     */
1160    @Child(name = "keyword", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1161    @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates." )
1162    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/profile-code")
1163    protected List<Coding> keyword;
1164
1165    /**
1166     * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.
1167     */
1168    @Child(name = "fhirVersion", type = {IdType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1169    @Description(shortDefinition="FHIR Version this StructureDefinition targets", formalDefinition="The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version." )
1170    protected IdType fhirVersion;
1171
1172    /**
1173     * An external specification that the content is mapped to.
1174     */
1175    @Child(name = "mapping", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1176    @Description(shortDefinition="External specification that the content is mapped to", formalDefinition="An external specification that the content is mapped to." )
1177    protected List<StructureDefinitionMappingComponent> mapping;
1178
1179    /**
1180     * Defines the kind of structure that this definition is describing.
1181     */
1182    @Child(name = "kind", type = {CodeType.class}, order=6, min=1, max=1, modifier=false, summary=true)
1183    @Description(shortDefinition="primitive-type | complex-type | resource | logical", formalDefinition="Defines the kind of structure that this definition is describing." )
1184    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/structure-definition-kind")
1185    protected Enumeration<StructureDefinitionKind> kind;
1186
1187    /**
1188     * Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems.
1189     */
1190    @Child(name = "abstract", type = {BooleanType.class}, order=7, min=1, max=1, modifier=false, summary=true)
1191    @Description(shortDefinition="Whether the structure is abstract", formalDefinition="Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems." )
1192    protected BooleanType abstract_;
1193
1194    /**
1195     * If this is an extension, Identifies the context within FHIR resources where the extension can be used.
1196     */
1197    @Child(name = "contextType", type = {CodeType.class}, order=8, min=0, max=1, modifier=false, summary=true)
1198    @Description(shortDefinition="resource | datatype | extension", formalDefinition="If this is an extension, Identifies the context within FHIR resources where the extension can be used." )
1199    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/extension-context")
1200    protected Enumeration<ExtensionContext> contextType;
1201
1202    /**
1203     * Identifies the types of resource or data type elements to which the extension can be applied.
1204     */
1205    @Child(name = "context", type = {StringType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1206    @Description(shortDefinition="Where the extension can be used in instances", formalDefinition="Identifies the types of resource or data type elements to which the extension can be applied." )
1207    protected List<StringType> context;
1208
1209    /**
1210     * A set of rules as Fluent Invariants about when the extension can be used (e.g. co-occurrence variants for the extension).
1211     */
1212    @Child(name = "contextInvariant", type = {StringType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1213    @Description(shortDefinition="FHIRPath invariants - when the extension can be used", formalDefinition="A set of rules as Fluent Invariants about when the extension can be used (e.g. co-occurrence variants for the extension)." )
1214    protected List<StringType> contextInvariant;
1215
1216    /**
1217     * The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).
1218     */
1219    @Child(name = "type", type = {CodeType.class}, order=11, min=1, max=1, modifier=false, summary=true)
1220    @Description(shortDefinition="Type defined or constrained by this structure", formalDefinition="The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type)." )
1221    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
1222    protected CodeType type;
1223
1224    /**
1225     * An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.
1226     */
1227    @Child(name = "baseDefinition", type = {UriType.class}, order=12, min=0, max=1, modifier=false, summary=true)
1228    @Description(shortDefinition="Definition that this type is constrained/specialized from", formalDefinition="An absolute URI that is the base structure from which this type is derived, either by specialization or constraint." )
1229    protected UriType baseDefinition;
1230
1231    /**
1232     * How the type relates to the baseDefinition.
1233     */
1234    @Child(name = "derivation", type = {CodeType.class}, order=13, min=0, max=1, modifier=false, summary=true)
1235    @Description(shortDefinition="specialization | constraint - How relates to base definition", formalDefinition="How the type relates to the baseDefinition." )
1236    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/type-derivation-rule")
1237    protected Enumeration<TypeDerivationRule> derivation;
1238
1239    /**
1240     * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.
1241     */
1242    @Child(name = "snapshot", type = {}, order=14, min=0, max=1, modifier=false, summary=false)
1243    @Description(shortDefinition="Snapshot view of the structure", formalDefinition="A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition." )
1244    protected StructureDefinitionSnapshotComponent snapshot;
1245
1246    /**
1247     * A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.
1248     */
1249    @Child(name = "differential", type = {}, order=15, min=0, max=1, modifier=false, summary=false)
1250    @Description(shortDefinition="Differential view of the structure", formalDefinition="A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies." )
1251    protected StructureDefinitionDifferentialComponent differential;
1252
1253    private static final long serialVersionUID = -1511739381L;
1254
1255  /**
1256   * Constructor
1257   */
1258    public StructureDefinition() {
1259      super();
1260    }
1261
1262  /**
1263   * Constructor
1264   */
1265    public StructureDefinition(UriType url, StringType name, Enumeration<PublicationStatus> status, Enumeration<StructureDefinitionKind> kind, BooleanType abstract_, CodeType type) {
1266      super();
1267      this.url = url;
1268      this.name = name;
1269      this.status = status;
1270      this.kind = kind;
1271      this.abstract_ = abstract_;
1272      this.type = type;
1273    }
1274
1275    /**
1276     * @return {@link #url} (An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. The URL SHOULD include the major version of the structure definition. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1277     */
1278    public UriType getUrlElement() { 
1279      if (this.url == null)
1280        if (Configuration.errorOnAutoCreate())
1281          throw new Error("Attempt to auto-create StructureDefinition.url");
1282        else if (Configuration.doAutoCreate())
1283          this.url = new UriType(); // bb
1284      return this.url;
1285    }
1286
1287    public boolean hasUrlElement() { 
1288      return this.url != null && !this.url.isEmpty();
1289    }
1290
1291    public boolean hasUrl() { 
1292      return this.url != null && !this.url.isEmpty();
1293    }
1294
1295    /**
1296     * @param value {@link #url} (An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. The URL SHOULD include the major version of the structure definition. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1297     */
1298    public StructureDefinition setUrlElement(UriType value) { 
1299      this.url = value;
1300      return this;
1301    }
1302
1303    /**
1304     * @return An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. The URL SHOULD include the major version of the structure definition. For more information see [Technical and Business Versions](resource.html#versions).
1305     */
1306    public String getUrl() { 
1307      return this.url == null ? null : this.url.getValue();
1308    }
1309
1310    /**
1311     * @param value An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. The URL SHOULD include the major version of the structure definition. For more information see [Technical and Business Versions](resource.html#versions).
1312     */
1313    public StructureDefinition setUrl(String value) { 
1314        if (this.url == null)
1315          this.url = new UriType();
1316        this.url.setValue(value);
1317      return this;
1318    }
1319
1320    /**
1321     * @return {@link #identifier} (A formal identifier that is used to identify this structure definition when it is represented in other formats, or referenced in a specification, model, design or an instance.)
1322     */
1323    public List<Identifier> getIdentifier() { 
1324      if (this.identifier == null)
1325        this.identifier = new ArrayList<Identifier>();
1326      return this.identifier;
1327    }
1328
1329    /**
1330     * @return Returns a reference to <code>this</code> for easy method chaining
1331     */
1332    public StructureDefinition setIdentifier(List<Identifier> theIdentifier) { 
1333      this.identifier = theIdentifier;
1334      return this;
1335    }
1336
1337    public boolean hasIdentifier() { 
1338      if (this.identifier == null)
1339        return false;
1340      for (Identifier item : this.identifier)
1341        if (!item.isEmpty())
1342          return true;
1343      return false;
1344    }
1345
1346    public Identifier addIdentifier() { //3
1347      Identifier t = new Identifier();
1348      if (this.identifier == null)
1349        this.identifier = new ArrayList<Identifier>();
1350      this.identifier.add(t);
1351      return t;
1352    }
1353
1354    public StructureDefinition addIdentifier(Identifier t) { //3
1355      if (t == null)
1356        return this;
1357      if (this.identifier == null)
1358        this.identifier = new ArrayList<Identifier>();
1359      this.identifier.add(t);
1360      return this;
1361    }
1362
1363    /**
1364     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1365     */
1366    public Identifier getIdentifierFirstRep() { 
1367      if (getIdentifier().isEmpty()) {
1368        addIdentifier();
1369      }
1370      return getIdentifier().get(0);
1371    }
1372
1373    /**
1374     * @return {@link #version} (The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1375     */
1376    public StringType getVersionElement() { 
1377      if (this.version == null)
1378        if (Configuration.errorOnAutoCreate())
1379          throw new Error("Attempt to auto-create StructureDefinition.version");
1380        else if (Configuration.doAutoCreate())
1381          this.version = new StringType(); // bb
1382      return this.version;
1383    }
1384
1385    public boolean hasVersionElement() { 
1386      return this.version != null && !this.version.isEmpty();
1387    }
1388
1389    public boolean hasVersion() { 
1390      return this.version != null && !this.version.isEmpty();
1391    }
1392
1393    /**
1394     * @param value {@link #version} (The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1395     */
1396    public StructureDefinition setVersionElement(StringType value) { 
1397      this.version = value;
1398      return this;
1399    }
1400
1401    /**
1402     * @return The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
1403     */
1404    public String getVersion() { 
1405      return this.version == null ? null : this.version.getValue();
1406    }
1407
1408    /**
1409     * @param value The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
1410     */
1411    public StructureDefinition setVersion(String value) { 
1412      if (Utilities.noString(value))
1413        this.version = null;
1414      else {
1415        if (this.version == null)
1416          this.version = new StringType();
1417        this.version.setValue(value);
1418      }
1419      return this;
1420    }
1421
1422    /**
1423     * @return {@link #name} (A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1424     */
1425    public StringType getNameElement() { 
1426      if (this.name == null)
1427        if (Configuration.errorOnAutoCreate())
1428          throw new Error("Attempt to auto-create StructureDefinition.name");
1429        else if (Configuration.doAutoCreate())
1430          this.name = new StringType(); // bb
1431      return this.name;
1432    }
1433
1434    public boolean hasNameElement() { 
1435      return this.name != null && !this.name.isEmpty();
1436    }
1437
1438    public boolean hasName() { 
1439      return this.name != null && !this.name.isEmpty();
1440    }
1441
1442    /**
1443     * @param value {@link #name} (A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1444     */
1445    public StructureDefinition setNameElement(StringType value) { 
1446      this.name = value;
1447      return this;
1448    }
1449
1450    /**
1451     * @return A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
1452     */
1453    public String getName() { 
1454      return this.name == null ? null : this.name.getValue();
1455    }
1456
1457    /**
1458     * @param value A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
1459     */
1460    public StructureDefinition setName(String value) { 
1461        if (this.name == null)
1462          this.name = new StringType();
1463        this.name.setValue(value);
1464      return this;
1465    }
1466
1467    /**
1468     * @return {@link #title} (A short, descriptive, user-friendly title for the structure definition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1469     */
1470    public StringType getTitleElement() { 
1471      if (this.title == null)
1472        if (Configuration.errorOnAutoCreate())
1473          throw new Error("Attempt to auto-create StructureDefinition.title");
1474        else if (Configuration.doAutoCreate())
1475          this.title = new StringType(); // bb
1476      return this.title;
1477    }
1478
1479    public boolean hasTitleElement() { 
1480      return this.title != null && !this.title.isEmpty();
1481    }
1482
1483    public boolean hasTitle() { 
1484      return this.title != null && !this.title.isEmpty();
1485    }
1486
1487    /**
1488     * @param value {@link #title} (A short, descriptive, user-friendly title for the structure definition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1489     */
1490    public StructureDefinition setTitleElement(StringType value) { 
1491      this.title = value;
1492      return this;
1493    }
1494
1495    /**
1496     * @return A short, descriptive, user-friendly title for the structure definition.
1497     */
1498    public String getTitle() { 
1499      return this.title == null ? null : this.title.getValue();
1500    }
1501
1502    /**
1503     * @param value A short, descriptive, user-friendly title for the structure definition.
1504     */
1505    public StructureDefinition setTitle(String value) { 
1506      if (Utilities.noString(value))
1507        this.title = null;
1508      else {
1509        if (this.title == null)
1510          this.title = new StringType();
1511        this.title.setValue(value);
1512      }
1513      return this;
1514    }
1515
1516    /**
1517     * @return {@link #status} (The status of this structure definition. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1518     */
1519    public Enumeration<PublicationStatus> getStatusElement() { 
1520      if (this.status == null)
1521        if (Configuration.errorOnAutoCreate())
1522          throw new Error("Attempt to auto-create StructureDefinition.status");
1523        else if (Configuration.doAutoCreate())
1524          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
1525      return this.status;
1526    }
1527
1528    public boolean hasStatusElement() { 
1529      return this.status != null && !this.status.isEmpty();
1530    }
1531
1532    public boolean hasStatus() { 
1533      return this.status != null && !this.status.isEmpty();
1534    }
1535
1536    /**
1537     * @param value {@link #status} (The status of this structure definition. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1538     */
1539    public StructureDefinition setStatusElement(Enumeration<PublicationStatus> value) { 
1540      this.status = value;
1541      return this;
1542    }
1543
1544    /**
1545     * @return The status of this structure definition. Enables tracking the life-cycle of the content.
1546     */
1547    public PublicationStatus getStatus() { 
1548      return this.status == null ? null : this.status.getValue();
1549    }
1550
1551    /**
1552     * @param value The status of this structure definition. Enables tracking the life-cycle of the content.
1553     */
1554    public StructureDefinition setStatus(PublicationStatus value) { 
1555        if (this.status == null)
1556          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
1557        this.status.setValue(value);
1558      return this;
1559    }
1560
1561    /**
1562     * @return {@link #experimental} (A boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
1563     */
1564    public BooleanType getExperimentalElement() { 
1565      if (this.experimental == null)
1566        if (Configuration.errorOnAutoCreate())
1567          throw new Error("Attempt to auto-create StructureDefinition.experimental");
1568        else if (Configuration.doAutoCreate())
1569          this.experimental = new BooleanType(); // bb
1570      return this.experimental;
1571    }
1572
1573    public boolean hasExperimentalElement() { 
1574      return this.experimental != null && !this.experimental.isEmpty();
1575    }
1576
1577    public boolean hasExperimental() { 
1578      return this.experimental != null && !this.experimental.isEmpty();
1579    }
1580
1581    /**
1582     * @param value {@link #experimental} (A boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
1583     */
1584    public StructureDefinition setExperimentalElement(BooleanType value) { 
1585      this.experimental = value;
1586      return this;
1587    }
1588
1589    /**
1590     * @return A boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
1591     */
1592    public boolean getExperimental() { 
1593      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
1594    }
1595
1596    /**
1597     * @param value A boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
1598     */
1599    public StructureDefinition setExperimental(boolean value) { 
1600        if (this.experimental == null)
1601          this.experimental = new BooleanType();
1602        this.experimental.setValue(value);
1603      return this;
1604    }
1605
1606    /**
1607     * @return {@link #date} (The date  (and optionally time) when the structure definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1608     */
1609    public DateTimeType getDateElement() { 
1610      if (this.date == null)
1611        if (Configuration.errorOnAutoCreate())
1612          throw new Error("Attempt to auto-create StructureDefinition.date");
1613        else if (Configuration.doAutoCreate())
1614          this.date = new DateTimeType(); // bb
1615      return this.date;
1616    }
1617
1618    public boolean hasDateElement() { 
1619      return this.date != null && !this.date.isEmpty();
1620    }
1621
1622    public boolean hasDate() { 
1623      return this.date != null && !this.date.isEmpty();
1624    }
1625
1626    /**
1627     * @param value {@link #date} (The date  (and optionally time) when the structure definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1628     */
1629    public StructureDefinition setDateElement(DateTimeType value) { 
1630      this.date = value;
1631      return this;
1632    }
1633
1634    /**
1635     * @return The date  (and optionally time) when the structure definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.
1636     */
1637    public Date getDate() { 
1638      return this.date == null ? null : this.date.getValue();
1639    }
1640
1641    /**
1642     * @param value The date  (and optionally time) when the structure definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.
1643     */
1644    public StructureDefinition setDate(Date value) { 
1645      if (value == null)
1646        this.date = null;
1647      else {
1648        if (this.date == null)
1649          this.date = new DateTimeType();
1650        this.date.setValue(value);
1651      }
1652      return this;
1653    }
1654
1655    /**
1656     * @return {@link #publisher} (The name of the individual or organization that published the structure definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
1657     */
1658    public StringType getPublisherElement() { 
1659      if (this.publisher == null)
1660        if (Configuration.errorOnAutoCreate())
1661          throw new Error("Attempt to auto-create StructureDefinition.publisher");
1662        else if (Configuration.doAutoCreate())
1663          this.publisher = new StringType(); // bb
1664      return this.publisher;
1665    }
1666
1667    public boolean hasPublisherElement() { 
1668      return this.publisher != null && !this.publisher.isEmpty();
1669    }
1670
1671    public boolean hasPublisher() { 
1672      return this.publisher != null && !this.publisher.isEmpty();
1673    }
1674
1675    /**
1676     * @param value {@link #publisher} (The name of the individual or organization that published the structure definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
1677     */
1678    public StructureDefinition setPublisherElement(StringType value) { 
1679      this.publisher = value;
1680      return this;
1681    }
1682
1683    /**
1684     * @return The name of the individual or organization that published the structure definition.
1685     */
1686    public String getPublisher() { 
1687      return this.publisher == null ? null : this.publisher.getValue();
1688    }
1689
1690    /**
1691     * @param value The name of the individual or organization that published the structure definition.
1692     */
1693    public StructureDefinition setPublisher(String value) { 
1694      if (Utilities.noString(value))
1695        this.publisher = null;
1696      else {
1697        if (this.publisher == null)
1698          this.publisher = new StringType();
1699        this.publisher.setValue(value);
1700      }
1701      return this;
1702    }
1703
1704    /**
1705     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
1706     */
1707    public List<ContactDetail> getContact() { 
1708      if (this.contact == null)
1709        this.contact = new ArrayList<ContactDetail>();
1710      return this.contact;
1711    }
1712
1713    /**
1714     * @return Returns a reference to <code>this</code> for easy method chaining
1715     */
1716    public StructureDefinition setContact(List<ContactDetail> theContact) { 
1717      this.contact = theContact;
1718      return this;
1719    }
1720
1721    public boolean hasContact() { 
1722      if (this.contact == null)
1723        return false;
1724      for (ContactDetail item : this.contact)
1725        if (!item.isEmpty())
1726          return true;
1727      return false;
1728    }
1729
1730    public ContactDetail addContact() { //3
1731      ContactDetail t = new ContactDetail();
1732      if (this.contact == null)
1733        this.contact = new ArrayList<ContactDetail>();
1734      this.contact.add(t);
1735      return t;
1736    }
1737
1738    public StructureDefinition addContact(ContactDetail t) { //3
1739      if (t == null)
1740        return this;
1741      if (this.contact == null)
1742        this.contact = new ArrayList<ContactDetail>();
1743      this.contact.add(t);
1744      return this;
1745    }
1746
1747    /**
1748     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
1749     */
1750    public ContactDetail getContactFirstRep() { 
1751      if (getContact().isEmpty()) {
1752        addContact();
1753      }
1754      return getContact().get(0);
1755    }
1756
1757    /**
1758     * @return {@link #description} (A free text natural language description of the structure definition from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1759     */
1760    public MarkdownType getDescriptionElement() { 
1761      if (this.description == null)
1762        if (Configuration.errorOnAutoCreate())
1763          throw new Error("Attempt to auto-create StructureDefinition.description");
1764        else if (Configuration.doAutoCreate())
1765          this.description = new MarkdownType(); // bb
1766      return this.description;
1767    }
1768
1769    public boolean hasDescriptionElement() { 
1770      return this.description != null && !this.description.isEmpty();
1771    }
1772
1773    public boolean hasDescription() { 
1774      return this.description != null && !this.description.isEmpty();
1775    }
1776
1777    /**
1778     * @param value {@link #description} (A free text natural language description of the structure definition from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1779     */
1780    public StructureDefinition setDescriptionElement(MarkdownType value) { 
1781      this.description = value;
1782      return this;
1783    }
1784
1785    /**
1786     * @return A free text natural language description of the structure definition from a consumer's perspective.
1787     */
1788    public String getDescription() { 
1789      return this.description == null ? null : this.description.getValue();
1790    }
1791
1792    /**
1793     * @param value A free text natural language description of the structure definition from a consumer's perspective.
1794     */
1795    public StructureDefinition setDescription(String value) { 
1796      if (value == null)
1797        this.description = null;
1798      else {
1799        if (this.description == null)
1800          this.description = new MarkdownType();
1801        this.description.setValue(value);
1802      }
1803      return this;
1804    }
1805
1806    /**
1807     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate structure definition instances.)
1808     */
1809    public List<UsageContext> getUseContext() { 
1810      if (this.useContext == null)
1811        this.useContext = new ArrayList<UsageContext>();
1812      return this.useContext;
1813    }
1814
1815    /**
1816     * @return Returns a reference to <code>this</code> for easy method chaining
1817     */
1818    public StructureDefinition setUseContext(List<UsageContext> theUseContext) { 
1819      this.useContext = theUseContext;
1820      return this;
1821    }
1822
1823    public boolean hasUseContext() { 
1824      if (this.useContext == null)
1825        return false;
1826      for (UsageContext item : this.useContext)
1827        if (!item.isEmpty())
1828          return true;
1829      return false;
1830    }
1831
1832    public UsageContext addUseContext() { //3
1833      UsageContext t = new UsageContext();
1834      if (this.useContext == null)
1835        this.useContext = new ArrayList<UsageContext>();
1836      this.useContext.add(t);
1837      return t;
1838    }
1839
1840    public StructureDefinition addUseContext(UsageContext t) { //3
1841      if (t == null)
1842        return this;
1843      if (this.useContext == null)
1844        this.useContext = new ArrayList<UsageContext>();
1845      this.useContext.add(t);
1846      return this;
1847    }
1848
1849    /**
1850     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
1851     */
1852    public UsageContext getUseContextFirstRep() { 
1853      if (getUseContext().isEmpty()) {
1854        addUseContext();
1855      }
1856      return getUseContext().get(0);
1857    }
1858
1859    /**
1860     * @return {@link #jurisdiction} (A legal or geographic region in which the structure definition is intended to be used.)
1861     */
1862    public List<CodeableConcept> getJurisdiction() { 
1863      if (this.jurisdiction == null)
1864        this.jurisdiction = new ArrayList<CodeableConcept>();
1865      return this.jurisdiction;
1866    }
1867
1868    /**
1869     * @return Returns a reference to <code>this</code> for easy method chaining
1870     */
1871    public StructureDefinition setJurisdiction(List<CodeableConcept> theJurisdiction) { 
1872      this.jurisdiction = theJurisdiction;
1873      return this;
1874    }
1875
1876    public boolean hasJurisdiction() { 
1877      if (this.jurisdiction == null)
1878        return false;
1879      for (CodeableConcept item : this.jurisdiction)
1880        if (!item.isEmpty())
1881          return true;
1882      return false;
1883    }
1884
1885    public CodeableConcept addJurisdiction() { //3
1886      CodeableConcept t = new CodeableConcept();
1887      if (this.jurisdiction == null)
1888        this.jurisdiction = new ArrayList<CodeableConcept>();
1889      this.jurisdiction.add(t);
1890      return t;
1891    }
1892
1893    public StructureDefinition addJurisdiction(CodeableConcept t) { //3
1894      if (t == null)
1895        return this;
1896      if (this.jurisdiction == null)
1897        this.jurisdiction = new ArrayList<CodeableConcept>();
1898      this.jurisdiction.add(t);
1899      return this;
1900    }
1901
1902    /**
1903     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
1904     */
1905    public CodeableConcept getJurisdictionFirstRep() { 
1906      if (getJurisdiction().isEmpty()) {
1907        addJurisdiction();
1908      }
1909      return getJurisdiction().get(0);
1910    }
1911
1912    /**
1913     * @return {@link #purpose} (Explaination of why this structure definition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
1914     */
1915    public MarkdownType getPurposeElement() { 
1916      if (this.purpose == null)
1917        if (Configuration.errorOnAutoCreate())
1918          throw new Error("Attempt to auto-create StructureDefinition.purpose");
1919        else if (Configuration.doAutoCreate())
1920          this.purpose = new MarkdownType(); // bb
1921      return this.purpose;
1922    }
1923
1924    public boolean hasPurposeElement() { 
1925      return this.purpose != null && !this.purpose.isEmpty();
1926    }
1927
1928    public boolean hasPurpose() { 
1929      return this.purpose != null && !this.purpose.isEmpty();
1930    }
1931
1932    /**
1933     * @param value {@link #purpose} (Explaination of why this structure definition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
1934     */
1935    public StructureDefinition setPurposeElement(MarkdownType value) { 
1936      this.purpose = value;
1937      return this;
1938    }
1939
1940    /**
1941     * @return Explaination of why this structure definition is needed and why it has been designed as it has.
1942     */
1943    public String getPurpose() { 
1944      return this.purpose == null ? null : this.purpose.getValue();
1945    }
1946
1947    /**
1948     * @param value Explaination of why this structure definition is needed and why it has been designed as it has.
1949     */
1950    public StructureDefinition setPurpose(String value) { 
1951      if (value == null)
1952        this.purpose = null;
1953      else {
1954        if (this.purpose == null)
1955          this.purpose = new MarkdownType();
1956        this.purpose.setValue(value);
1957      }
1958      return this;
1959    }
1960
1961    /**
1962     * @return {@link #copyright} (A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
1963     */
1964    public MarkdownType getCopyrightElement() { 
1965      if (this.copyright == null)
1966        if (Configuration.errorOnAutoCreate())
1967          throw new Error("Attempt to auto-create StructureDefinition.copyright");
1968        else if (Configuration.doAutoCreate())
1969          this.copyright = new MarkdownType(); // bb
1970      return this.copyright;
1971    }
1972
1973    public boolean hasCopyrightElement() { 
1974      return this.copyright != null && !this.copyright.isEmpty();
1975    }
1976
1977    public boolean hasCopyright() { 
1978      return this.copyright != null && !this.copyright.isEmpty();
1979    }
1980
1981    /**
1982     * @param value {@link #copyright} (A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
1983     */
1984    public StructureDefinition setCopyrightElement(MarkdownType value) { 
1985      this.copyright = value;
1986      return this;
1987    }
1988
1989    /**
1990     * @return A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.
1991     */
1992    public String getCopyright() { 
1993      return this.copyright == null ? null : this.copyright.getValue();
1994    }
1995
1996    /**
1997     * @param value A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.
1998     */
1999    public StructureDefinition setCopyright(String value) { 
2000      if (value == null)
2001        this.copyright = null;
2002      else {
2003        if (this.copyright == null)
2004          this.copyright = new MarkdownType();
2005        this.copyright.setValue(value);
2006      }
2007      return this;
2008    }
2009
2010    /**
2011     * @return {@link #keyword} (A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates.)
2012     */
2013    public List<Coding> getKeyword() { 
2014      if (this.keyword == null)
2015        this.keyword = new ArrayList<Coding>();
2016      return this.keyword;
2017    }
2018
2019    /**
2020     * @return Returns a reference to <code>this</code> for easy method chaining
2021     */
2022    public StructureDefinition setKeyword(List<Coding> theKeyword) { 
2023      this.keyword = theKeyword;
2024      return this;
2025    }
2026
2027    public boolean hasKeyword() { 
2028      if (this.keyword == null)
2029        return false;
2030      for (Coding item : this.keyword)
2031        if (!item.isEmpty())
2032          return true;
2033      return false;
2034    }
2035
2036    public Coding addKeyword() { //3
2037      Coding t = new Coding();
2038      if (this.keyword == null)
2039        this.keyword = new ArrayList<Coding>();
2040      this.keyword.add(t);
2041      return t;
2042    }
2043
2044    public StructureDefinition addKeyword(Coding t) { //3
2045      if (t == null)
2046        return this;
2047      if (this.keyword == null)
2048        this.keyword = new ArrayList<Coding>();
2049      this.keyword.add(t);
2050      return this;
2051    }
2052
2053    /**
2054     * @return The first repetition of repeating field {@link #keyword}, creating it if it does not already exist
2055     */
2056    public Coding getKeywordFirstRep() { 
2057      if (getKeyword().isEmpty()) {
2058        addKeyword();
2059      }
2060      return getKeyword().get(0);
2061    }
2062
2063    /**
2064     * @return {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value
2065     */
2066    public IdType getFhirVersionElement() { 
2067      if (this.fhirVersion == null)
2068        if (Configuration.errorOnAutoCreate())
2069          throw new Error("Attempt to auto-create StructureDefinition.fhirVersion");
2070        else if (Configuration.doAutoCreate())
2071          this.fhirVersion = new IdType(); // bb
2072      return this.fhirVersion;
2073    }
2074
2075    public boolean hasFhirVersionElement() { 
2076      return this.fhirVersion != null && !this.fhirVersion.isEmpty();
2077    }
2078
2079    public boolean hasFhirVersion() { 
2080      return this.fhirVersion != null && !this.fhirVersion.isEmpty();
2081    }
2082
2083    /**
2084     * @param value {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value
2085     */
2086    public StructureDefinition setFhirVersionElement(IdType value) { 
2087      this.fhirVersion = value;
2088      return this;
2089    }
2090
2091    /**
2092     * @return The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.
2093     */
2094    public String getFhirVersion() { 
2095      return this.fhirVersion == null ? null : this.fhirVersion.getValue();
2096    }
2097
2098    /**
2099     * @param value The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.
2100     */
2101    public StructureDefinition setFhirVersion(String value) { 
2102      if (Utilities.noString(value))
2103        this.fhirVersion = null;
2104      else {
2105        if (this.fhirVersion == null)
2106          this.fhirVersion = new IdType();
2107        this.fhirVersion.setValue(value);
2108      }
2109      return this;
2110    }
2111
2112    /**
2113     * @return {@link #mapping} (An external specification that the content is mapped to.)
2114     */
2115    public List<StructureDefinitionMappingComponent> getMapping() { 
2116      if (this.mapping == null)
2117        this.mapping = new ArrayList<StructureDefinitionMappingComponent>();
2118      return this.mapping;
2119    }
2120
2121    /**
2122     * @return Returns a reference to <code>this</code> for easy method chaining
2123     */
2124    public StructureDefinition setMapping(List<StructureDefinitionMappingComponent> theMapping) { 
2125      this.mapping = theMapping;
2126      return this;
2127    }
2128
2129    public boolean hasMapping() { 
2130      if (this.mapping == null)
2131        return false;
2132      for (StructureDefinitionMappingComponent item : this.mapping)
2133        if (!item.isEmpty())
2134          return true;
2135      return false;
2136    }
2137
2138    public StructureDefinitionMappingComponent addMapping() { //3
2139      StructureDefinitionMappingComponent t = new StructureDefinitionMappingComponent();
2140      if (this.mapping == null)
2141        this.mapping = new ArrayList<StructureDefinitionMappingComponent>();
2142      this.mapping.add(t);
2143      return t;
2144    }
2145
2146    public StructureDefinition addMapping(StructureDefinitionMappingComponent t) { //3
2147      if (t == null)
2148        return this;
2149      if (this.mapping == null)
2150        this.mapping = new ArrayList<StructureDefinitionMappingComponent>();
2151      this.mapping.add(t);
2152      return this;
2153    }
2154
2155    /**
2156     * @return The first repetition of repeating field {@link #mapping}, creating it if it does not already exist
2157     */
2158    public StructureDefinitionMappingComponent getMappingFirstRep() { 
2159      if (getMapping().isEmpty()) {
2160        addMapping();
2161      }
2162      return getMapping().get(0);
2163    }
2164
2165    /**
2166     * @return {@link #kind} (Defines the kind of structure that this definition is describing.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
2167     */
2168    public Enumeration<StructureDefinitionKind> getKindElement() { 
2169      if (this.kind == null)
2170        if (Configuration.errorOnAutoCreate())
2171          throw new Error("Attempt to auto-create StructureDefinition.kind");
2172        else if (Configuration.doAutoCreate())
2173          this.kind = new Enumeration<StructureDefinitionKind>(new StructureDefinitionKindEnumFactory()); // bb
2174      return this.kind;
2175    }
2176
2177    public boolean hasKindElement() { 
2178      return this.kind != null && !this.kind.isEmpty();
2179    }
2180
2181    public boolean hasKind() { 
2182      return this.kind != null && !this.kind.isEmpty();
2183    }
2184
2185    /**
2186     * @param value {@link #kind} (Defines the kind of structure that this definition is describing.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
2187     */
2188    public StructureDefinition setKindElement(Enumeration<StructureDefinitionKind> value) { 
2189      this.kind = value;
2190      return this;
2191    }
2192
2193    /**
2194     * @return Defines the kind of structure that this definition is describing.
2195     */
2196    public StructureDefinitionKind getKind() { 
2197      return this.kind == null ? null : this.kind.getValue();
2198    }
2199
2200    /**
2201     * @param value Defines the kind of structure that this definition is describing.
2202     */
2203    public StructureDefinition setKind(StructureDefinitionKind value) { 
2204        if (this.kind == null)
2205          this.kind = new Enumeration<StructureDefinitionKind>(new StructureDefinitionKindEnumFactory());
2206        this.kind.setValue(value);
2207      return this;
2208    }
2209
2210    /**
2211     * @return {@link #abstract_} (Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value
2212     */
2213    public BooleanType getAbstractElement() { 
2214      if (this.abstract_ == null)
2215        if (Configuration.errorOnAutoCreate())
2216          throw new Error("Attempt to auto-create StructureDefinition.abstract_");
2217        else if (Configuration.doAutoCreate())
2218          this.abstract_ = new BooleanType(); // bb
2219      return this.abstract_;
2220    }
2221
2222    public boolean hasAbstractElement() { 
2223      return this.abstract_ != null && !this.abstract_.isEmpty();
2224    }
2225
2226    public boolean hasAbstract() { 
2227      return this.abstract_ != null && !this.abstract_.isEmpty();
2228    }
2229
2230    /**
2231     * @param value {@link #abstract_} (Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value
2232     */
2233    public StructureDefinition setAbstractElement(BooleanType value) { 
2234      this.abstract_ = value;
2235      return this;
2236    }
2237
2238    /**
2239     * @return Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems.
2240     */
2241    public boolean getAbstract() { 
2242      return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue();
2243    }
2244
2245    /**
2246     * @param value Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems.
2247     */
2248    public StructureDefinition setAbstract(boolean value) { 
2249        if (this.abstract_ == null)
2250          this.abstract_ = new BooleanType();
2251        this.abstract_.setValue(value);
2252      return this;
2253    }
2254
2255    /**
2256     * @return {@link #contextType} (If this is an extension, Identifies the context within FHIR resources where the extension can be used.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value
2257     */
2258    public Enumeration<ExtensionContext> getContextTypeElement() { 
2259      if (this.contextType == null)
2260        if (Configuration.errorOnAutoCreate())
2261          throw new Error("Attempt to auto-create StructureDefinition.contextType");
2262        else if (Configuration.doAutoCreate())
2263          this.contextType = new Enumeration<ExtensionContext>(new ExtensionContextEnumFactory()); // bb
2264      return this.contextType;
2265    }
2266
2267    public boolean hasContextTypeElement() { 
2268      return this.contextType != null && !this.contextType.isEmpty();
2269    }
2270
2271    public boolean hasContextType() { 
2272      return this.contextType != null && !this.contextType.isEmpty();
2273    }
2274
2275    /**
2276     * @param value {@link #contextType} (If this is an extension, Identifies the context within FHIR resources where the extension can be used.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value
2277     */
2278    public StructureDefinition setContextTypeElement(Enumeration<ExtensionContext> value) { 
2279      this.contextType = value;
2280      return this;
2281    }
2282
2283    /**
2284     * @return If this is an extension, Identifies the context within FHIR resources where the extension can be used.
2285     */
2286    public ExtensionContext getContextType() { 
2287      return this.contextType == null ? null : this.contextType.getValue();
2288    }
2289
2290    /**
2291     * @param value If this is an extension, Identifies the context within FHIR resources where the extension can be used.
2292     */
2293    public StructureDefinition setContextType(ExtensionContext value) { 
2294      if (value == null)
2295        this.contextType = null;
2296      else {
2297        if (this.contextType == null)
2298          this.contextType = new Enumeration<ExtensionContext>(new ExtensionContextEnumFactory());
2299        this.contextType.setValue(value);
2300      }
2301      return this;
2302    }
2303
2304    /**
2305     * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.)
2306     */
2307    public List<StringType> getContext() { 
2308      if (this.context == null)
2309        this.context = new ArrayList<StringType>();
2310      return this.context;
2311    }
2312
2313    /**
2314     * @return Returns a reference to <code>this</code> for easy method chaining
2315     */
2316    public StructureDefinition setContext(List<StringType> theContext) { 
2317      this.context = theContext;
2318      return this;
2319    }
2320
2321    public boolean hasContext() { 
2322      if (this.context == null)
2323        return false;
2324      for (StringType item : this.context)
2325        if (!item.isEmpty())
2326          return true;
2327      return false;
2328    }
2329
2330    /**
2331     * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.)
2332     */
2333    public StringType addContextElement() {//2 
2334      StringType t = new StringType();
2335      if (this.context == null)
2336        this.context = new ArrayList<StringType>();
2337      this.context.add(t);
2338      return t;
2339    }
2340
2341    /**
2342     * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.)
2343     */
2344    public StructureDefinition addContext(String value) { //1
2345      StringType t = new StringType();
2346      t.setValue(value);
2347      if (this.context == null)
2348        this.context = new ArrayList<StringType>();
2349      this.context.add(t);
2350      return this;
2351    }
2352
2353    /**
2354     * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.)
2355     */
2356    public boolean hasContext(String value) { 
2357      if (this.context == null)
2358        return false;
2359      for (StringType v : this.context)
2360        if (v.getValue().equals(value)) // string
2361          return true;
2362      return false;
2363    }
2364
2365    /**
2366     * @return {@link #contextInvariant} (A set of rules as Fluent Invariants about when the extension can be used (e.g. co-occurrence variants for the extension).)
2367     */
2368    public List<StringType> getContextInvariant() { 
2369      if (this.contextInvariant == null)
2370        this.contextInvariant = new ArrayList<StringType>();
2371      return this.contextInvariant;
2372    }
2373
2374    /**
2375     * @return Returns a reference to <code>this</code> for easy method chaining
2376     */
2377    public StructureDefinition setContextInvariant(List<StringType> theContextInvariant) { 
2378      this.contextInvariant = theContextInvariant;
2379      return this;
2380    }
2381
2382    public boolean hasContextInvariant() { 
2383      if (this.contextInvariant == null)
2384        return false;
2385      for (StringType item : this.contextInvariant)
2386        if (!item.isEmpty())
2387          return true;
2388      return false;
2389    }
2390
2391    /**
2392     * @return {@link #contextInvariant} (A set of rules as Fluent Invariants about when the extension can be used (e.g. co-occurrence variants for the extension).)
2393     */
2394    public StringType addContextInvariantElement() {//2 
2395      StringType t = new StringType();
2396      if (this.contextInvariant == null)
2397        this.contextInvariant = new ArrayList<StringType>();
2398      this.contextInvariant.add(t);
2399      return t;
2400    }
2401
2402    /**
2403     * @param value {@link #contextInvariant} (A set of rules as Fluent Invariants about when the extension can be used (e.g. co-occurrence variants for the extension).)
2404     */
2405    public StructureDefinition addContextInvariant(String value) { //1
2406      StringType t = new StringType();
2407      t.setValue(value);
2408      if (this.contextInvariant == null)
2409        this.contextInvariant = new ArrayList<StringType>();
2410      this.contextInvariant.add(t);
2411      return this;
2412    }
2413
2414    /**
2415     * @param value {@link #contextInvariant} (A set of rules as Fluent Invariants about when the extension can be used (e.g. co-occurrence variants for the extension).)
2416     */
2417    public boolean hasContextInvariant(String value) { 
2418      if (this.contextInvariant == null)
2419        return false;
2420      for (StringType v : this.contextInvariant)
2421        if (v.getValue().equals(value)) // string
2422          return true;
2423      return false;
2424    }
2425
2426    /**
2427     * @return {@link #type} (The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2428     */
2429    public CodeType getTypeElement() { 
2430      if (this.type == null)
2431        if (Configuration.errorOnAutoCreate())
2432          throw new Error("Attempt to auto-create StructureDefinition.type");
2433        else if (Configuration.doAutoCreate())
2434          this.type = new CodeType(); // bb
2435      return this.type;
2436    }
2437
2438    public boolean hasTypeElement() { 
2439      return this.type != null && !this.type.isEmpty();
2440    }
2441
2442    public boolean hasType() { 
2443      return this.type != null && !this.type.isEmpty();
2444    }
2445
2446    /**
2447     * @param value {@link #type} (The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2448     */
2449    public StructureDefinition setTypeElement(CodeType value) { 
2450      this.type = value;
2451      return this;
2452    }
2453
2454    /**
2455     * @return The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).
2456     */
2457    public String getType() { 
2458      return this.type == null ? null : this.type.getValue();
2459    }
2460
2461    /**
2462     * @param value The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).
2463     */
2464    public StructureDefinition setType(String value) { 
2465        if (this.type == null)
2466          this.type = new CodeType();
2467        this.type.setValue(value);
2468      return this;
2469    }
2470
2471    /**
2472     * @return {@link #baseDefinition} (An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.). This is the underlying object with id, value and extensions. The accessor "getBaseDefinition" gives direct access to the value
2473     */
2474    public UriType getBaseDefinitionElement() { 
2475      if (this.baseDefinition == null)
2476        if (Configuration.errorOnAutoCreate())
2477          throw new Error("Attempt to auto-create StructureDefinition.baseDefinition");
2478        else if (Configuration.doAutoCreate())
2479          this.baseDefinition = new UriType(); // bb
2480      return this.baseDefinition;
2481    }
2482
2483    public boolean hasBaseDefinitionElement() { 
2484      return this.baseDefinition != null && !this.baseDefinition.isEmpty();
2485    }
2486
2487    public boolean hasBaseDefinition() { 
2488      return this.baseDefinition != null && !this.baseDefinition.isEmpty();
2489    }
2490
2491    /**
2492     * @param value {@link #baseDefinition} (An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.). This is the underlying object with id, value and extensions. The accessor "getBaseDefinition" gives direct access to the value
2493     */
2494    public StructureDefinition setBaseDefinitionElement(UriType value) { 
2495      this.baseDefinition = value;
2496      return this;
2497    }
2498
2499    /**
2500     * @return An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.
2501     */
2502    public String getBaseDefinition() { 
2503      return this.baseDefinition == null ? null : this.baseDefinition.getValue();
2504    }
2505
2506    /**
2507     * @param value An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.
2508     */
2509    public StructureDefinition setBaseDefinition(String value) { 
2510      if (Utilities.noString(value))
2511        this.baseDefinition = null;
2512      else {
2513        if (this.baseDefinition == null)
2514          this.baseDefinition = new UriType();
2515        this.baseDefinition.setValue(value);
2516      }
2517      return this;
2518    }
2519
2520    /**
2521     * @return {@link #derivation} (How the type relates to the baseDefinition.). This is the underlying object with id, value and extensions. The accessor "getDerivation" gives direct access to the value
2522     */
2523    public Enumeration<TypeDerivationRule> getDerivationElement() { 
2524      if (this.derivation == null)
2525        if (Configuration.errorOnAutoCreate())
2526          throw new Error("Attempt to auto-create StructureDefinition.derivation");
2527        else if (Configuration.doAutoCreate())
2528          this.derivation = new Enumeration<TypeDerivationRule>(new TypeDerivationRuleEnumFactory()); // bb
2529      return this.derivation;
2530    }
2531
2532    public boolean hasDerivationElement() { 
2533      return this.derivation != null && !this.derivation.isEmpty();
2534    }
2535
2536    public boolean hasDerivation() { 
2537      return this.derivation != null && !this.derivation.isEmpty();
2538    }
2539
2540    /**
2541     * @param value {@link #derivation} (How the type relates to the baseDefinition.). This is the underlying object with id, value and extensions. The accessor "getDerivation" gives direct access to the value
2542     */
2543    public StructureDefinition setDerivationElement(Enumeration<TypeDerivationRule> value) { 
2544      this.derivation = value;
2545      return this;
2546    }
2547
2548    /**
2549     * @return How the type relates to the baseDefinition.
2550     */
2551    public TypeDerivationRule getDerivation() { 
2552      return this.derivation == null ? null : this.derivation.getValue();
2553    }
2554
2555    /**
2556     * @param value How the type relates to the baseDefinition.
2557     */
2558    public StructureDefinition setDerivation(TypeDerivationRule value) { 
2559      if (value == null)
2560        this.derivation = null;
2561      else {
2562        if (this.derivation == null)
2563          this.derivation = new Enumeration<TypeDerivationRule>(new TypeDerivationRuleEnumFactory());
2564        this.derivation.setValue(value);
2565      }
2566      return this;
2567    }
2568
2569    /**
2570     * @return {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.)
2571     */
2572    public StructureDefinitionSnapshotComponent getSnapshot() { 
2573      if (this.snapshot == null)
2574        if (Configuration.errorOnAutoCreate())
2575          throw new Error("Attempt to auto-create StructureDefinition.snapshot");
2576        else if (Configuration.doAutoCreate())
2577          this.snapshot = new StructureDefinitionSnapshotComponent(); // cc
2578      return this.snapshot;
2579    }
2580
2581    public boolean hasSnapshot() { 
2582      return this.snapshot != null && !this.snapshot.isEmpty();
2583    }
2584
2585    /**
2586     * @param value {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.)
2587     */
2588    public StructureDefinition setSnapshot(StructureDefinitionSnapshotComponent value)  { 
2589      this.snapshot = value;
2590      return this;
2591    }
2592
2593    /**
2594     * @return {@link #differential} (A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.)
2595     */
2596    public StructureDefinitionDifferentialComponent getDifferential() { 
2597      if (this.differential == null)
2598        if (Configuration.errorOnAutoCreate())
2599          throw new Error("Attempt to auto-create StructureDefinition.differential");
2600        else if (Configuration.doAutoCreate())
2601          this.differential = new StructureDefinitionDifferentialComponent(); // cc
2602      return this.differential;
2603    }
2604
2605    public boolean hasDifferential() { 
2606      return this.differential != null && !this.differential.isEmpty();
2607    }
2608
2609    /**
2610     * @param value {@link #differential} (A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.)
2611     */
2612    public StructureDefinition setDifferential(StructureDefinitionDifferentialComponent value)  { 
2613      this.differential = value;
2614      return this;
2615    }
2616
2617      protected void listChildren(List<Property> children) {
2618        super.listChildren(children);
2619        children.add(new Property("url", "uri", "An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. The URL SHOULD include the major version of the structure definition. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url));
2620        children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this structure definition when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
2621        children.add(new Property("version", "string", "The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version));
2622        children.add(new Property("name", "string", "A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
2623        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the structure definition.", 0, 1, title));
2624        children.add(new Property("status", "code", "The status of this structure definition. Enables tracking the life-cycle of the content.", 0, 1, status));
2625        children.add(new Property("experimental", "boolean", "A boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental));
2626        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the structure definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.", 0, 1, date));
2627        children.add(new Property("publisher", "string", "The name of the individual or organization that published the structure definition.", 0, 1, publisher));
2628        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
2629        children.add(new Property("description", "markdown", "A free text natural language description of the structure definition from a consumer's perspective.", 0, 1, description));
2630        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate structure definition instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
2631        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the structure definition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
2632        children.add(new Property("purpose", "markdown", "Explaination of why this structure definition is needed and why it has been designed as it has.", 0, 1, purpose));
2633        children.add(new Property("copyright", "markdown", "A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.", 0, 1, copyright));
2634        children.add(new Property("keyword", "Coding", "A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, keyword));
2635        children.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.", 0, 1, fhirVersion));
2636        children.add(new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping));
2637        children.add(new Property("kind", "code", "Defines the kind of structure that this definition is describing.", 0, 1, kind));
2638        children.add(new Property("abstract", "boolean", "Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems.", 0, 1, abstract_));
2639        children.add(new Property("contextType", "code", "If this is an extension, Identifies the context within FHIR resources where the extension can be used.", 0, 1, contextType));
2640        children.add(new Property("context", "string", "Identifies the types of resource or data type elements to which the extension can be applied.", 0, java.lang.Integer.MAX_VALUE, context));
2641        children.add(new Property("contextInvariant", "string", "A set of rules as Fluent Invariants about when the extension can be used (e.g. co-occurrence variants for the extension).", 0, java.lang.Integer.MAX_VALUE, contextInvariant));
2642        children.add(new Property("type", "code", "The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).", 0, 1, type));
2643        children.add(new Property("baseDefinition", "uri", "An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.", 0, 1, baseDefinition));
2644        children.add(new Property("derivation", "code", "How the type relates to the baseDefinition.", 0, 1, derivation));
2645        children.add(new Property("snapshot", "", "A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.", 0, 1, snapshot));
2646        children.add(new Property("differential", "", "A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.", 0, 1, differential));
2647      }
2648
2649      @Override
2650      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2651        switch (_hash) {
2652        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. The URL SHOULD include the major version of the structure definition. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url);
2653        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this structure definition when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
2654        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version);
2655        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
2656        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the structure definition.", 0, 1, title);
2657        case -892481550: /*status*/  return new Property("status", "code", "The status of this structure definition. Enables tracking the life-cycle of the content.", 0, 1, status);
2658        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental);
2659        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the structure definition was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.", 0, 1, date);
2660        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the individual or organization that published the structure definition.", 0, 1, publisher);
2661        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
2662        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the structure definition from a consumer's perspective.", 0, 1, description);
2663        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate structure definition instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
2664        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the structure definition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
2665        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explaination of why this structure definition is needed and why it has been designed as it has.", 0, 1, purpose);
2666        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.", 0, 1, copyright);
2667        case -814408215: /*keyword*/  return new Property("keyword", "Coding", "A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, keyword);
2668        case 461006061: /*fhirVersion*/  return new Property("fhirVersion", "id", "The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.", 0, 1, fhirVersion);
2669        case 837556430: /*mapping*/  return new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping);
2670        case 3292052: /*kind*/  return new Property("kind", "code", "Defines the kind of structure that this definition is describing.", 0, 1, kind);
2671        case 1732898850: /*abstract*/  return new Property("abstract", "boolean", "Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems.", 0, 1, abstract_);
2672        case -102839927: /*contextType*/  return new Property("contextType", "code", "If this is an extension, Identifies the context within FHIR resources where the extension can be used.", 0, 1, contextType);
2673        case 951530927: /*context*/  return new Property("context", "string", "Identifies the types of resource or data type elements to which the extension can be applied.", 0, java.lang.Integer.MAX_VALUE, context);
2674        case -802505007: /*contextInvariant*/  return new Property("contextInvariant", "string", "A set of rules as Fluent Invariants about when the extension can be used (e.g. co-occurrence variants for the extension).", 0, java.lang.Integer.MAX_VALUE, contextInvariant);
2675        case 3575610: /*type*/  return new Property("type", "code", "The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).", 0, 1, type);
2676        case 1139771140: /*baseDefinition*/  return new Property("baseDefinition", "uri", "An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.", 0, 1, baseDefinition);
2677        case -1353885513: /*derivation*/  return new Property("derivation", "code", "How the type relates to the baseDefinition.", 0, 1, derivation);
2678        case 284874180: /*snapshot*/  return new Property("snapshot", "", "A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.", 0, 1, snapshot);
2679        case -1196150917: /*differential*/  return new Property("differential", "", "A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.", 0, 1, differential);
2680        default: return super.getNamedProperty(_hash, _name, _checkValid);
2681        }
2682
2683      }
2684
2685      @Override
2686      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2687        switch (hash) {
2688        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
2689        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2690        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
2691        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2692        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
2693        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
2694        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
2695        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
2696        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
2697        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
2698        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2699        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
2700        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
2701        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
2702        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
2703        case -814408215: /*keyword*/ return this.keyword == null ? new Base[0] : this.keyword.toArray(new Base[this.keyword.size()]); // Coding
2704        case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType
2705        case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // StructureDefinitionMappingComponent
2706        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<StructureDefinitionKind>
2707        case 1732898850: /*abstract*/ return this.abstract_ == null ? new Base[0] : new Base[] {this.abstract_}; // BooleanType
2708        case -102839927: /*contextType*/ return this.contextType == null ? new Base[0] : new Base[] {this.contextType}; // Enumeration<ExtensionContext>
2709        case 951530927: /*context*/ return this.context == null ? new Base[0] : this.context.toArray(new Base[this.context.size()]); // StringType
2710        case -802505007: /*contextInvariant*/ return this.contextInvariant == null ? new Base[0] : this.contextInvariant.toArray(new Base[this.contextInvariant.size()]); // StringType
2711        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType
2712        case 1139771140: /*baseDefinition*/ return this.baseDefinition == null ? new Base[0] : new Base[] {this.baseDefinition}; // UriType
2713        case -1353885513: /*derivation*/ return this.derivation == null ? new Base[0] : new Base[] {this.derivation}; // Enumeration<TypeDerivationRule>
2714        case 284874180: /*snapshot*/ return this.snapshot == null ? new Base[0] : new Base[] {this.snapshot}; // StructureDefinitionSnapshotComponent
2715        case -1196150917: /*differential*/ return this.differential == null ? new Base[0] : new Base[] {this.differential}; // StructureDefinitionDifferentialComponent
2716        default: return super.getProperty(hash, name, checkValid);
2717        }
2718
2719      }
2720
2721      @Override
2722      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2723        switch (hash) {
2724        case 116079: // url
2725          this.url = castToUri(value); // UriType
2726          return value;
2727        case -1618432855: // identifier
2728          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2729          return value;
2730        case 351608024: // version
2731          this.version = castToString(value); // StringType
2732          return value;
2733        case 3373707: // name
2734          this.name = castToString(value); // StringType
2735          return value;
2736        case 110371416: // title
2737          this.title = castToString(value); // StringType
2738          return value;
2739        case -892481550: // status
2740          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
2741          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
2742          return value;
2743        case -404562712: // experimental
2744          this.experimental = castToBoolean(value); // BooleanType
2745          return value;
2746        case 3076014: // date
2747          this.date = castToDateTime(value); // DateTimeType
2748          return value;
2749        case 1447404028: // publisher
2750          this.publisher = castToString(value); // StringType
2751          return value;
2752        case 951526432: // contact
2753          this.getContact().add(castToContactDetail(value)); // ContactDetail
2754          return value;
2755        case -1724546052: // description
2756          this.description = castToMarkdown(value); // MarkdownType
2757          return value;
2758        case -669707736: // useContext
2759          this.getUseContext().add(castToUsageContext(value)); // UsageContext
2760          return value;
2761        case -507075711: // jurisdiction
2762          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
2763          return value;
2764        case -220463842: // purpose
2765          this.purpose = castToMarkdown(value); // MarkdownType
2766          return value;
2767        case 1522889671: // copyright
2768          this.copyright = castToMarkdown(value); // MarkdownType
2769          return value;
2770        case -814408215: // keyword
2771          this.getKeyword().add(castToCoding(value)); // Coding
2772          return value;
2773        case 461006061: // fhirVersion
2774          this.fhirVersion = castToId(value); // IdType
2775          return value;
2776        case 837556430: // mapping
2777          this.getMapping().add((StructureDefinitionMappingComponent) value); // StructureDefinitionMappingComponent
2778          return value;
2779        case 3292052: // kind
2780          value = new StructureDefinitionKindEnumFactory().fromType(castToCode(value));
2781          this.kind = (Enumeration) value; // Enumeration<StructureDefinitionKind>
2782          return value;
2783        case 1732898850: // abstract
2784          this.abstract_ = castToBoolean(value); // BooleanType
2785          return value;
2786        case -102839927: // contextType
2787          value = new ExtensionContextEnumFactory().fromType(castToCode(value));
2788          this.contextType = (Enumeration) value; // Enumeration<ExtensionContext>
2789          return value;
2790        case 951530927: // context
2791          this.getContext().add(castToString(value)); // StringType
2792          return value;
2793        case -802505007: // contextInvariant
2794          this.getContextInvariant().add(castToString(value)); // StringType
2795          return value;
2796        case 3575610: // type
2797          this.type = castToCode(value); // CodeType
2798          return value;
2799        case 1139771140: // baseDefinition
2800          this.baseDefinition = castToUri(value); // UriType
2801          return value;
2802        case -1353885513: // derivation
2803          value = new TypeDerivationRuleEnumFactory().fromType(castToCode(value));
2804          this.derivation = (Enumeration) value; // Enumeration<TypeDerivationRule>
2805          return value;
2806        case 284874180: // snapshot
2807          this.snapshot = (StructureDefinitionSnapshotComponent) value; // StructureDefinitionSnapshotComponent
2808          return value;
2809        case -1196150917: // differential
2810          this.differential = (StructureDefinitionDifferentialComponent) value; // StructureDefinitionDifferentialComponent
2811          return value;
2812        default: return super.setProperty(hash, name, value);
2813        }
2814
2815      }
2816
2817      @Override
2818      public Base setProperty(String name, Base value) throws FHIRException {
2819        if (name.equals("url")) {
2820          this.url = castToUri(value); // UriType
2821        } else if (name.equals("identifier")) {
2822          this.getIdentifier().add(castToIdentifier(value));
2823        } else if (name.equals("version")) {
2824          this.version = castToString(value); // StringType
2825        } else if (name.equals("name")) {
2826          this.name = castToString(value); // StringType
2827        } else if (name.equals("title")) {
2828          this.title = castToString(value); // StringType
2829        } else if (name.equals("status")) {
2830          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
2831          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
2832        } else if (name.equals("experimental")) {
2833          this.experimental = castToBoolean(value); // BooleanType
2834        } else if (name.equals("date")) {
2835          this.date = castToDateTime(value); // DateTimeType
2836        } else if (name.equals("publisher")) {
2837          this.publisher = castToString(value); // StringType
2838        } else if (name.equals("contact")) {
2839          this.getContact().add(castToContactDetail(value));
2840        } else if (name.equals("description")) {
2841          this.description = castToMarkdown(value); // MarkdownType
2842        } else if (name.equals("useContext")) {
2843          this.getUseContext().add(castToUsageContext(value));
2844        } else if (name.equals("jurisdiction")) {
2845          this.getJurisdiction().add(castToCodeableConcept(value));
2846        } else if (name.equals("purpose")) {
2847          this.purpose = castToMarkdown(value); // MarkdownType
2848        } else if (name.equals("copyright")) {
2849          this.copyright = castToMarkdown(value); // MarkdownType
2850        } else if (name.equals("keyword")) {
2851          this.getKeyword().add(castToCoding(value));
2852        } else if (name.equals("fhirVersion")) {
2853          this.fhirVersion = castToId(value); // IdType
2854        } else if (name.equals("mapping")) {
2855          this.getMapping().add((StructureDefinitionMappingComponent) value);
2856        } else if (name.equals("kind")) {
2857          value = new StructureDefinitionKindEnumFactory().fromType(castToCode(value));
2858          this.kind = (Enumeration) value; // Enumeration<StructureDefinitionKind>
2859        } else if (name.equals("abstract")) {
2860          this.abstract_ = castToBoolean(value); // BooleanType
2861        } else if (name.equals("contextType")) {
2862          value = new ExtensionContextEnumFactory().fromType(castToCode(value));
2863          this.contextType = (Enumeration) value; // Enumeration<ExtensionContext>
2864        } else if (name.equals("context")) {
2865          this.getContext().add(castToString(value));
2866        } else if (name.equals("contextInvariant")) {
2867          this.getContextInvariant().add(castToString(value));
2868        } else if (name.equals("type")) {
2869          this.type = castToCode(value); // CodeType
2870        } else if (name.equals("baseDefinition")) {
2871          this.baseDefinition = castToUri(value); // UriType
2872        } else if (name.equals("derivation")) {
2873          value = new TypeDerivationRuleEnumFactory().fromType(castToCode(value));
2874          this.derivation = (Enumeration) value; // Enumeration<TypeDerivationRule>
2875        } else if (name.equals("snapshot")) {
2876          this.snapshot = (StructureDefinitionSnapshotComponent) value; // StructureDefinitionSnapshotComponent
2877        } else if (name.equals("differential")) {
2878          this.differential = (StructureDefinitionDifferentialComponent) value; // StructureDefinitionDifferentialComponent
2879        } else
2880          return super.setProperty(name, value);
2881        return value;
2882      }
2883
2884      @Override
2885      public Base makeProperty(int hash, String name) throws FHIRException {
2886        switch (hash) {
2887        case 116079:  return getUrlElement();
2888        case -1618432855:  return addIdentifier(); 
2889        case 351608024:  return getVersionElement();
2890        case 3373707:  return getNameElement();
2891        case 110371416:  return getTitleElement();
2892        case -892481550:  return getStatusElement();
2893        case -404562712:  return getExperimentalElement();
2894        case 3076014:  return getDateElement();
2895        case 1447404028:  return getPublisherElement();
2896        case 951526432:  return addContact(); 
2897        case -1724546052:  return getDescriptionElement();
2898        case -669707736:  return addUseContext(); 
2899        case -507075711:  return addJurisdiction(); 
2900        case -220463842:  return getPurposeElement();
2901        case 1522889671:  return getCopyrightElement();
2902        case -814408215:  return addKeyword(); 
2903        case 461006061:  return getFhirVersionElement();
2904        case 837556430:  return addMapping(); 
2905        case 3292052:  return getKindElement();
2906        case 1732898850:  return getAbstractElement();
2907        case -102839927:  return getContextTypeElement();
2908        case 951530927:  return addContextElement();
2909        case -802505007:  return addContextInvariantElement();
2910        case 3575610:  return getTypeElement();
2911        case 1139771140:  return getBaseDefinitionElement();
2912        case -1353885513:  return getDerivationElement();
2913        case 284874180:  return getSnapshot(); 
2914        case -1196150917:  return getDifferential(); 
2915        default: return super.makeProperty(hash, name);
2916        }
2917
2918      }
2919
2920      @Override
2921      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2922        switch (hash) {
2923        case 116079: /*url*/ return new String[] {"uri"};
2924        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2925        case 351608024: /*version*/ return new String[] {"string"};
2926        case 3373707: /*name*/ return new String[] {"string"};
2927        case 110371416: /*title*/ return new String[] {"string"};
2928        case -892481550: /*status*/ return new String[] {"code"};
2929        case -404562712: /*experimental*/ return new String[] {"boolean"};
2930        case 3076014: /*date*/ return new String[] {"dateTime"};
2931        case 1447404028: /*publisher*/ return new String[] {"string"};
2932        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
2933        case -1724546052: /*description*/ return new String[] {"markdown"};
2934        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
2935        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
2936        case -220463842: /*purpose*/ return new String[] {"markdown"};
2937        case 1522889671: /*copyright*/ return new String[] {"markdown"};
2938        case -814408215: /*keyword*/ return new String[] {"Coding"};
2939        case 461006061: /*fhirVersion*/ return new String[] {"id"};
2940        case 837556430: /*mapping*/ return new String[] {};
2941        case 3292052: /*kind*/ return new String[] {"code"};
2942        case 1732898850: /*abstract*/ return new String[] {"boolean"};
2943        case -102839927: /*contextType*/ return new String[] {"code"};
2944        case 951530927: /*context*/ return new String[] {"string"};
2945        case -802505007: /*contextInvariant*/ return new String[] {"string"};
2946        case 3575610: /*type*/ return new String[] {"code"};
2947        case 1139771140: /*baseDefinition*/ return new String[] {"uri"};
2948        case -1353885513: /*derivation*/ return new String[] {"code"};
2949        case 284874180: /*snapshot*/ return new String[] {};
2950        case -1196150917: /*differential*/ return new String[] {};
2951        default: return super.getTypesForProperty(hash, name);
2952        }
2953
2954      }
2955
2956      @Override
2957      public Base addChild(String name) throws FHIRException {
2958        if (name.equals("url")) {
2959          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.url");
2960        }
2961        else if (name.equals("identifier")) {
2962          return addIdentifier();
2963        }
2964        else if (name.equals("version")) {
2965          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.version");
2966        }
2967        else if (name.equals("name")) {
2968          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.name");
2969        }
2970        else if (name.equals("title")) {
2971          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.title");
2972        }
2973        else if (name.equals("status")) {
2974          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.status");
2975        }
2976        else if (name.equals("experimental")) {
2977          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.experimental");
2978        }
2979        else if (name.equals("date")) {
2980          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.date");
2981        }
2982        else if (name.equals("publisher")) {
2983          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.publisher");
2984        }
2985        else if (name.equals("contact")) {
2986          return addContact();
2987        }
2988        else if (name.equals("description")) {
2989          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.description");
2990        }
2991        else if (name.equals("useContext")) {
2992          return addUseContext();
2993        }
2994        else if (name.equals("jurisdiction")) {
2995          return addJurisdiction();
2996        }
2997        else if (name.equals("purpose")) {
2998          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.purpose");
2999        }
3000        else if (name.equals("copyright")) {
3001          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.copyright");
3002        }
3003        else if (name.equals("keyword")) {
3004          return addKeyword();
3005        }
3006        else if (name.equals("fhirVersion")) {
3007          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.fhirVersion");
3008        }
3009        else if (name.equals("mapping")) {
3010          return addMapping();
3011        }
3012        else if (name.equals("kind")) {
3013          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.kind");
3014        }
3015        else if (name.equals("abstract")) {
3016          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.abstract");
3017        }
3018        else if (name.equals("contextType")) {
3019          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.contextType");
3020        }
3021        else if (name.equals("context")) {
3022          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.context");
3023        }
3024        else if (name.equals("contextInvariant")) {
3025          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.contextInvariant");
3026        }
3027        else if (name.equals("type")) {
3028          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.type");
3029        }
3030        else if (name.equals("baseDefinition")) {
3031          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.baseDefinition");
3032        }
3033        else if (name.equals("derivation")) {
3034          throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.derivation");
3035        }
3036        else if (name.equals("snapshot")) {
3037          this.snapshot = new StructureDefinitionSnapshotComponent();
3038          return this.snapshot;
3039        }
3040        else if (name.equals("differential")) {
3041          this.differential = new StructureDefinitionDifferentialComponent();
3042          return this.differential;
3043        }
3044        else
3045          return super.addChild(name);
3046      }
3047
3048  public String fhirType() {
3049    return "StructureDefinition";
3050
3051  }
3052
3053      public StructureDefinition copy() {
3054        StructureDefinition dst = new StructureDefinition();
3055        copyValues(dst);
3056        dst.url = url == null ? null : url.copy();
3057        if (identifier != null) {
3058          dst.identifier = new ArrayList<Identifier>();
3059          for (Identifier i : identifier)
3060            dst.identifier.add(i.copy());
3061        };
3062        dst.version = version == null ? null : version.copy();
3063        dst.name = name == null ? null : name.copy();
3064        dst.title = title == null ? null : title.copy();
3065        dst.status = status == null ? null : status.copy();
3066        dst.experimental = experimental == null ? null : experimental.copy();
3067        dst.date = date == null ? null : date.copy();
3068        dst.publisher = publisher == null ? null : publisher.copy();
3069        if (contact != null) {
3070          dst.contact = new ArrayList<ContactDetail>();
3071          for (ContactDetail i : contact)
3072            dst.contact.add(i.copy());
3073        };
3074        dst.description = description == null ? null : description.copy();
3075        if (useContext != null) {
3076          dst.useContext = new ArrayList<UsageContext>();
3077          for (UsageContext i : useContext)
3078            dst.useContext.add(i.copy());
3079        };
3080        if (jurisdiction != null) {
3081          dst.jurisdiction = new ArrayList<CodeableConcept>();
3082          for (CodeableConcept i : jurisdiction)
3083            dst.jurisdiction.add(i.copy());
3084        };
3085        dst.purpose = purpose == null ? null : purpose.copy();
3086        dst.copyright = copyright == null ? null : copyright.copy();
3087        if (keyword != null) {
3088          dst.keyword = new ArrayList<Coding>();
3089          for (Coding i : keyword)
3090            dst.keyword.add(i.copy());
3091        };
3092        dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy();
3093        if (mapping != null) {
3094          dst.mapping = new ArrayList<StructureDefinitionMappingComponent>();
3095          for (StructureDefinitionMappingComponent i : mapping)
3096            dst.mapping.add(i.copy());
3097        };
3098        dst.kind = kind == null ? null : kind.copy();
3099        dst.abstract_ = abstract_ == null ? null : abstract_.copy();
3100        dst.contextType = contextType == null ? null : contextType.copy();
3101        if (context != null) {
3102          dst.context = new ArrayList<StringType>();
3103          for (StringType i : context)
3104            dst.context.add(i.copy());
3105        };
3106        if (contextInvariant != null) {
3107          dst.contextInvariant = new ArrayList<StringType>();
3108          for (StringType i : contextInvariant)
3109            dst.contextInvariant.add(i.copy());
3110        };
3111        dst.type = type == null ? null : type.copy();
3112        dst.baseDefinition = baseDefinition == null ? null : baseDefinition.copy();
3113        dst.derivation = derivation == null ? null : derivation.copy();
3114        dst.snapshot = snapshot == null ? null : snapshot.copy();
3115        dst.differential = differential == null ? null : differential.copy();
3116        return dst;
3117      }
3118
3119      protected StructureDefinition typedCopy() {
3120        return copy();
3121      }
3122
3123      @Override
3124      public boolean equalsDeep(Base other_) {
3125        if (!super.equalsDeep(other_))
3126          return false;
3127        if (!(other_ instanceof StructureDefinition))
3128          return false;
3129        StructureDefinition o = (StructureDefinition) other_;
3130        return compareDeep(identifier, o.identifier, true) && compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true)
3131           && compareDeep(keyword, o.keyword, true) && compareDeep(fhirVersion, o.fhirVersion, true) && compareDeep(mapping, o.mapping, true)
3132           && compareDeep(kind, o.kind, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(contextType, o.contextType, true)
3133           && compareDeep(context, o.context, true) && compareDeep(contextInvariant, o.contextInvariant, true)
3134           && compareDeep(type, o.type, true) && compareDeep(baseDefinition, o.baseDefinition, true) && compareDeep(derivation, o.derivation, true)
3135           && compareDeep(snapshot, o.snapshot, true) && compareDeep(differential, o.differential, true);
3136      }
3137
3138      @Override
3139      public boolean equalsShallow(Base other_) {
3140        if (!super.equalsShallow(other_))
3141          return false;
3142        if (!(other_ instanceof StructureDefinition))
3143          return false;
3144        StructureDefinition o = (StructureDefinition) other_;
3145        return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(fhirVersion, o.fhirVersion, true)
3146           && compareValues(kind, o.kind, true) && compareValues(abstract_, o.abstract_, true) && compareValues(contextType, o.contextType, true)
3147           && compareValues(context, o.context, true) && compareValues(contextInvariant, o.contextInvariant, true)
3148           && compareValues(type, o.type, true) && compareValues(baseDefinition, o.baseDefinition, true) && compareValues(derivation, o.derivation, true)
3149          ;
3150      }
3151
3152      public boolean isEmpty() {
3153        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, purpose, copyright
3154          , keyword, fhirVersion, mapping, kind, abstract_, contextType, context, contextInvariant
3155          , type, baseDefinition, derivation, snapshot, differential);
3156      }
3157
3158  @Override
3159  public ResourceType getResourceType() {
3160    return ResourceType.StructureDefinition;
3161   }
3162
3163 /**
3164   * Search parameter: <b>date</b>
3165   * <p>
3166   * Description: <b>The structure definition publication date</b><br>
3167   * Type: <b>date</b><br>
3168   * Path: <b>StructureDefinition.date</b><br>
3169   * </p>
3170   */
3171  @SearchParamDefinition(name="date", path="StructureDefinition.date", description="The structure definition publication date", type="date" )
3172  public static final String SP_DATE = "date";
3173 /**
3174   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3175   * <p>
3176   * Description: <b>The structure definition publication date</b><br>
3177   * Type: <b>date</b><br>
3178   * Path: <b>StructureDefinition.date</b><br>
3179   * </p>
3180   */
3181  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3182
3183 /**
3184   * Search parameter: <b>identifier</b>
3185   * <p>
3186   * Description: <b>External identifier for the structure definition</b><br>
3187   * Type: <b>token</b><br>
3188   * Path: <b>StructureDefinition.identifier</b><br>
3189   * </p>
3190   */
3191  @SearchParamDefinition(name="identifier", path="StructureDefinition.identifier", description="External identifier for the structure definition", type="token" )
3192  public static final String SP_IDENTIFIER = "identifier";
3193 /**
3194   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3195   * <p>
3196   * Description: <b>External identifier for the structure definition</b><br>
3197   * Type: <b>token</b><br>
3198   * Path: <b>StructureDefinition.identifier</b><br>
3199   * </p>
3200   */
3201  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3202
3203 /**
3204   * Search parameter: <b>valueset</b>
3205   * <p>
3206   * Description: <b>A vocabulary binding reference</b><br>
3207   * Type: <b>reference</b><br>
3208   * Path: <b>StructureDefinition.snapshot.element.binding.valueSet[x]</b><br>
3209   * </p>
3210   */
3211  @SearchParamDefinition(name="valueset", path="StructureDefinition.snapshot.element.binding.valueSet", description="A vocabulary binding reference", type="reference", target={ValueSet.class } )
3212  public static final String SP_VALUESET = "valueset";
3213 /**
3214   * <b>Fluent Client</b> search parameter constant for <b>valueset</b>
3215   * <p>
3216   * Description: <b>A vocabulary binding reference</b><br>
3217   * Type: <b>reference</b><br>
3218   * Path: <b>StructureDefinition.snapshot.element.binding.valueSet[x]</b><br>
3219   * </p>
3220   */
3221  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam VALUESET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_VALUESET);
3222
3223/**
3224   * Constant for fluent queries to be used to add include statements. Specifies
3225   * the path value of "<b>StructureDefinition:valueset</b>".
3226   */
3227  public static final ca.uhn.fhir.model.api.Include INCLUDE_VALUESET = new ca.uhn.fhir.model.api.Include("StructureDefinition:valueset").toLocked();
3228
3229 /**
3230   * Search parameter: <b>kind</b>
3231   * <p>
3232   * Description: <b>primitive-type | complex-type | resource | logical</b><br>
3233   * Type: <b>token</b><br>
3234   * Path: <b>StructureDefinition.kind</b><br>
3235   * </p>
3236   */
3237  @SearchParamDefinition(name="kind", path="StructureDefinition.kind", description="primitive-type | complex-type | resource | logical", type="token" )
3238  public static final String SP_KIND = "kind";
3239 /**
3240   * <b>Fluent Client</b> search parameter constant for <b>kind</b>
3241   * <p>
3242   * Description: <b>primitive-type | complex-type | resource | logical</b><br>
3243   * Type: <b>token</b><br>
3244   * Path: <b>StructureDefinition.kind</b><br>
3245   * </p>
3246   */
3247  public static final ca.uhn.fhir.rest.gclient.TokenClientParam KIND = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KIND);
3248
3249 /**
3250   * Search parameter: <b>jurisdiction</b>
3251   * <p>
3252   * Description: <b>Intended jurisdiction for the structure definition</b><br>
3253   * Type: <b>token</b><br>
3254   * Path: <b>StructureDefinition.jurisdiction</b><br>
3255   * </p>
3256   */
3257  @SearchParamDefinition(name="jurisdiction", path="StructureDefinition.jurisdiction", description="Intended jurisdiction for the structure definition", type="token" )
3258  public static final String SP_JURISDICTION = "jurisdiction";
3259 /**
3260   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
3261   * <p>
3262   * Description: <b>Intended jurisdiction for the structure definition</b><br>
3263   * Type: <b>token</b><br>
3264   * Path: <b>StructureDefinition.jurisdiction</b><br>
3265   * </p>
3266   */
3267  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
3268
3269 /**
3270   * Search parameter: <b>description</b>
3271   * <p>
3272   * Description: <b>The description of the structure definition</b><br>
3273   * Type: <b>string</b><br>
3274   * Path: <b>StructureDefinition.description</b><br>
3275   * </p>
3276   */
3277  @SearchParamDefinition(name="description", path="StructureDefinition.description", description="The description of the structure definition", type="string" )
3278  public static final String SP_DESCRIPTION = "description";
3279 /**
3280   * <b>Fluent Client</b> search parameter constant for <b>description</b>
3281   * <p>
3282   * Description: <b>The description of the structure definition</b><br>
3283   * Type: <b>string</b><br>
3284   * Path: <b>StructureDefinition.description</b><br>
3285   * </p>
3286   */
3287  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
3288
3289 /**
3290   * Search parameter: <b>experimental</b>
3291   * <p>
3292   * Description: <b>For testing purposes, not real usage</b><br>
3293   * Type: <b>token</b><br>
3294   * Path: <b>StructureDefinition.experimental</b><br>
3295   * </p>
3296   */
3297  @SearchParamDefinition(name="experimental", path="StructureDefinition.experimental", description="For testing purposes, not real usage", type="token" )
3298  public static final String SP_EXPERIMENTAL = "experimental";
3299 /**
3300   * <b>Fluent Client</b> search parameter constant for <b>experimental</b>
3301   * <p>
3302   * Description: <b>For testing purposes, not real usage</b><br>
3303   * Type: <b>token</b><br>
3304   * Path: <b>StructureDefinition.experimental</b><br>
3305   * </p>
3306   */
3307  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXPERIMENTAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXPERIMENTAL);
3308
3309 /**
3310   * Search parameter: <b>context-type</b>
3311   * <p>
3312   * Description: <b>resource | datatype | extension</b><br>
3313   * Type: <b>token</b><br>
3314   * Path: <b>StructureDefinition.contextType</b><br>
3315   * </p>
3316   */
3317  @SearchParamDefinition(name="context-type", path="StructureDefinition.contextType", description="resource | datatype | extension", type="token" )
3318  public static final String SP_CONTEXT_TYPE = "context-type";
3319 /**
3320   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
3321   * <p>
3322   * Description: <b>resource | datatype | extension</b><br>
3323   * Type: <b>token</b><br>
3324   * Path: <b>StructureDefinition.contextType</b><br>
3325   * </p>
3326   */
3327  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE);
3328
3329 /**
3330   * Search parameter: <b>abstract</b>
3331   * <p>
3332   * Description: <b>Whether the structure is abstract</b><br>
3333   * Type: <b>token</b><br>
3334   * Path: <b>StructureDefinition.abstract</b><br>
3335   * </p>
3336   */
3337  @SearchParamDefinition(name="abstract", path="StructureDefinition.abstract", description="Whether the structure is abstract", type="token" )
3338  public static final String SP_ABSTRACT = "abstract";
3339 /**
3340   * <b>Fluent Client</b> search parameter constant for <b>abstract</b>
3341   * <p>
3342   * Description: <b>Whether the structure is abstract</b><br>
3343   * Type: <b>token</b><br>
3344   * Path: <b>StructureDefinition.abstract</b><br>
3345   * </p>
3346   */
3347  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ABSTRACT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ABSTRACT);
3348
3349 /**
3350   * Search parameter: <b>title</b>
3351   * <p>
3352   * Description: <b>The human-friendly name of the structure definition</b><br>
3353   * Type: <b>string</b><br>
3354   * Path: <b>StructureDefinition.title</b><br>
3355   * </p>
3356   */
3357  @SearchParamDefinition(name="title", path="StructureDefinition.title", description="The human-friendly name of the structure definition", type="string" )
3358  public static final String SP_TITLE = "title";
3359 /**
3360   * <b>Fluent Client</b> search parameter constant for <b>title</b>
3361   * <p>
3362   * Description: <b>The human-friendly name of the structure definition</b><br>
3363   * Type: <b>string</b><br>
3364   * Path: <b>StructureDefinition.title</b><br>
3365   * </p>
3366   */
3367  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
3368
3369 /**
3370   * Search parameter: <b>type</b>
3371   * <p>
3372   * Description: <b>Type defined or constrained by this structure</b><br>
3373   * Type: <b>token</b><br>
3374   * Path: <b>StructureDefinition.type</b><br>
3375   * </p>
3376   */
3377  @SearchParamDefinition(name="type", path="StructureDefinition.type", description="Type defined or constrained by this structure", type="token" )
3378  public static final String SP_TYPE = "type";
3379 /**
3380   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3381   * <p>
3382   * Description: <b>Type defined or constrained by this structure</b><br>
3383   * Type: <b>token</b><br>
3384   * Path: <b>StructureDefinition.type</b><br>
3385   * </p>
3386   */
3387  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
3388
3389 /**
3390   * Search parameter: <b>version</b>
3391   * <p>
3392   * Description: <b>The business version of the structure definition</b><br>
3393   * Type: <b>token</b><br>
3394   * Path: <b>StructureDefinition.version</b><br>
3395   * </p>
3396   */
3397  @SearchParamDefinition(name="version", path="StructureDefinition.version", description="The business version of the structure definition", type="token" )
3398  public static final String SP_VERSION = "version";
3399 /**
3400   * <b>Fluent Client</b> search parameter constant for <b>version</b>
3401   * <p>
3402   * Description: <b>The business version of the structure definition</b><br>
3403   * Type: <b>token</b><br>
3404   * Path: <b>StructureDefinition.version</b><br>
3405   * </p>
3406   */
3407  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
3408
3409 /**
3410   * Search parameter: <b>url</b>
3411   * <p>
3412   * Description: <b>The uri that identifies the structure definition</b><br>
3413   * Type: <b>uri</b><br>
3414   * Path: <b>StructureDefinition.url</b><br>
3415   * </p>
3416   */
3417  @SearchParamDefinition(name="url", path="StructureDefinition.url", description="The uri that identifies the structure definition", type="uri" )
3418  public static final String SP_URL = "url";
3419 /**
3420   * <b>Fluent Client</b> search parameter constant for <b>url</b>
3421   * <p>
3422   * Description: <b>The uri that identifies the structure definition</b><br>
3423   * Type: <b>uri</b><br>
3424   * Path: <b>StructureDefinition.url</b><br>
3425   * </p>
3426   */
3427  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
3428
3429 /**
3430   * Search parameter: <b>path</b>
3431   * <p>
3432   * Description: <b>A path that is constrained in the profile</b><br>
3433   * Type: <b>token</b><br>
3434   * Path: <b>StructureDefinition.snapshot.element.path, StructureDefinition.differential.element.path</b><br>
3435   * </p>
3436   */
3437  @SearchParamDefinition(name="path", path="StructureDefinition.snapshot.element.path | StructureDefinition.differential.element.path", description="A path that is constrained in the profile", type="token" )
3438  public static final String SP_PATH = "path";
3439 /**
3440   * <b>Fluent Client</b> search parameter constant for <b>path</b>
3441   * <p>
3442   * Description: <b>A path that is constrained in the profile</b><br>
3443   * Type: <b>token</b><br>
3444   * Path: <b>StructureDefinition.snapshot.element.path, StructureDefinition.differential.element.path</b><br>
3445   * </p>
3446   */
3447  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATH = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATH);
3448
3449 /**
3450   * Search parameter: <b>ext-context</b>
3451   * <p>
3452   * Description: <b>Where the extension can be used in instances</b><br>
3453   * Type: <b>string</b><br>
3454   * Path: <b>StructureDefinition.context</b><br>
3455   * </p>
3456   */
3457  @SearchParamDefinition(name="ext-context", path="StructureDefinition.context", description="Where the extension can be used in instances", type="string" )
3458  public static final String SP_EXT_CONTEXT = "ext-context";
3459 /**
3460   * <b>Fluent Client</b> search parameter constant for <b>ext-context</b>
3461   * <p>
3462   * Description: <b>Where the extension can be used in instances</b><br>
3463   * Type: <b>string</b><br>
3464   * Path: <b>StructureDefinition.context</b><br>
3465   * </p>
3466   */
3467  public static final ca.uhn.fhir.rest.gclient.StringClientParam EXT_CONTEXT = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_EXT_CONTEXT);
3468
3469 /**
3470   * Search parameter: <b>name</b>
3471   * <p>
3472   * Description: <b>Computationally friendly name of the structure definition</b><br>
3473   * Type: <b>string</b><br>
3474   * Path: <b>StructureDefinition.name</b><br>
3475   * </p>
3476   */
3477  @SearchParamDefinition(name="name", path="StructureDefinition.name", description="Computationally friendly name of the structure definition", type="string" )
3478  public static final String SP_NAME = "name";
3479 /**
3480   * <b>Fluent Client</b> search parameter constant for <b>name</b>
3481   * <p>
3482   * Description: <b>Computationally friendly name of the structure definition</b><br>
3483   * Type: <b>string</b><br>
3484   * Path: <b>StructureDefinition.name</b><br>
3485   * </p>
3486   */
3487  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
3488
3489 /**
3490   * Search parameter: <b>base-path</b>
3491   * <p>
3492   * Description: <b>Path that identifies the base element</b><br>
3493   * Type: <b>token</b><br>
3494   * Path: <b>StructureDefinition.snapshot.element.base.path, StructureDefinition.differential.element.base.path</b><br>
3495   * </p>
3496   */
3497  @SearchParamDefinition(name="base-path", path="StructureDefinition.snapshot.element.base.path | StructureDefinition.differential.element.base.path", description="Path that identifies the base element", type="token" )
3498  public static final String SP_BASE_PATH = "base-path";
3499 /**
3500   * <b>Fluent Client</b> search parameter constant for <b>base-path</b>
3501   * <p>
3502   * Description: <b>Path that identifies the base element</b><br>
3503   * Type: <b>token</b><br>
3504   * Path: <b>StructureDefinition.snapshot.element.base.path, StructureDefinition.differential.element.base.path</b><br>
3505   * </p>
3506   */
3507  public static final ca.uhn.fhir.rest.gclient.TokenClientParam BASE_PATH = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BASE_PATH);
3508
3509 /**
3510   * Search parameter: <b>publisher</b>
3511   * <p>
3512   * Description: <b>Name of the publisher of the structure definition</b><br>
3513   * Type: <b>string</b><br>
3514   * Path: <b>StructureDefinition.publisher</b><br>
3515   * </p>
3516   */
3517  @SearchParamDefinition(name="publisher", path="StructureDefinition.publisher", description="Name of the publisher of the structure definition", type="string" )
3518  public static final String SP_PUBLISHER = "publisher";
3519 /**
3520   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
3521   * <p>
3522   * Description: <b>Name of the publisher of the structure definition</b><br>
3523   * Type: <b>string</b><br>
3524   * Path: <b>StructureDefinition.publisher</b><br>
3525   * </p>
3526   */
3527  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
3528
3529 /**
3530   * Search parameter: <b>derivation</b>
3531   * <p>
3532   * Description: <b>specialization | constraint - How relates to base definition</b><br>
3533   * Type: <b>token</b><br>
3534   * Path: <b>StructureDefinition.derivation</b><br>
3535   * </p>
3536   */
3537  @SearchParamDefinition(name="derivation", path="StructureDefinition.derivation", description="specialization | constraint - How relates to base definition", type="token" )
3538  public static final String SP_DERIVATION = "derivation";
3539 /**
3540   * <b>Fluent Client</b> search parameter constant for <b>derivation</b>
3541   * <p>
3542   * Description: <b>specialization | constraint - How relates to base definition</b><br>
3543   * Type: <b>token</b><br>
3544   * Path: <b>StructureDefinition.derivation</b><br>
3545   * </p>
3546   */
3547  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DERIVATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DERIVATION);
3548
3549 /**
3550   * Search parameter: <b>keyword</b>
3551   * <p>
3552   * Description: <b>A code for the profile</b><br>
3553   * Type: <b>token</b><br>
3554   * Path: <b>StructureDefinition.keyword</b><br>
3555   * </p>
3556   */
3557  @SearchParamDefinition(name="keyword", path="StructureDefinition.keyword", description="A code for the profile", type="token" )
3558  public static final String SP_KEYWORD = "keyword";
3559 /**
3560   * <b>Fluent Client</b> search parameter constant for <b>keyword</b>
3561   * <p>
3562   * Description: <b>A code for the profile</b><br>
3563   * Type: <b>token</b><br>
3564   * Path: <b>StructureDefinition.keyword</b><br>
3565   * </p>
3566   */
3567  public static final ca.uhn.fhir.rest.gclient.TokenClientParam KEYWORD = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KEYWORD);
3568
3569 /**
3570   * Search parameter: <b>status</b>
3571   * <p>
3572   * Description: <b>The current status of the structure definition</b><br>
3573   * Type: <b>token</b><br>
3574   * Path: <b>StructureDefinition.status</b><br>
3575   * </p>
3576   */
3577  @SearchParamDefinition(name="status", path="StructureDefinition.status", description="The current status of the structure definition", type="token" )
3578  public static final String SP_STATUS = "status";
3579 /**
3580   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3581   * <p>
3582   * Description: <b>The current status of the structure definition</b><br>
3583   * Type: <b>token</b><br>
3584   * Path: <b>StructureDefinition.status</b><br>
3585   * </p>
3586   */
3587  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3588
3589 /**
3590   * Search parameter: <b>base</b>
3591   * <p>
3592   * Description: <b>Definition that this type is constrained/specialized from</b><br>
3593   * Type: <b>uri</b><br>
3594   * Path: <b>StructureDefinition.baseDefinition</b><br>
3595   * </p>
3596   */
3597  @SearchParamDefinition(name="base", path="StructureDefinition.baseDefinition", description="Definition that this type is constrained/specialized from", type="uri" )
3598  public static final String SP_BASE = "base";
3599 /**
3600   * <b>Fluent Client</b> search parameter constant for <b>base</b>
3601   * <p>
3602   * Description: <b>Definition that this type is constrained/specialized from</b><br>
3603   * Type: <b>uri</b><br>
3604   * Path: <b>StructureDefinition.baseDefinition</b><br>
3605   * </p>
3606   */
3607  public static final ca.uhn.fhir.rest.gclient.UriClientParam BASE = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_BASE);
3608
3609
3610}
3611