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