001package org.hl7.fhir.r5.model;
002
003
004/*
005 * #%L
006 * org.hl7.fhir.r5
007 * %%
008 * Copyright (C) 2014 - 2019 Health Level 7
009 * %%
010 * Licensed under the Apache License, Version 2.0 (the \"License\");
011 * you may not use this file except in compliance with the License.
012 * You may obtain a copy of the License at
013 * 
014 *      http://www.apache.org/licenses/LICENSE-2.0
015 * 
016 * Unless required by applicable law or agreed to in writing, software
017 * distributed under the License is distributed on an \"AS IS\" BASIS,
018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
019 * See the License for the specific language governing permissions and
020 * limitations under the License.
021 * #L%
022 */
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, \
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this \
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, \
034     this list of conditions and the following disclaimer in the documentation \
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
049  POSSIBILITY OF SUCH DAMAGE.
050  */
051
052// Generated on Tue, Dec 31, 2019 12:12+1100 for FHIR vcurrent
053
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057import org.hl7.fhir.utilities.Utilities;
058import org.hl7.fhir.r5.model.Enumerations.*;
059import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
060import org.hl7.fhir.exceptions.FHIRException;
061import org.hl7.fhir.instance.model.api.ICompositeType;
062import ca.uhn.fhir.model.api.annotation.Child;
063import ca.uhn.fhir.model.api.annotation.ChildOrder;
064import ca.uhn.fhir.model.api.annotation.DatatypeDef;
065import ca.uhn.fhir.model.api.annotation.Description;
066import ca.uhn.fhir.model.api.annotation.Block;
067
068/**
069 * Base StructureDefinition for ParameterDefinition Type: The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.
070 */
071@DatatypeDef(name="ParameterDefinition")
072public class ParameterDefinition extends DataType implements ICompositeType {
073
074    /**
075     * The name of the parameter used to allow access to the value of the parameter in evaluation contexts.
076     */
077    @Child(name = "name", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true)
078    @Description(shortDefinition="Name used to access the parameter value", formalDefinition="The name of the parameter used to allow access to the value of the parameter in evaluation contexts." )
079    protected CodeType name;
080
081    /**
082     * Whether the parameter is input or output for the module.
083     */
084    @Child(name = "use", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
085    @Description(shortDefinition="in | out", formalDefinition="Whether the parameter is input or output for the module." )
086    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/operation-parameter-use")
087    protected Enumeration<OperationParameterUse> use;
088
089    /**
090     * The minimum number of times this parameter SHALL appear in the request or response.
091     */
092    @Child(name = "min", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true)
093    @Description(shortDefinition="Minimum cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." )
094    protected IntegerType min;
095
096    /**
097     * The maximum number of times this element is permitted to appear in the request or response.
098     */
099    @Child(name = "max", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
100    @Description(shortDefinition="Maximum cardinality (a number of *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." )
101    protected StringType max;
102
103    /**
104     * A brief discussion of what the parameter is for and how it is used by the module.
105     */
106    @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
107    @Description(shortDefinition="A brief description of the parameter", formalDefinition="A brief discussion of what the parameter is for and how it is used by the module." )
108    protected StringType documentation;
109
110    /**
111     * The type of the parameter.
112     */
113    @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=true)
114    @Description(shortDefinition="What type of value", formalDefinition="The type of the parameter." )
115    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/all-types")
116    protected Enumeration<FHIRAllTypes> type;
117
118    /**
119     * If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.
120     */
121    @Child(name = "profile", type = {CanonicalType.class}, order=6, min=0, max=1, modifier=false, summary=true)
122    @Description(shortDefinition="What profile the value is expected to be", formalDefinition="If specified, this indicates a profile that the input data must conform to, or that the output data will conform to." )
123    protected CanonicalType profile;
124
125    private static final long serialVersionUID = -1132749008L;
126
127  /**
128   * Constructor
129   */
130    public ParameterDefinition() {
131      super();
132    }
133
134  /**
135   * Constructor
136   */
137    public ParameterDefinition(OperationParameterUse use, FHIRAllTypes type) {
138      super();
139      this.setUse(use);
140      this.setType(type);
141    }
142
143    /**
144     * @return {@link #name} (The name of the parameter used to allow access to the value of the parameter in evaluation contexts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
145     */
146    public CodeType getNameElement() { 
147      if (this.name == null)
148        if (Configuration.errorOnAutoCreate())
149          throw new Error("Attempt to auto-create ParameterDefinition.name");
150        else if (Configuration.doAutoCreate())
151          this.name = new CodeType(); // bb
152      return this.name;
153    }
154
155    public boolean hasNameElement() { 
156      return this.name != null && !this.name.isEmpty();
157    }
158
159    public boolean hasName() { 
160      return this.name != null && !this.name.isEmpty();
161    }
162
163    /**
164     * @param value {@link #name} (The name of the parameter used to allow access to the value of the parameter in evaluation contexts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
165     */
166    public ParameterDefinition setNameElement(CodeType value) { 
167      this.name = value;
168      return this;
169    }
170
171    /**
172     * @return The name of the parameter used to allow access to the value of the parameter in evaluation contexts.
173     */
174    public String getName() { 
175      return this.name == null ? null : this.name.getValue();
176    }
177
178    /**
179     * @param value The name of the parameter used to allow access to the value of the parameter in evaluation contexts.
180     */
181    public ParameterDefinition setName(String value) { 
182      if (Utilities.noString(value))
183        this.name = null;
184      else {
185        if (this.name == null)
186          this.name = new CodeType();
187        this.name.setValue(value);
188      }
189      return this;
190    }
191
192    /**
193     * @return {@link #use} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value
194     */
195    public Enumeration<OperationParameterUse> getUseElement() { 
196      if (this.use == null)
197        if (Configuration.errorOnAutoCreate())
198          throw new Error("Attempt to auto-create ParameterDefinition.use");
199        else if (Configuration.doAutoCreate())
200          this.use = new Enumeration<OperationParameterUse>(new OperationParameterUseEnumFactory()); // bb
201      return this.use;
202    }
203
204    public boolean hasUseElement() { 
205      return this.use != null && !this.use.isEmpty();
206    }
207
208    public boolean hasUse() { 
209      return this.use != null && !this.use.isEmpty();
210    }
211
212    /**
213     * @param value {@link #use} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value
214     */
215    public ParameterDefinition setUseElement(Enumeration<OperationParameterUse> value) { 
216      this.use = value;
217      return this;
218    }
219
220    /**
221     * @return Whether the parameter is input or output for the module.
222     */
223    public OperationParameterUse getUse() { 
224      return this.use == null ? null : this.use.getValue();
225    }
226
227    /**
228     * @param value Whether the parameter is input or output for the module.
229     */
230    public ParameterDefinition setUse(OperationParameterUse value) { 
231        if (this.use == null)
232          this.use = new Enumeration<OperationParameterUse>(new OperationParameterUseEnumFactory());
233        this.use.setValue(value);
234      return this;
235    }
236
237    /**
238     * @return {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
239     */
240    public IntegerType getMinElement() { 
241      if (this.min == null)
242        if (Configuration.errorOnAutoCreate())
243          throw new Error("Attempt to auto-create ParameterDefinition.min");
244        else if (Configuration.doAutoCreate())
245          this.min = new IntegerType(); // bb
246      return this.min;
247    }
248
249    public boolean hasMinElement() { 
250      return this.min != null && !this.min.isEmpty();
251    }
252
253    public boolean hasMin() { 
254      return this.min != null && !this.min.isEmpty();
255    }
256
257    /**
258     * @param value {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value
259     */
260    public ParameterDefinition setMinElement(IntegerType value) { 
261      this.min = value;
262      return this;
263    }
264
265    /**
266     * @return The minimum number of times this parameter SHALL appear in the request or response.
267     */
268    public int getMin() { 
269      return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue();
270    }
271
272    /**
273     * @param value The minimum number of times this parameter SHALL appear in the request or response.
274     */
275    public ParameterDefinition setMin(int value) { 
276        if (this.min == null)
277          this.min = new IntegerType();
278        this.min.setValue(value);
279      return this;
280    }
281
282    /**
283     * @return {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
284     */
285    public StringType getMaxElement() { 
286      if (this.max == null)
287        if (Configuration.errorOnAutoCreate())
288          throw new Error("Attempt to auto-create ParameterDefinition.max");
289        else if (Configuration.doAutoCreate())
290          this.max = new StringType(); // bb
291      return this.max;
292    }
293
294    public boolean hasMaxElement() { 
295      return this.max != null && !this.max.isEmpty();
296    }
297
298    public boolean hasMax() { 
299      return this.max != null && !this.max.isEmpty();
300    }
301
302    /**
303     * @param value {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value
304     */
305    public ParameterDefinition setMaxElement(StringType value) { 
306      this.max = value;
307      return this;
308    }
309
310    /**
311     * @return The maximum number of times this element is permitted to appear in the request or response.
312     */
313    public String getMax() { 
314      return this.max == null ? null : this.max.getValue();
315    }
316
317    /**
318     * @param value The maximum number of times this element is permitted to appear in the request or response.
319     */
320    public ParameterDefinition setMax(String value) { 
321      if (Utilities.noString(value))
322        this.max = null;
323      else {
324        if (this.max == null)
325          this.max = new StringType();
326        this.max.setValue(value);
327      }
328      return this;
329    }
330
331    /**
332     * @return {@link #documentation} (A brief discussion of what the parameter is for and how it is used by the module.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
333     */
334    public StringType getDocumentationElement() { 
335      if (this.documentation == null)
336        if (Configuration.errorOnAutoCreate())
337          throw new Error("Attempt to auto-create ParameterDefinition.documentation");
338        else if (Configuration.doAutoCreate())
339          this.documentation = new StringType(); // bb
340      return this.documentation;
341    }
342
343    public boolean hasDocumentationElement() { 
344      return this.documentation != null && !this.documentation.isEmpty();
345    }
346
347    public boolean hasDocumentation() { 
348      return this.documentation != null && !this.documentation.isEmpty();
349    }
350
351    /**
352     * @param value {@link #documentation} (A brief discussion of what the parameter is for and how it is used by the module.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
353     */
354    public ParameterDefinition setDocumentationElement(StringType value) { 
355      this.documentation = value;
356      return this;
357    }
358
359    /**
360     * @return A brief discussion of what the parameter is for and how it is used by the module.
361     */
362    public String getDocumentation() { 
363      return this.documentation == null ? null : this.documentation.getValue();
364    }
365
366    /**
367     * @param value A brief discussion of what the parameter is for and how it is used by the module.
368     */
369    public ParameterDefinition setDocumentation(String value) { 
370      if (Utilities.noString(value))
371        this.documentation = null;
372      else {
373        if (this.documentation == null)
374          this.documentation = new StringType();
375        this.documentation.setValue(value);
376      }
377      return this;
378    }
379
380    /**
381     * @return {@link #type} (The type of the parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
382     */
383    public Enumeration<FHIRAllTypes> getTypeElement() { 
384      if (this.type == null)
385        if (Configuration.errorOnAutoCreate())
386          throw new Error("Attempt to auto-create ParameterDefinition.type");
387        else if (Configuration.doAutoCreate())
388          this.type = new Enumeration<FHIRAllTypes>(new FHIRAllTypesEnumFactory()); // bb
389      return this.type;
390    }
391
392    public boolean hasTypeElement() { 
393      return this.type != null && !this.type.isEmpty();
394    }
395
396    public boolean hasType() { 
397      return this.type != null && !this.type.isEmpty();
398    }
399
400    /**
401     * @param value {@link #type} (The type of the parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
402     */
403    public ParameterDefinition setTypeElement(Enumeration<FHIRAllTypes> value) { 
404      this.type = value;
405      return this;
406    }
407
408    /**
409     * @return The type of the parameter.
410     */
411    public FHIRAllTypes getType() { 
412      return this.type == null ? null : this.type.getValue();
413    }
414
415    /**
416     * @param value The type of the parameter.
417     */
418    public ParameterDefinition setType(FHIRAllTypes value) { 
419        if (this.type == null)
420          this.type = new Enumeration<FHIRAllTypes>(new FHIRAllTypesEnumFactory());
421        this.type.setValue(value);
422      return this;
423    }
424
425    /**
426     * @return {@link #profile} (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value
427     */
428    public CanonicalType getProfileElement() { 
429      if (this.profile == null)
430        if (Configuration.errorOnAutoCreate())
431          throw new Error("Attempt to auto-create ParameterDefinition.profile");
432        else if (Configuration.doAutoCreate())
433          this.profile = new CanonicalType(); // bb
434      return this.profile;
435    }
436
437    public boolean hasProfileElement() { 
438      return this.profile != null && !this.profile.isEmpty();
439    }
440
441    public boolean hasProfile() { 
442      return this.profile != null && !this.profile.isEmpty();
443    }
444
445    /**
446     * @param value {@link #profile} (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value
447     */
448    public ParameterDefinition setProfileElement(CanonicalType value) { 
449      this.profile = value;
450      return this;
451    }
452
453    /**
454     * @return If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.
455     */
456    public String getProfile() { 
457      return this.profile == null ? null : this.profile.getValue();
458    }
459
460    /**
461     * @param value If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.
462     */
463    public ParameterDefinition setProfile(String value) { 
464      if (Utilities.noString(value))
465        this.profile = null;
466      else {
467        if (this.profile == null)
468          this.profile = new CanonicalType();
469        this.profile.setValue(value);
470      }
471      return this;
472    }
473
474      protected void listChildren(List<Property> children) {
475        super.listChildren(children);
476        children.add(new Property("name", "code", "The name of the parameter used to allow access to the value of the parameter in evaluation contexts.", 0, 1, name));
477        children.add(new Property("use", "code", "Whether the parameter is input or output for the module.", 0, 1, use));
478        children.add(new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, 1, min));
479        children.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, 1, max));
480        children.add(new Property("documentation", "string", "A brief discussion of what the parameter is for and how it is used by the module.", 0, 1, documentation));
481        children.add(new Property("type", "code", "The type of the parameter.", 0, 1, type));
482        children.add(new Property("profile", "canonical(StructureDefinition)", "If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.", 0, 1, profile));
483      }
484
485      @Override
486      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
487        switch (_hash) {
488        case 3373707: /*name*/  return new Property("name", "code", "The name of the parameter used to allow access to the value of the parameter in evaluation contexts.", 0, 1, name);
489        case 116103: /*use*/  return new Property("use", "code", "Whether the parameter is input or output for the module.", 0, 1, use);
490        case 108114: /*min*/  return new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, 1, min);
491        case 107876: /*max*/  return new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, 1, max);
492        case 1587405498: /*documentation*/  return new Property("documentation", "string", "A brief discussion of what the parameter is for and how it is used by the module.", 0, 1, documentation);
493        case 3575610: /*type*/  return new Property("type", "code", "The type of the parameter.", 0, 1, type);
494        case -309425751: /*profile*/  return new Property("profile", "canonical(StructureDefinition)", "If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.", 0, 1, profile);
495        default: return super.getNamedProperty(_hash, _name, _checkValid);
496        }
497
498      }
499
500      @Override
501      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
502        switch (hash) {
503        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // CodeType
504        case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration<OperationParameterUse>
505        case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType
506        case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType
507        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
508        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<FHIRAllTypes>
509        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // CanonicalType
510        default: return super.getProperty(hash, name, checkValid);
511        }
512
513      }
514
515      @Override
516      public Base setProperty(int hash, String name, Base value) throws FHIRException {
517        switch (hash) {
518        case 3373707: // name
519          this.name = TypeConvertor.castToCode(value); // CodeType
520          return value;
521        case 116103: // use
522          value = new OperationParameterUseEnumFactory().fromType(TypeConvertor.castToCode(value));
523          this.use = (Enumeration) value; // Enumeration<OperationParameterUse>
524          return value;
525        case 108114: // min
526          this.min = TypeConvertor.castToInteger(value); // IntegerType
527          return value;
528        case 107876: // max
529          this.max = TypeConvertor.castToString(value); // StringType
530          return value;
531        case 1587405498: // documentation
532          this.documentation = TypeConvertor.castToString(value); // StringType
533          return value;
534        case 3575610: // type
535          value = new FHIRAllTypesEnumFactory().fromType(TypeConvertor.castToCode(value));
536          this.type = (Enumeration) value; // Enumeration<FHIRAllTypes>
537          return value;
538        case -309425751: // profile
539          this.profile = TypeConvertor.castToCanonical(value); // CanonicalType
540          return value;
541        default: return super.setProperty(hash, name, value);
542        }
543
544      }
545
546      @Override
547      public Base setProperty(String name, Base value) throws FHIRException {
548        if (name.equals("name")) {
549          this.name = TypeConvertor.castToCode(value); // CodeType
550        } else if (name.equals("use")) {
551          value = new OperationParameterUseEnumFactory().fromType(TypeConvertor.castToCode(value));
552          this.use = (Enumeration) value; // Enumeration<OperationParameterUse>
553        } else if (name.equals("min")) {
554          this.min = TypeConvertor.castToInteger(value); // IntegerType
555        } else if (name.equals("max")) {
556          this.max = TypeConvertor.castToString(value); // StringType
557        } else if (name.equals("documentation")) {
558          this.documentation = TypeConvertor.castToString(value); // StringType
559        } else if (name.equals("type")) {
560          value = new FHIRAllTypesEnumFactory().fromType(TypeConvertor.castToCode(value));
561          this.type = (Enumeration) value; // Enumeration<FHIRAllTypes>
562        } else if (name.equals("profile")) {
563          this.profile = TypeConvertor.castToCanonical(value); // CanonicalType
564        } else
565          return super.setProperty(name, value);
566        return value;
567      }
568
569      @Override
570      public Base makeProperty(int hash, String name) throws FHIRException {
571        switch (hash) {
572        case 3373707:  return getNameElement();
573        case 116103:  return getUseElement();
574        case 108114:  return getMinElement();
575        case 107876:  return getMaxElement();
576        case 1587405498:  return getDocumentationElement();
577        case 3575610:  return getTypeElement();
578        case -309425751:  return getProfileElement();
579        default: return super.makeProperty(hash, name);
580        }
581
582      }
583
584      @Override
585      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
586        switch (hash) {
587        case 3373707: /*name*/ return new String[] {"code"};
588        case 116103: /*use*/ return new String[] {"code"};
589        case 108114: /*min*/ return new String[] {"integer"};
590        case 107876: /*max*/ return new String[] {"string"};
591        case 1587405498: /*documentation*/ return new String[] {"string"};
592        case 3575610: /*type*/ return new String[] {"code"};
593        case -309425751: /*profile*/ return new String[] {"canonical"};
594        default: return super.getTypesForProperty(hash, name);
595        }
596
597      }
598
599      @Override
600      public Base addChild(String name) throws FHIRException {
601        if (name.equals("name")) {
602          throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.name");
603        }
604        else if (name.equals("use")) {
605          throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.use");
606        }
607        else if (name.equals("min")) {
608          throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.min");
609        }
610        else if (name.equals("max")) {
611          throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.max");
612        }
613        else if (name.equals("documentation")) {
614          throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.documentation");
615        }
616        else if (name.equals("type")) {
617          throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.type");
618        }
619        else if (name.equals("profile")) {
620          throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.profile");
621        }
622        else
623          return super.addChild(name);
624      }
625
626  public String fhirType() {
627    return "ParameterDefinition";
628
629  }
630
631      public ParameterDefinition copy() {
632        ParameterDefinition dst = new ParameterDefinition();
633        copyValues(dst);
634        return dst;
635      }
636
637      public void copyValues(ParameterDefinition dst) {
638        super.copyValues(dst);
639        dst.name = name == null ? null : name.copy();
640        dst.use = use == null ? null : use.copy();
641        dst.min = min == null ? null : min.copy();
642        dst.max = max == null ? null : max.copy();
643        dst.documentation = documentation == null ? null : documentation.copy();
644        dst.type = type == null ? null : type.copy();
645        dst.profile = profile == null ? null : profile.copy();
646      }
647
648      protected ParameterDefinition typedCopy() {
649        return copy();
650      }
651
652      @Override
653      public boolean equalsDeep(Base other_) {
654        if (!super.equalsDeep(other_))
655          return false;
656        if (!(other_ instanceof ParameterDefinition))
657          return false;
658        ParameterDefinition o = (ParameterDefinition) other_;
659        return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(min, o.min, true)
660           && compareDeep(max, o.max, true) && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true)
661           && compareDeep(profile, o.profile, true);
662      }
663
664      @Override
665      public boolean equalsShallow(Base other_) {
666        if (!super.equalsShallow(other_))
667          return false;
668        if (!(other_ instanceof ParameterDefinition))
669          return false;
670        ParameterDefinition o = (ParameterDefinition) other_;
671        return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(min, o.min, true)
672           && compareValues(max, o.max, true) && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true)
673           && compareValues(profile, o.profile, true);
674      }
675
676      public boolean isEmpty() {
677        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, use, min, max, documentation
678          , type, profile);
679      }
680
681
682}
683