001package org.hl7.fhir.dstu3.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu3
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
053import java.util.ArrayList;
054import java.util.List;
055
056import org.hl7.fhir.exceptions.FHIRException;
057import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
058import org.hl7.fhir.instance.model.api.IBaseParameters;
059
060import ca.uhn.fhir.model.api.annotation.Block;
061import ca.uhn.fhir.model.api.annotation.Child;
062import ca.uhn.fhir.model.api.annotation.Description;
063import ca.uhn.fhir.model.api.annotation.ResourceDef;
064/**
065 * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it.
066 */
067@ResourceDef(name="Parameters", profile="http://hl7.org/fhir/Profile/Parameters")
068public class Parameters extends Resource implements IBaseParameters {
069
070    @Block()
071    public static class ParametersParameterComponent extends BackboneElement implements IBaseBackboneElement {
072        /**
073         * The name of the parameter (reference to the operation definition).
074         */
075        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
076        @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." )
077        protected StringType name;
078
079        /**
080         * If the parameter is a data type.
081         */
082        @Child(name = "value", type = {}, order=2, min=0, max=1, modifier=false, summary=true)
083        @Description(shortDefinition="If parameter is a data type", formalDefinition="If the parameter is a data type." )
084        protected org.hl7.fhir.dstu3.model.Type value;
085
086        /**
087         * If the parameter is a whole resource.
088         */
089        @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=true)
090        @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." )
091        protected Resource resource;
092
093        /**
094         * A named part of a multi-part parameter.
095         */
096        @Child(name = "part", type = {ParametersParameterComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
097        @Description(shortDefinition="Named part of a multi-part parameter", formalDefinition="A named part of a multi-part parameter." )
098        protected List<ParametersParameterComponent> part;
099
100        private static final long serialVersionUID = -839605058L;
101
102    /**
103     * Constructor
104     */
105      public ParametersParameterComponent() {
106        super();
107      }
108
109    /**
110     * Constructor
111     */
112      public ParametersParameterComponent(StringType name) {
113        super();
114        this.name = name;
115      }
116
117        /**
118         * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
119         */
120        public StringType getNameElement() { 
121          if (this.name == null)
122            if (Configuration.errorOnAutoCreate())
123              throw new Error("Attempt to auto-create ParametersParameterComponent.name");
124            else if (Configuration.doAutoCreate())
125              this.name = new StringType(); // bb
126          return this.name;
127        }
128
129        public boolean hasNameElement() { 
130          return this.name != null && !this.name.isEmpty();
131        }
132
133        public boolean hasName() { 
134          return this.name != null && !this.name.isEmpty();
135        }
136
137        /**
138         * @param value {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
139         */
140        public ParametersParameterComponent setNameElement(StringType value) { 
141          this.name = value;
142          return this;
143        }
144
145        /**
146         * @return The name of the parameter (reference to the operation definition).
147         */
148        public String getName() { 
149          return this.name == null ? null : this.name.getValue();
150        }
151
152        /**
153         * @param value The name of the parameter (reference to the operation definition).
154         */
155        public ParametersParameterComponent setName(String value) { 
156            if (this.name == null)
157              this.name = new StringType();
158            this.name.setValue(value);
159          return this;
160        }
161
162        /**
163         * @return {@link #value} (If the parameter is a data type.)
164         */
165        public org.hl7.fhir.dstu3.model.Type getValue() { 
166          return this.value;
167        }
168
169        public boolean hasValue() { 
170          return this.value != null && !this.value.isEmpty();
171        }
172
173        /**
174         * @param value {@link #value} (If the parameter is a data type.)
175         */
176        public ParametersParameterComponent setValue(org.hl7.fhir.dstu3.model.Type value)  { 
177          this.value = value;
178          return this;
179        }
180
181        /**
182         * @return {@link #resource} (If the parameter is a whole resource.)
183         */
184        public Resource getResource() { 
185          return this.resource;
186        }
187
188        public boolean hasResource() { 
189          return this.resource != null && !this.resource.isEmpty();
190        }
191
192        /**
193         * @param value {@link #resource} (If the parameter is a whole resource.)
194         */
195        public ParametersParameterComponent setResource(Resource value)  { 
196          this.resource = value;
197          return this;
198        }
199
200        /**
201         * @return {@link #part} (A named part of a multi-part parameter.)
202         */
203        public List<ParametersParameterComponent> getPart() { 
204          if (this.part == null)
205            this.part = new ArrayList<ParametersParameterComponent>();
206          return this.part;
207        }
208
209        /**
210         * @return Returns a reference to <code>this</code> for easy method chaining
211         */
212        public ParametersParameterComponent setPart(List<ParametersParameterComponent> thePart) { 
213          this.part = thePart;
214          return this;
215        }
216
217        public boolean hasPart() { 
218          if (this.part == null)
219            return false;
220          for (ParametersParameterComponent item : this.part)
221            if (!item.isEmpty())
222              return true;
223          return false;
224        }
225
226        public ParametersParameterComponent addPart() { //3
227          ParametersParameterComponent t = new ParametersParameterComponent();
228          if (this.part == null)
229            this.part = new ArrayList<ParametersParameterComponent>();
230          this.part.add(t);
231          return t;
232        }
233
234        public ParametersParameterComponent addPart(ParametersParameterComponent t) { //3
235          if (t == null)
236            return this;
237          if (this.part == null)
238            this.part = new ArrayList<ParametersParameterComponent>();
239          this.part.add(t);
240          return this;
241        }
242
243        /**
244         * @return The first repetition of repeating field {@link #part}, creating it if it does not already exist
245         */
246        public ParametersParameterComponent getPartFirstRep() { 
247          if (getPart().isEmpty()) {
248            addPart();
249          }
250          return getPart().get(0);
251        }
252
253        protected void listChildren(List<Property> children) {
254          super.listChildren(children);
255          children.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, 1, name));
256          children.add(new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value));
257          children.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, 1, resource));
258          children.add(new Property("part", "@Parameters.parameter", "A named part of a multi-part parameter.", 0, java.lang.Integer.MAX_VALUE, part));
259        }
260
261        @Override
262        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
263          switch (_hash) {
264          case 3373707: /*name*/  return new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, 1, name);
265          case -1410166417: /*value[x]*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
266          case 111972721: /*value*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
267          case -1535024575: /*valueBase64Binary*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
268          case 733421943: /*valueBoolean*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
269          case -786218365: /*valueCanonical*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
270          case -766209282: /*valueCode*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
271          case -766192449: /*valueDate*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
272          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
273          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
274          case 231604844: /*valueId*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
275          case -1668687056: /*valueInstant*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
276          case -1668204915: /*valueInteger*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
277          case -497880704: /*valueMarkdown*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
278          case -1410178407: /*valueOid*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
279          case -1249932027: /*valuePositiveInt*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
280          case -1424603934: /*valueString*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
281          case -765708322: /*valueTime*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
282          case 26529417: /*valueUnsignedInt*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
283          case -1410172357: /*valueUri*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
284          case -1410172354: /*valueUrl*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
285          case -765667124: /*valueUuid*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
286          case -478981821: /*valueAddress*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
287          case -67108992: /*valueAnnotation*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
288          case -475566732: /*valueAttachment*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
289          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
290          case -1887705029: /*valueCoding*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
291          case 944904545: /*valueContactPoint*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
292          case -2026205465: /*valueHumanName*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
293          case -130498310: /*valueIdentifier*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
294          case -1524344174: /*valuePeriod*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
295          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
296          case 2030761548: /*valueRange*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
297          case 2030767386: /*valueRatio*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
298          case 1755241690: /*valueReference*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
299          case -962229101: /*valueSampledData*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
300          case -540985785: /*valueSignature*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
301          case -1406282469: /*valueTiming*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
302          case -1858636920: /*valueDosage*/  return new Property("value[x]", "*", "If the parameter is a data type.", 0, 1, value);
303          case -341064690: /*resource*/  return new Property("resource", "Resource", "If the parameter is a whole resource.", 0, 1, resource);
304          case 3433459: /*part*/  return new Property("part", "@Parameters.parameter", "A named part of a multi-part parameter.", 0, java.lang.Integer.MAX_VALUE, part);
305          default: return super.getNamedProperty(_hash, _name, _checkValid);
306          }
307
308        }
309
310      @Override
311      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
312        switch (hash) {
313        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
314        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.dstu3.model.Type
315        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Resource
316        case 3433459: /*part*/ return this.part == null ? new Base[0] : this.part.toArray(new Base[this.part.size()]); // ParametersParameterComponent
317        default: return super.getProperty(hash, name, checkValid);
318        }
319
320      }
321
322      @Override
323      public Base setProperty(int hash, String name, Base value) throws FHIRException {
324        switch (hash) {
325        case 3373707: // name
326          this.name = castToString(value); // StringType
327          return value;
328        case 111972721: // value
329          this.value = castToType(value); // org.hl7.fhir.dstu3.model.Type
330          return value;
331        case -341064690: // resource
332          this.resource = castToResource(value); // Resource
333          return value;
334        case 3433459: // part
335          this.getPart().add((ParametersParameterComponent) value); // ParametersParameterComponent
336          return value;
337        default: return super.setProperty(hash, name, value);
338        }
339
340      }
341
342      @Override
343      public Base setProperty(String name, Base value) throws FHIRException {
344        if (name.equals("name")) {
345          this.name = castToString(value); // StringType
346        } else if (name.equals("value[x]")) {
347          this.value = castToType(value); // org.hl7.fhir.dstu3.model.Type
348        } else if (name.equals("resource")) {
349          this.resource = castToResource(value); // Resource
350        } else if (name.equals("part")) {
351          this.getPart().add((ParametersParameterComponent) value);
352        } else
353          return super.setProperty(name, value);
354        return value;
355      }
356
357      @Override
358      public Base makeProperty(int hash, String name) throws FHIRException {
359        switch (hash) {
360        case 3373707:  return getNameElement();
361        case -1410166417:  return getValue(); 
362        case 111972721:  return getValue(); 
363        case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource
364        case 3433459:  return addPart(); 
365        default: return super.makeProperty(hash, name);
366        }
367
368      }
369
370      @Override
371      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
372        switch (hash) {
373        case 3373707: /*name*/ return new String[] {"string"};
374        case 111972721: /*value*/ return new String[] {"*"};
375        case -341064690: /*resource*/ return new String[] {"Resource"};
376        case 3433459: /*part*/ return new String[] {"@Parameters.parameter"};
377        default: return super.getTypesForProperty(hash, name);
378        }
379
380      }
381
382      @Override
383      public Base addChild(String name) throws FHIRException {
384        if (name.equals("name")) {
385          throw new FHIRException("Cannot call addChild on a primitive type Parameters.name");
386        }
387        else if (name.equals("valueBoolean")) {
388          this.value = new BooleanType();
389          return this.value;
390        }
391        else if (name.equals("valueInteger")) {
392          this.value = new IntegerType();
393          return this.value;
394        }
395        else if (name.equals("valueDecimal")) {
396          this.value = new DecimalType();
397          return this.value;
398        }
399        else if (name.equals("valueBase64Binary")) {
400          this.value = new Base64BinaryType();
401          return this.value;
402        }
403        else if (name.equals("valueInstant")) {
404          this.value = new InstantType();
405          return this.value;
406        }
407        else if (name.equals("valueString")) {
408          this.value = new StringType();
409          return this.value;
410        }
411        else if (name.equals("valueUri")) {
412          this.value = new UriType();
413          return this.value;
414        }
415        else if (name.equals("valueDate")) {
416          this.value = new DateType();
417          return this.value;
418        }
419        else if (name.equals("valueDateTime")) {
420          this.value = new DateTimeType();
421          return this.value;
422        }
423        else if (name.equals("valueTime")) {
424          this.value = new TimeType();
425          return this.value;
426        }
427        else if (name.equals("valueCode")) {
428          this.value = new CodeType();
429          return this.value;
430        }
431        else if (name.equals("valueOid")) {
432          this.value = new OidType();
433          return this.value;
434        }
435        else if (name.equals("valueId")) {
436          this.value = new IdType();
437          return this.value;
438        }
439        else if (name.equals("valueUnsignedInt")) {
440          this.value = new UnsignedIntType();
441          return this.value;
442        }
443        else if (name.equals("valuePositiveInt")) {
444          this.value = new PositiveIntType();
445          return this.value;
446        }
447        else if (name.equals("valueMarkdown")) {
448          this.value = new MarkdownType();
449          return this.value;
450        }
451        else if (name.equals("valueAnnotation")) {
452          this.value = new Annotation();
453          return this.value;
454        }
455        else if (name.equals("valueAttachment")) {
456          this.value = new Attachment();
457          return this.value;
458        }
459        else if (name.equals("valueIdentifier")) {
460          this.value = new Identifier();
461          return this.value;
462        }
463        else if (name.equals("valueCodeableConcept")) {
464          this.value = new CodeableConcept();
465          return this.value;
466        }
467        else if (name.equals("valueCoding")) {
468          this.value = new Coding();
469          return this.value;
470        }
471        else if (name.equals("valueQuantity")) {
472          this.value = new Quantity();
473          return this.value;
474        }
475        else if (name.equals("valueRange")) {
476          this.value = new Range();
477          return this.value;
478        }
479        else if (name.equals("valuePeriod")) {
480          this.value = new Period();
481          return this.value;
482        }
483        else if (name.equals("valueRatio")) {
484          this.value = new Ratio();
485          return this.value;
486        }
487        else if (name.equals("valueSampledData")) {
488          this.value = new SampledData();
489          return this.value;
490        }
491        else if (name.equals("valueSignature")) {
492          this.value = new Signature();
493          return this.value;
494        }
495        else if (name.equals("valueHumanName")) {
496          this.value = new HumanName();
497          return this.value;
498        }
499        else if (name.equals("valueAddress")) {
500          this.value = new Address();
501          return this.value;
502        }
503        else if (name.equals("valueContactPoint")) {
504          this.value = new ContactPoint();
505          return this.value;
506        }
507        else if (name.equals("valueTiming")) {
508          this.value = new Timing();
509          return this.value;
510        }
511        else if (name.equals("valueReference")) {
512          this.value = new Reference();
513          return this.value;
514        }
515        else if (name.equals("valueMeta")) {
516          this.value = new Meta();
517          return this.value;
518        }
519        else if (name.equals("resource")) {
520          throw new FHIRException("Cannot call addChild on an abstract type Parameters.resource");
521        }
522        else if (name.equals("part")) {
523          return addPart();
524        }
525        else
526          return super.addChild(name);
527      }
528
529      public ParametersParameterComponent copy() {
530        ParametersParameterComponent dst = new ParametersParameterComponent();
531        copyValues(dst);
532        dst.name = name == null ? null : name.copy();
533        dst.value = value == null ? null : value.copy();
534        dst.resource = resource == null ? null : resource.copy();
535        if (part != null) {
536          dst.part = new ArrayList<ParametersParameterComponent>();
537          for (ParametersParameterComponent i : part)
538            dst.part.add(i.copy());
539        };
540        return dst;
541      }
542
543      @Override
544      public boolean equalsDeep(Base other_) {
545        if (!super.equalsDeep(other_))
546          return false;
547        if (!(other_ instanceof ParametersParameterComponent))
548          return false;
549        ParametersParameterComponent o = (ParametersParameterComponent) other_;
550        return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(resource, o.resource, true)
551           && compareDeep(part, o.part, true);
552      }
553
554      @Override
555      public boolean equalsShallow(Base other_) {
556        if (!super.equalsShallow(other_))
557          return false;
558        if (!(other_ instanceof ParametersParameterComponent))
559          return false;
560        ParametersParameterComponent o = (ParametersParameterComponent) other_;
561        return compareValues(name, o.name, true);
562      }
563
564      public boolean isEmpty() {
565        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value, resource, part
566          );
567      }
568
569  public String fhirType() {
570    return "Parameters.parameter";
571
572  }
573
574  }
575
576    /**
577     * A parameter passed to or received from the operation.
578     */
579    @Child(name = "parameter", type = {}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
580    @Description(shortDefinition="Operation Parameter", formalDefinition="A parameter passed to or received from the operation." )
581    protected List<ParametersParameterComponent> parameter;
582
583    private static final long serialVersionUID = -1495940293L;
584
585  /**
586   * Constructor
587   */
588    public Parameters() {
589      super();
590    }
591
592    /**
593     * @return {@link #parameter} (A parameter passed to or received from the operation.)
594     */
595    public List<ParametersParameterComponent> getParameter() { 
596      if (this.parameter == null)
597        this.parameter = new ArrayList<ParametersParameterComponent>();
598      return this.parameter;
599    }
600
601    /**
602     * @return Returns a reference to <code>this</code> for easy method chaining
603     */
604    public Parameters setParameter(List<ParametersParameterComponent> theParameter) { 
605      this.parameter = theParameter;
606      return this;
607    }
608
609    public boolean hasParameter() { 
610      if (this.parameter == null)
611        return false;
612      for (ParametersParameterComponent item : this.parameter)
613        if (!item.isEmpty())
614          return true;
615      return false;
616    }
617
618    public ParametersParameterComponent addParameter() { //3
619      ParametersParameterComponent t = new ParametersParameterComponent();
620      if (this.parameter == null)
621        this.parameter = new ArrayList<ParametersParameterComponent>();
622      this.parameter.add(t);
623      return t;
624    }
625
626    public Parameters addParameter(ParametersParameterComponent t) { //3
627      if (t == null)
628        return this;
629      if (this.parameter == null)
630        this.parameter = new ArrayList<ParametersParameterComponent>();
631      this.parameter.add(t);
632      return this;
633    }
634
635    /**
636     * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist
637     */
638    public ParametersParameterComponent getParameterFirstRep() { 
639      if (getParameter().isEmpty()) {
640        addParameter();
641      }
642      return getParameter().get(0);
643    }
644
645      protected void listChildren(List<Property> children) {
646        super.listChildren(children);
647        children.add(new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter));
648      }
649
650      @Override
651      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
652        switch (_hash) {
653        case 1954460585: /*parameter*/  return new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter);
654        default: return super.getNamedProperty(_hash, _name, _checkValid);
655        }
656
657      }
658
659      @Override
660      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
661        switch (hash) {
662        case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParametersParameterComponent
663        default: return super.getProperty(hash, name, checkValid);
664        }
665
666      }
667
668      @Override
669      public Base setProperty(int hash, String name, Base value) throws FHIRException {
670        switch (hash) {
671        case 1954460585: // parameter
672          this.getParameter().add((ParametersParameterComponent) value); // ParametersParameterComponent
673          return value;
674        default: return super.setProperty(hash, name, value);
675        }
676
677      }
678
679      @Override
680      public Base setProperty(String name, Base value) throws FHIRException {
681        if (name.equals("parameter")) {
682          this.getParameter().add((ParametersParameterComponent) value);
683        } else
684          return super.setProperty(name, value);
685        return value;
686      }
687
688      @Override
689      public Base makeProperty(int hash, String name) throws FHIRException {
690        switch (hash) {
691        case 1954460585:  return addParameter(); 
692        default: return super.makeProperty(hash, name);
693        }
694
695      }
696
697      @Override
698      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
699        switch (hash) {
700        case 1954460585: /*parameter*/ return new String[] {};
701        default: return super.getTypesForProperty(hash, name);
702        }
703
704      }
705
706      @Override
707      public Base addChild(String name) throws FHIRException {
708        if (name.equals("parameter")) {
709          return addParameter();
710        }
711        else
712          return super.addChild(name);
713      }
714
715  public String fhirType() {
716    return "Parameters";
717
718  }
719
720      public Parameters copy() {
721        Parameters dst = new Parameters();
722        copyValues(dst);
723        if (parameter != null) {
724          dst.parameter = new ArrayList<ParametersParameterComponent>();
725          for (ParametersParameterComponent i : parameter)
726            dst.parameter.add(i.copy());
727        };
728        return dst;
729      }
730
731      protected Parameters typedCopy() {
732        return copy();
733      }
734
735      @Override
736      public boolean equalsDeep(Base other_) {
737        if (!super.equalsDeep(other_))
738          return false;
739        if (!(other_ instanceof Parameters))
740          return false;
741        Parameters o = (Parameters) other_;
742        return compareDeep(parameter, o.parameter, true);
743      }
744
745      @Override
746      public boolean equalsShallow(Base other_) {
747        if (!super.equalsShallow(other_))
748          return false;
749        if (!(other_ instanceof Parameters))
750          return false;
751        Parameters o = (Parameters) other_;
752        return true;
753      }
754
755      public boolean isEmpty() {
756        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(parameter);
757      }
758
759  @Override
760  public ResourceType getResourceType() {
761    return ResourceType.Parameters;
762   }
763
764
765}
766