001package org.hl7.fhir.dstu2.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.dstu2.model.Enumerations.BindingStrength;
041import org.hl7.fhir.dstu2.model.Enumerations.BindingStrengthEnumFactory;
042import org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus;
043import org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatusEnumFactory;
044import ca.uhn.fhir.model.api.annotation.Block;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.Description;
047import ca.uhn.fhir.model.api.annotation.ResourceDef;
048import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
049import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
050import org.hl7.fhir.exceptions.FHIRException;
051import org.hl7.fhir.utilities.Utilities;
052/**
053 * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).
054 */
055@ResourceDef(name="OperationDefinition", profile="http://hl7.org/fhir/Profile/OperationDefinition")
056public class OperationDefinition extends DomainResource {
057
058    public enum OperationKind {
059        /**
060         * This operation is invoked as an operation.
061         */
062        OPERATION, 
063        /**
064         * This operation is a named query, invoked using the search mechanism.
065         */
066        QUERY, 
067        /**
068         * added to help the parsers
069         */
070        NULL;
071        public static OperationKind fromCode(String codeString) throws FHIRException {
072            if (codeString == null || "".equals(codeString))
073                return null;
074        if ("operation".equals(codeString))
075          return OPERATION;
076        if ("query".equals(codeString))
077          return QUERY;
078        throw new FHIRException("Unknown OperationKind code '"+codeString+"'");
079        }
080        public String toCode() {
081          switch (this) {
082            case OPERATION: return "operation";
083            case QUERY: return "query";
084            default: return "?";
085          }
086        }
087        public String getSystem() {
088          switch (this) {
089            case OPERATION: return "http://hl7.org/fhir/operation-kind";
090            case QUERY: return "http://hl7.org/fhir/operation-kind";
091            default: return "?";
092          }
093        }
094        public String getDefinition() {
095          switch (this) {
096            case OPERATION: return "This operation is invoked as an operation.";
097            case QUERY: return "This operation is a named query, invoked using the search mechanism.";
098            default: return "?";
099          }
100        }
101        public String getDisplay() {
102          switch (this) {
103            case OPERATION: return "Operation";
104            case QUERY: return "Query";
105            default: return "?";
106          }
107        }
108    }
109
110  public static class OperationKindEnumFactory implements EnumFactory<OperationKind> {
111    public OperationKind fromCode(String codeString) throws IllegalArgumentException {
112      if (codeString == null || "".equals(codeString))
113            if (codeString == null || "".equals(codeString))
114                return null;
115        if ("operation".equals(codeString))
116          return OperationKind.OPERATION;
117        if ("query".equals(codeString))
118          return OperationKind.QUERY;
119        throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'");
120        }
121        public Enumeration<OperationKind> fromType(Base code) throws FHIRException {
122          if (code == null || code.isEmpty())
123            return null;
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    }
141
142    public enum OperationParameterUse {
143        /**
144         * This is an input parameter.
145         */
146        IN, 
147        /**
148         * This is an output parameter.
149         */
150        OUT, 
151        /**
152         * added to help the parsers
153         */
154        NULL;
155        public static OperationParameterUse fromCode(String codeString) throws FHIRException {
156            if (codeString == null || "".equals(codeString))
157                return null;
158        if ("in".equals(codeString))
159          return IN;
160        if ("out".equals(codeString))
161          return OUT;
162        throw new FHIRException("Unknown OperationParameterUse code '"+codeString+"'");
163        }
164        public String toCode() {
165          switch (this) {
166            case IN: return "in";
167            case OUT: return "out";
168            default: return "?";
169          }
170        }
171        public String getSystem() {
172          switch (this) {
173            case IN: return "http://hl7.org/fhir/operation-parameter-use";
174            case OUT: return "http://hl7.org/fhir/operation-parameter-use";
175            default: return "?";
176          }
177        }
178        public String getDefinition() {
179          switch (this) {
180            case IN: return "This is an input parameter.";
181            case OUT: return "This is an output parameter.";
182            default: return "?";
183          }
184        }
185        public String getDisplay() {
186          switch (this) {
187            case IN: return "In";
188            case OUT: return "Out";
189            default: return "?";
190          }
191        }
192    }
193
194  public static class OperationParameterUseEnumFactory implements EnumFactory<OperationParameterUse> {
195    public OperationParameterUse fromCode(String codeString) throws IllegalArgumentException {
196      if (codeString == null || "".equals(codeString))
197            if (codeString == null || "".equals(codeString))
198                return null;
199        if ("in".equals(codeString))
200          return OperationParameterUse.IN;
201        if ("out".equals(codeString))
202          return OperationParameterUse.OUT;
203        throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'");
204        }
205        public Enumeration<OperationParameterUse> fromType(Base code) throws FHIRException {
206          if (code == null || code.isEmpty())
207            return null;
208          String codeString = ((PrimitiveType) code).asStringValue();
209          if (codeString == null || "".equals(codeString))
210            return null;
211        if ("in".equals(codeString))
212          return new Enumeration<OperationParameterUse>(this, OperationParameterUse.IN);
213        if ("out".equals(codeString))
214          return new Enumeration<OperationParameterUse>(this, OperationParameterUse.OUT);
215        throw new FHIRException("Unknown OperationParameterUse code '"+codeString+"'");
216        }
217    public String toCode(OperationParameterUse code) {
218      if (code == OperationParameterUse.IN)
219        return "in";
220      if (code == OperationParameterUse.OUT)
221        return "out";
222      return "?";
223      }
224    }
225
226    @Block()
227    public static class OperationDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement {
228        /**
229         * The name of an individual to contact regarding the operation definition.
230         */
231        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
232        @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the operation definition." )
233        protected StringType name;
234
235        /**
236         * Contact details for individual (if a name was provided) or the publisher.
237         */
238        @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
239        @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." )
240        protected List<ContactPoint> telecom;
241
242        private static final long serialVersionUID = -1179697803L;
243
244    /*
245     * Constructor
246     */
247      public OperationDefinitionContactComponent() {
248        super();
249      }
250
251        /**
252         * @return {@link #name} (The name of an individual to contact regarding the operation definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
253         */
254        public StringType getNameElement() { 
255          if (this.name == null)
256            if (Configuration.errorOnAutoCreate())
257              throw new Error("Attempt to auto-create OperationDefinitionContactComponent.name");
258            else if (Configuration.doAutoCreate())
259              this.name = new StringType(); // bb
260          return this.name;
261        }
262
263        public boolean hasNameElement() { 
264          return this.name != null && !this.name.isEmpty();
265        }
266
267        public boolean hasName() { 
268          return this.name != null && !this.name.isEmpty();
269        }
270
271        /**
272         * @param value {@link #name} (The name of an individual to contact regarding the operation definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
273         */
274        public OperationDefinitionContactComponent setNameElement(StringType value) { 
275          this.name = value;
276          return this;
277        }
278
279        /**
280         * @return The name of an individual to contact regarding the operation definition.
281         */
282        public String getName() { 
283          return this.name == null ? null : this.name.getValue();
284        }
285
286        /**
287         * @param value The name of an individual to contact regarding the operation definition.
288         */
289        public OperationDefinitionContactComponent setName(String value) { 
290          if (Utilities.noString(value))
291            this.name = null;
292          else {
293            if (this.name == null)
294              this.name = new StringType();
295            this.name.setValue(value);
296          }
297          return this;
298        }
299
300        /**
301         * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.)
302         */
303        public List<ContactPoint> getTelecom() { 
304          if (this.telecom == null)
305            this.telecom = new ArrayList<ContactPoint>();
306          return this.telecom;
307        }
308
309        public boolean hasTelecom() { 
310          if (this.telecom == null)
311            return false;
312          for (ContactPoint item : this.telecom)
313            if (!item.isEmpty())
314              return true;
315          return false;
316        }
317
318        /**
319         * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.)
320         */
321    // syntactic sugar
322        public ContactPoint addTelecom() { //3
323          ContactPoint t = new ContactPoint();
324          if (this.telecom == null)
325            this.telecom = new ArrayList<ContactPoint>();
326          this.telecom.add(t);
327          return t;
328        }
329
330    // syntactic sugar
331        public OperationDefinitionContactComponent addTelecom(ContactPoint t) { //3
332          if (t == null)
333            return this;
334          if (this.telecom == null)
335            this.telecom = new ArrayList<ContactPoint>();
336          this.telecom.add(t);
337          return this;
338        }
339
340        protected void listChildren(List<Property> childrenList) {
341          super.listChildren(childrenList);
342          childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the operation definition.", 0, java.lang.Integer.MAX_VALUE, name));
343          childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom));
344        }
345
346      @Override
347      public void setProperty(String name, Base value) throws FHIRException {
348        if (name.equals("name"))
349          this.name = castToString(value); // StringType
350        else if (name.equals("telecom"))
351          this.getTelecom().add(castToContactPoint(value));
352        else
353          super.setProperty(name, value);
354      }
355
356      @Override
357      public Base addChild(String name) throws FHIRException {
358        if (name.equals("name")) {
359          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.name");
360        }
361        else if (name.equals("telecom")) {
362          return addTelecom();
363        }
364        else
365          return super.addChild(name);
366      }
367
368      public OperationDefinitionContactComponent copy() {
369        OperationDefinitionContactComponent dst = new OperationDefinitionContactComponent();
370        copyValues(dst);
371        dst.name = name == null ? null : name.copy();
372        if (telecom != null) {
373          dst.telecom = new ArrayList<ContactPoint>();
374          for (ContactPoint i : telecom)
375            dst.telecom.add(i.copy());
376        };
377        return dst;
378      }
379
380      @Override
381      public boolean equalsDeep(Base other) {
382        if (!super.equalsDeep(other))
383          return false;
384        if (!(other instanceof OperationDefinitionContactComponent))
385          return false;
386        OperationDefinitionContactComponent o = (OperationDefinitionContactComponent) other;
387        return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true);
388      }
389
390      @Override
391      public boolean equalsShallow(Base other) {
392        if (!super.equalsShallow(other))
393          return false;
394        if (!(other instanceof OperationDefinitionContactComponent))
395          return false;
396        OperationDefinitionContactComponent o = (OperationDefinitionContactComponent) other;
397        return compareValues(name, o.name, true);
398      }
399
400      public boolean isEmpty() {
401        return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty())
402          ;
403      }
404
405  public String fhirType() {
406    return "OperationDefinition.contact";
407
408  }
409
410  }
411
412    @Block()
413    public static class OperationDefinitionParameterComponent extends BackboneElement implements IBaseBackboneElement {
414        /**
415         * The name of used to identify the parameter.
416         */
417        @Child(name = "name", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
418        @Description(shortDefinition="Name in Parameters.parameter.name or in URL", formalDefinition="The name of used to identify the parameter." )
419        protected CodeType name;
420
421        /**
422         * Whether this is an input or an output parameter.
423         */
424        @Child(name = "use", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
425        @Description(shortDefinition="in | out", formalDefinition="Whether this is an input or an output parameter." )
426        protected Enumeration<OperationParameterUse> use;
427
428        /**
429         * The minimum number of times this parameter SHALL appear in the request or response.
430         */
431        @Child(name = "min", type = {IntegerType.class}, order=3, min=1, max=1, modifier=false, summary=false)
432        @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." )
433        protected IntegerType min;
434
435        /**
436         * The maximum number of times this element is permitted to appear in the request or response.
437         */
438        @Child(name = "max", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=false)
439        @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." )
440        protected StringType max;
441
442        /**
443         * Describes the meaning or use of this parameter.
444         */
445        @Child(name = "documentation", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
446        @Description(shortDefinition="Description of meaning/use", formalDefinition="Describes the meaning or use of this parameter." )
447        protected StringType documentation;
448
449        /**
450         * The type for this parameter.
451         */
452        @Child(name = "type", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
453        @Description(shortDefinition="What type this parameter has", formalDefinition="The type for this parameter." )
454        protected CodeType type;
455
456        /**
457         * A profile the specifies the rules that this parameter must conform to.
458         */
459        @Child(name = "profile", type = {StructureDefinition.class}, order=7, min=0, max=1, modifier=false, summary=false)
460        @Description(shortDefinition="Profile on the type", formalDefinition="A profile the specifies the rules that this parameter must conform to." )
461        protected Reference profile;
462
463        /**
464         * The actual object that is the target of the reference (A profile the specifies the rules that this parameter must conform to.)
465         */
466        protected StructureDefinition profileTarget;
467
468        /**
469         * Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).
470         */
471        @Child(name = "binding", type = {}, order=8, min=0, max=1, modifier=false, summary=false)
472        @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this parameter is coded (code, Coding, CodeableConcept)." )
473        protected OperationDefinitionParameterBindingComponent binding;
474
475        /**
476         * The parts of a Tuple Parameter.
477         */
478        @Child(name = "part", type = {OperationDefinitionParameterComponent.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
479        @Description(shortDefinition="Parts of a Tuple Parameter", formalDefinition="The parts of a Tuple Parameter." )
480        protected List<OperationDefinitionParameterComponent> part;
481
482        private static final long serialVersionUID = -1514145741L;
483
484    /*
485     * Constructor
486     */
487      public OperationDefinitionParameterComponent() {
488        super();
489      }
490
491    /*
492     * Constructor
493     */
494      public OperationDefinitionParameterComponent(CodeType name, Enumeration<OperationParameterUse> use, IntegerType min, StringType max) {
495        super();
496        this.name = name;
497        this.use = use;
498        this.min = min;
499        this.max = max;
500      }
501
502        /**
503         * @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
504         */
505        public CodeType getNameElement() { 
506          if (this.name == null)
507            if (Configuration.errorOnAutoCreate())
508              throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.name");
509            else if (Configuration.doAutoCreate())
510              this.name = new CodeType(); // bb
511          return this.name;
512        }
513
514        public boolean hasNameElement() { 
515          return this.name != null && !this.name.isEmpty();
516        }
517
518        public boolean hasName() { 
519          return this.name != null && !this.name.isEmpty();
520        }
521
522        /**
523         * @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
524         */
525        public OperationDefinitionParameterComponent setNameElement(CodeType value) { 
526          this.name = value;
527          return this;
528        }
529
530        /**
531         * @return The name of used to identify the parameter.
532         */
533        public String getName() { 
534          return this.name == null ? null : this.name.getValue();
535        }
536
537        /**
538         * @param value The name of used to identify the parameter.
539         */
540        public OperationDefinitionParameterComponent setName(String value) { 
541            if (this.name == null)
542              this.name = new CodeType();
543            this.name.setValue(value);
544          return this;
545        }
546
547        /**
548         * @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
549         */
550        public Enumeration<OperationParameterUse> getUseElement() { 
551          if (this.use == null)
552            if (Configuration.errorOnAutoCreate())
553              throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.use");
554            else if (Configuration.doAutoCreate())
555              this.use = new Enumeration<OperationParameterUse>(new OperationParameterUseEnumFactory()); // bb
556          return this.use;
557        }
558
559        public boolean hasUseElement() { 
560          return this.use != null && !this.use.isEmpty();
561        }
562
563        public boolean hasUse() { 
564          return this.use != null && !this.use.isEmpty();
565        }
566
567        /**
568         * @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
569         */
570        public OperationDefinitionParameterComponent setUseElement(Enumeration<OperationParameterUse> value) { 
571          this.use = value;
572          return this;
573        }
574
575        /**
576         * @return Whether this is an input or an output parameter.
577         */
578        public OperationParameterUse getUse() { 
579          return this.use == null ? null : this.use.getValue();
580        }
581
582        /**
583         * @param value Whether this is an input or an output parameter.
584         */
585        public OperationDefinitionParameterComponent setUse(OperationParameterUse value) { 
586            if (this.use == null)
587              this.use = new Enumeration<OperationParameterUse>(new OperationParameterUseEnumFactory());
588            this.use.setValue(value);
589          return this;
590        }
591
592        /**
593         * @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
594         */
595        public IntegerType getMinElement() { 
596          if (this.min == null)
597            if (Configuration.errorOnAutoCreate())
598              throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.min");
599            else if (Configuration.doAutoCreate())
600              this.min = new IntegerType(); // bb
601          return this.min;
602        }
603
604        public boolean hasMinElement() { 
605          return this.min != null && !this.min.isEmpty();
606        }
607
608        public boolean hasMin() { 
609          return this.min != null && !this.min.isEmpty();
610        }
611
612        /**
613         * @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
614         */
615        public OperationDefinitionParameterComponent setMinElement(IntegerType value) { 
616          this.min = value;
617          return this;
618        }
619
620        /**
621         * @return The minimum number of times this parameter SHALL appear in the request or response.
622         */
623        public int getMin() { 
624          return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue();
625        }
626
627        /**
628         * @param value The minimum number of times this parameter SHALL appear in the request or response.
629         */
630        public OperationDefinitionParameterComponent setMin(int value) { 
631            if (this.min == null)
632              this.min = new IntegerType();
633            this.min.setValue(value);
634          return this;
635        }
636
637        /**
638         * @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
639         */
640        public StringType getMaxElement() { 
641          if (this.max == null)
642            if (Configuration.errorOnAutoCreate())
643              throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.max");
644            else if (Configuration.doAutoCreate())
645              this.max = new StringType(); // bb
646          return this.max;
647        }
648
649        public boolean hasMaxElement() { 
650          return this.max != null && !this.max.isEmpty();
651        }
652
653        public boolean hasMax() { 
654          return this.max != null && !this.max.isEmpty();
655        }
656
657        /**
658         * @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
659         */
660        public OperationDefinitionParameterComponent setMaxElement(StringType value) { 
661          this.max = value;
662          return this;
663        }
664
665        /**
666         * @return The maximum number of times this element is permitted to appear in the request or response.
667         */
668        public String getMax() { 
669          return this.max == null ? null : this.max.getValue();
670        }
671
672        /**
673         * @param value The maximum number of times this element is permitted to appear in the request or response.
674         */
675        public OperationDefinitionParameterComponent setMax(String value) { 
676            if (this.max == null)
677              this.max = new StringType();
678            this.max.setValue(value);
679          return this;
680        }
681
682        /**
683         * @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
684         */
685        public StringType getDocumentationElement() { 
686          if (this.documentation == null)
687            if (Configuration.errorOnAutoCreate())
688              throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.documentation");
689            else if (Configuration.doAutoCreate())
690              this.documentation = new StringType(); // bb
691          return this.documentation;
692        }
693
694        public boolean hasDocumentationElement() { 
695          return this.documentation != null && !this.documentation.isEmpty();
696        }
697
698        public boolean hasDocumentation() { 
699          return this.documentation != null && !this.documentation.isEmpty();
700        }
701
702        /**
703         * @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
704         */
705        public OperationDefinitionParameterComponent setDocumentationElement(StringType value) { 
706          this.documentation = value;
707          return this;
708        }
709
710        /**
711         * @return Describes the meaning or use of this parameter.
712         */
713        public String getDocumentation() { 
714          return this.documentation == null ? null : this.documentation.getValue();
715        }
716
717        /**
718         * @param value Describes the meaning or use of this parameter.
719         */
720        public OperationDefinitionParameterComponent setDocumentation(String value) { 
721          if (Utilities.noString(value))
722            this.documentation = null;
723          else {
724            if (this.documentation == null)
725              this.documentation = new StringType();
726            this.documentation.setValue(value);
727          }
728          return this;
729        }
730
731        /**
732         * @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
733         */
734        public CodeType getTypeElement() { 
735          if (this.type == null)
736            if (Configuration.errorOnAutoCreate())
737              throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.type");
738            else if (Configuration.doAutoCreate())
739              this.type = new CodeType(); // bb
740          return this.type;
741        }
742
743        public boolean hasTypeElement() { 
744          return this.type != null && !this.type.isEmpty();
745        }
746
747        public boolean hasType() { 
748          return this.type != null && !this.type.isEmpty();
749        }
750
751        /**
752         * @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
753         */
754        public OperationDefinitionParameterComponent setTypeElement(CodeType value) { 
755          this.type = value;
756          return this;
757        }
758
759        /**
760         * @return The type for this parameter.
761         */
762        public String getType() { 
763          return this.type == null ? null : this.type.getValue();
764        }
765
766        /**
767         * @param value The type for this parameter.
768         */
769        public OperationDefinitionParameterComponent setType(String value) { 
770          if (Utilities.noString(value))
771            this.type = null;
772          else {
773            if (this.type == null)
774              this.type = new CodeType();
775            this.type.setValue(value);
776          }
777          return this;
778        }
779
780        /**
781         * @return {@link #profile} (A profile the specifies the rules that this parameter must conform to.)
782         */
783        public Reference getProfile() { 
784          if (this.profile == null)
785            if (Configuration.errorOnAutoCreate())
786              throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.profile");
787            else if (Configuration.doAutoCreate())
788              this.profile = new Reference(); // cc
789          return this.profile;
790        }
791
792        public boolean hasProfile() { 
793          return this.profile != null && !this.profile.isEmpty();
794        }
795
796        /**
797         * @param value {@link #profile} (A profile the specifies the rules that this parameter must conform to.)
798         */
799        public OperationDefinitionParameterComponent setProfile(Reference value) { 
800          this.profile = value;
801          return this;
802        }
803
804        /**
805         * @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.)
806         */
807        public StructureDefinition getProfileTarget() { 
808          if (this.profileTarget == null)
809            if (Configuration.errorOnAutoCreate())
810              throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.profile");
811            else if (Configuration.doAutoCreate())
812              this.profileTarget = new StructureDefinition(); // aa
813          return this.profileTarget;
814        }
815
816        /**
817         * @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.)
818         */
819        public OperationDefinitionParameterComponent setProfileTarget(StructureDefinition value) { 
820          this.profileTarget = value;
821          return this;
822        }
823
824        /**
825         * @return {@link #binding} (Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).)
826         */
827        public OperationDefinitionParameterBindingComponent getBinding() { 
828          if (this.binding == null)
829            if (Configuration.errorOnAutoCreate())
830              throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.binding");
831            else if (Configuration.doAutoCreate())
832              this.binding = new OperationDefinitionParameterBindingComponent(); // cc
833          return this.binding;
834        }
835
836        public boolean hasBinding() { 
837          return this.binding != null && !this.binding.isEmpty();
838        }
839
840        /**
841         * @param value {@link #binding} (Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).)
842         */
843        public OperationDefinitionParameterComponent setBinding(OperationDefinitionParameterBindingComponent value) { 
844          this.binding = value;
845          return this;
846        }
847
848        /**
849         * @return {@link #part} (The parts of a Tuple Parameter.)
850         */
851        public List<OperationDefinitionParameterComponent> getPart() { 
852          if (this.part == null)
853            this.part = new ArrayList<OperationDefinitionParameterComponent>();
854          return this.part;
855        }
856
857        public boolean hasPart() { 
858          if (this.part == null)
859            return false;
860          for (OperationDefinitionParameterComponent item : this.part)
861            if (!item.isEmpty())
862              return true;
863          return false;
864        }
865
866        /**
867         * @return {@link #part} (The parts of a Tuple Parameter.)
868         */
869    // syntactic sugar
870        public OperationDefinitionParameterComponent addPart() { //3
871          OperationDefinitionParameterComponent t = new OperationDefinitionParameterComponent();
872          if (this.part == null)
873            this.part = new ArrayList<OperationDefinitionParameterComponent>();
874          this.part.add(t);
875          return t;
876        }
877
878    // syntactic sugar
879        public OperationDefinitionParameterComponent addPart(OperationDefinitionParameterComponent t) { //3
880          if (t == null)
881            return this;
882          if (this.part == null)
883            this.part = new ArrayList<OperationDefinitionParameterComponent>();
884          this.part.add(t);
885          return this;
886        }
887
888        protected void listChildren(List<Property> childrenList) {
889          super.listChildren(childrenList);
890          childrenList.add(new Property("name", "code", "The name of used to identify the parameter.", 0, java.lang.Integer.MAX_VALUE, name));
891          childrenList.add(new Property("use", "code", "Whether this is an input or an output parameter.", 0, java.lang.Integer.MAX_VALUE, use));
892          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));
893          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));
894          childrenList.add(new Property("documentation", "string", "Describes the meaning or use of this parameter.", 0, java.lang.Integer.MAX_VALUE, documentation));
895          childrenList.add(new Property("type", "code", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type));
896          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));
897          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));
898          childrenList.add(new Property("part", "@OperationDefinition.parameter", "The parts of a Tuple Parameter.", 0, java.lang.Integer.MAX_VALUE, part));
899        }
900
901      @Override
902      public void setProperty(String name, Base value) throws FHIRException {
903        if (name.equals("name"))
904          this.name = castToCode(value); // CodeType
905        else if (name.equals("use"))
906          this.use = new OperationParameterUseEnumFactory().fromType(value); // Enumeration<OperationParameterUse>
907        else if (name.equals("min"))
908          this.min = castToInteger(value); // IntegerType
909        else if (name.equals("max"))
910          this.max = castToString(value); // StringType
911        else if (name.equals("documentation"))
912          this.documentation = castToString(value); // StringType
913        else if (name.equals("type"))
914          this.type = castToCode(value); // CodeType
915        else if (name.equals("profile"))
916          this.profile = castToReference(value); // Reference
917        else if (name.equals("binding"))
918          this.binding = (OperationDefinitionParameterBindingComponent) value; // OperationDefinitionParameterBindingComponent
919        else if (name.equals("part"))
920          this.getPart().add((OperationDefinitionParameterComponent) value);
921        else
922          super.setProperty(name, value);
923      }
924
925      @Override
926      public Base addChild(String name) throws FHIRException {
927        if (name.equals("name")) {
928          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.name");
929        }
930        else if (name.equals("use")) {
931          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.use");
932        }
933        else if (name.equals("min")) {
934          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.min");
935        }
936        else if (name.equals("max")) {
937          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.max");
938        }
939        else if (name.equals("documentation")) {
940          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.documentation");
941        }
942        else if (name.equals("type")) {
943          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.type");
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.profile = profile == null ? null : profile.copy();
970        dst.binding = binding == null ? null : binding.copy();
971        if (part != null) {
972          dst.part = new ArrayList<OperationDefinitionParameterComponent>();
973          for (OperationDefinitionParameterComponent i : part)
974            dst.part.add(i.copy());
975        };
976        return dst;
977      }
978
979      @Override
980      public boolean equalsDeep(Base other) {
981        if (!super.equalsDeep(other))
982          return false;
983        if (!(other instanceof OperationDefinitionParameterComponent))
984          return false;
985        OperationDefinitionParameterComponent o = (OperationDefinitionParameterComponent) other;
986        return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(min, o.min, true)
987           && compareDeep(max, o.max, true) && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true)
988           && compareDeep(profile, o.profile, true) && compareDeep(binding, o.binding, true) && compareDeep(part, o.part, true)
989          ;
990      }
991
992      @Override
993      public boolean equalsShallow(Base other) {
994        if (!super.equalsShallow(other))
995          return false;
996        if (!(other instanceof OperationDefinitionParameterComponent))
997          return false;
998        OperationDefinitionParameterComponent o = (OperationDefinitionParameterComponent) other;
999        return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(min, o.min, true)
1000           && compareValues(max, o.max, true) && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true)
1001          ;
1002      }
1003
1004      public boolean isEmpty() {
1005        return super.isEmpty() && (name == null || name.isEmpty()) && (use == null || use.isEmpty())
1006           && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty())
1007           && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) && (binding == null || binding.isEmpty())
1008           && (part == null || part.isEmpty());
1009      }
1010
1011  public String fhirType() {
1012    return "OperationDefinition.parameter";
1013
1014  }
1015
1016  }
1017
1018    @Block()
1019    public static class OperationDefinitionParameterBindingComponent extends BackboneElement implements IBaseBackboneElement {
1020        /**
1021         * 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.
1022         */
1023        @Child(name = "strength", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1024        @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." )
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 void setProperty(String name, Base value) throws FHIRException {
1150        if (name.equals("strength"))
1151          this.strength = new BindingStrengthEnumFactory().fromType(value); // Enumeration<BindingStrength>
1152        else if (name.equals("valueSet[x]"))
1153          this.valueSet = (Type) value; // Type
1154        else
1155          super.setProperty(name, value);
1156      }
1157
1158      @Override
1159      public Base addChild(String name) throws FHIRException {
1160        if (name.equals("strength")) {
1161          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.strength");
1162        }
1163        else if (name.equals("valueSetUri")) {
1164          this.valueSet = new UriType();
1165          return this.valueSet;
1166        }
1167        else if (name.equals("valueSetReference")) {
1168          this.valueSet = new Reference();
1169          return this.valueSet;
1170        }
1171        else
1172          return super.addChild(name);
1173      }
1174
1175      public OperationDefinitionParameterBindingComponent copy() {
1176        OperationDefinitionParameterBindingComponent dst = new OperationDefinitionParameterBindingComponent();
1177        copyValues(dst);
1178        dst.strength = strength == null ? null : strength.copy();
1179        dst.valueSet = valueSet == null ? null : valueSet.copy();
1180        return dst;
1181      }
1182
1183      @Override
1184      public boolean equalsDeep(Base other) {
1185        if (!super.equalsDeep(other))
1186          return false;
1187        if (!(other instanceof OperationDefinitionParameterBindingComponent))
1188          return false;
1189        OperationDefinitionParameterBindingComponent o = (OperationDefinitionParameterBindingComponent) other;
1190        return compareDeep(strength, o.strength, true) && compareDeep(valueSet, o.valueSet, true);
1191      }
1192
1193      @Override
1194      public boolean equalsShallow(Base other) {
1195        if (!super.equalsShallow(other))
1196          return false;
1197        if (!(other instanceof OperationDefinitionParameterBindingComponent))
1198          return false;
1199        OperationDefinitionParameterBindingComponent o = (OperationDefinitionParameterBindingComponent) other;
1200        return compareValues(strength, o.strength, true);
1201      }
1202
1203      public boolean isEmpty() {
1204        return super.isEmpty() && (strength == null || strength.isEmpty()) && (valueSet == null || valueSet.isEmpty())
1205          ;
1206      }
1207
1208  public String fhirType() {
1209    return "OperationDefinition.parameter.binding";
1210
1211  }
1212
1213  }
1214
1215    /**
1216     * An absolute URL 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.
1217     */
1218    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=false)
1219    @Description(shortDefinition="Logical URL to reference this operation definition", formalDefinition="An absolute URL 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." )
1220    protected UriType url;
1221
1222    /**
1223     * The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.
1224     */
1225    @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1226    @Description(shortDefinition="Logical id for this version of the operation definition", formalDefinition="The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." )
1227    protected StringType version;
1228
1229    /**
1230     * A free text natural language name identifying the operation.
1231     */
1232    @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
1233    @Description(shortDefinition="Informal name for this operation", formalDefinition="A free text natural language name identifying the operation." )
1234    protected StringType name;
1235
1236    /**
1237     * The status of the profile.
1238     */
1239    @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=false)
1240    @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the profile." )
1241    protected Enumeration<ConformanceResourceStatus> status;
1242
1243    /**
1244     * Whether this is an operation or a named query.
1245     */
1246    @Child(name = "kind", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false)
1247    @Description(shortDefinition="operation | query", formalDefinition="Whether this is an operation or a named query." )
1248    protected Enumeration<OperationKind> kind;
1249
1250    /**
1251     * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
1252     */
1253    @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=false)
1254    @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." )
1255    protected BooleanType experimental;
1256
1257    /**
1258     * The name of the individual or organization that published the operation definition.
1259     */
1260    @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
1261    @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the operation definition." )
1262    protected StringType publisher;
1263
1264    /**
1265     * Contacts to assist a user in finding and communicating with the publisher.
1266     */
1267    @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1268    @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." )
1269    protected List<OperationDefinitionContactComponent> contact;
1270
1271    /**
1272     * The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes.
1273     */
1274    @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=false)
1275    @Description(shortDefinition="Date for this version of the operation definition", formalDefinition="The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes." )
1276    protected DateTimeType date;
1277
1278    /**
1279     * A free text natural language description of the profile and its use.
1280     */
1281    @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
1282    @Description(shortDefinition="Natural language description of the operation", formalDefinition="A free text natural language description of the profile and its use." )
1283    protected StringType description;
1284
1285    /**
1286     * Explains why this operation definition is needed and why it's been constrained as it has.
1287     */
1288    @Child(name = "requirements", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
1289    @Description(shortDefinition="Why is this needed?", formalDefinition="Explains why this operation definition is needed and why it's been constrained as it has." )
1290    protected StringType requirements;
1291
1292    /**
1293     * 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.
1294     */
1295    @Child(name = "idempotent", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=false)
1296    @Description(shortDefinition="Whether content is unchanged by 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." )
1297    protected BooleanType idempotent;
1298
1299    /**
1300     * The name used to invoke the operation.
1301     */
1302    @Child(name = "code", type = {CodeType.class}, order=12, min=1, max=1, modifier=false, summary=false)
1303    @Description(shortDefinition="Name used to invoke the operation", formalDefinition="The name used to invoke the operation." )
1304    protected CodeType code;
1305
1306    /**
1307     * Additional information about how to use this operation or named query.
1308     */
1309    @Child(name = "notes", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false)
1310    @Description(shortDefinition="Additional information about use", formalDefinition="Additional information about how to use this operation or named query." )
1311    protected StringType notes;
1312
1313    /**
1314     * Indicates that this operation definition is a constraining profile on the base.
1315     */
1316    @Child(name = "base", type = {OperationDefinition.class}, order=14, min=0, max=1, modifier=false, summary=false)
1317    @Description(shortDefinition="Marks this as a profile of the base", formalDefinition="Indicates that this operation definition is a constraining profile on the base." )
1318    protected Reference base;
1319
1320    /**
1321     * The actual object that is the target of the reference (Indicates that this operation definition is a constraining profile on the base.)
1322     */
1323    protected OperationDefinition baseTarget;
1324
1325    /**
1326     * 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).
1327     */
1328    @Child(name = "system", type = {BooleanType.class}, order=15, min=1, max=1, modifier=false, summary=false)
1329    @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)." )
1330    protected BooleanType system;
1331
1332    /**
1333     * 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 resource type for the context).
1334     */
1335    @Child(name = "type", type = {CodeType.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1336    @Description(shortDefinition="Invoke at resource level for these type", 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 resource type for the context)." )
1337    protected List<CodeType> type;
1338
1339    /**
1340     * Indicates whether this operation can be invoked on a particular instance of one of the given types.
1341     */
1342    @Child(name = "instance", type = {BooleanType.class}, order=17, min=1, max=1, modifier=false, summary=false)
1343    @Description(shortDefinition="Invoke on an instance?", formalDefinition="Indicates whether this operation can be invoked on a particular instance of one of the given types." )
1344    protected BooleanType instance;
1345
1346    /**
1347     * The parameters for the operation/query.
1348     */
1349    @Child(name = "parameter", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1350    @Description(shortDefinition="Parameters for the operation/query", formalDefinition="The parameters for the operation/query." )
1351    protected List<OperationDefinitionParameterComponent> parameter;
1352
1353    private static final long serialVersionUID = 148203484L;
1354
1355  /*
1356   * Constructor
1357   */
1358    public OperationDefinition() {
1359      super();
1360    }
1361
1362  /*
1363   * Constructor
1364   */
1365    public OperationDefinition(StringType name, Enumeration<ConformanceResourceStatus> status, Enumeration<OperationKind> kind, CodeType code, BooleanType system, BooleanType instance) {
1366      super();
1367      this.name = name;
1368      this.status = status;
1369      this.kind = kind;
1370      this.code = code;
1371      this.system = system;
1372      this.instance = instance;
1373    }
1374
1375    /**
1376     * @return {@link #url} (An absolute URL 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.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1377     */
1378    public UriType getUrlElement() { 
1379      if (this.url == null)
1380        if (Configuration.errorOnAutoCreate())
1381          throw new Error("Attempt to auto-create OperationDefinition.url");
1382        else if (Configuration.doAutoCreate())
1383          this.url = new UriType(); // bb
1384      return this.url;
1385    }
1386
1387    public boolean hasUrlElement() { 
1388      return this.url != null && !this.url.isEmpty();
1389    }
1390
1391    public boolean hasUrl() { 
1392      return this.url != null && !this.url.isEmpty();
1393    }
1394
1395    /**
1396     * @param value {@link #url} (An absolute URL 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.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1397     */
1398    public OperationDefinition setUrlElement(UriType value) { 
1399      this.url = value;
1400      return this;
1401    }
1402
1403    /**
1404     * @return An absolute URL 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.
1405     */
1406    public String getUrl() { 
1407      return this.url == null ? null : this.url.getValue();
1408    }
1409
1410    /**
1411     * @param value An absolute URL 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.
1412     */
1413    public OperationDefinition setUrl(String value) { 
1414      if (Utilities.noString(value))
1415        this.url = null;
1416      else {
1417        if (this.url == null)
1418          this.url = new UriType();
1419        this.url.setValue(value);
1420      }
1421      return this;
1422    }
1423
1424    /**
1425     * @return {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1426     */
1427    public StringType getVersionElement() { 
1428      if (this.version == null)
1429        if (Configuration.errorOnAutoCreate())
1430          throw new Error("Attempt to auto-create OperationDefinition.version");
1431        else if (Configuration.doAutoCreate())
1432          this.version = new StringType(); // bb
1433      return this.version;
1434    }
1435
1436    public boolean hasVersionElement() { 
1437      return this.version != null && !this.version.isEmpty();
1438    }
1439
1440    public boolean hasVersion() { 
1441      return this.version != null && !this.version.isEmpty();
1442    }
1443
1444    /**
1445     * @param value {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1446     */
1447    public OperationDefinition setVersionElement(StringType value) { 
1448      this.version = value;
1449      return this;
1450    }
1451
1452    /**
1453     * @return The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.
1454     */
1455    public String getVersion() { 
1456      return this.version == null ? null : this.version.getValue();
1457    }
1458
1459    /**
1460     * @param value The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.
1461     */
1462    public OperationDefinition setVersion(String value) { 
1463      if (Utilities.noString(value))
1464        this.version = null;
1465      else {
1466        if (this.version == null)
1467          this.version = new StringType();
1468        this.version.setValue(value);
1469      }
1470      return this;
1471    }
1472
1473    /**
1474     * @return {@link #name} (A free text natural language name identifying the operation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1475     */
1476    public StringType getNameElement() { 
1477      if (this.name == null)
1478        if (Configuration.errorOnAutoCreate())
1479          throw new Error("Attempt to auto-create OperationDefinition.name");
1480        else if (Configuration.doAutoCreate())
1481          this.name = new StringType(); // bb
1482      return this.name;
1483    }
1484
1485    public boolean hasNameElement() { 
1486      return this.name != null && !this.name.isEmpty();
1487    }
1488
1489    public boolean hasName() { 
1490      return this.name != null && !this.name.isEmpty();
1491    }
1492
1493    /**
1494     * @param value {@link #name} (A free text natural language name identifying the operation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1495     */
1496    public OperationDefinition setNameElement(StringType value) { 
1497      this.name = value;
1498      return this;
1499    }
1500
1501    /**
1502     * @return A free text natural language name identifying the operation.
1503     */
1504    public String getName() { 
1505      return this.name == null ? null : this.name.getValue();
1506    }
1507
1508    /**
1509     * @param value A free text natural language name identifying the operation.
1510     */
1511    public OperationDefinition setName(String value) { 
1512        if (this.name == null)
1513          this.name = new StringType();
1514        this.name.setValue(value);
1515      return this;
1516    }
1517
1518    /**
1519     * @return {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1520     */
1521    public Enumeration<ConformanceResourceStatus> getStatusElement() { 
1522      if (this.status == null)
1523        if (Configuration.errorOnAutoCreate())
1524          throw new Error("Attempt to auto-create OperationDefinition.status");
1525        else if (Configuration.doAutoCreate())
1526          this.status = new Enumeration<ConformanceResourceStatus>(new ConformanceResourceStatusEnumFactory()); // bb
1527      return this.status;
1528    }
1529
1530    public boolean hasStatusElement() { 
1531      return this.status != null && !this.status.isEmpty();
1532    }
1533
1534    public boolean hasStatus() { 
1535      return this.status != null && !this.status.isEmpty();
1536    }
1537
1538    /**
1539     * @param value {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1540     */
1541    public OperationDefinition setStatusElement(Enumeration<ConformanceResourceStatus> value) { 
1542      this.status = value;
1543      return this;
1544    }
1545
1546    /**
1547     * @return The status of the profile.
1548     */
1549    public ConformanceResourceStatus getStatus() { 
1550      return this.status == null ? null : this.status.getValue();
1551    }
1552
1553    /**
1554     * @param value The status of the profile.
1555     */
1556    public OperationDefinition setStatus(ConformanceResourceStatus value) { 
1557        if (this.status == null)
1558          this.status = new Enumeration<ConformanceResourceStatus>(new ConformanceResourceStatusEnumFactory());
1559        this.status.setValue(value);
1560      return this;
1561    }
1562
1563    /**
1564     * @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
1565     */
1566    public Enumeration<OperationKind> getKindElement() { 
1567      if (this.kind == null)
1568        if (Configuration.errorOnAutoCreate())
1569          throw new Error("Attempt to auto-create OperationDefinition.kind");
1570        else if (Configuration.doAutoCreate())
1571          this.kind = new Enumeration<OperationKind>(new OperationKindEnumFactory()); // bb
1572      return this.kind;
1573    }
1574
1575    public boolean hasKindElement() { 
1576      return this.kind != null && !this.kind.isEmpty();
1577    }
1578
1579    public boolean hasKind() { 
1580      return this.kind != null && !this.kind.isEmpty();
1581    }
1582
1583    /**
1584     * @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
1585     */
1586    public OperationDefinition setKindElement(Enumeration<OperationKind> value) { 
1587      this.kind = value;
1588      return this;
1589    }
1590
1591    /**
1592     * @return Whether this is an operation or a named query.
1593     */
1594    public OperationKind getKind() { 
1595      return this.kind == null ? null : this.kind.getValue();
1596    }
1597
1598    /**
1599     * @param value Whether this is an operation or a named query.
1600     */
1601    public OperationDefinition setKind(OperationKind value) { 
1602        if (this.kind == null)
1603          this.kind = new Enumeration<OperationKind>(new OperationKindEnumFactory());
1604        this.kind.setValue(value);
1605      return this;
1606    }
1607
1608    /**
1609     * @return {@link #experimental} (This profile was 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
1610     */
1611    public BooleanType getExperimentalElement() { 
1612      if (this.experimental == null)
1613        if (Configuration.errorOnAutoCreate())
1614          throw new Error("Attempt to auto-create OperationDefinition.experimental");
1615        else if (Configuration.doAutoCreate())
1616          this.experimental = new BooleanType(); // bb
1617      return this.experimental;
1618    }
1619
1620    public boolean hasExperimentalElement() { 
1621      return this.experimental != null && !this.experimental.isEmpty();
1622    }
1623
1624    public boolean hasExperimental() { 
1625      return this.experimental != null && !this.experimental.isEmpty();
1626    }
1627
1628    /**
1629     * @param value {@link #experimental} (This profile was 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
1630     */
1631    public OperationDefinition setExperimentalElement(BooleanType value) { 
1632      this.experimental = value;
1633      return this;
1634    }
1635
1636    /**
1637     * @return This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
1638     */
1639    public boolean getExperimental() { 
1640      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
1641    }
1642
1643    /**
1644     * @param value This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
1645     */
1646    public OperationDefinition setExperimental(boolean value) { 
1647        if (this.experimental == null)
1648          this.experimental = new BooleanType();
1649        this.experimental.setValue(value);
1650      return this;
1651    }
1652
1653    /**
1654     * @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
1655     */
1656    public StringType getPublisherElement() { 
1657      if (this.publisher == null)
1658        if (Configuration.errorOnAutoCreate())
1659          throw new Error("Attempt to auto-create OperationDefinition.publisher");
1660        else if (Configuration.doAutoCreate())
1661          this.publisher = new StringType(); // bb
1662      return this.publisher;
1663    }
1664
1665    public boolean hasPublisherElement() { 
1666      return this.publisher != null && !this.publisher.isEmpty();
1667    }
1668
1669    public boolean hasPublisher() { 
1670      return this.publisher != null && !this.publisher.isEmpty();
1671    }
1672
1673    /**
1674     * @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
1675     */
1676    public OperationDefinition setPublisherElement(StringType value) { 
1677      this.publisher = value;
1678      return this;
1679    }
1680
1681    /**
1682     * @return The name of the individual or organization that published the operation definition.
1683     */
1684    public String getPublisher() { 
1685      return this.publisher == null ? null : this.publisher.getValue();
1686    }
1687
1688    /**
1689     * @param value The name of the individual or organization that published the operation definition.
1690     */
1691    public OperationDefinition setPublisher(String value) { 
1692      if (Utilities.noString(value))
1693        this.publisher = null;
1694      else {
1695        if (this.publisher == null)
1696          this.publisher = new StringType();
1697        this.publisher.setValue(value);
1698      }
1699      return this;
1700    }
1701
1702    /**
1703     * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.)
1704     */
1705    public List<OperationDefinitionContactComponent> getContact() { 
1706      if (this.contact == null)
1707        this.contact = new ArrayList<OperationDefinitionContactComponent>();
1708      return this.contact;
1709    }
1710
1711    public boolean hasContact() { 
1712      if (this.contact == null)
1713        return false;
1714      for (OperationDefinitionContactComponent item : this.contact)
1715        if (!item.isEmpty())
1716          return true;
1717      return false;
1718    }
1719
1720    /**
1721     * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.)
1722     */
1723    // syntactic sugar
1724    public OperationDefinitionContactComponent addContact() { //3
1725      OperationDefinitionContactComponent t = new OperationDefinitionContactComponent();
1726      if (this.contact == null)
1727        this.contact = new ArrayList<OperationDefinitionContactComponent>();
1728      this.contact.add(t);
1729      return t;
1730    }
1731
1732    // syntactic sugar
1733    public OperationDefinition addContact(OperationDefinitionContactComponent t) { //3
1734      if (t == null)
1735        return this;
1736      if (this.contact == null)
1737        this.contact = new ArrayList<OperationDefinitionContactComponent>();
1738      this.contact.add(t);
1739      return this;
1740    }
1741
1742    /**
1743     * @return {@link #date} (The date this version of the operation definition was published. The date must change when the business version changes, if it does, 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
1744     */
1745    public DateTimeType getDateElement() { 
1746      if (this.date == null)
1747        if (Configuration.errorOnAutoCreate())
1748          throw new Error("Attempt to auto-create OperationDefinition.date");
1749        else if (Configuration.doAutoCreate())
1750          this.date = new DateTimeType(); // bb
1751      return this.date;
1752    }
1753
1754    public boolean hasDateElement() { 
1755      return this.date != null && !this.date.isEmpty();
1756    }
1757
1758    public boolean hasDate() { 
1759      return this.date != null && !this.date.isEmpty();
1760    }
1761
1762    /**
1763     * @param value {@link #date} (The date this version of the operation definition was published. The date must change when the business version changes, if it does, 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
1764     */
1765    public OperationDefinition setDateElement(DateTimeType value) { 
1766      this.date = value;
1767      return this;
1768    }
1769
1770    /**
1771     * @return The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes.
1772     */
1773    public Date getDate() { 
1774      return this.date == null ? null : this.date.getValue();
1775    }
1776
1777    /**
1778     * @param value The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes.
1779     */
1780    public OperationDefinition setDate(Date value) { 
1781      if (value == null)
1782        this.date = null;
1783      else {
1784        if (this.date == null)
1785          this.date = new DateTimeType();
1786        this.date.setValue(value);
1787      }
1788      return this;
1789    }
1790
1791    /**
1792     * @return {@link #description} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1793     */
1794    public StringType getDescriptionElement() { 
1795      if (this.description == null)
1796        if (Configuration.errorOnAutoCreate())
1797          throw new Error("Attempt to auto-create OperationDefinition.description");
1798        else if (Configuration.doAutoCreate())
1799          this.description = new StringType(); // bb
1800      return this.description;
1801    }
1802
1803    public boolean hasDescriptionElement() { 
1804      return this.description != null && !this.description.isEmpty();
1805    }
1806
1807    public boolean hasDescription() { 
1808      return this.description != null && !this.description.isEmpty();
1809    }
1810
1811    /**
1812     * @param value {@link #description} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1813     */
1814    public OperationDefinition setDescriptionElement(StringType value) { 
1815      this.description = value;
1816      return this;
1817    }
1818
1819    /**
1820     * @return A free text natural language description of the profile and its use.
1821     */
1822    public String getDescription() { 
1823      return this.description == null ? null : this.description.getValue();
1824    }
1825
1826    /**
1827     * @param value A free text natural language description of the profile and its use.
1828     */
1829    public OperationDefinition setDescription(String value) { 
1830      if (Utilities.noString(value))
1831        this.description = null;
1832      else {
1833        if (this.description == null)
1834          this.description = new StringType();
1835        this.description.setValue(value);
1836      }
1837      return this;
1838    }
1839
1840    /**
1841     * @return {@link #requirements} (Explains why this operation definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
1842     */
1843    public StringType getRequirementsElement() { 
1844      if (this.requirements == null)
1845        if (Configuration.errorOnAutoCreate())
1846          throw new Error("Attempt to auto-create OperationDefinition.requirements");
1847        else if (Configuration.doAutoCreate())
1848          this.requirements = new StringType(); // bb
1849      return this.requirements;
1850    }
1851
1852    public boolean hasRequirementsElement() { 
1853      return this.requirements != null && !this.requirements.isEmpty();
1854    }
1855
1856    public boolean hasRequirements() { 
1857      return this.requirements != null && !this.requirements.isEmpty();
1858    }
1859
1860    /**
1861     * @param value {@link #requirements} (Explains why this operation definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
1862     */
1863    public OperationDefinition setRequirementsElement(StringType value) { 
1864      this.requirements = value;
1865      return this;
1866    }
1867
1868    /**
1869     * @return Explains why this operation definition is needed and why it's been constrained as it has.
1870     */
1871    public String getRequirements() { 
1872      return this.requirements == null ? null : this.requirements.getValue();
1873    }
1874
1875    /**
1876     * @param value Explains why this operation definition is needed and why it's been constrained as it has.
1877     */
1878    public OperationDefinition setRequirements(String value) { 
1879      if (Utilities.noString(value))
1880        this.requirements = null;
1881      else {
1882        if (this.requirements == null)
1883          this.requirements = new StringType();
1884        this.requirements.setValue(value);
1885      }
1886      return this;
1887    }
1888
1889    /**
1890     * @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
1891     */
1892    public BooleanType getIdempotentElement() { 
1893      if (this.idempotent == null)
1894        if (Configuration.errorOnAutoCreate())
1895          throw new Error("Attempt to auto-create OperationDefinition.idempotent");
1896        else if (Configuration.doAutoCreate())
1897          this.idempotent = new BooleanType(); // bb
1898      return this.idempotent;
1899    }
1900
1901    public boolean hasIdempotentElement() { 
1902      return this.idempotent != null && !this.idempotent.isEmpty();
1903    }
1904
1905    public boolean hasIdempotent() { 
1906      return this.idempotent != null && !this.idempotent.isEmpty();
1907    }
1908
1909    /**
1910     * @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
1911     */
1912    public OperationDefinition setIdempotentElement(BooleanType value) { 
1913      this.idempotent = value;
1914      return this;
1915    }
1916
1917    /**
1918     * @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.
1919     */
1920    public boolean getIdempotent() { 
1921      return this.idempotent == null || this.idempotent.isEmpty() ? false : this.idempotent.getValue();
1922    }
1923
1924    /**
1925     * @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.
1926     */
1927    public OperationDefinition setIdempotent(boolean value) { 
1928        if (this.idempotent == null)
1929          this.idempotent = new BooleanType();
1930        this.idempotent.setValue(value);
1931      return this;
1932    }
1933
1934    /**
1935     * @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
1936     */
1937    public CodeType getCodeElement() { 
1938      if (this.code == null)
1939        if (Configuration.errorOnAutoCreate())
1940          throw new Error("Attempt to auto-create OperationDefinition.code");
1941        else if (Configuration.doAutoCreate())
1942          this.code = new CodeType(); // bb
1943      return this.code;
1944    }
1945
1946    public boolean hasCodeElement() { 
1947      return this.code != null && !this.code.isEmpty();
1948    }
1949
1950    public boolean hasCode() { 
1951      return this.code != null && !this.code.isEmpty();
1952    }
1953
1954    /**
1955     * @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
1956     */
1957    public OperationDefinition setCodeElement(CodeType value) { 
1958      this.code = value;
1959      return this;
1960    }
1961
1962    /**
1963     * @return The name used to invoke the operation.
1964     */
1965    public String getCode() { 
1966      return this.code == null ? null : this.code.getValue();
1967    }
1968
1969    /**
1970     * @param value The name used to invoke the operation.
1971     */
1972    public OperationDefinition setCode(String value) { 
1973        if (this.code == null)
1974          this.code = new CodeType();
1975        this.code.setValue(value);
1976      return this;
1977    }
1978
1979    /**
1980     * @return {@link #notes} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value
1981     */
1982    public StringType getNotesElement() { 
1983      if (this.notes == null)
1984        if (Configuration.errorOnAutoCreate())
1985          throw new Error("Attempt to auto-create OperationDefinition.notes");
1986        else if (Configuration.doAutoCreate())
1987          this.notes = new StringType(); // bb
1988      return this.notes;
1989    }
1990
1991    public boolean hasNotesElement() { 
1992      return this.notes != null && !this.notes.isEmpty();
1993    }
1994
1995    public boolean hasNotes() { 
1996      return this.notes != null && !this.notes.isEmpty();
1997    }
1998
1999    /**
2000     * @param value {@link #notes} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value
2001     */
2002    public OperationDefinition setNotesElement(StringType value) { 
2003      this.notes = value;
2004      return this;
2005    }
2006
2007    /**
2008     * @return Additional information about how to use this operation or named query.
2009     */
2010    public String getNotes() { 
2011      return this.notes == null ? null : this.notes.getValue();
2012    }
2013
2014    /**
2015     * @param value Additional information about how to use this operation or named query.
2016     */
2017    public OperationDefinition setNotes(String value) { 
2018      if (Utilities.noString(value))
2019        this.notes = null;
2020      else {
2021        if (this.notes == null)
2022          this.notes = new StringType();
2023        this.notes.setValue(value);
2024      }
2025      return this;
2026    }
2027
2028    /**
2029     * @return {@link #base} (Indicates that this operation definition is a constraining profile on the base.)
2030     */
2031    public Reference getBase() { 
2032      if (this.base == null)
2033        if (Configuration.errorOnAutoCreate())
2034          throw new Error("Attempt to auto-create OperationDefinition.base");
2035        else if (Configuration.doAutoCreate())
2036          this.base = new Reference(); // cc
2037      return this.base;
2038    }
2039
2040    public boolean hasBase() { 
2041      return this.base != null && !this.base.isEmpty();
2042    }
2043
2044    /**
2045     * @param value {@link #base} (Indicates that this operation definition is a constraining profile on the base.)
2046     */
2047    public OperationDefinition setBase(Reference value) { 
2048      this.base = value;
2049      return this;
2050    }
2051
2052    /**
2053     * @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.)
2054     */
2055    public OperationDefinition getBaseTarget() { 
2056      if (this.baseTarget == null)
2057        if (Configuration.errorOnAutoCreate())
2058          throw new Error("Attempt to auto-create OperationDefinition.base");
2059        else if (Configuration.doAutoCreate())
2060          this.baseTarget = new OperationDefinition(); // aa
2061      return this.baseTarget;
2062    }
2063
2064    /**
2065     * @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.)
2066     */
2067    public OperationDefinition setBaseTarget(OperationDefinition value) { 
2068      this.baseTarget = value;
2069      return this;
2070    }
2071
2072    /**
2073     * @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
2074     */
2075    public BooleanType getSystemElement() { 
2076      if (this.system == null)
2077        if (Configuration.errorOnAutoCreate())
2078          throw new Error("Attempt to auto-create OperationDefinition.system");
2079        else if (Configuration.doAutoCreate())
2080          this.system = new BooleanType(); // bb
2081      return this.system;
2082    }
2083
2084    public boolean hasSystemElement() { 
2085      return this.system != null && !this.system.isEmpty();
2086    }
2087
2088    public boolean hasSystem() { 
2089      return this.system != null && !this.system.isEmpty();
2090    }
2091
2092    /**
2093     * @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
2094     */
2095    public OperationDefinition setSystemElement(BooleanType value) { 
2096      this.system = value;
2097      return this;
2098    }
2099
2100    /**
2101     * @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).
2102     */
2103    public boolean getSystem() { 
2104      return this.system == null || this.system.isEmpty() ? false : this.system.getValue();
2105    }
2106
2107    /**
2108     * @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).
2109     */
2110    public OperationDefinition setSystem(boolean value) { 
2111        if (this.system == null)
2112          this.system = new BooleanType();
2113        this.system.setValue(value);
2114      return this;
2115    }
2116
2117    /**
2118     * @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 resource type for the context).)
2119     */
2120    public List<CodeType> getType() { 
2121      if (this.type == null)
2122        this.type = new ArrayList<CodeType>();
2123      return this.type;
2124    }
2125
2126    public boolean hasType() { 
2127      if (this.type == null)
2128        return false;
2129      for (CodeType item : this.type)
2130        if (!item.isEmpty())
2131          return true;
2132      return false;
2133    }
2134
2135    /**
2136     * @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 resource type for the context).)
2137     */
2138    // syntactic sugar
2139    public CodeType addTypeElement() {//2 
2140      CodeType t = new CodeType();
2141      if (this.type == null)
2142        this.type = new ArrayList<CodeType>();
2143      this.type.add(t);
2144      return t;
2145    }
2146
2147    /**
2148     * @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 resource type for the context).)
2149     */
2150    public OperationDefinition addType(String value) { //1
2151      CodeType t = new CodeType();
2152      t.setValue(value);
2153      if (this.type == null)
2154        this.type = new ArrayList<CodeType>();
2155      this.type.add(t);
2156      return this;
2157    }
2158
2159    /**
2160     * @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 resource type for the context).)
2161     */
2162    public boolean hasType(String value) { 
2163      if (this.type == null)
2164        return false;
2165      for (CodeType v : this.type)
2166        if (v.equals(value)) // code
2167          return true;
2168      return false;
2169    }
2170
2171    /**
2172     * @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
2173     */
2174    public BooleanType getInstanceElement() { 
2175      if (this.instance == null)
2176        if (Configuration.errorOnAutoCreate())
2177          throw new Error("Attempt to auto-create OperationDefinition.instance");
2178        else if (Configuration.doAutoCreate())
2179          this.instance = new BooleanType(); // bb
2180      return this.instance;
2181    }
2182
2183    public boolean hasInstanceElement() { 
2184      return this.instance != null && !this.instance.isEmpty();
2185    }
2186
2187    public boolean hasInstance() { 
2188      return this.instance != null && !this.instance.isEmpty();
2189    }
2190
2191    /**
2192     * @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
2193     */
2194    public OperationDefinition setInstanceElement(BooleanType value) { 
2195      this.instance = value;
2196      return this;
2197    }
2198
2199    /**
2200     * @return Indicates whether this operation can be invoked on a particular instance of one of the given types.
2201     */
2202    public boolean getInstance() { 
2203      return this.instance == null || this.instance.isEmpty() ? false : this.instance.getValue();
2204    }
2205
2206    /**
2207     * @param value Indicates whether this operation can be invoked on a particular instance of one of the given types.
2208     */
2209    public OperationDefinition setInstance(boolean value) { 
2210        if (this.instance == null)
2211          this.instance = new BooleanType();
2212        this.instance.setValue(value);
2213      return this;
2214    }
2215
2216    /**
2217     * @return {@link #parameter} (The parameters for the operation/query.)
2218     */
2219    public List<OperationDefinitionParameterComponent> getParameter() { 
2220      if (this.parameter == null)
2221        this.parameter = new ArrayList<OperationDefinitionParameterComponent>();
2222      return this.parameter;
2223    }
2224
2225    public boolean hasParameter() { 
2226      if (this.parameter == null)
2227        return false;
2228      for (OperationDefinitionParameterComponent item : this.parameter)
2229        if (!item.isEmpty())
2230          return true;
2231      return false;
2232    }
2233
2234    /**
2235     * @return {@link #parameter} (The parameters for the operation/query.)
2236     */
2237    // syntactic sugar
2238    public OperationDefinitionParameterComponent addParameter() { //3
2239      OperationDefinitionParameterComponent t = new OperationDefinitionParameterComponent();
2240      if (this.parameter == null)
2241        this.parameter = new ArrayList<OperationDefinitionParameterComponent>();
2242      this.parameter.add(t);
2243      return t;
2244    }
2245
2246    // syntactic sugar
2247    public OperationDefinition addParameter(OperationDefinitionParameterComponent t) { //3
2248      if (t == null)
2249        return this;
2250      if (this.parameter == null)
2251        this.parameter = new ArrayList<OperationDefinitionParameterComponent>();
2252      this.parameter.add(t);
2253      return this;
2254    }
2255
2256      protected void listChildren(List<Property> childrenList) {
2257        super.listChildren(childrenList);
2258        childrenList.add(new Property("url", "uri", "An absolute URL 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.", 0, java.lang.Integer.MAX_VALUE, url));
2259        childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version));
2260        childrenList.add(new Property("name", "string", "A free text natural language name identifying the operation.", 0, java.lang.Integer.MAX_VALUE, name));
2261        childrenList.add(new Property("status", "code", "The status of the profile.", 0, java.lang.Integer.MAX_VALUE, status));
2262        childrenList.add(new Property("kind", "code", "Whether this is an operation or a named query.", 0, java.lang.Integer.MAX_VALUE, kind));
2263        childrenList.add(new Property("experimental", "boolean", "This profile was 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));
2264        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));
2265        childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
2266        childrenList.add(new Property("date", "dateTime", "The date this version of the operation definition was published. The date must change when the business version changes, if it does, 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));
2267        childrenList.add(new Property("description", "string", "A free text natural language description of the profile and its use.", 0, java.lang.Integer.MAX_VALUE, description));
2268        childrenList.add(new Property("requirements", "string", "Explains why this operation definition is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements));
2269        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));
2270        childrenList.add(new Property("code", "code", "The name used to invoke the operation.", 0, java.lang.Integer.MAX_VALUE, code));
2271        childrenList.add(new Property("notes", "string", "Additional information about how to use this operation or named query.", 0, java.lang.Integer.MAX_VALUE, notes));
2272        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));
2273        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));
2274        childrenList.add(new Property("type", "code", "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 resource type for the context).", 0, java.lang.Integer.MAX_VALUE, type));
2275        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));
2276        childrenList.add(new Property("parameter", "", "The parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter));
2277      }
2278
2279      @Override
2280      public void setProperty(String name, Base value) throws FHIRException {
2281        if (name.equals("url"))
2282          this.url = castToUri(value); // UriType
2283        else if (name.equals("version"))
2284          this.version = castToString(value); // StringType
2285        else if (name.equals("name"))
2286          this.name = castToString(value); // StringType
2287        else if (name.equals("status"))
2288          this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration<ConformanceResourceStatus>
2289        else if (name.equals("kind"))
2290          this.kind = new OperationKindEnumFactory().fromType(value); // Enumeration<OperationKind>
2291        else if (name.equals("experimental"))
2292          this.experimental = castToBoolean(value); // BooleanType
2293        else if (name.equals("publisher"))
2294          this.publisher = castToString(value); // StringType
2295        else if (name.equals("contact"))
2296          this.getContact().add((OperationDefinitionContactComponent) value);
2297        else if (name.equals("date"))
2298          this.date = castToDateTime(value); // DateTimeType
2299        else if (name.equals("description"))
2300          this.description = castToString(value); // StringType
2301        else if (name.equals("requirements"))
2302          this.requirements = castToString(value); // StringType
2303        else if (name.equals("idempotent"))
2304          this.idempotent = castToBoolean(value); // BooleanType
2305        else if (name.equals("code"))
2306          this.code = castToCode(value); // CodeType
2307        else if (name.equals("notes"))
2308          this.notes = castToString(value); // StringType
2309        else if (name.equals("base"))
2310          this.base = castToReference(value); // Reference
2311        else if (name.equals("system"))
2312          this.system = castToBoolean(value); // BooleanType
2313        else if (name.equals("type"))
2314          this.getType().add(castToCode(value));
2315        else if (name.equals("instance"))
2316          this.instance = castToBoolean(value); // BooleanType
2317        else if (name.equals("parameter"))
2318          this.getParameter().add((OperationDefinitionParameterComponent) value);
2319        else
2320          super.setProperty(name, value);
2321      }
2322
2323      @Override
2324      public Base addChild(String name) throws FHIRException {
2325        if (name.equals("url")) {
2326          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.url");
2327        }
2328        else if (name.equals("version")) {
2329          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.version");
2330        }
2331        else if (name.equals("name")) {
2332          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.name");
2333        }
2334        else if (name.equals("status")) {
2335          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.status");
2336        }
2337        else if (name.equals("kind")) {
2338          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.kind");
2339        }
2340        else if (name.equals("experimental")) {
2341          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.experimental");
2342        }
2343        else if (name.equals("publisher")) {
2344          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.publisher");
2345        }
2346        else if (name.equals("contact")) {
2347          return addContact();
2348        }
2349        else if (name.equals("date")) {
2350          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.date");
2351        }
2352        else if (name.equals("description")) {
2353          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.description");
2354        }
2355        else if (name.equals("requirements")) {
2356          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.requirements");
2357        }
2358        else if (name.equals("idempotent")) {
2359          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.idempotent");
2360        }
2361        else if (name.equals("code")) {
2362          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.code");
2363        }
2364        else if (name.equals("notes")) {
2365          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.notes");
2366        }
2367        else if (name.equals("base")) {
2368          this.base = new Reference();
2369          return this.base;
2370        }
2371        else if (name.equals("system")) {
2372          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.system");
2373        }
2374        else if (name.equals("type")) {
2375          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.type");
2376        }
2377        else if (name.equals("instance")) {
2378          throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.instance");
2379        }
2380        else if (name.equals("parameter")) {
2381          return addParameter();
2382        }
2383        else
2384          return super.addChild(name);
2385      }
2386
2387  public String fhirType() {
2388    return "OperationDefinition";
2389
2390  }
2391
2392      public OperationDefinition copy() {
2393        OperationDefinition dst = new OperationDefinition();
2394        copyValues(dst);
2395        dst.url = url == null ? null : url.copy();
2396        dst.version = version == null ? null : version.copy();
2397        dst.name = name == null ? null : name.copy();
2398        dst.status = status == null ? null : status.copy();
2399        dst.kind = kind == null ? null : kind.copy();
2400        dst.experimental = experimental == null ? null : experimental.copy();
2401        dst.publisher = publisher == null ? null : publisher.copy();
2402        if (contact != null) {
2403          dst.contact = new ArrayList<OperationDefinitionContactComponent>();
2404          for (OperationDefinitionContactComponent i : contact)
2405            dst.contact.add(i.copy());
2406        };
2407        dst.date = date == null ? null : date.copy();
2408        dst.description = description == null ? null : description.copy();
2409        dst.requirements = requirements == null ? null : requirements.copy();
2410        dst.idempotent = idempotent == null ? null : idempotent.copy();
2411        dst.code = code == null ? null : code.copy();
2412        dst.notes = notes == null ? null : notes.copy();
2413        dst.base = base == null ? null : base.copy();
2414        dst.system = system == null ? null : system.copy();
2415        if (type != null) {
2416          dst.type = new ArrayList<CodeType>();
2417          for (CodeType i : type)
2418            dst.type.add(i.copy());
2419        };
2420        dst.instance = instance == null ? null : instance.copy();
2421        if (parameter != null) {
2422          dst.parameter = new ArrayList<OperationDefinitionParameterComponent>();
2423          for (OperationDefinitionParameterComponent i : parameter)
2424            dst.parameter.add(i.copy());
2425        };
2426        return dst;
2427      }
2428
2429      protected OperationDefinition typedCopy() {
2430        return copy();
2431      }
2432
2433      @Override
2434      public boolean equalsDeep(Base other) {
2435        if (!super.equalsDeep(other))
2436          return false;
2437        if (!(other instanceof OperationDefinition))
2438          return false;
2439        OperationDefinition o = (OperationDefinition) other;
2440        return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true)
2441           && compareDeep(status, o.status, true) && compareDeep(kind, o.kind, true) && compareDeep(experimental, o.experimental, true)
2442           && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true)
2443           && compareDeep(description, o.description, true) && compareDeep(requirements, o.requirements, true)
2444           && compareDeep(idempotent, o.idempotent, true) && compareDeep(code, o.code, true) && compareDeep(notes, o.notes, true)
2445           && compareDeep(base, o.base, true) && compareDeep(system, o.system, true) && compareDeep(type, o.type, true)
2446           && compareDeep(instance, o.instance, true) && compareDeep(parameter, o.parameter, true);
2447      }
2448
2449      @Override
2450      public boolean equalsShallow(Base other) {
2451        if (!super.equalsShallow(other))
2452          return false;
2453        if (!(other instanceof OperationDefinition))
2454          return false;
2455        OperationDefinition o = (OperationDefinition) other;
2456        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true)
2457           && compareValues(status, o.status, true) && compareValues(kind, o.kind, true) && compareValues(experimental, o.experimental, true)
2458           && compareValues(publisher, o.publisher, true) && compareValues(date, o.date, true) && compareValues(description, o.description, true)
2459           && compareValues(requirements, o.requirements, true) && compareValues(idempotent, o.idempotent, true)
2460           && compareValues(code, o.code, true) && compareValues(notes, o.notes, true) && compareValues(system, o.system, true)
2461           && compareValues(type, o.type, true) && compareValues(instance, o.instance, true);
2462      }
2463
2464      public boolean isEmpty() {
2465        return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty())
2466           && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) && (kind == null || kind.isEmpty())
2467           && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty())
2468           && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty())
2469           && (requirements == null || requirements.isEmpty()) && (idempotent == null || idempotent.isEmpty())
2470           && (code == null || code.isEmpty()) && (notes == null || notes.isEmpty()) && (base == null || base.isEmpty())
2471           && (system == null || system.isEmpty()) && (type == null || type.isEmpty()) && (instance == null || instance.isEmpty())
2472           && (parameter == null || parameter.isEmpty());
2473      }
2474
2475  @Override
2476  public ResourceType getResourceType() {
2477    return ResourceType.OperationDefinition;
2478   }
2479
2480  @SearchParamDefinition(name="date", path="OperationDefinition.date", description="Date for this version of the operation definition", type="date" )
2481  public static final String SP_DATE = "date";
2482  @SearchParamDefinition(name="code", path="OperationDefinition.code", description="Name used to invoke the operation", type="token" )
2483  public static final String SP_CODE = "code";
2484  @SearchParamDefinition(name="instance", path="OperationDefinition.instance", description="Invoke on an instance?", type="token" )
2485  public static final String SP_INSTANCE = "instance";
2486  @SearchParamDefinition(name="kind", path="OperationDefinition.kind", description="operation | query", type="token" )
2487  public static final String SP_KIND = "kind";
2488  @SearchParamDefinition(name="profile", path="OperationDefinition.parameter.profile", description="Profile on the type", type="reference" )
2489  public static final String SP_PROFILE = "profile";
2490  @SearchParamDefinition(name="type", path="OperationDefinition.type", description="Invoke at resource level for these type", type="token" )
2491  public static final String SP_TYPE = "type";
2492  @SearchParamDefinition(name="version", path="OperationDefinition.version", description="Logical id for this version of the operation definition", type="token" )
2493  public static final String SP_VERSION = "version";
2494  @SearchParamDefinition(name="url", path="OperationDefinition.url", description="Logical URL to reference this operation definition", type="uri" )
2495  public static final String SP_URL = "url";
2496  @SearchParamDefinition(name="system", path="OperationDefinition.system", description="Invoke at the system level?", type="token" )
2497  public static final String SP_SYSTEM = "system";
2498  @SearchParamDefinition(name="name", path="OperationDefinition.name", description="Informal name for this operation", type="string" )
2499  public static final String SP_NAME = "name";
2500  @SearchParamDefinition(name="publisher", path="OperationDefinition.publisher", description="Name of the publisher (Organization or individual)", type="string" )
2501  public static final String SP_PUBLISHER = "publisher";
2502  @SearchParamDefinition(name="status", path="OperationDefinition.status", description="draft | active | retired", type="token" )
2503  public static final String SP_STATUS = "status";
2504  @SearchParamDefinition(name="base", path="OperationDefinition.base", description="Marks this as a profile of the base", type="reference" )
2505  public static final String SP_BASE = "base";
2506
2507}