001package org.hl7.fhir.r5.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, \
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this \
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, \
016     this list of conditions and the following disclaimer in the documentation \
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
031  POSSIBILITY OF SUCH DAMAGE.
032  */
033
034// Generated on Mon, May 11, 2020 09:58+1000 for FHIR vcurrent
035
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
041import org.hl7.fhir.utilities.Utilities;
042import org.hl7.fhir.r5.model.Enumerations.*;
043import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
044import org.hl7.fhir.exceptions.FHIRException;
045import org.hl7.fhir.instance.model.api.ICompositeType;
046import ca.uhn.fhir.model.api.annotation.ResourceDef;
047import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
048import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
049import ca.uhn.fhir.model.api.annotation.Child;
050import ca.uhn.fhir.model.api.annotation.ChildOrder;
051import ca.uhn.fhir.model.api.annotation.Description;
052import ca.uhn.fhir.model.api.annotation.Block;
053
054import org.hl7.fhir.instance.model.api.IBaseParameters;
055/**
056 * This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it.
057 */
058@ResourceDef(name="Parameters", profile="http://hl7.org/fhir/StructureDefinition/Parameters")
059public class Parameters extends Resource implements IBaseParameters {
060
061    @Block()
062    public static class ParametersParameterComponent extends BackboneElement implements IBaseBackboneElement {
063        /**
064         * The name of the parameter (reference to the operation definition).
065         */
066        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
067        @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." )
068        protected StringType name;
069
070        /**
071         * If the parameter is a data type.
072         */
073        @Child(name = "value", type = {Base64BinaryType.class, BooleanType.class, CanonicalType.class, CodeType.class, DateType.class, DateTimeType.class, DecimalType.class, IdType.class, InstantType.class, IntegerType.class, Integer64Type.class, MarkdownType.class, OidType.class, PositiveIntType.class, StringType.class, TimeType.class, UnsignedIntType.class, UriType.class, UrlType.class, UuidType.class, Address.class, Age.class, Annotation.class, Attachment.class, CodeableConcept.class, Coding.class, ContactPoint.class, Count.class, Distance.class, Duration.class, HumanName.class, Identifier.class, Money.class, Period.class, Quantity.class, Range.class, Ratio.class, Reference.class, SampledData.class, Signature.class, Timing.class, ContactDetail.class, Contributor.class, DataRequirement.class, Expression.class, ParameterDefinition.class, RelatedArtifact.class, TriggerDefinition.class, UsageContext.class, Dosage.class, Meta.class}, order=2, min=0, max=1, modifier=false, summary=true)
074        @Description(shortDefinition="If parameter is a data type", formalDefinition="If the parameter is a data type." )
075        protected DataType value;
076
077        /**
078         * If the parameter is a whole resource.
079         */
080        @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=true)
081        @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." )
082        protected Resource resource;
083
084        /**
085         * A named part of a multi-part parameter.
086         */
087        @Child(name = "part", type = {ParametersParameterComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
088        @Description(shortDefinition="Named part of a multi-part parameter", formalDefinition="A named part of a multi-part parameter." )
089        protected List<ParametersParameterComponent> part;
090
091        private static final long serialVersionUID = -1755858390L;
092
093    /**
094     * Constructor
095     */
096      public ParametersParameterComponent() {
097        super();
098      }
099
100    /**
101     * Constructor
102     */
103      public ParametersParameterComponent(String name) {
104        super();
105        this.setName(name);
106      }
107
108        /**
109         * @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
110         */
111        public StringType getNameElement() { 
112          if (this.name == null)
113            if (Configuration.errorOnAutoCreate())
114              throw new Error("Attempt to auto-create ParametersParameterComponent.name");
115            else if (Configuration.doAutoCreate())
116              this.name = new StringType(); // bb
117          return this.name;
118        }
119
120        public boolean hasNameElement() { 
121          return this.name != null && !this.name.isEmpty();
122        }
123
124        public boolean hasName() { 
125          return this.name != null && !this.name.isEmpty();
126        }
127
128        /**
129         * @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
130         */
131        public ParametersParameterComponent setNameElement(StringType value) { 
132          this.name = value;
133          return this;
134        }
135
136        /**
137         * @return The name of the parameter (reference to the operation definition).
138         */
139        public String getName() { 
140          return this.name == null ? null : this.name.getValue();
141        }
142
143        /**
144         * @param value The name of the parameter (reference to the operation definition).
145         */
146        public ParametersParameterComponent setName(String value) { 
147            if (this.name == null)
148              this.name = new StringType();
149            this.name.setValue(value);
150          return this;
151        }
152
153        /**
154         * @return {@link #value} (If the parameter is a data type.)
155         */
156        public DataType getValue() { 
157          return this.value;
158        }
159
160        /**
161         * @return {@link #value} (If the parameter is a data type.)
162         */
163        public Base64BinaryType getValueBase64BinaryType() throws FHIRException { 
164          if (this.value == null)
165            this.value = new Base64BinaryType();
166          if (!(this.value instanceof Base64BinaryType))
167            throw new FHIRException("Type mismatch: the type Base64BinaryType was expected, but "+this.value.getClass().getName()+" was encountered");
168          return (Base64BinaryType) this.value;
169        }
170
171        public boolean hasValueBase64BinaryType() { 
172          return this != null && this.value instanceof Base64BinaryType;
173        }
174
175        /**
176         * @return {@link #value} (If the parameter is a data type.)
177         */
178        public BooleanType getValueBooleanType() throws FHIRException { 
179          if (this.value == null)
180            this.value = new BooleanType();
181          if (!(this.value instanceof BooleanType))
182            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
183          return (BooleanType) this.value;
184        }
185
186        public boolean hasValueBooleanType() { 
187          return this != null && this.value instanceof BooleanType;
188        }
189
190        /**
191         * @return {@link #value} (If the parameter is a data type.)
192         */
193        public CanonicalType getValueCanonicalType() throws FHIRException { 
194          if (this.value == null)
195            this.value = new CanonicalType();
196          if (!(this.value instanceof CanonicalType))
197            throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.value.getClass().getName()+" was encountered");
198          return (CanonicalType) this.value;
199        }
200
201        public boolean hasValueCanonicalType() { 
202          return this != null && this.value instanceof CanonicalType;
203        }
204
205        /**
206         * @return {@link #value} (If the parameter is a data type.)
207         */
208        public CodeType getValueCodeType() throws FHIRException { 
209          if (this.value == null)
210            this.value = new CodeType();
211          if (!(this.value instanceof CodeType))
212            throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered");
213          return (CodeType) this.value;
214        }
215
216        public boolean hasValueCodeType() { 
217          return this != null && this.value instanceof CodeType;
218        }
219
220        /**
221         * @return {@link #value} (If the parameter is a data type.)
222         */
223        public DateType getValueDateType() throws FHIRException { 
224          if (this.value == null)
225            this.value = new DateType();
226          if (!(this.value instanceof DateType))
227            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
228          return (DateType) this.value;
229        }
230
231        public boolean hasValueDateType() { 
232          return this != null && this.value instanceof DateType;
233        }
234
235        /**
236         * @return {@link #value} (If the parameter is a data type.)
237         */
238        public DateTimeType getValueDateTimeType() throws FHIRException { 
239          if (this.value == null)
240            this.value = new DateTimeType();
241          if (!(this.value instanceof DateTimeType))
242            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
243          return (DateTimeType) this.value;
244        }
245
246        public boolean hasValueDateTimeType() { 
247          return this != null && this.value instanceof DateTimeType;
248        }
249
250        /**
251         * @return {@link #value} (If the parameter is a data type.)
252         */
253        public DecimalType getValueDecimalType() throws FHIRException { 
254          if (this.value == null)
255            this.value = new DecimalType();
256          if (!(this.value instanceof DecimalType))
257            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered");
258          return (DecimalType) this.value;
259        }
260
261        public boolean hasValueDecimalType() { 
262          return this != null && this.value instanceof DecimalType;
263        }
264
265        /**
266         * @return {@link #value} (If the parameter is a data type.)
267         */
268        public IdType getValueIdType() throws FHIRException { 
269          if (this.value == null)
270            this.value = new IdType();
271          if (!(this.value instanceof IdType))
272            throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.value.getClass().getName()+" was encountered");
273          return (IdType) this.value;
274        }
275
276        public boolean hasValueIdType() { 
277          return this != null && this.value instanceof IdType;
278        }
279
280        /**
281         * @return {@link #value} (If the parameter is a data type.)
282         */
283        public InstantType getValueInstantType() throws FHIRException { 
284          if (this.value == null)
285            this.value = new InstantType();
286          if (!(this.value instanceof InstantType))
287            throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered");
288          return (InstantType) this.value;
289        }
290
291        public boolean hasValueInstantType() { 
292          return this != null && this.value instanceof InstantType;
293        }
294
295        /**
296         * @return {@link #value} (If the parameter is a data type.)
297         */
298        public IntegerType getValueIntegerType() throws FHIRException { 
299          if (this.value == null)
300            this.value = new IntegerType();
301          if (!(this.value instanceof IntegerType))
302            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
303          return (IntegerType) this.value;
304        }
305
306        public boolean hasValueIntegerType() { 
307          return this != null && this.value instanceof IntegerType;
308        }
309
310        /**
311         * @return {@link #value} (If the parameter is a data type.)
312         */
313        public Integer64Type getValueInteger64Type() throws FHIRException { 
314          if (this.value == null)
315            this.value = new Integer64Type();
316          if (!(this.value instanceof Integer64Type))
317            throw new FHIRException("Type mismatch: the type Integer64Type was expected, but "+this.value.getClass().getName()+" was encountered");
318          return (Integer64Type) this.value;
319        }
320
321        public boolean hasValueInteger64Type() { 
322          return this != null && this.value instanceof Integer64Type;
323        }
324
325        /**
326         * @return {@link #value} (If the parameter is a data type.)
327         */
328        public MarkdownType getValueMarkdownType() throws FHIRException { 
329          if (this.value == null)
330            this.value = new MarkdownType();
331          if (!(this.value instanceof MarkdownType))
332            throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.value.getClass().getName()+" was encountered");
333          return (MarkdownType) this.value;
334        }
335
336        public boolean hasValueMarkdownType() { 
337          return this != null && this.value instanceof MarkdownType;
338        }
339
340        /**
341         * @return {@link #value} (If the parameter is a data type.)
342         */
343        public OidType getValueOidType() throws FHIRException { 
344          if (this.value == null)
345            this.value = new OidType();
346          if (!(this.value instanceof OidType))
347            throw new FHIRException("Type mismatch: the type OidType was expected, but "+this.value.getClass().getName()+" was encountered");
348          return (OidType) this.value;
349        }
350
351        public boolean hasValueOidType() { 
352          return this != null && this.value instanceof OidType;
353        }
354
355        /**
356         * @return {@link #value} (If the parameter is a data type.)
357         */
358        public PositiveIntType getValuePositiveIntType() throws FHIRException { 
359          if (this.value == null)
360            this.value = new PositiveIntType();
361          if (!(this.value instanceof PositiveIntType))
362            throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.value.getClass().getName()+" was encountered");
363          return (PositiveIntType) this.value;
364        }
365
366        public boolean hasValuePositiveIntType() { 
367          return this != null && this.value instanceof PositiveIntType;
368        }
369
370        /**
371         * @return {@link #value} (If the parameter is a data type.)
372         */
373        public StringType getValueStringType() throws FHIRException { 
374          if (this.value == null)
375            this.value = new StringType();
376          if (!(this.value instanceof StringType))
377            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
378          return (StringType) this.value;
379        }
380
381        public boolean hasValueStringType() { 
382          return this != null && this.value instanceof StringType;
383        }
384
385        /**
386         * @return {@link #value} (If the parameter is a data type.)
387         */
388        public TimeType getValueTimeType() throws FHIRException { 
389          if (this.value == null)
390            this.value = new TimeType();
391          if (!(this.value instanceof TimeType))
392            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
393          return (TimeType) this.value;
394        }
395
396        public boolean hasValueTimeType() { 
397          return this != null && this.value instanceof TimeType;
398        }
399
400        /**
401         * @return {@link #value} (If the parameter is a data type.)
402         */
403        public UnsignedIntType getValueUnsignedIntType() throws FHIRException { 
404          if (this.value == null)
405            this.value = new UnsignedIntType();
406          if (!(this.value instanceof UnsignedIntType))
407            throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.value.getClass().getName()+" was encountered");
408          return (UnsignedIntType) this.value;
409        }
410
411        public boolean hasValueUnsignedIntType() { 
412          return this != null && this.value instanceof UnsignedIntType;
413        }
414
415        /**
416         * @return {@link #value} (If the parameter is a data type.)
417         */
418        public UriType getValueUriType() throws FHIRException { 
419          if (this.value == null)
420            this.value = new UriType();
421          if (!(this.value instanceof UriType))
422            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered");
423          return (UriType) this.value;
424        }
425
426        public boolean hasValueUriType() { 
427          return this != null && this.value instanceof UriType;
428        }
429
430        /**
431         * @return {@link #value} (If the parameter is a data type.)
432         */
433        public UrlType getValueUrlType() throws FHIRException { 
434          if (this.value == null)
435            this.value = new UrlType();
436          if (!(this.value instanceof UrlType))
437            throw new FHIRException("Type mismatch: the type UrlType was expected, but "+this.value.getClass().getName()+" was encountered");
438          return (UrlType) this.value;
439        }
440
441        public boolean hasValueUrlType() { 
442          return this != null && this.value instanceof UrlType;
443        }
444
445        /**
446         * @return {@link #value} (If the parameter is a data type.)
447         */
448        public UuidType getValueUuidType() throws FHIRException { 
449          if (this.value == null)
450            this.value = new UuidType();
451          if (!(this.value instanceof UuidType))
452            throw new FHIRException("Type mismatch: the type UuidType was expected, but "+this.value.getClass().getName()+" was encountered");
453          return (UuidType) this.value;
454        }
455
456        public boolean hasValueUuidType() { 
457          return this != null && this.value instanceof UuidType;
458        }
459
460        /**
461         * @return {@link #value} (If the parameter is a data type.)
462         */
463        public Address getValueAddress() throws FHIRException { 
464          if (this.value == null)
465            this.value = new Address();
466          if (!(this.value instanceof Address))
467            throw new FHIRException("Type mismatch: the type Address was expected, but "+this.value.getClass().getName()+" was encountered");
468          return (Address) this.value;
469        }
470
471        public boolean hasValueAddress() { 
472          return this != null && this.value instanceof Address;
473        }
474
475        /**
476         * @return {@link #value} (If the parameter is a data type.)
477         */
478        public Age getValueAge() throws FHIRException { 
479          if (this.value == null)
480            this.value = new Age();
481          if (!(this.value instanceof Age))
482            throw new FHIRException("Type mismatch: the type Age was expected, but "+this.value.getClass().getName()+" was encountered");
483          return (Age) this.value;
484        }
485
486        public boolean hasValueAge() { 
487          return this != null && this.value instanceof Age;
488        }
489
490        /**
491         * @return {@link #value} (If the parameter is a data type.)
492         */
493        public Annotation getValueAnnotation() throws FHIRException { 
494          if (this.value == null)
495            this.value = new Annotation();
496          if (!(this.value instanceof Annotation))
497            throw new FHIRException("Type mismatch: the type Annotation was expected, but "+this.value.getClass().getName()+" was encountered");
498          return (Annotation) this.value;
499        }
500
501        public boolean hasValueAnnotation() { 
502          return this != null && this.value instanceof Annotation;
503        }
504
505        /**
506         * @return {@link #value} (If the parameter is a data type.)
507         */
508        public Attachment getValueAttachment() throws FHIRException { 
509          if (this.value == null)
510            this.value = new Attachment();
511          if (!(this.value instanceof Attachment))
512            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
513          return (Attachment) this.value;
514        }
515
516        public boolean hasValueAttachment() { 
517          return this != null && this.value instanceof Attachment;
518        }
519
520        /**
521         * @return {@link #value} (If the parameter is a data type.)
522         */
523        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
524          if (this.value == null)
525            this.value = new CodeableConcept();
526          if (!(this.value instanceof CodeableConcept))
527            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
528          return (CodeableConcept) this.value;
529        }
530
531        public boolean hasValueCodeableConcept() { 
532          return this != null && this.value instanceof CodeableConcept;
533        }
534
535        /**
536         * @return {@link #value} (If the parameter is a data type.)
537         */
538        public Coding getValueCoding() throws FHIRException { 
539          if (this.value == null)
540            this.value = new Coding();
541          if (!(this.value instanceof Coding))
542            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered");
543          return (Coding) this.value;
544        }
545
546        public boolean hasValueCoding() { 
547          return this != null && this.value instanceof Coding;
548        }
549
550        /**
551         * @return {@link #value} (If the parameter is a data type.)
552         */
553        public ContactPoint getValueContactPoint() throws FHIRException { 
554          if (this.value == null)
555            this.value = new ContactPoint();
556          if (!(this.value instanceof ContactPoint))
557            throw new FHIRException("Type mismatch: the type ContactPoint was expected, but "+this.value.getClass().getName()+" was encountered");
558          return (ContactPoint) this.value;
559        }
560
561        public boolean hasValueContactPoint() { 
562          return this != null && this.value instanceof ContactPoint;
563        }
564
565        /**
566         * @return {@link #value} (If the parameter is a data type.)
567         */
568        public Count getValueCount() throws FHIRException { 
569          if (this.value == null)
570            this.value = new Count();
571          if (!(this.value instanceof Count))
572            throw new FHIRException("Type mismatch: the type Count was expected, but "+this.value.getClass().getName()+" was encountered");
573          return (Count) this.value;
574        }
575
576        public boolean hasValueCount() { 
577          return this != null && this.value instanceof Count;
578        }
579
580        /**
581         * @return {@link #value} (If the parameter is a data type.)
582         */
583        public Distance getValueDistance() throws FHIRException { 
584          if (this.value == null)
585            this.value = new Distance();
586          if (!(this.value instanceof Distance))
587            throw new FHIRException("Type mismatch: the type Distance was expected, but "+this.value.getClass().getName()+" was encountered");
588          return (Distance) this.value;
589        }
590
591        public boolean hasValueDistance() { 
592          return this != null && this.value instanceof Distance;
593        }
594
595        /**
596         * @return {@link #value} (If the parameter is a data type.)
597         */
598        public Duration getValueDuration() throws FHIRException { 
599          if (this.value == null)
600            this.value = new Duration();
601          if (!(this.value instanceof Duration))
602            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.value.getClass().getName()+" was encountered");
603          return (Duration) this.value;
604        }
605
606        public boolean hasValueDuration() { 
607          return this != null && this.value instanceof Duration;
608        }
609
610        /**
611         * @return {@link #value} (If the parameter is a data type.)
612         */
613        public HumanName getValueHumanName() throws FHIRException { 
614          if (this.value == null)
615            this.value = new HumanName();
616          if (!(this.value instanceof HumanName))
617            throw new FHIRException("Type mismatch: the type HumanName was expected, but "+this.value.getClass().getName()+" was encountered");
618          return (HumanName) this.value;
619        }
620
621        public boolean hasValueHumanName() { 
622          return this != null && this.value instanceof HumanName;
623        }
624
625        /**
626         * @return {@link #value} (If the parameter is a data type.)
627         */
628        public Identifier getValueIdentifier() throws FHIRException { 
629          if (this.value == null)
630            this.value = new Identifier();
631          if (!(this.value instanceof Identifier))
632            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.value.getClass().getName()+" was encountered");
633          return (Identifier) this.value;
634        }
635
636        public boolean hasValueIdentifier() { 
637          return this != null && this.value instanceof Identifier;
638        }
639
640        /**
641         * @return {@link #value} (If the parameter is a data type.)
642         */
643        public Money getValueMoney() throws FHIRException { 
644          if (this.value == null)
645            this.value = new Money();
646          if (!(this.value instanceof Money))
647            throw new FHIRException("Type mismatch: the type Money was expected, but "+this.value.getClass().getName()+" was encountered");
648          return (Money) this.value;
649        }
650
651        public boolean hasValueMoney() { 
652          return this != null && this.value instanceof Money;
653        }
654
655        /**
656         * @return {@link #value} (If the parameter is a data type.)
657         */
658        public Period getValuePeriod() throws FHIRException { 
659          if (this.value == null)
660            this.value = new Period();
661          if (!(this.value instanceof Period))
662            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered");
663          return (Period) this.value;
664        }
665
666        public boolean hasValuePeriod() { 
667          return this != null && this.value instanceof Period;
668        }
669
670        /**
671         * @return {@link #value} (If the parameter is a data type.)
672         */
673        public Quantity getValueQuantity() throws FHIRException { 
674          if (this.value == null)
675            this.value = new Quantity();
676          if (!(this.value instanceof Quantity))
677            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
678          return (Quantity) this.value;
679        }
680
681        public boolean hasValueQuantity() { 
682          return this != null && this.value instanceof Quantity;
683        }
684
685        /**
686         * @return {@link #value} (If the parameter is a data type.)
687         */
688        public Range getValueRange() throws FHIRException { 
689          if (this.value == null)
690            this.value = new Range();
691          if (!(this.value instanceof Range))
692            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
693          return (Range) this.value;
694        }
695
696        public boolean hasValueRange() { 
697          return this != null && this.value instanceof Range;
698        }
699
700        /**
701         * @return {@link #value} (If the parameter is a data type.)
702         */
703        public Ratio getValueRatio() throws FHIRException { 
704          if (this.value == null)
705            this.value = new Ratio();
706          if (!(this.value instanceof Ratio))
707            throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered");
708          return (Ratio) this.value;
709        }
710
711        public boolean hasValueRatio() { 
712          return this != null && this.value instanceof Ratio;
713        }
714
715        /**
716         * @return {@link #value} (If the parameter is a data type.)
717         */
718        public Reference getValueReference() throws FHIRException { 
719          if (this.value == null)
720            this.value = new Reference();
721          if (!(this.value instanceof Reference))
722            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
723          return (Reference) this.value;
724        }
725
726        public boolean hasValueReference() { 
727          return this != null && this.value instanceof Reference;
728        }
729
730        /**
731         * @return {@link #value} (If the parameter is a data type.)
732         */
733        public SampledData getValueSampledData() throws FHIRException { 
734          if (this.value == null)
735            this.value = new SampledData();
736          if (!(this.value instanceof SampledData))
737            throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered");
738          return (SampledData) this.value;
739        }
740
741        public boolean hasValueSampledData() { 
742          return this != null && this.value instanceof SampledData;
743        }
744
745        /**
746         * @return {@link #value} (If the parameter is a data type.)
747         */
748        public Signature getValueSignature() throws FHIRException { 
749          if (this.value == null)
750            this.value = new Signature();
751          if (!(this.value instanceof Signature))
752            throw new FHIRException("Type mismatch: the type Signature was expected, but "+this.value.getClass().getName()+" was encountered");
753          return (Signature) this.value;
754        }
755
756        public boolean hasValueSignature() { 
757          return this != null && this.value instanceof Signature;
758        }
759
760        /**
761         * @return {@link #value} (If the parameter is a data type.)
762         */
763        public Timing getValueTiming() throws FHIRException { 
764          if (this.value == null)
765            this.value = new Timing();
766          if (!(this.value instanceof Timing))
767            throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.value.getClass().getName()+" was encountered");
768          return (Timing) this.value;
769        }
770
771        public boolean hasValueTiming() { 
772          return this != null && this.value instanceof Timing;
773        }
774
775        /**
776         * @return {@link #value} (If the parameter is a data type.)
777         */
778        public ContactDetail getValueContactDetail() throws FHIRException { 
779          if (this.value == null)
780            this.value = new ContactDetail();
781          if (!(this.value instanceof ContactDetail))
782            throw new FHIRException("Type mismatch: the type ContactDetail was expected, but "+this.value.getClass().getName()+" was encountered");
783          return (ContactDetail) this.value;
784        }
785
786        public boolean hasValueContactDetail() { 
787          return this != null && this.value instanceof ContactDetail;
788        }
789
790        /**
791         * @return {@link #value} (If the parameter is a data type.)
792         */
793        public Contributor getValueContributor() throws FHIRException { 
794          if (this.value == null)
795            this.value = new Contributor();
796          if (!(this.value instanceof Contributor))
797            throw new FHIRException("Type mismatch: the type Contributor was expected, but "+this.value.getClass().getName()+" was encountered");
798          return (Contributor) this.value;
799        }
800
801        public boolean hasValueContributor() { 
802          return this != null && this.value instanceof Contributor;
803        }
804
805        /**
806         * @return {@link #value} (If the parameter is a data type.)
807         */
808        public DataRequirement getValueDataRequirement() throws FHIRException { 
809          if (this.value == null)
810            this.value = new DataRequirement();
811          if (!(this.value instanceof DataRequirement))
812            throw new FHIRException("Type mismatch: the type DataRequirement was expected, but "+this.value.getClass().getName()+" was encountered");
813          return (DataRequirement) this.value;
814        }
815
816        public boolean hasValueDataRequirement() { 
817          return this != null && this.value instanceof DataRequirement;
818        }
819
820        /**
821         * @return {@link #value} (If the parameter is a data type.)
822         */
823        public Expression getValueExpression() throws FHIRException { 
824          if (this.value == null)
825            this.value = new Expression();
826          if (!(this.value instanceof Expression))
827            throw new FHIRException("Type mismatch: the type Expression was expected, but "+this.value.getClass().getName()+" was encountered");
828          return (Expression) this.value;
829        }
830
831        public boolean hasValueExpression() { 
832          return this != null && this.value instanceof Expression;
833        }
834
835        /**
836         * @return {@link #value} (If the parameter is a data type.)
837         */
838        public ParameterDefinition getValueParameterDefinition() throws FHIRException { 
839          if (this.value == null)
840            this.value = new ParameterDefinition();
841          if (!(this.value instanceof ParameterDefinition))
842            throw new FHIRException("Type mismatch: the type ParameterDefinition was expected, but "+this.value.getClass().getName()+" was encountered");
843          return (ParameterDefinition) this.value;
844        }
845
846        public boolean hasValueParameterDefinition() { 
847          return this != null && this.value instanceof ParameterDefinition;
848        }
849
850        /**
851         * @return {@link #value} (If the parameter is a data type.)
852         */
853        public RelatedArtifact getValueRelatedArtifact() throws FHIRException { 
854          if (this.value == null)
855            this.value = new RelatedArtifact();
856          if (!(this.value instanceof RelatedArtifact))
857            throw new FHIRException("Type mismatch: the type RelatedArtifact was expected, but "+this.value.getClass().getName()+" was encountered");
858          return (RelatedArtifact) this.value;
859        }
860
861        public boolean hasValueRelatedArtifact() { 
862          return this != null && this.value instanceof RelatedArtifact;
863        }
864
865        /**
866         * @return {@link #value} (If the parameter is a data type.)
867         */
868        public TriggerDefinition getValueTriggerDefinition() throws FHIRException { 
869          if (this.value == null)
870            this.value = new TriggerDefinition();
871          if (!(this.value instanceof TriggerDefinition))
872            throw new FHIRException("Type mismatch: the type TriggerDefinition was expected, but "+this.value.getClass().getName()+" was encountered");
873          return (TriggerDefinition) this.value;
874        }
875
876        public boolean hasValueTriggerDefinition() { 
877          return this != null && this.value instanceof TriggerDefinition;
878        }
879
880        /**
881         * @return {@link #value} (If the parameter is a data type.)
882         */
883        public UsageContext getValueUsageContext() throws FHIRException { 
884          if (this.value == null)
885            this.value = new UsageContext();
886          if (!(this.value instanceof UsageContext))
887            throw new FHIRException("Type mismatch: the type UsageContext was expected, but "+this.value.getClass().getName()+" was encountered");
888          return (UsageContext) this.value;
889        }
890
891        public boolean hasValueUsageContext() { 
892          return this != null && this.value instanceof UsageContext;
893        }
894
895        /**
896         * @return {@link #value} (If the parameter is a data type.)
897         */
898        public Dosage getValueDosage() throws FHIRException { 
899          if (this.value == null)
900            this.value = new Dosage();
901          if (!(this.value instanceof Dosage))
902            throw new FHIRException("Type mismatch: the type Dosage was expected, but "+this.value.getClass().getName()+" was encountered");
903          return (Dosage) this.value;
904        }
905
906        public boolean hasValueDosage() { 
907          return this != null && this.value instanceof Dosage;
908        }
909
910        /**
911         * @return {@link #value} (If the parameter is a data type.)
912         */
913        public Meta getValueMeta() throws FHIRException { 
914          if (this.value == null)
915            this.value = new Meta();
916          if (!(this.value instanceof Meta))
917            throw new FHIRException("Type mismatch: the type Meta was expected, but "+this.value.getClass().getName()+" was encountered");
918          return (Meta) this.value;
919        }
920
921        public boolean hasValueMeta() { 
922          return this != null && this.value instanceof Meta;
923        }
924
925        public boolean hasValue() { 
926          return this.value != null && !this.value.isEmpty();
927        }
928
929        /**
930         * @param value {@link #value} (If the parameter is a data type.)
931         */
932        public ParametersParameterComponent setValue(DataType value) { 
933          if (value != null && !(value instanceof Base64BinaryType || value instanceof BooleanType || value instanceof CanonicalType || value instanceof CodeType || value instanceof DateType || value instanceof DateTimeType || value instanceof DecimalType || value instanceof IdType || value instanceof InstantType || value instanceof IntegerType || value instanceof Integer64Type || value instanceof MarkdownType || value instanceof OidType || value instanceof PositiveIntType || value instanceof StringType || value instanceof TimeType || value instanceof UnsignedIntType || value instanceof UriType || value instanceof UrlType || value instanceof UuidType || value instanceof Address || value instanceof Age || value instanceof Annotation || value instanceof Attachment || value instanceof CodeableConcept || value instanceof Coding || value instanceof ContactPoint || value instanceof Count || value instanceof Distance || value instanceof Duration || value instanceof HumanName || value instanceof Identifier || value instanceof Money || value instanceof Period || value instanceof Quantity || value instanceof Range || value instanceof Ratio || value instanceof Reference || value instanceof SampledData || value instanceof Signature || value instanceof Timing || value instanceof ContactDetail || value instanceof Contributor || value instanceof DataRequirement || value instanceof Expression || value instanceof ParameterDefinition || value instanceof RelatedArtifact || value instanceof TriggerDefinition || value instanceof UsageContext || value instanceof Dosage || value instanceof Meta))
934            throw new Error("Not the right type for Parameters.parameter.value[x]: "+value.fhirType());
935          this.value = value;
936          return this;
937        }
938
939        /**
940         * @return {@link #resource} (If the parameter is a whole resource.)
941         */
942        public Resource getResource() { 
943          return this.resource;
944        }
945
946        public boolean hasResource() { 
947          return this.resource != null && !this.resource.isEmpty();
948        }
949
950        /**
951         * @param value {@link #resource} (If the parameter is a whole resource.)
952         */
953        public ParametersParameterComponent setResource(Resource value) { 
954          this.resource = value;
955          return this;
956        }
957
958        /**
959         * @return {@link #part} (A named part of a multi-part parameter.)
960         */
961        public List<ParametersParameterComponent> getPart() { 
962          if (this.part == null)
963            this.part = new ArrayList<ParametersParameterComponent>();
964          return this.part;
965        }
966
967        /**
968         * @return Returns a reference to <code>this</code> for easy method chaining
969         */
970        public ParametersParameterComponent setPart(List<ParametersParameterComponent> thePart) { 
971          this.part = thePart;
972          return this;
973        }
974
975        public boolean hasPart() { 
976          if (this.part == null)
977            return false;
978          for (ParametersParameterComponent item : this.part)
979            if (!item.isEmpty())
980              return true;
981          return false;
982        }
983
984        public ParametersParameterComponent addPart() { //3
985          ParametersParameterComponent t = new ParametersParameterComponent();
986          if (this.part == null)
987            this.part = new ArrayList<ParametersParameterComponent>();
988          this.part.add(t);
989          return t;
990        }
991
992        public ParametersParameterComponent addPart(ParametersParameterComponent t) { //3
993          if (t == null)
994            return this;
995          if (this.part == null)
996            this.part = new ArrayList<ParametersParameterComponent>();
997          this.part.add(t);
998          return this;
999        }
1000
1001        /**
1002         * @return The first repetition of repeating field {@link #part}, creating it if it does not already exist {3}
1003         */
1004        public ParametersParameterComponent getPartFirstRep() { 
1005          if (getPart().isEmpty()) {
1006            addPart();
1007          }
1008          return getPart().get(0);
1009        }
1010
1011        protected void listChildren(List<Property> children) {
1012          super.listChildren(children);
1013          children.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, 1, name));
1014          children.add(new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "If the parameter is a data type.", 0, 1, value));
1015          children.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, 1, resource));
1016          children.add(new Property("part", "@Parameters.parameter", "A named part of a multi-part parameter.", 0, java.lang.Integer.MAX_VALUE, part));
1017        }
1018
1019        @Override
1020        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1021          switch (_hash) {
1022          case 3373707: /*name*/  return new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, 1, name);
1023          case -1410166417: /*value[x]*/  return new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "If the parameter is a data type.", 0, 1, value);
1024          case 111972721: /*value*/  return new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|integer64|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "If the parameter is a data type.", 0, 1, value);
1025          case -1535024575: /*valueBase64Binary*/  return new Property("value[x]", "base64Binary", "If the parameter is a data type.", 0, 1, value);
1026          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "If the parameter is a data type.", 0, 1, value);
1027          case -786218365: /*valueCanonical*/  return new Property("value[x]", "canonical", "If the parameter is a data type.", 0, 1, value);
1028          case -766209282: /*valueCode*/  return new Property("value[x]", "code", "If the parameter is a data type.", 0, 1, value);
1029          case -766192449: /*valueDate*/  return new Property("value[x]", "date", "If the parameter is a data type.", 0, 1, value);
1030          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "dateTime", "If the parameter is a data type.", 0, 1, value);
1031          case -2083993440: /*valueDecimal*/  return new Property("value[x]", "decimal", "If the parameter is a data type.", 0, 1, value);
1032          case 231604844: /*valueId*/  return new Property("value[x]", "id", "If the parameter is a data type.", 0, 1, value);
1033          case -1668687056: /*valueInstant*/  return new Property("value[x]", "instant", "If the parameter is a data type.", 0, 1, value);
1034          case -1668204915: /*valueInteger*/  return new Property("value[x]", "integer", "If the parameter is a data type.", 0, 1, value);
1035          case -1122120181: /*valueInteger64*/  return new Property("value[x]", "integer64", "If the parameter is a data type.", 0, 1, value);
1036          case -497880704: /*valueMarkdown*/  return new Property("value[x]", "markdown", "If the parameter is a data type.", 0, 1, value);
1037          case -1410178407: /*valueOid*/  return new Property("value[x]", "oid", "If the parameter is a data type.", 0, 1, value);
1038          case -1249932027: /*valuePositiveInt*/  return new Property("value[x]", "positiveInt", "If the parameter is a data type.", 0, 1, value);
1039          case -1424603934: /*valueString*/  return new Property("value[x]", "string", "If the parameter is a data type.", 0, 1, value);
1040          case -765708322: /*valueTime*/  return new Property("value[x]", "time", "If the parameter is a data type.", 0, 1, value);
1041          case 26529417: /*valueUnsignedInt*/  return new Property("value[x]", "unsignedInt", "If the parameter is a data type.", 0, 1, value);
1042          case -1410172357: /*valueUri*/  return new Property("value[x]", "uri", "If the parameter is a data type.", 0, 1, value);
1043          case -1410172354: /*valueUrl*/  return new Property("value[x]", "url", "If the parameter is a data type.", 0, 1, value);
1044          case -765667124: /*valueUuid*/  return new Property("value[x]", "uuid", "If the parameter is a data type.", 0, 1, value);
1045          case -478981821: /*valueAddress*/  return new Property("value[x]", "Address", "If the parameter is a data type.", 0, 1, value);
1046          case -1410191922: /*valueAge*/  return new Property("value[x]", "Age", "If the parameter is a data type.", 0, 1, value);
1047          case -67108992: /*valueAnnotation*/  return new Property("value[x]", "Annotation", "If the parameter is a data type.", 0, 1, value);
1048          case -475566732: /*valueAttachment*/  return new Property("value[x]", "Attachment", "If the parameter is a data type.", 0, 1, value);
1049          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "If the parameter is a data type.", 0, 1, value);
1050          case -1887705029: /*valueCoding*/  return new Property("value[x]", "Coding", "If the parameter is a data type.", 0, 1, value);
1051          case 944904545: /*valueContactPoint*/  return new Property("value[x]", "ContactPoint", "If the parameter is a data type.", 0, 1, value);
1052          case 2017332766: /*valueCount*/  return new Property("value[x]", "Count", "If the parameter is a data type.", 0, 1, value);
1053          case -456359802: /*valueDistance*/  return new Property("value[x]", "Distance", "If the parameter is a data type.", 0, 1, value);
1054          case 1558135333: /*valueDuration*/  return new Property("value[x]", "Duration", "If the parameter is a data type.", 0, 1, value);
1055          case -2026205465: /*valueHumanName*/  return new Property("value[x]", "HumanName", "If the parameter is a data type.", 0, 1, value);
1056          case -130498310: /*valueIdentifier*/  return new Property("value[x]", "Identifier", "If the parameter is a data type.", 0, 1, value);
1057          case 2026560975: /*valueMoney*/  return new Property("value[x]", "Money", "If the parameter is a data type.", 0, 1, value);
1058          case -1524344174: /*valuePeriod*/  return new Property("value[x]", "Period", "If the parameter is a data type.", 0, 1, value);
1059          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "If the parameter is a data type.", 0, 1, value);
1060          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "If the parameter is a data type.", 0, 1, value);
1061          case 2030767386: /*valueRatio*/  return new Property("value[x]", "Ratio", "If the parameter is a data type.", 0, 1, value);
1062          case 1755241690: /*valueReference*/  return new Property("value[x]", "Reference", "If the parameter is a data type.", 0, 1, value);
1063          case -962229101: /*valueSampledData*/  return new Property("value[x]", "SampledData", "If the parameter is a data type.", 0, 1, value);
1064          case -540985785: /*valueSignature*/  return new Property("value[x]", "Signature", "If the parameter is a data type.", 0, 1, value);
1065          case -1406282469: /*valueTiming*/  return new Property("value[x]", "Timing", "If the parameter is a data type.", 0, 1, value);
1066          case -1125200224: /*valueContactDetail*/  return new Property("value[x]", "ContactDetail", "If the parameter is a data type.", 0, 1, value);
1067          case 1281021610: /*valueContributor*/  return new Property("value[x]", "Contributor", "If the parameter is a data type.", 0, 1, value);
1068          case 1710554248: /*valueDataRequirement*/  return new Property("value[x]", "DataRequirement", "If the parameter is a data type.", 0, 1, value);
1069          case -307517719: /*valueExpression*/  return new Property("value[x]", "Expression", "If the parameter is a data type.", 0, 1, value);
1070          case 1387478187: /*valueParameterDefinition*/  return new Property("value[x]", "ParameterDefinition", "If the parameter is a data type.", 0, 1, value);
1071          case 1748214124: /*valueRelatedArtifact*/  return new Property("value[x]", "RelatedArtifact", "If the parameter is a data type.", 0, 1, value);
1072          case 976830394: /*valueTriggerDefinition*/  return new Property("value[x]", "TriggerDefinition", "If the parameter is a data type.", 0, 1, value);
1073          case 588000479: /*valueUsageContext*/  return new Property("value[x]", "UsageContext", "If the parameter is a data type.", 0, 1, value);
1074          case -1858636920: /*valueDosage*/  return new Property("value[x]", "Dosage", "If the parameter is a data type.", 0, 1, value);
1075          case -765920490: /*valueMeta*/  return new Property("value[x]", "Meta", "If the parameter is a data type.", 0, 1, value);
1076          case -341064690: /*resource*/  return new Property("resource", "Resource", "If the parameter is a whole resource.", 0, 1, resource);
1077          case 3433459: /*part*/  return new Property("part", "@Parameters.parameter", "A named part of a multi-part parameter.", 0, java.lang.Integer.MAX_VALUE, part);
1078          default: return super.getNamedProperty(_hash, _name, _checkValid);
1079          }
1080
1081        }
1082
1083      @Override
1084      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1085        switch (hash) {
1086        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1087        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
1088        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Resource
1089        case 3433459: /*part*/ return this.part == null ? new Base[0] : this.part.toArray(new Base[this.part.size()]); // ParametersParameterComponent
1090        default: return super.getProperty(hash, name, checkValid);
1091        }
1092
1093      }
1094
1095      @Override
1096      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1097        switch (hash) {
1098        case 3373707: // name
1099          this.name = TypeConvertor.castToString(value); // StringType
1100          return value;
1101        case 111972721: // value
1102          this.value = TypeConvertor.castToType(value); // DataType
1103          return value;
1104        case -341064690: // resource
1105          this.resource = TypeConvertor.castToResource(value); // Resource
1106          return value;
1107        case 3433459: // part
1108          this.getPart().add((ParametersParameterComponent) value); // ParametersParameterComponent
1109          return value;
1110        default: return super.setProperty(hash, name, value);
1111        }
1112
1113      }
1114
1115      @Override
1116      public Base setProperty(String name, Base value) throws FHIRException {
1117        if (name.equals("name")) {
1118          this.name = TypeConvertor.castToString(value); // StringType
1119        } else if (name.equals("value[x]")) {
1120          this.value = TypeConvertor.castToType(value); // DataType
1121        } else if (name.equals("resource")) {
1122          this.resource = TypeConvertor.castToResource(value); // Resource
1123        } else if (name.equals("part")) {
1124          this.getPart().add((ParametersParameterComponent) value);
1125        } else
1126          return super.setProperty(name, value);
1127        return value;
1128      }
1129
1130      @Override
1131      public Base makeProperty(int hash, String name) throws FHIRException {
1132        switch (hash) {
1133        case 3373707:  return getNameElement();
1134        case -1410166417:  return getValue();
1135        case 111972721:  return getValue();
1136        case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource
1137        case 3433459:  return addPart(); 
1138        default: return super.makeProperty(hash, name);
1139        }
1140
1141      }
1142
1143      @Override
1144      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1145        switch (hash) {
1146        case 3373707: /*name*/ return new String[] {"string"};
1147        case 111972721: /*value*/ return new String[] {"base64Binary", "boolean", "canonical", "code", "date", "dateTime", "decimal", "id", "instant", "integer", "integer64", "markdown", "oid", "positiveInt", "string", "time", "unsignedInt", "uri", "url", "uuid", "Address", "Age", "Annotation", "Attachment", "CodeableConcept", "Coding", "ContactPoint", "Count", "Distance", "Duration", "HumanName", "Identifier", "Money", "Period", "Quantity", "Range", "Ratio", "Reference", "SampledData", "Signature", "Timing", "ContactDetail", "Contributor", "DataRequirement", "Expression", "ParameterDefinition", "RelatedArtifact", "TriggerDefinition", "UsageContext", "Dosage", "Meta"};
1148        case -341064690: /*resource*/ return new String[] {"Resource"};
1149        case 3433459: /*part*/ return new String[] {"@Parameters.parameter"};
1150        default: return super.getTypesForProperty(hash, name);
1151        }
1152
1153      }
1154
1155      @Override
1156      public Base addChild(String name) throws FHIRException {
1157        if (name.equals("name")) {
1158          throw new FHIRException("Cannot call addChild on a primitive type Parameters.parameter.name");
1159        }
1160        else if (name.equals("valueBase64Binary")) {
1161          this.value = new Base64BinaryType();
1162          return this.value;
1163        }
1164        else if (name.equals("valueBoolean")) {
1165          this.value = new BooleanType();
1166          return this.value;
1167        }
1168        else if (name.equals("valueCanonical")) {
1169          this.value = new CanonicalType();
1170          return this.value;
1171        }
1172        else if (name.equals("valueCode")) {
1173          this.value = new CodeType();
1174          return this.value;
1175        }
1176        else if (name.equals("valueDate")) {
1177          this.value = new DateType();
1178          return this.value;
1179        }
1180        else if (name.equals("valueDateTime")) {
1181          this.value = new DateTimeType();
1182          return this.value;
1183        }
1184        else if (name.equals("valueDecimal")) {
1185          this.value = new DecimalType();
1186          return this.value;
1187        }
1188        else if (name.equals("valueId")) {
1189          this.value = new IdType();
1190          return this.value;
1191        }
1192        else if (name.equals("valueInstant")) {
1193          this.value = new InstantType();
1194          return this.value;
1195        }
1196        else if (name.equals("valueInteger")) {
1197          this.value = new IntegerType();
1198          return this.value;
1199        }
1200        else if (name.equals("valueInteger64")) {
1201          this.value = new Integer64Type();
1202          return this.value;
1203        }
1204        else if (name.equals("valueMarkdown")) {
1205          this.value = new MarkdownType();
1206          return this.value;
1207        }
1208        else if (name.equals("valueOid")) {
1209          this.value = new OidType();
1210          return this.value;
1211        }
1212        else if (name.equals("valuePositiveInt")) {
1213          this.value = new PositiveIntType();
1214          return this.value;
1215        }
1216        else if (name.equals("valueString")) {
1217          this.value = new StringType();
1218          return this.value;
1219        }
1220        else if (name.equals("valueTime")) {
1221          this.value = new TimeType();
1222          return this.value;
1223        }
1224        else if (name.equals("valueUnsignedInt")) {
1225          this.value = new UnsignedIntType();
1226          return this.value;
1227        }
1228        else if (name.equals("valueUri")) {
1229          this.value = new UriType();
1230          return this.value;
1231        }
1232        else if (name.equals("valueUrl")) {
1233          this.value = new UrlType();
1234          return this.value;
1235        }
1236        else if (name.equals("valueUuid")) {
1237          this.value = new UuidType();
1238          return this.value;
1239        }
1240        else if (name.equals("valueAddress")) {
1241          this.value = new Address();
1242          return this.value;
1243        }
1244        else if (name.equals("valueAge")) {
1245          this.value = new Age();
1246          return this.value;
1247        }
1248        else if (name.equals("valueAnnotation")) {
1249          this.value = new Annotation();
1250          return this.value;
1251        }
1252        else if (name.equals("valueAttachment")) {
1253          this.value = new Attachment();
1254          return this.value;
1255        }
1256        else if (name.equals("valueCodeableConcept")) {
1257          this.value = new CodeableConcept();
1258          return this.value;
1259        }
1260        else if (name.equals("valueCoding")) {
1261          this.value = new Coding();
1262          return this.value;
1263        }
1264        else if (name.equals("valueContactPoint")) {
1265          this.value = new ContactPoint();
1266          return this.value;
1267        }
1268        else if (name.equals("valueCount")) {
1269          this.value = new Count();
1270          return this.value;
1271        }
1272        else if (name.equals("valueDistance")) {
1273          this.value = new Distance();
1274          return this.value;
1275        }
1276        else if (name.equals("valueDuration")) {
1277          this.value = new Duration();
1278          return this.value;
1279        }
1280        else if (name.equals("valueHumanName")) {
1281          this.value = new HumanName();
1282          return this.value;
1283        }
1284        else if (name.equals("valueIdentifier")) {
1285          this.value = new Identifier();
1286          return this.value;
1287        }
1288        else if (name.equals("valueMoney")) {
1289          this.value = new Money();
1290          return this.value;
1291        }
1292        else if (name.equals("valuePeriod")) {
1293          this.value = new Period();
1294          return this.value;
1295        }
1296        else if (name.equals("valueQuantity")) {
1297          this.value = new Quantity();
1298          return this.value;
1299        }
1300        else if (name.equals("valueRange")) {
1301          this.value = new Range();
1302          return this.value;
1303        }
1304        else if (name.equals("valueRatio")) {
1305          this.value = new Ratio();
1306          return this.value;
1307        }
1308        else if (name.equals("valueReference")) {
1309          this.value = new Reference();
1310          return this.value;
1311        }
1312        else if (name.equals("valueSampledData")) {
1313          this.value = new SampledData();
1314          return this.value;
1315        }
1316        else if (name.equals("valueSignature")) {
1317          this.value = new Signature();
1318          return this.value;
1319        }
1320        else if (name.equals("valueTiming")) {
1321          this.value = new Timing();
1322          return this.value;
1323        }
1324        else if (name.equals("valueContactDetail")) {
1325          this.value = new ContactDetail();
1326          return this.value;
1327        }
1328        else if (name.equals("valueContributor")) {
1329          this.value = new Contributor();
1330          return this.value;
1331        }
1332        else if (name.equals("valueDataRequirement")) {
1333          this.value = new DataRequirement();
1334          return this.value;
1335        }
1336        else if (name.equals("valueExpression")) {
1337          this.value = new Expression();
1338          return this.value;
1339        }
1340        else if (name.equals("valueParameterDefinition")) {
1341          this.value = new ParameterDefinition();
1342          return this.value;
1343        }
1344        else if (name.equals("valueRelatedArtifact")) {
1345          this.value = new RelatedArtifact();
1346          return this.value;
1347        }
1348        else if (name.equals("valueTriggerDefinition")) {
1349          this.value = new TriggerDefinition();
1350          return this.value;
1351        }
1352        else if (name.equals("valueUsageContext")) {
1353          this.value = new UsageContext();
1354          return this.value;
1355        }
1356        else if (name.equals("valueDosage")) {
1357          this.value = new Dosage();
1358          return this.value;
1359        }
1360        else if (name.equals("valueMeta")) {
1361          this.value = new Meta();
1362          return this.value;
1363        }
1364        else if (name.equals("resource")) {
1365          throw new FHIRException("Cannot call addChild on an abstract type Parameters.parameter.resource");
1366        }
1367        else if (name.equals("part")) {
1368          return addPart();
1369        }
1370        else
1371          return super.addChild(name);
1372      }
1373
1374      public ParametersParameterComponent copy() {
1375        ParametersParameterComponent dst = new ParametersParameterComponent();
1376        copyValues(dst);
1377        return dst;
1378      }
1379
1380      public void copyValues(ParametersParameterComponent dst) {
1381        super.copyValues(dst);
1382        dst.name = name == null ? null : name.copy();
1383        dst.value = value == null ? null : value.copy();
1384        dst.resource = resource == null ? null : resource.copy();
1385        if (part != null) {
1386          dst.part = new ArrayList<ParametersParameterComponent>();
1387          for (ParametersParameterComponent i : part)
1388            dst.part.add(i.copy());
1389        };
1390      }
1391
1392      @Override
1393      public boolean equalsDeep(Base other_) {
1394        if (!super.equalsDeep(other_))
1395          return false;
1396        if (!(other_ instanceof ParametersParameterComponent))
1397          return false;
1398        ParametersParameterComponent o = (ParametersParameterComponent) other_;
1399        return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(resource, o.resource, true)
1400           && compareDeep(part, o.part, true);
1401      }
1402
1403      @Override
1404      public boolean equalsShallow(Base other_) {
1405        if (!super.equalsShallow(other_))
1406          return false;
1407        if (!(other_ instanceof ParametersParameterComponent))
1408          return false;
1409        ParametersParameterComponent o = (ParametersParameterComponent) other_;
1410        return compareValues(name, o.name, true);
1411      }
1412
1413      public boolean isEmpty() {
1414        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value, resource, part
1415          );
1416      }
1417
1418  public String fhirType() {
1419    return "Parameters.parameter";
1420
1421  }
1422
1423// added from java-adornments.txt:
1424  public String toString() {
1425    String s = getName() + " = ";
1426    if (hasValue()) {
1427      if (getValue().isPrimitive()) {
1428        s = s + getValue().primitiveValue();
1429      } else {
1430        s = s + "["+getValue().fhirType()+"]";
1431      }
1432    } else if (hasResource()) {
1433      s = s + "["+getResource().fhirType()+"]";
1434    } else {
1435      CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
1436      for (ParametersParameterComponent p : getPart()) {
1437        b.append(p.getName());
1438      }
1439      s = s + "{"+b.toString()+"}";
1440    }
1441    return s;
1442  }
1443
1444// end addition
1445  }
1446
1447    /**
1448     * A parameter passed to or received from the operation.
1449     */
1450    @Child(name = "parameter", type = {}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1451    @Description(shortDefinition="Operation Parameter", formalDefinition="A parameter passed to or received from the operation." )
1452    protected List<ParametersParameterComponent> parameter;
1453
1454    private static final long serialVersionUID = -1495940293L;
1455
1456  /**
1457   * Constructor
1458   */
1459    public Parameters() {
1460      super();
1461    }
1462
1463    /**
1464     * @return {@link #parameter} (A parameter passed to or received from the operation.)
1465     */
1466    public List<ParametersParameterComponent> getParameter() { 
1467      if (this.parameter == null)
1468        this.parameter = new ArrayList<ParametersParameterComponent>();
1469      return this.parameter;
1470    }
1471
1472    /**
1473     * @return Returns a reference to <code>this</code> for easy method chaining
1474     */
1475    public Parameters setParameter(List<ParametersParameterComponent> theParameter) { 
1476      this.parameter = theParameter;
1477      return this;
1478    }
1479
1480    public boolean hasParameter() { 
1481      if (this.parameter == null)
1482        return false;
1483      for (ParametersParameterComponent item : this.parameter)
1484        if (!item.isEmpty())
1485          return true;
1486      return false;
1487    }
1488
1489    public ParametersParameterComponent addParameter() { //3
1490      ParametersParameterComponent t = new ParametersParameterComponent();
1491      if (this.parameter == null)
1492        this.parameter = new ArrayList<ParametersParameterComponent>();
1493      this.parameter.add(t);
1494      return t;
1495    }
1496
1497    public Parameters addParameter(ParametersParameterComponent t) { //3
1498      if (t == null)
1499        return this;
1500      if (this.parameter == null)
1501        this.parameter = new ArrayList<ParametersParameterComponent>();
1502      this.parameter.add(t);
1503      return this;
1504    }
1505
1506    /**
1507     * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist {3}
1508     */
1509    public ParametersParameterComponent getParameterFirstRep() { 
1510      if (getParameter().isEmpty()) {
1511        addParameter();
1512      }
1513      return getParameter().get(0);
1514    }
1515
1516      protected void listChildren(List<Property> children) {
1517        super.listChildren(children);
1518        children.add(new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter));
1519      }
1520
1521      @Override
1522      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1523        switch (_hash) {
1524        case 1954460585: /*parameter*/  return new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter);
1525        default: return super.getNamedProperty(_hash, _name, _checkValid);
1526        }
1527
1528      }
1529
1530      @Override
1531      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1532        switch (hash) {
1533        case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParametersParameterComponent
1534        default: return super.getProperty(hash, name, checkValid);
1535        }
1536
1537      }
1538
1539      @Override
1540      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1541        switch (hash) {
1542        case 1954460585: // parameter
1543          this.getParameter().add((ParametersParameterComponent) value); // ParametersParameterComponent
1544          return value;
1545        default: return super.setProperty(hash, name, value);
1546        }
1547
1548      }
1549
1550      @Override
1551      public Base setProperty(String name, Base value) throws FHIRException {
1552        if (name.equals("parameter")) {
1553          this.getParameter().add((ParametersParameterComponent) value);
1554        } else
1555          return super.setProperty(name, value);
1556        return value;
1557      }
1558
1559      @Override
1560      public Base makeProperty(int hash, String name) throws FHIRException {
1561        switch (hash) {
1562        case 1954460585:  return addParameter(); 
1563        default: return super.makeProperty(hash, name);
1564        }
1565
1566      }
1567
1568      @Override
1569      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1570        switch (hash) {
1571        case 1954460585: /*parameter*/ return new String[] {};
1572        default: return super.getTypesForProperty(hash, name);
1573        }
1574
1575      }
1576
1577      @Override
1578      public Base addChild(String name) throws FHIRException {
1579        if (name.equals("parameter")) {
1580          return addParameter();
1581        }
1582        else
1583          return super.addChild(name);
1584      }
1585
1586  public String fhirType() {
1587    return "Parameters";
1588
1589  }
1590
1591      public Parameters copy() {
1592        Parameters dst = new Parameters();
1593        copyValues(dst);
1594        return dst;
1595      }
1596
1597      public void copyValues(Parameters dst) {
1598        super.copyValues(dst);
1599        if (parameter != null) {
1600          dst.parameter = new ArrayList<ParametersParameterComponent>();
1601          for (ParametersParameterComponent i : parameter)
1602            dst.parameter.add(i.copy());
1603        };
1604      }
1605
1606      protected Parameters typedCopy() {
1607        return copy();
1608      }
1609
1610      @Override
1611      public boolean equalsDeep(Base other_) {
1612        if (!super.equalsDeep(other_))
1613          return false;
1614        if (!(other_ instanceof Parameters))
1615          return false;
1616        Parameters o = (Parameters) other_;
1617        return compareDeep(parameter, o.parameter, true);
1618      }
1619
1620      @Override
1621      public boolean equalsShallow(Base other_) {
1622        if (!super.equalsShallow(other_))
1623          return false;
1624        if (!(other_ instanceof Parameters))
1625          return false;
1626        Parameters o = (Parameters) other_;
1627        return true;
1628      }
1629
1630      public boolean isEmpty() {
1631        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(parameter);
1632      }
1633
1634  @Override
1635  public ResourceType getResourceType() {
1636    return ResourceType.Parameters;
1637   }
1638
1639// Manual code (from Configuration.txt)t:
1640 
1641  public Parameters addParameter(String name, boolean b) {
1642    addParameter().setName(name).setValue(new BooleanType(b));
1643    return this;
1644  }
1645
1646  public Parameters addParameter(String name, String s) {
1647    if (s != null)
1648      addParameter().setName(name).setValue(new StringType(s));
1649    return this;
1650  }
1651
1652  public Parameters addParameter(String name, DataType v) {
1653    if (v != null)
1654      addParameter().setName(name).setValue(v);
1655    return this;
1656  }
1657
1658  public Parameters setParameter(String name, boolean b) {
1659    for (ParametersParameterComponent p : getParameter()) {
1660      if (p.getName().equals(name)) {
1661        p.setValue(new BooleanType(b));
1662        return this;
1663      }
1664    }
1665    addParameter().setName(name).setValue(new BooleanType(b));
1666    return this;
1667  }
1668
1669  public Parameters setParameter(String name, String s) {
1670    if (s != null) {
1671      for (ParametersParameterComponent p : getParameter()) {
1672        if (p.getName().equals(name)) {
1673          p.setValue(new StringType(s));
1674          return this;
1675        }
1676      }
1677      addParameter().setName(name).setValue(new StringType(s));
1678    }
1679    return this;
1680  }
1681
1682  public Parameters setParameter(String name, DataType v) {
1683    if (v != null) {
1684      for (ParametersParameterComponent p : getParameter()                                                                                     ) {
1685        if (p.getName().equals(name)) {
1686          p.setValue(v);
1687          return this;
1688        }
1689      }
1690      addParameter().setName(name).setValue(v);
1691    }
1692    return this;
1693  }
1694
1695  public boolean hasParameter(String name) {
1696    for (ParametersParameterComponent p : getParameter()) {
1697      if (p.getName().equals(name))
1698        return true;
1699    }
1700    return false;
1701  }
1702
1703  public DataType getParameter(String name) {
1704    for (ParametersParameterComponent p : getParameter()) {
1705      if (p.getName().equals(name))
1706        return p.getValue();
1707    }
1708    return null;
1709  }
1710
1711  public List<DataType> getParameters(String name) {
1712    List<DataType> res = new ArrayList<>();
1713    for (ParametersParameterComponent p : getParameter()) {
1714      if (p.getName().equals(name))
1715        res.add(p.getValue());
1716    }
1717    return res;
1718  }
1719  
1720  
1721  public boolean getParameterBool(String name) {
1722    for (ParametersParameterComponent p : getParameter()) {
1723      if (p.getName().equals(name)) {
1724        if (p.getValue() instanceof BooleanType)
1725          return ((BooleanType) p.getValue()).booleanValue();
1726        boolean ok = Boolean.getBoolean(p.getValue().primitiveValue());
1727        return ok;
1728      }
1729    }
1730    return false;
1731  }
1732
1733// end addition
1734
1735}