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