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