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