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