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