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