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